JDK 9 RFR of fallthrough fix in ASM
Lance Andersen
Lance.Andersen at oracle.com
Fri May 30 23:32:28 UTC 2014
+1
On May 30, 2014, at 7:28 PM, Joe Darcy <joe.darcy at oracle.com> wrote:
> Hello,
>
> Please review this change to suppress a fall-through warning recently sync'ed into ASM:
>
> --- a/src/share/classes/jdk/internal/org/objectweb/asm/Item.java Fri May 30 13:37:35 2014 -0700
> +++ b/src/share/classes/jdk/internal/org/objectweb/asm/Item.java Fri May 30 16:19:12 2014 -0700
> @@ -230,6 +230,7 @@
> * @param strVal3
> * third part of the value of this item.
> */
> + @SuppressWarnings("fallthrough")
> void set(final int type, final String strVal1, final String strVal2,
> final String strVal3) {
> this.type = type;
>
>
> The switch statement is
>
> switch (type) {
> case ClassWriter.CLASS:
> this.intVal = 0; // intVal of a class must be zero, see visitInnerClass
> case ClassWriter.UTF8:
> case ClassWriter.STR:
> case ClassWriter.MTYPE:
> case ClassWriter.TYPE_NORMAL:
> hashCode = 0x7FFFFFFF & (type + strVal1.hashCode());
> return;
> case ClassWriter.NAME_TYPE: {
> hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
> * strVal2.hashCode());
> return;
> }
> // ClassWriter.FIELD:
> // ClassWriter.METH:
> // ClassWritehr.IMETH:
> // ClassWriter.HANDLE_BASE + 1..9
> default:
> hashCode = 0x7FFFFFFF & (type + strVal1.hashCode()
> * strVal2.hashCode() * strVal3.hashCode());
> }
> }
>
> Thanks,
>
> -Joe
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com
More information about the core-libs-dev
mailing list