Bug 6893 - LocalTypeDeclaration includes preceeding comment even if there are statements in between
Summary: LocalTypeDeclaration includes preceeding comment even if there are statements...
Status: RESOLVED 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.0 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-13 10:35 EST by Dirk Baeumer CLA
Modified: 2002-01-11 08:56 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 Dirk Baeumer CLA 2001-12-13 10:35:33 EST
package invalidSelection;

public class A_test131 {
	public void foo() {
		
		/*]*/foo();
		class Inner {
		}
		foo();/*[*/
		
		Inner inner= new Inner();
	}
}

The ASTNode for the local Type declaration class Inner {...} looks like this:

LocalTypeDeclaration.declarationSourceStart == / of /*]*/ although there is a 
method call foo between the comment and the class Inner {...}
Comment 1 Olivier Thomann CLA 2001-12-13 13:41:29 EST
Fix released in HEAD. It is a complement of the fix for 6829, 6833 and 5413. 
The change in checkAnnotation() was necessary, but I forgot to reset the 
scanner.commentPtr in case the token is not a modifier. See change in 
consumeToken(). The problem could be seen if you replace the test case with:
package invalidSelection;

public class A_test131 {
        public void foo() {
                
                /**]*/foo();
                class Inner {
                }
                foo();/*[*/
                
                Inner inner= new Inner();
        }
}