Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 405934

Summary: [1.8][dom ast] thrown Exceptions with Type Annotations should have malformed nodes for AST level less than 8
Product: [Eclipse Project] JDT Reporter: Manoj N Palat <manoj.palat>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, markus.kell.r, srikanth_sankaran
Version: 4.3Flags: jarthana: review? (manoj.palat)
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Test case to reproduce
none
Fix with test none

Description Manoj N Palat CLA 2013-04-18 02:16:14 EDT
Created attachment 229840 [details]
Test case to reproduce

See  java.io.@NonNull EOFException node in the attached test case using ast viewer:

thrownExceptions are converted to Name in ast level prior to 8. These nodes should have malformed flag set (somewhere) in case of presence of type annotations in the thrown exceptions.
Comment 1 Jay Arthanareeswaran CLA 2013-06-19 03:43:04 EDT
Created attachment 232524 [details]
Fix with test

Simple fix to mark the exception Name as MALFORMED when there are annotations found in the type reference.
Comment 2 Jay Arthanareeswaran CLA 2013-06-24 02:03:40 EDT
Manoj, can you glance over the patch once, please?
Comment 3 Manoj N Palat CLA 2013-06-24 02:51:39 EDT
(In reply to comment #2)
> Manoj, can you glance over the patch once, please?

Jay: 
1) Patch looks good.

2) Experimenting with the test case, it can be seen that the same issue applies in return types, and parameters ie for < 1.8, the ASTNode is not signalled as MALFORMED. If possible, we should address in the same bug or raise another bug for the same.
Comment 4 Jay Arthanareeswaran CLA 2013-06-26 05:35:40 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Manoj, can you glance over the patch once, please?
> 
> Jay: 
> 1) Patch looks good.
> 
> 2) Experimenting with the test case, it can be seen that the same issue
> applies in return types, and parameters ie for < 1.8, the ASTNode is not
> signalled as MALFORMED. If possible, we should address in the same bug or
> raise another bug for the same.

Actually, when I switch the AST level in the ASTView, I do see that return types and types of arguments are marked as malformed.

Manoj, can you please confirm?
Comment 5 Manoj N Palat CLA 2013-07-01 01:50:29 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Manoj, can you glance over the patch once, please?
> > 
> > Jay: 
> > 1) Patch looks good.
> > 
> > 2) Experimenting with the test case, it can be seen that the same issue
> > applies in return types, and parameters ie for < 1.8, the ASTNode is not
> > signalled as MALFORMED. If possible, we should address in the same bug or
> > raise another bug for the same.
> 
> Actually, when I switch the AST level in the ASTView, I do see that return
> types and types of arguments are marked as malformed.
> 
> Manoj, can you please confirm?

Jay: Please ignore my comment 2 regarding return types and parameters as I did not consider the availability of SE7 annotations at that point. Patch is good to commit without any changes.
Comment 6 Jay Arthanareeswaran CLA 2013-07-01 10:31:34 EDT
Thanks for reviewing, Manoj. Fix released via commit:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=4eeaf0d0e03ab922557bc9369f948328bc88b0fc