Bug 24773 - CompilationUnit.getProblems: not all problems?
Summary: CompilationUnit.getProblems: not all problems?
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-15 06:30 EDT by Martin Aeschlimann CLA
Modified: 2002-11-13 09:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2002-10-15 06:30:10 EDT
20021015 (Updated JCore).

The updated JCore now also shows 'uncaught exceptions' on reconcile (not only 
on rebuild). However, when asking a ast.CompilationUnit for its 
problems, 'uncaught exceptions' are not contained. 
Is that a bug?
Comment 1 Philipe Mulet CLA 2002-10-15 11:01:34 EDT
Only reconciliation provides all errors. The DOM doesn't yet, though it could 
do so now given the existing support.
Comment 2 Olivier Thomann CLA 2002-10-15 11:09:06 EDT
Please provide a test case.
Comment 3 Martin Aeschlimann CLA 2002-10-15 11:23:48 EDT
see LocalCorrectionsQuickFixTest.testUncaughtException
Comment 4 Olivier Thomann CLA 2002-10-15 12:40:25 EDT
Fixing this has a side-effect on bug 24623. In this case, the abstract method 
gets an empty body. So it is not possible to get the contents of the body, but 
it doesn't return null anymore.
Is this acceptable for you?
If yes, I can release this change.
Comment 5 Olivier Thomann CLA 2002-10-15 15:39:30 EDT
Ok, I got rid of this side-effect. The problem was that I got a binding when I
force all errors to be returned. Now I am using directly the modifiers of the
method declaration during the conversion instead of calling the isAbstract() or
isNative() methods which use the binding if any.
See bug 24623 for further comments.
Comment 6 Martin Aeschlimann CLA 2002-10-16 03:42:51 EDT
I'm confused. Are the two PRs really related?
Having a body would be he solution for bug 24623 . I don't need the body's 
statements.
Comment 7 Olivier Thomann CLA 2002-10-16 07:45:59 EDT
Indeed they are. When you report more problems, you might end up with a binding 
where you had no binding before. Therefore it can affect the conversion, 
because the semantics of the ast node (compiler nodes) can change when they 
have a binding (isNative() or isAbstract() methods might not answer the same 
value).
So I will release this fix when the build M2 is successful. You will get a body 
in 24623 even if the body is empty.
Comment 8 Olivier Thomann CLA 2002-10-17 16:44:21 EDT
Use the new API to report all problems during the conversion.
Fixed and released in 2.1 stream. Regression tests added.
Comment 9 David Audel CLA 2002-11-13 09:15:20 EST
Verified.