Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-ui-dev] [jdt-core-dev] Is there a method similar to the NetBeans TreeUtilities.getUncaughtExceptions() method in the Eclipse JDT?

Actually, we are assuming that the code compiles correctly. Here is the API documentation and here is the source code.

>>> "Stephan Herrmann" <stephan.herrmann@xxxxxxxxx> 07/22/15 1:48 PM >>>
I would  think of leveraging the existing IProblems along these lines: 
- retrieve the problems from the compilation unit declaration
- filter for id == IProblem.UnhandledException
- perhaps also filter per source range

Unfortunately, finding the referenced exception type might require reverse-engineering the problem message.
Or you use the source range of the problem for identifying the offending AST node, and then inspect its resolvedBinding()
(should be a MethodBinding).

HTH,
Stephan


----- ursprüngliche Nachricht ---------

Subject: Re: [jdt-core-dev] Is there a method similar to the NetBeans TreeUtilities.getUncaughtExceptions() method in the Eclipse JDT?
Date: Di 21 Jul 2015 11:50:20 CEST
From: Raffi Khatchadourian<RKhatchadourian@xxxxxxxxxxxxxxxxx>
To: jdt-core-dev@xxxxxxxxxxx, jdt-ui-dev@xxxxxxxxxxx

Sorry, meant to say uncaught exceptions (not messages).


>>> Raffi Khatchadourian 07/21/15 10:14 AM >>>
NetBeans source code analysis has a method org.netbeans.api.java.source.TreeUtilities.getUncaughtExceptions(TreePath) that retrieves uncaught messages from an AST subtree. Does the Eclipse JDT have a similar method?


---- ursprüngliche Nachricht Ende ----

Back to the top