Share

IBM Jikes Compiler for the Java Language

Tracker: Bugs

5 final variable in loop with continue still gives error - ID: 1148387
Last Update: Tracker Item Submitted ( nobody )

Running jike 1.18 I am strill getting the following error message:
The blank final variable "j" cannot be assigned within the body of a loop
that may execute more than once.

It compiles with javac.


Source:
public class Junk {
public static void main(String[] args) {
int i = 0 ;
while (i < 10) {
i++ ;
if (i == 4) {
final long j ;
j = i ;
i +=2 ;
continue ;
}
}
}
}

Output:
jikes -bootclasspath /usr/java/j2sdk1.4.1/jre/lib/rt.jar Junk.java

Found 1 semantic error compiling "Junk.java":

8. j = i ;
^
*** Semantic Error: The blank final variable "j" cannot be assigned within
the body of a loop that may execute more than once.

Version info:
> jikes -version
Jikes Compiler - Version 1.18 - 21 November 2002
(C) Copyright IBM Corp. 1997, 1998, 1999, 2000, 2001, 2002.
- Licensed Materials - Program Property of IBM - All Rights Reserved.
Originally written by Philippe Charles and David Shields of IBM Research,
Jikes is now maintained and refined by the Jikes Project at:
<http://ibm.com/developerworks/opensource/jikes>
Please consult this URL for more information and for reporting problems.


Nobody/Anonymous ( nobody ) - 2002-12-05 21:15

5

Open

None

Nobody/Anonymous

parser

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.