Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse conditional breakpoint doesn't work

I faced with issue that conditional break point doesn't work on my PC. I use following code:

package test;

public class Main {

    public static class C1 {
        public static C1 c = new C1();

        public Boolean b = null;

        private boolean isB() {
            if (b == null) {
                b = Boolean.TRUE;
            }
            return b; //USE BREAKPOINT HERE
        }
    }

    public static void main(String[] args) throws Exception {
        Thread[] threads = new Thread[100];
        for (int i = 0; i < 100; i++) {
            Thread t = new Thread(new Runnable() {
                public void run() {
                    C1.c.isB();
                }
            });
            threads[i] = t;
        }
        for (Thread t : threads) {
           t.start();
        }
   }
}

The conditional breakpoint is set to "return b;" line and use "Boolean.TRUE.equals(b)" conditional. I reinstall Eclipse without any plugin and tried different versions of Java 8, but each time I get the same error, that says "Conditional breakpoint encountered runtime exception. Reason: java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occured retrieving stack frames."

I don't use any JRebel, DCEVM or some profiling tools.

What can be the reason? Could it be CPU related issue? I use Intel 6700K. Windows 10 + JDK8u111 + Neon.1a Release (4.6.1). Also doesn't work with Eclipse Mars.

like image 970
Marat Kamalov Avatar asked Dec 14 '16 15:12

Marat Kamalov


1 Answers

Eclipse Photon 2018

I've tested this with JDK 8 and 7 (both 64 bit) on Eclipse Photon 2018

Version: Photon Release (4.8.0) Build id: 20180619-1200

And the break point works fine.

I suspect this is down to your JDK or Eclipse version.

like image 179
jeff porter Avatar answered Oct 23 '22 09:10

jeff porter