Community
Participate
Working Groups
The following code compile OK with - Eclipse 3.2.2 build M20070212-1330, - Sun javac 1.5.0_05-b05 - Sun javac 1.6.0-b105 But do not compile with AJC 1.5.3 /** * {@inheritDoc} */ @Override public void setAsText(String text) throws IllegalArgumentException { value = Enum.valueOf(value.getClass(), text); } Actual behaviour: Error from AJC compiler : "Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture-of ? extends Enum<E>>, String). The inferred type capture-of ? extends Enum<E> is not a valid substitute for the bounded parameter <T extends Enum<T>>" Expected behaviour : Compilation OK with 1 warning, like with Sun & Eclipse compilers. Workaround: /** * {@inheritDoc} */ @Override public void setAsText(String text) throws IllegalArgumentException { Class enumClass = value.getClass(); value = Enum.valueOf(enumClass, text); }
Note : the code I posted is excerpt from an EnumPropertyEditor to bind a String to an enum value (part of a Web framework).
As you have proved, by checking that it works fine in Eclipse 3.2.2, this is a bug because AspectJ1.5.3 is based on the Eclipse 3.1 compiler. The compiler upgrade will occur in the AspectJ1.6 release.
If there was a test program here, I'd test it - but I guess I'll just have to assume it is fixed. AJDT 1.5.2 and AspectJ1.6.0m1 are now available, based on the Eclipse 3.3 compiler.