【问题标题】:Eclipse breaking on ClassLoader with java 8 when debuggingEclipse 在调试时使用 java 8 在 ClassLoader 上中断
【发布时间】:2015-03-22 23:56:30
【问题描述】:

我在一些项目中迁移到了 java 8,并注意到每个设置为使用 java 8 运行的项目在调试它们时都会无缘无故地中断..

当我在调试模式下运行项目时,Eclipse 只是在第 436 行的 ClassLoader 类中中断,这是 synchronized 的右花括号

这是 jre 库中类的部分代码

protected Class<?> loadClass(String name, boolean resolve)
    throws ClassNotFoundException
{
    synchronized (getClassLoadingLock(name)) {
        // First, check if the class has already been loaded
        Class<?> c = findLoadedClass(name);
        if (c == null) {
            long t0 = System.nanoTime();
            try {
                if (parent != null) {
                    c = parent.loadClass(name, false);
                } else {
                    c = findBootstrapClassOrNull(name);
                }
            } catch (ClassNotFoundException e) {
                // ClassNotFoundException thrown if class not found
                // from the non-null parent class loader
            }

            if (c == null) {
                // If still not found, then invoke findClass in order
                // to find the class.
                long t1 = System.nanoTime();
                c = findClass(name);

                // this is the defining class loader; record the stats
                sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
                sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
                sun.misc.PerfCounter.getFindClasses().increment();
            }
        }
        if (resolve) {
            resolveClass(c);
        }
        return c;
    } // <-- This is line 436 where it breaks just right after I click on the debug mode
} 

然后我必须点击播放,一切都很好,但每次我想调试一个让我发疯的应用程序时都这样做是多么令人兴奋。试图找到与此相关的任何东西,但没有运气。

我还检查了断点视图,并且有。还检查了Skip all breakpoints 按钮,但似乎没有任何反应。

还可以下载一个新的干净的 Eclipse 并且仍在进行中。

这是截图:

【问题讨论】:

  • 你的描述让我想起了 Eclipse 烦人地停在(不是真的)未捕获的异常处,如stackoverflow.com/questions/6290470/…中所述
  • @halfbit 谢谢,我解决了这个问题。您可以发布答案,以便我接受。

标签: java eclipse debugging breakpoints


【解决方案1】:

我通过禁用 Step Filtering 修复了它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-13
    • 1970-01-01
    • 2015-02-14
    • 2016-12-21
    • 1970-01-01
    • 2013-08-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多