I have the following code:
final BlockingQueue<CsvFileRow> allRows = new LinkedBlockingQueue<CsvFileRow>(); ExecutorService exec = Executors.newFixedThreadPool(3); Callable<Void> producer = new Callable<Void>() { @Override public Void call() throws Exception { System.out.println("Before producer"); produceDataRows(allRows); System.out.println(" After producer"); return null; } }; Callable<Void> consumer = new Callable<Void>() { @Override public Void call() throws Exception { System.out.println("Before consumer"); consumeDataRows(allRows); System.out.println(" After consumer"); return null; } }; exec.submit(producer); exec.submit(consumer); exec.shutdown(); exec.awaitTermination(10, TimeUnit.DAYS); assert Boolean.TRUE;
I have breakpoints on lines 7, 16, 21, and 25. Code execution stops at breakpoints 21.7, and then 25 - breakpoint 16 is skipped! But the code was executed, see Output:
Before producer Before consumer After consumer After producer
Now, if I remove breakpoint 7, the debugger will stop at breakpoints 21.16, and then 25.
This is a very annoying problem. In fact, there are other scenarios where I noticed that IntelliJ ignores breakpoints, which is very alarming.
Did I miss something?
source share