2

In my eclipse plugin I use a ScheduledExecutorService for a repeating task. However this seems to lead to some unreachable code within the scheduled task because I can set a breakpoint in eclipse up to a certain line and it will be reached in the debugger but when I set it one line further it is not reached... Just nothing happens then, no exception just nothing.

When I try to overstep this respective line I land somewhere in the sources of the ScheduledThreadPoolExecutor and my stack shows this:

ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).run() line: not available [local variables unavailable]   


Whats going on here?

Raven
  • 2,951
  • 2
  • 26
  • 42
  • Can you try with the sample code given in https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html – Java Geo May 26 '16 at 18:24
  • Looks to be like the classes are not getting compiled.Please have a look at http://stackoverflow.com/questions/15851215/java-local-variable-unavailable – Java Geo May 26 '16 at 18:28
  • The sample code can be debugged without problems... – Raven May 26 '16 at 18:40
  • can u try cleaning the workspace and building it again? – Java Geo May 26 '16 at 18:43
  • It stays the same... The sample still has no problems but my plugin still can't be debugged – Raven May 26 '16 at 18:54

1 Answers1

0

Okay the problem was that there was actually an exception being thrown but it seems like the ScheduledExecutorService swallows it without telling anything about it...

I foud this out by surrounding my code in the run-method with a generic try-catch-block like this:

@Override
public void run() {
    try {
        // Code
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Raven
  • 2,951
  • 2
  • 26
  • 42