--- old/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java 2017-05-17 15:52:07.098380286 -0700 +++ new/src/java.base/share/classes/sun/reflect/annotation/TypeAnnotationParser.java 2017-05-17 15:52:06.958310292 -0700 @@ -123,9 +123,30 @@ tmp.add(t); } } + // If a constructor has a mandated outer this, it has no + // annotations and the annotations to parameter mapping should + // be offset by 1. + boolean offset = false; + if (decl instanceof Constructor) { + Constructor ctor = (Constructor) decl; + Class declaringClass = ctor.getDeclaringClass(); + if (!declaringClass.isEnum() && + (declaringClass.isMemberClass() && + (declaringClass.getModifiers() & Modifier.STATIC) == 0) ) { + } + offset = true; + } for (int i = 0; i < size; i++) { - @SuppressWarnings("unchecked") - ArrayList list = l[i]; + ArrayList list; + if (offset) { + @SuppressWarnings("unchecked") + ArrayList tmp = (i == 0) ? null : l[i - 1]; + list = tmp; + } else { + @SuppressWarnings("unchecked") + ArrayList tmp = l[i]; + list = tmp; + } TypeAnnotation[] typeAnnotations; if (list != null) { typeAnnotations = list.toArray(new TypeAnnotation[list.size()]);