public class TestInnerClasses {
public static void main(String[] args) {
Test a = new Test() {
@Override
public int test(int a) {
int result = a + 1;
return result;
}
};
Test b = new TestB();
System.out.println(a.test(1));
System.out.println(b.test(1));
}
}
abstract class Test {
abstract public int test(int a);
}
class TestB extends Test{
@Override
public int test(int a) {
int result = a + 1;
return result;
}
}
Can not "Run to Method/Line" in anonymous class in default package
Currently it is not possible to jump into methods of inner classes. In the following example I was not able to get into the method "test" of the inner class. Jumping to the method TestB.test() worked fine though:
Official Responses
-
EMPLOYEE
I’m happy
Issues related to anonymous classes should be fixed in Chronon 2.0
This particular issue related to anonymous classes in only in default package still remains though.
The reason for this is not in the Chronon replayer but the 'launching' mechanism of Chronon doesnt 'include' the anonymous classes in default package.
If you include the classes manually, the replayer/debugger will work fine.
As I mentioned previously, nobody really writes code in default packages so it is not our priority. -
This happens only when the classes are inside a 'default' package.
Putting the code inside any package makes the issue disappear.
Its a bug. Will be fixed in the next release.
Though we consider this to be a low priority issue since nobody actually puts their code in 'default' package.
-
This happens only when the classes are inside a 'default' package.
Putting the code inside any package makes the issue disappear.
Its a bug. Will be fixed in the next release.
Though we consider this to be a low priority issue since nobody actually puts their code in 'default' package. -
-
Following up on this:
This bug is related to a longstanding bug in eclipse which doesnt allow the correct name of the .class file of an anonymous class to be determined from the source code.
It seems that the eclipse bug wont be closed till eclipse 3.8. We will try to find good workaround through it till then. -
-
I have a similar issue with some anonymous runnable classes being passed to an executor service. It's quite odd because it doesn't happen with all anonymous tasks, just the ones I'm trying to get into!!
I should also note that in my use case, I'm working in an OSGi environment, that I'm recording only packages coming from one bundle, and that the executor service is provided from another bundle. But the Runnable $ class is being profiled.
NOTE: Just re-read the topic, my case my anonymous classes are NOT in the default package!!-
can you please create a different topic for this. This issue is about anonymous classes in a default package
-
-
This issue should be now fixed in Chronon 2.0
-
-
-
-
-
EMPLOYEE
I’m happy
Issues related to anonymous classes should be fixed in Chronon 2.0
This particular issue related to anonymous classes in only in default package still remains though.
The reason for this is not in the Chronon replayer but the 'launching' mechanism of Chronon doesnt 'include' the anonymous classes in default package.
If you include the classes manually, the replayer/debugger will work fine.
As I mentioned previously, nobody really writes code in default packages so it is not our priority. -
-
I have this issue with anonymous inner classes in non-default packages.
Even when I somehow manage to single-step into them, I do not get the green bar in the annotation area within the class, i.e. I have to navigate around the methods using single step. Direct jump via mouse is not possible. -