-
Enhancement
-
Resolution: Fixed
-
P3
-
7
-
b34
-
generic
-
generic
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2155615 | 6u10 | Jonathan Gibbons | P3 | Resolved | Fixed | b12 |
JDK-2165587 | OpenJDK6 | Jonathan Gibbons | P3 | Resolved | Fixed | b12 |
JavaCard does not support clone() for arrays, which causes problems for enums.
It would be nice if javac could generate different code for the values() method that does not rely on array.clone().
For example, replace the following:
public static Color[] values() {
return (Color[]) $VALUES.clone();
}
with this:
public static Color[] values() {
Color[] copy = new Color[$VALUES.length];
System.arraycopy($VALUES, 0,
copy, 0,
$VALUES.length);
return copy;
}
It would be nice if javac could generate different code for the values() method that does not rely on array.clone().
For example, replace the following:
public static Color[] values() {
return (Color[]) $VALUES.clone();
}
with this:
public static Color[] values() {
Color[] copy = new Color[$VALUES.length];
System.arraycopy($VALUES, 0,
copy, 0,
$VALUES.length);
return copy;
}
- backported by
-
JDK-2155615 javac generates code that uses array.clone, which is not available on JavaCard
- Resolved
-
JDK-2165587 javac generates code that uses array.clone, which is not available on JavaCard
- Resolved
- relates to
-
JDK-6877751 test/tools/javac/6627362/T6627362.java fails
- Closed
-
JDK-6627364 javac needs Float and Double on the bootclasspath even when not directly used
- Closed
-
JDK-6627366 javac needs Cloneable and Serializable on the classpath even when not directly used
- Closed