Author: bayard Date: Fri Oct 20 15:02:34 2006 New Revision: 466275 URL: http://svn.apache.org/viewvc?view=rev&rev=466275 Log: Adding note that using switch is not type-safe
Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java?view=diff&rev=466275&r1=466274&r2=466275 ============================================================================== --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java Fri Oct 20 15:02:34 2006 @@ -94,6 +94,10 @@ * <p>As shown, each enum has a name and a value. These can be accessed using * <code>getName</code> and <code>getValue</code>.</p> * + * <p><em>NOTE:</em> Because the switch is ultimately sitting on top of an + * int, the example above is not type-safe. That is, there is nothing that + * checks that JAVA1_0_VALUE is a legal constant for JavaVersionEnum. </p> + * * <p>The <code>getEnum</code> and <code>iterator</code> methods are recommended. * Unfortunately, Java restrictions require these to be coded as shown in each subclass. * An alternative choice is to use the [EMAIL PROTECTED] EnumUtils} class.</p> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]