Bug 258685 - [editor] Editor shows an error on 'case' label with enum constant
Summary: [editor] Editor shows an error on 'case' label with enum constant
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 1.6.2   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 1.6.2   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-12 13:44 EST by David Pytel CLA
Modified: 2008-12-12 15:22 EST (History)
1 user (show)

See Also:


Attachments
Project in which the bug appears (1.40 KB, application/zip)
2008-12-12 13:44 EST, David Pytel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Pytel CLA 2008-12-12 13:44:24 EST
Created attachment 120359 [details]
Project in which the bug appears

Build ID: M20080911-1700

Steps To Reproduce:
1. Create aspect with some method
2. Add switch statement.
3. Add case label with enum constant


More information:
AJDT version: 1.6.2.20081211185107 from JDT Weaving

Example code where the error appears:

package none;

/**
 * @author Dawid Pytel
 * 
 */
public aspect AspectWithSwitch {
	public enum SomeEnum {
		VAL1
	}

	public void foo() {
		SomeEnum e = SomeEnum.VAL1;
		switch (e) {
		case VAL1: // here the error appears
			System.out.println("Val1");
			break;
		}
	}
}

If I move this piece of code to a Java class everything is perfectly fine. 
Error appears only when aspect is in .aj file.
Comment 1 Andrew Eisenberg CLA 2008-12-12 14:09:05 EST
Thanks for the test case.  Will look into it now.
Comment 2 Andrew Eisenberg CLA 2008-12-12 15:22:22 EST
Seems that our aspects transformer doesn't handle case statements properly (regardless of the enum.  It is confusing case statements with pointcut declarations!

Made the change, and tested it.  The project you submitted is now part of the test case.

Committed.