--- old/src/share/classes/com/sun/tools/javac/comp/Annotate.java 2013-10-03 19:06:55.302016029 -0400 +++ new/src/share/classes/com/sun/tools/javac/comp/Annotate.java 2013-10-03 19:06:55.077014350 -0400 @@ -541,7 +541,7 @@ Attribute.Compound ca = origAnnoDecl.attribute(syms.repeatableType.tsym); if (ca == null) { // has no Repeatable annotation if (reportError) - log.error(pos, "duplicate.annotation.missing.container", origAnnoType, syms.repeatableType); + log.error(pos, "duplicate.annotation.missing.containing.type", origAnnoType, syms.repeatableType); return null; } --- old/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-10-03 19:06:55.776019566 -0400 +++ new/src/share/classes/com/sun/tools/javac/comp/Attr.java 2013-10-03 19:06:55.685018887 -0400 @@ -816,7 +816,7 @@ } if (interfaceOrArrayExpected && !(t.tsym.isInterface() || t.getTag() == ARRAY)) { - log.error(tree.pos(), "intf.expected.here"); + log.error(tree.pos(), "intf.or.array.expected.here"); // return errType is necessary since otherwise there might // be undetected cycles which cause attribution to loop return types.createErrorType(t); --- old/src/share/classes/com/sun/tools/javac/comp/Check.java 2013-10-03 19:06:56.219022872 -0400 +++ new/src/share/classes/com/sun/tools/javac/comp/Check.java 2013-10-03 19:06:56.124022163 -0400 @@ -2680,7 +2680,7 @@ validateAnnotationType(pos, types.elemtype(type)); return; } - log.error(pos, "invalid.annotation.member.type"); + log.error(pos, "annotation.invalid.element.type"); } /** @@ -3095,7 +3095,7 @@ if (m == null || m.type.isErroneous()) continue; if (!members.remove(m)) { isValid = false; - log.error(assign.lhs.pos(), "duplicate.annotation.member.value", + log.error(assign.lhs.pos(), "annotation.duplicate.element", m.name, a.type); } } @@ -3420,7 +3420,7 @@ sym.name != names.error && (!staticImport || !e.isStaticallyImported())) { if (!e.sym.type.isErroneous()) { - String what = e.sym.toString(); + String what = e.sym.getSimpleName().toString(); if (!isClassDecl) { if (staticImport) log.error(pos, "already.defined.static.single.import", what); --- old/src/share/classes/com/sun/tools/javac/resources/compiler.properties 2013-10-03 19:06:56.768026967 -0400 +++ new/src/share/classes/com/sun/tools/javac/resources/compiler.properties 2013-10-03 19:06:56.525025154 -0400 @@ -78,26 +78,26 @@ # 0: string compiler.err.already.defined.single.import=\ - {0} is already defined in a single-type import + a type with simple name {0} is already defined in a single-type-import # 0: string compiler.err.already.defined.static.single.import=\ - {0} is already defined in a static single-type import + a type with simple name {0} is already defined in a static single-type-import compiler.err.already.defined.this.unit=\ {0} is already defined in this compilation unit # 0: type, 1: list of name compiler.err.annotation.missing.default.value=\ - annotation {0} is missing value for the attribute {1} + annotation @{0} is missing a default value for the element '{1}' # 0: type, 1: list of name compiler.err.annotation.missing.default.value.1=\ - annotation {0} is missing values for attributes {1} + annotation @{0} is missing default values for elements {1} # 0: type compiler.err.annotation.not.valid.for.type=\ - annotation not valid for a value of type {0} + annotation not valid for an element of type {0} compiler.err.annotation.type.not.applicable=\ annotation type not applicable to this kind of declaration @@ -135,7 +135,7 @@ array required, but {0} found compiler.err.attribute.value.must.be.constant=\ - attribute value must be constant + element value must be a constant expression # 0: statement type compiler.err.bad.initializer=\ @@ -299,7 +299,7 @@ cyclic inheritance involving {0} compiler.err.cyclic.annotation.element=\ - cyclic annotation element type + type of element '{0}' is cyclic # 0: unused compiler.err.call.to.super.not.allowed.in.enum.ctor=\ @@ -307,14 +307,14 @@ # 0: type compiler.err.no.superclass=\ - {0} has no superclass + {0} has no superclass. # 0: symbol, 1: type, 2: symbol, 3: type, 4: unused compiler.err.concrete.inheritance.conflict=\ methods {0} from {1} and {2} from {3} are inherited with the same signature compiler.err.default.allowed.in.intf.annotation.member=\ - default value only allowed in an @interface member + default value only allowed in an annotation type declaration # 0: symbol compiler.err.doesnt.exist=\ @@ -325,15 +325,15 @@ # 0: type compiler.err.duplicate.annotation.invalid.repeated=\ - annotation {0} cannot be repeated\nIt does not define a valid containing annotation. + annotation {0} cannot be repeated\nIt does not define a valid containing annotation # 0: name, 1: type -compiler.err.duplicate.annotation.member.value=\ - duplicate annotation member value {0} in {1} +compiler.err.annotation.duplicate.element=\ + duplicate element '{0}' in annotation @{1}. # 0: type, 1: type -compiler.err.duplicate.annotation.missing.container=\ - duplicate annotation: the declaration of {0} does not have a valid {1} annotation +compiler.err.duplicate.annotation.missing.containing.type=\ + duplicate annotation: {0} is not a Repeatable annotation type # 0: type compiler.err.invalid.repeatable.annotation=\ @@ -353,27 +353,27 @@ # 0: symbol type, 1: type, 2: type compiler.err.invalid.repeatable.annotation.value.return=\ - duplicate annotation: value element of containing annotation {0} should have type {2}, found {1} + duplicate annotation: containing annotation ({0}) must declare a 'value' element of type {2} # 0: symbol or type, 1: symbol compiler.err.invalid.repeatable.annotation.elem.nondefault=\ - containing annotation {0} does not have a default value for element {1} + containing annotation type ({0}) does not have a default value for element {1} # 0: symbol, 1: type, 2: symbol, 3: type compiler.err.invalid.repeatable.annotation.retention=\ - containing annotation {0} has shorter retention ({1}) than the contained annotation {2} with retention {3} + retention of containing annotation ({0}) is shorter retention than the retention of repeatable annotation type ({2}) # 0: symbol, 1: symbol compiler.err.invalid.repeatable.annotation.not.documented=\ - containing annotation type, {0}, is not @Documented while repeated annotation type, {1}, is + repeatable annotation type ({1}) is @Documented while containing annotation type ({0}) is not # 0: symbol, 1: symbol compiler.err.invalid.repeatable.annotation.not.inherited=\ - containing annotation type, {0}, is not @Inherited while repeated annotation type, {1}, is + repeatable annotation type ({1}) is @Inherited while containing annotation type ({0}) is not # 0: symbol, 1: symbol compiler.err.invalid.repeatable.annotation.incompatible.target=\ - target of container annotation {0} is not a subset of target of repeated annotation {1} + containing annotation ({0}) is applicable to more targets than repeatable annotation type ({1}) # 0: symbol compiler.err.invalid.repeatable.annotation.repeated.and.container.present=\ @@ -561,26 +561,29 @@ integer number too large: {0} compiler.err.intf.annotation.members.cant.have.params=\ - @interface members may not have parameters + elements in annotation type declarations cannot declare formal parameters compiler.err.intf.annotation.cant.have.type.params=\ - @interface may not have type parameters + annotation type @{0} cannot be generic compiler.err.intf.annotation.members.cant.have.type.params=\ - @interface members may not have type parameters + elements in annotation type declarations cannot be generic methods # 0: symbol, 1: type compiler.err.intf.annotation.member.clash=\ - @interface member clashes with method ''{0}'' in {1} + annotation type @{1} declares an element with the same name as method {0} compiler.err.intf.expected.here=\ interface expected here +compiler.err.intf.or.array.expected.here=\ + interface or array type expected here + compiler.err.intf.meth.cant.have.body=\ interface abstract methods cannot have body -compiler.err.invalid.annotation.member.type=\ - invalid type for annotation member +compiler.err.annotation.invalid.element.type=\ + invalid type for element {0} of annotation type compiler.err.invalid.binary.number=\ binary numbers must contain at least one binary digit @@ -2297,6 +2300,11 @@ (use -source 8 or higher to enable type annotations) # 0: string +compiler.err.repeatable.annotations.not.supported.in.source=\ + repeatable annotations are not supported in -source {0}\n\ +(use -source 8 or higher to enable type annotations) + +# 0: string compiler.err.foreach.not.supported.in.source=\ for-each loops are not supported in -source {0}\n\ (use -source 5 or higher to enable for-each loops) --- old/test/tools/javac/diags/examples/DuplicateAnnotationJava8.java 2013-10-03 19:06:57.207030243 -0400 +++ new/test/tools/javac/diags/examples/DuplicateAnnotationJava8.java 2013-10-03 19:06:57.074029251 -0400 @@ -21,7 +21,7 @@ * questions. */ -// key: compiler.err.duplicate.annotation.missing.container +// key: compiler.err.duplicate.annotation.missing.containing.type @interface Anno { } --- old/test/tools/javac/diags/examples/DuplicateAnnotationMemberValue.java 2013-10-03 19:06:57.633033422 -0400 +++ /dev/null 2013-10-02 16:28:30.531212249 -0400 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// key: compiler.err.duplicate.annotation.member.value - -@interface Anno { - int value(); -} - -@Anno(value=1, value=2) -class DuplicateAnnotationMemberValue { } --- /dev/null 2013-10-02 16:28:30.531212249 -0400 +++ new/test/tools/javac/diags/examples/AnnotationDuplicateElement.java 2013-10-03 19:06:57.524032609 -0400 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// key: compiler.err.annotation.duplicate.element + +@interface Anno { + int value(); +} + +@Anno(value=1, value=2) +class AnnotationDuplicateElement { }