How do I find an anonymous inner class if I have only been given the name of the class Class$N
when using Eclipse, without going through the code and counting each anonymous class? Is there a 'jump to anonymous class declaration' feature where I can enter the $suffix number?
The Search->Java feature was not helpful.
I am using VisualVM to find CPU hotspots. My hotspot is in an anonymous class named SomeClass$5. VisualVM cannot find the source for my class and I (and others) cannot find how to attach the source to VisualVM, shown here and here. The launcher plugin does not resolve this.
Counting the anonymous declarations is not an option because in the long-run the risk of human error sorting through hundreds of lines can result in a lot of time wasted trying to work on the wrong anonymous class just to find out it was the wrong class.
As a workaround I'm testing the classes with 'System.out.println("this="+this.getClass().getName());'
in a method to ensure it is the right one, but there's got to be a better way.