Community
Participate
Working Groups
I'm using Run As > Java Application on a class that has a proper main(...) method. However, it's taking some time to build a Type Hierarchy I didn't ask for. I've tried jstack and see at org.eclipse.jdt.internal.core.SourceType.newTypeHierarchy(SourceType.java:844) at org.eclipse.jdt.internal.debug.ui.launcher.MainMethodSearchEngine.addSubtypes(MainMethodSearchEngine.java:129) at org.eclipse.jdt.internal.debug.ui.launcher.MainMethodSearchEngine.searchMainMethods(MainMethodSearchEngine.java:106) at org.eclipse.jdt.internal.debug.ui.launcher.MainMethodSearchEngine$1.run(MainMethodSearchEngine.java:166) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) It seems like despite my class has a correct main(...) method, the launcher decides to look for other ones. I don't think it's a necessary nor desired behaviour in that case: let's just pick the correct one that's inside the current class and not care about the type hierarchy.
Do you have the new indexer ? See Bug 513334.
(In reply to Sarika Sinha from comment #1) > Do you have the new indexer ? > See Bug 513334. Could be this. However, what I question more in this ticket is why building a type hierarchy for this use case. Even if I wasn't facing the performance issue, it still seems like a waste of effort/CPU/energy to do so at this time.
(In reply to Mickael Istria from comment #2) > (In reply to Sarika Sinha from comment #1) > > Do you have the new indexer ? > > See Bug 513334. > > Could be this. > However, what I question more in this ticket is why building a type > hierarchy for this use case. Even if I wasn't facing the performance issue, > it still seems like a waste of effort/CPU/energy to do so at this time. Java doc says - * Searches for all main methods in the given scope. * Valid styles are IJavaElementSearchConstants.CONSIDER_BINARIES and * IJavaElementSearchConstants.CONSIDER_EXTERNAL_JARS * * @param pm progress monitor * @param scope search scope * @param includeSubtypes whether to consider types that inherit a main method
(In reply to Sarika Sinha from comment #3) > Java doc says - > * Searches for all main methods in the given scope. Ok, so in that case, this method or class shouldn't be used when we know the current class has a valid main.
(In reply to Mickael Istria from comment #4) > (In reply to Sarika Sinha from comment #3) > > Java doc says - > > * Searches for all main methods in the given scope. > > Ok, so in that case, this method or class shouldn't be used when we know the > current class has a valid main. Want to contribute and add some tests ?
(In reply to Sarika Sinha from comment #5) > Want to contribute and add some tests ? Maybe some time later. I already have too many more important patches waiting for review on JDT before I can consider adding noise there.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.