Bug 83701 - Java 5 'for each' loop syntax shows as a syntax error
Summary: Java 5 'for each' loop syntax shows as a syntax error
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-26 06:22 EST by Fintan CLA
Modified: 2005-03-23 09:22 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 Fintan CLA 2005-01-26 06:22:04 EST
As an AspectJ project the following code shows an error (Red circle with 'x' in 
gutter margin)

    File[] srcFiles = srcDir.listFiles();
            
    // FIXME Change to Java 5 code
    for(File file : srcFiles) {
//    for(int i = 0; i < srcFiles.length; i++) {
//    File file = srcFiles[i];
        ....
    }

The error messages are :
Syntax error on token(s), misplaced construct(s)
Syntax error on token ")", : expected

If I "Remove AspectJ nature" for the project - this error disappears.

Project Settings :
    AspectJ Compiler
        Enable Java 5 weaving behaviour (1.5) IS ticked

Everything else is left at the defaults.

AspectJ RunTime :
    /c:/eclipse/plugins/org.aspectj.runtime_1.5.0.20041214165937/aspectjrt.jar

Thanks,

Fintan
Comment 1 Adrian Colyer CLA 2005-03-23 09:22:13 EST
This is fixed in the AJ5 dev stream and in the latest AJDT milestone builds.