Thu, 24 Jul 2008 19:06:57 +0100
6717241: some diagnostic argument is prematurely converted into a String object
Summary: removed early toString() conversions applied to diagnostic arguments
Reviewed-by: jjg
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/com/sun/tools/javac/api/Formattable.java Thu Jul 24 19:06:57 2008 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* 1.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Sun designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Sun in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.26 + * have any questions. 1.27 + */ 1.28 + 1.29 +package com.sun.tools.javac.api; 1.30 + 1.31 +import java.util.ResourceBundle; 1.32 + 1.33 +/** 1.34 + * This interface must be implemented by any javac class that has non-trivial 1.35 + * formatting needs (e.g. where toString() does not apply because of localization). 1.36 + * 1.37 + * @author Maurizio Cimadamore 1.38 + */ 1.39 +public interface Formattable { 1.40 + 1.41 + /** 1.42 + * Used to obtain a localized String representing the object accordingly 1.43 + * to a given locale 1.44 + * 1.45 + * @param bundle resource bundle class used for localization 1.46 + * @return a locale-dependent string representing the object 1.47 + */ 1.48 + public String toString(ResourceBundle bundle); 1.49 + /** 1.50 + * Retrieve a pretty name of this object's kind 1.51 + * @return a string representing the object's kind 1.52 + */ 1.53 + String getKind(); 1.54 +}
2.1 --- a/src/share/classes/com/sun/tools/javac/code/Flags.java Thu Jul 24 11:12:41 2008 +0100 2.2 +++ b/src/share/classes/com/sun/tools/javac/code/Flags.java Thu Jul 24 19:06:57 2008 +0100 2.3 @@ -25,6 +25,7 @@ 2.4 2.5 package com.sun.tools.javac.code; 2.6 2.7 +import java.util.EnumSet; 2.8 import java.util.Collections; 2.9 import java.util.Map; 2.10 import java.util.Set; 2.11 @@ -43,38 +44,49 @@ 2.12 2.13 public static String toString(long flags) { 2.14 StringBuffer buf = new StringBuffer(); 2.15 - if ((flags&PUBLIC) != 0) buf.append("public "); 2.16 - if ((flags&PRIVATE) != 0) buf.append("private "); 2.17 - if ((flags&PROTECTED) != 0) buf.append("protected "); 2.18 - if ((flags&STATIC) != 0) buf.append("static "); 2.19 - if ((flags&FINAL) != 0) buf.append("final "); 2.20 - if ((flags&SYNCHRONIZED) != 0) buf.append("synchronized "); 2.21 - if ((flags&VOLATILE) != 0) buf.append("volatile "); 2.22 - if ((flags&TRANSIENT) != 0) buf.append("transient "); 2.23 - if ((flags&NATIVE) != 0) buf.append("native "); 2.24 - if ((flags&INTERFACE) != 0) buf.append("interface "); 2.25 - if ((flags&ABSTRACT) != 0) buf.append("abstract "); 2.26 - if ((flags&STRICTFP) != 0) buf.append("strictfp "); 2.27 - if ((flags&BRIDGE) != 0) buf.append("bridge "); 2.28 - if ((flags&SYNTHETIC) != 0) buf.append("synthetic "); 2.29 - if ((flags&DEPRECATED) != 0) buf.append("deprecated "); 2.30 - if ((flags&HASINIT) != 0) buf.append("hasinit "); 2.31 - if ((flags&ENUM) != 0) buf.append("enum "); 2.32 - if ((flags&IPROXY) != 0) buf.append("iproxy "); 2.33 - if ((flags&NOOUTERTHIS) != 0) buf.append("noouterthis "); 2.34 - if ((flags&EXISTS) != 0) buf.append("exists "); 2.35 - if ((flags&COMPOUND) != 0) buf.append("compound "); 2.36 - if ((flags&CLASS_SEEN) != 0) buf.append("class_seen "); 2.37 - if ((flags&SOURCE_SEEN) != 0) buf.append("source_seen "); 2.38 - if ((flags&LOCKED) != 0) buf.append("locked "); 2.39 - if ((flags&UNATTRIBUTED) != 0) buf.append("unattributed "); 2.40 - if ((flags&ANONCONSTR) != 0) buf.append("anonconstr "); 2.41 - if ((flags&ACYCLIC) != 0) buf.append("acyclic "); 2.42 - if ((flags&PARAMETER) != 0) buf.append("parameter "); 2.43 - if ((flags&VARARGS) != 0) buf.append("varargs "); 2.44 + String sep = ""; 2.45 + for (Flag s : asFlagSet(flags)) { 2.46 + buf.append(sep); 2.47 + buf.append(s); 2.48 + sep = " "; 2.49 + } 2.50 return buf.toString(); 2.51 } 2.52 2.53 + public static EnumSet<Flag> asFlagSet(long mask) { 2.54 + EnumSet<Flag> flags = EnumSet.noneOf(Flag.class); 2.55 + if ((mask&PUBLIC) != 0) flags.add(Flag.PUBLIC); 2.56 + if ((mask&PRIVATE) != 0) flags.add(Flag.PRIVATE); 2.57 + if ((mask&PROTECTED) != 0) flags.add(Flag.PROTECTED); 2.58 + if ((mask&STATIC) != 0) flags.add(Flag.STATIC); 2.59 + if ((mask&FINAL) != 0) flags.add(Flag.FINAL); 2.60 + if ((mask&SYNCHRONIZED) != 0) flags.add(Flag.SYNCHRONIZED); 2.61 + if ((mask&VOLATILE) != 0) flags.add(Flag.VOLATILE); 2.62 + if ((mask&TRANSIENT) != 0) flags.add(Flag.TRANSIENT); 2.63 + if ((mask&NATIVE) != 0) flags.add(Flag.NATIVE); 2.64 + if ((mask&INTERFACE) != 0) flags.add(Flag.INTERFACE); 2.65 + if ((mask&ABSTRACT) != 0) flags.add(Flag.ABSTRACT); 2.66 + if ((mask&STRICTFP) != 0) flags.add(Flag.STRICTFP); 2.67 + if ((mask&BRIDGE) != 0) flags.add(Flag.BRIDGE); 2.68 + if ((mask&SYNTHETIC) != 0) flags.add(Flag.SYNTHETIC); 2.69 + if ((mask&DEPRECATED) != 0) flags.add(Flag.DEPRECATED); 2.70 + if ((mask&HASINIT) != 0) flags.add(Flag.HASINIT); 2.71 + if ((mask&ENUM) != 0) flags.add(Flag.ENUM); 2.72 + if ((mask&IPROXY) != 0) flags.add(Flag.IPROXY); 2.73 + if ((mask&NOOUTERTHIS) != 0) flags.add(Flag.NOOUTERTHIS); 2.74 + if ((mask&EXISTS) != 0) flags.add(Flag.EXISTS); 2.75 + if ((mask&COMPOUND) != 0) flags.add(Flag.COMPOUND); 2.76 + if ((mask&CLASS_SEEN) != 0) flags.add(Flag.CLASS_SEEN); 2.77 + if ((mask&SOURCE_SEEN) != 0) flags.add(Flag.SOURCE_SEEN); 2.78 + if ((mask&LOCKED) != 0) flags.add(Flag.LOCKED); 2.79 + if ((mask&UNATTRIBUTED) != 0) flags.add(Flag.UNATTRIBUTED); 2.80 + if ((mask&ANONCONSTR) != 0) flags.add(Flag.ANONCONSTR); 2.81 + if ((mask&ACYCLIC) != 0) flags.add(Flag.ACYCLIC); 2.82 + if ((mask&PARAMETER) != 0) flags.add(Flag.PARAMETER); 2.83 + if ((mask&VARARGS) != 0) flags.add(Flag.VARARGS); 2.84 + return flags; 2.85 + } 2.86 + 2.87 /* Standard Java flags. 2.88 */ 2.89 public static final int PUBLIC = 1<<0; 2.90 @@ -271,4 +283,48 @@ 2.91 public static boolean isConstant(Symbol.VarSymbol symbol) { 2.92 return symbol.getConstValue() != null; 2.93 } 2.94 + 2.95 + public enum Flag { 2.96 + 2.97 + PUBLIC("public"), 2.98 + PRIVATE("private"), 2.99 + PROTECTED("protected"), 2.100 + STATIC("static"), 2.101 + FINAL("final"), 2.102 + SYNCHRONIZED("synchronized"), 2.103 + VOLATILE("volatile"), 2.104 + TRANSIENT("transient"), 2.105 + NATIVE("native"), 2.106 + INTERFACE("interface"), 2.107 + ABSTRACT("abstract"), 2.108 + STRICTFP("strictfp"), 2.109 + BRIDGE("bridge"), 2.110 + SYNTHETIC("synthetic"), 2.111 + DEPRECATED("deprecated"), 2.112 + HASINIT("hasinit"), 2.113 + ENUM("enum"), 2.114 + IPROXY("iproxy"), 2.115 + NOOUTERTHIS("noouterthis"), 2.116 + EXISTS("exists"), 2.117 + COMPOUND("compound"), 2.118 + CLASS_SEEN("class_seen"), 2.119 + SOURCE_SEEN("source_seen"), 2.120 + LOCKED("locked"), 2.121 + UNATTRIBUTED("unattributed"), 2.122 + ANONCONSTR("anonconstr"), 2.123 + ACYCLIC("acyclic"), 2.124 + PARAMETER("parameter"), 2.125 + VARARGS("varargs"), 2.126 + PACKAGE("package"); 2.127 + 2.128 + String name; 2.129 + 2.130 + Flag(String name) { 2.131 + this.name = name; 2.132 + } 2.133 + 2.134 + public String toString() { 2.135 + return name; 2.136 + } 2.137 + } 2.138 }
3.1 --- a/src/share/classes/com/sun/tools/javac/code/Kinds.java Thu Jul 24 11:12:41 2008 +0100 3.2 +++ b/src/share/classes/com/sun/tools/javac/code/Kinds.java Thu Jul 24 19:06:57 2008 +0100 3.3 @@ -25,6 +25,13 @@ 3.4 3.5 package com.sun.tools.javac.code; 3.6 3.7 +import java.util.EnumSet; 3.8 +import java.util.ResourceBundle; 3.9 + 3.10 +import com.sun.tools.javac.api.Formattable; 3.11 + 3.12 +import static com.sun.tools.javac.code.TypeTags.*; 3.13 +import static com.sun.tools.javac.code.Flags.*; 3.14 3.15 /** Internal symbol kinds, which distinguish between elements of 3.16 * different subclasses of Symbol. Symbol kinds are organized so they can be 3.17 @@ -82,4 +89,133 @@ 3.18 public static final int WRONG_MTH = ERRONEOUS+6; // one method with wrong arguments 3.19 public static final int ABSENT_MTH = ERRONEOUS+7; // missing method 3.20 public static final int ABSENT_TYP = ERRONEOUS+8; // missing type 3.21 + 3.22 + public enum KindName implements Formattable { 3.23 + ANNOTATION("kindname.interface"), 3.24 + CONSTRUCTOR("kindname.constructor"), 3.25 + INTERFACE("kindname.interface"), 3.26 + STATIC("kindname.static"), 3.27 + TYPEVAR("kindname.type.variable"), 3.28 + BOUND("kindname.type.variable.bound"), 3.29 + VAR("kindname.variable"), 3.30 + VAL("kindname.value"), 3.31 + METHOD("kindname.method"), 3.32 + CLASS("kindname.class"), 3.33 + PACKAGE("kindname.package"); 3.34 + 3.35 + private String name; 3.36 + 3.37 + KindName(String name) { 3.38 + this.name = name; 3.39 + } 3.40 + 3.41 + public String toString() { 3.42 + return name; 3.43 + } 3.44 + 3.45 + public String getKind() { 3.46 + return "Kindname"; 3.47 + } 3.48 + 3.49 + public String toString(ResourceBundle bundle) { 3.50 + String s = toString(); 3.51 + return bundle.getString("compiler.misc." + s); 3.52 + } 3.53 + } 3.54 + 3.55 + /** A KindName representing a given symbol kind 3.56 + */ 3.57 + public static KindName kindName(int kind) { 3.58 + switch (kind) { 3.59 + case PCK: return KindName.PACKAGE; 3.60 + case TYP: return KindName.CLASS; 3.61 + case VAR: return KindName.VAR; 3.62 + case VAL: return KindName.VAL; 3.63 + case MTH: return KindName.METHOD; 3.64 + default : throw new AssertionError("Unexpected kind: "+kind); 3.65 + } 3.66 + } 3.67 + 3.68 + /** A KindName representing a given symbol 3.69 + */ 3.70 + public static KindName kindName(Symbol sym) { 3.71 + switch (sym.getKind()) { 3.72 + case PACKAGE: 3.73 + return KindName.PACKAGE; 3.74 + 3.75 + case ENUM: 3.76 + case ANNOTATION_TYPE: 3.77 + case INTERFACE: 3.78 + case CLASS: 3.79 + return KindName.CLASS; 3.80 + 3.81 + case TYPE_PARAMETER: 3.82 + return KindName.TYPEVAR; 3.83 + 3.84 + case ENUM_CONSTANT: 3.85 + case FIELD: 3.86 + case PARAMETER: 3.87 + case LOCAL_VARIABLE: 3.88 + case EXCEPTION_PARAMETER: 3.89 + return KindName.VAR; 3.90 + 3.91 + case METHOD: 3.92 + case CONSTRUCTOR: 3.93 + case STATIC_INIT: 3.94 + case INSTANCE_INIT: 3.95 + return KindName.METHOD; 3.96 + 3.97 + default: 3.98 + if (sym.kind == VAL) 3.99 + // I don't think this can happen but it can't harm 3.100 + // playing it safe --ahe 3.101 + return KindName.VAL; 3.102 + else 3.103 + throw new AssertionError("Unexpected kind: "+sym.getKind()); 3.104 + } 3.105 + } 3.106 + 3.107 + /** A set of KindName(s) representing a set of symbol's kinds. 3.108 + */ 3.109 + public static EnumSet<KindName> kindNames(int kind) { 3.110 + EnumSet<KindName> kinds = EnumSet.noneOf(KindName.class); 3.111 + if ((kind & VAL) != 0) 3.112 + kinds.add(((kind & VAL) == VAR) ? KindName.VAR : KindName.VAL); 3.113 + if ((kind & MTH) != 0) kinds.add(KindName.METHOD); 3.114 + if ((kind & TYP) != 0) kinds.add(KindName.CLASS); 3.115 + if ((kind & PCK) != 0) kinds.add(KindName.PACKAGE); 3.116 + return kinds; 3.117 + } 3.118 + 3.119 + /** A KindName representing the kind of a given class/interface type. 3.120 + */ 3.121 + public static KindName typeKindName(Type t) { 3.122 + if (t.tag == TYPEVAR || 3.123 + t.tag == CLASS && (t.tsym.flags() & COMPOUND) != 0) 3.124 + return KindName.BOUND; 3.125 + else if (t.tag == PACKAGE) 3.126 + return KindName.PACKAGE; 3.127 + else if ((t.tsym.flags_field & ANNOTATION) != 0) 3.128 + return KindName.ANNOTATION; 3.129 + else if ((t.tsym.flags_field & INTERFACE) != 0) 3.130 + return KindName.INTERFACE; 3.131 + else 3.132 + return KindName.CLASS; 3.133 + } 3.134 + 3.135 + /** A KindName representing the kind of a a missing symbol, given an 3.136 + * error kind. 3.137 + * */ 3.138 + public static KindName absentKind(int kind) { 3.139 + switch (kind) { 3.140 + case ABSENT_VAR: 3.141 + return KindName.VAR; 3.142 + case WRONG_MTHS: case WRONG_MTH: case ABSENT_MTH: 3.143 + return KindName.METHOD; 3.144 + case ABSENT_TYP: 3.145 + return KindName.CLASS; 3.146 + default: 3.147 + throw new AssertionError("Unexpected kind: "+kind); 3.148 + } 3.149 + } 3.150 }
4.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java Thu Jul 24 11:12:41 2008 +0100 4.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java Thu Jul 24 19:06:57 2008 +0100 4.3 @@ -140,25 +140,27 @@ 4.4 } 4.5 4.6 /** A Java source description of the location of this symbol; used for 4.7 - * error reporting. Use of this method may result in the loss of the 4.8 - * symbol's description. 4.9 + * error reporting. 4.10 + * 4.11 + * @return null if the symbol is a package or a toplevel class defined in 4.12 + * the default package; otherwise, the owner symbol is returned 4.13 */ 4.14 - public String location() { 4.15 + public Symbol location() { 4.16 if (owner.name == null || (owner.name.len == 0 && owner.kind != PCK)) { 4.17 - return ""; 4.18 + return null; 4.19 } 4.20 - return owner.toString(); 4.21 + return owner; 4.22 } 4.23 4.24 - public String location(Type site, Types types) { 4.25 + public Symbol location(Type site, Types types) { 4.26 if (owner.name == null || owner.name.len == 0) { 4.27 return location(); 4.28 } 4.29 if (owner.type.tag == CLASS) { 4.30 Type ownertype = types.asOuterSuper(site, owner); 4.31 - if (ownertype != null) return ownertype.toString(); 4.32 + if (ownertype != null) return ownertype.tsym; 4.33 } 4.34 - return owner.toString(); 4.35 + return owner; 4.36 } 4.37 4.38 /** The symbol's erased type. 4.39 @@ -451,8 +453,8 @@ 4.40 this.other = other; 4.41 } 4.42 public String toString() { return other.toString(); } 4.43 - public String location() { return other.location(); } 4.44 - public String location(Type site, Types types) { return other.location(site, types); } 4.45 + public Symbol location() { return other.location(); } 4.46 + public Symbol location(Type site, Types types) { return other.location(site, types); } 4.47 public Type erasure(Types types) { return other.erasure(types); } 4.48 public Type externalType(Types types) { return other.externalType(types); } 4.49 public boolean isLocal() { return other.isLocal(); }
5.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Jul 24 11:12:41 2008 +0100 5.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Jul 24 19:06:57 2008 +0100 5.3 @@ -172,8 +172,8 @@ 5.4 owntype = chk.checkType(tree.pos(), owntype, pt); 5.5 } else { 5.6 log.error(tree.pos(), "unexpected.type", 5.7 - Resolve.kindNames(pkind), 5.8 - Resolve.kindName(ownkind)); 5.9 + kindNames(pkind), 5.10 + kindName(ownkind)); 5.11 owntype = syms.errType; 5.12 } 5.13 }
6.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Jul 24 11:12:41 2008 +0100 6.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Jul 24 19:06:57 2008 +0100 6.3 @@ -576,8 +576,8 @@ 6.4 if ((flags & set1) != 0 && (flags & set2) != 0) { 6.5 log.error(pos, 6.6 "illegal.combination.of.modifiers", 6.7 - TreeInfo.flagNames(TreeInfo.firstFlag(flags & set1)), 6.8 - TreeInfo.flagNames(TreeInfo.firstFlag(flags & set2))); 6.9 + asFlagSet(TreeInfo.firstFlag(flags & set1)), 6.10 + asFlagSet(TreeInfo.firstFlag(flags & set2))); 6.11 return false; 6.12 } else 6.13 return true; 6.14 @@ -670,7 +670,7 @@ 6.15 } 6.16 else { 6.17 log.error(pos, 6.18 - "mod.not.allowed.here", TreeInfo.flagNames(illegal)); 6.19 + "mod.not.allowed.here", asFlagSet(illegal)); 6.20 } 6.21 } 6.22 else if ((sym.kind == TYP || 6.23 @@ -1023,14 +1023,6 @@ 6.24 } 6.25 } 6.26 6.27 - /** A string describing the access permission given by a flag set. 6.28 - * This always returns a space-separated list of Java Keywords. 6.29 - */ 6.30 - private static String protectionString(long flags) { 6.31 - long flags1 = flags & AccessFlags; 6.32 - return (flags1 == 0) ? "package" : TreeInfo.flagNames(flags1); 6.33 - } 6.34 - 6.35 /** A customized "cannot override" error message. 6.36 * @param m The overriding method. 6.37 * @param other The overridden method. 6.38 @@ -1124,7 +1116,7 @@ 6.39 (other.flags() & STATIC) != 0) { 6.40 log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.meth", 6.41 cannotOverride(m, other), 6.42 - TreeInfo.flagNames(other.flags() & (FINAL | STATIC))); 6.43 + asFlagSet(other.flags() & (FINAL | STATIC))); 6.44 return; 6.45 } 6.46 6.47 @@ -1138,9 +1130,10 @@ 6.48 protection(m.flags()) > protection(other.flags())) { 6.49 log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.weaker.access", 6.50 cannotOverride(m, other), 6.51 - protectionString(other.flags())); 6.52 + other.flags() == 0 ? 6.53 + Flag.PACKAGE : 6.54 + asFlagSet(other.flags() & AccessFlags)); 6.55 return; 6.56 - 6.57 } 6.58 6.59 Type mt = types.memberType(origin.type, m); 6.60 @@ -2035,7 +2028,7 @@ 6.61 log.error(pos, 6.62 "operator.cant.be.applied", 6.63 treeinfo.operatorName(tag), 6.64 - left + "," + right); 6.65 + List.of(left, right)); 6.66 } 6.67 return operator.opcode; 6.68 }
7.1 --- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Jul 24 11:12:41 2008 +0100 7.2 +++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Jul 24 19:06:57 2008 +0100 7.3 @@ -317,8 +317,9 @@ 7.4 importFrom(tsym); 7.5 if (!found) { 7.6 log.error(pos, "cant.resolve.location", 7.7 - JCDiagnostic.fragment("kindname.static"), 7.8 - name, "", "", Resolve.typeKindName(tsym.type), 7.9 + KindName.STATIC, 7.10 + name, List.<Type>nil(), List.<Type>nil(), 7.11 + typeKindName(tsym.type), 7.12 tsym.type); 7.13 } 7.14 } finally { 7.15 @@ -719,7 +720,7 @@ 7.16 annotations.nonEmpty()) 7.17 log.error(annotations.head.pos, 7.18 "already.annotated", 7.19 - Resolve.kindName(s), s); 7.20 + kindName(s), s); 7.21 enterAnnotations(annotations, localEnv, s); 7.22 } finally { 7.23 log.useSource(prev);
8.1 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Jul 24 11:12:41 2008 +0100 8.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Jul 24 19:06:57 2008 +0100 8.3 @@ -1442,107 +1442,6 @@ 8.4 } 8.5 8.6 /* *************************************************************************** 8.7 - * Methods related to kinds 8.8 - ****************************************************************************/ 8.9 - 8.10 - /** A localized string describing a given kind. 8.11 - */ 8.12 - static JCDiagnostic kindName(int kind) { 8.13 - switch (kind) { 8.14 - case PCK: return JCDiagnostic.fragment("kindname.package"); 8.15 - case TYP: return JCDiagnostic.fragment("kindname.class"); 8.16 - case VAR: return JCDiagnostic.fragment("kindname.variable"); 8.17 - case VAL: return JCDiagnostic.fragment("kindname.value"); 8.18 - case MTH: return JCDiagnostic.fragment("kindname.method"); 8.19 - default : return JCDiagnostic.fragment("kindname", 8.20 - Integer.toString(kind)); //debug 8.21 - } 8.22 - } 8.23 - 8.24 - static JCDiagnostic kindName(Symbol sym) { 8.25 - switch (sym.getKind()) { 8.26 - case PACKAGE: 8.27 - return JCDiagnostic.fragment("kindname.package"); 8.28 - 8.29 - case ENUM: 8.30 - case ANNOTATION_TYPE: 8.31 - case INTERFACE: 8.32 - case CLASS: 8.33 - return JCDiagnostic.fragment("kindname.class"); 8.34 - 8.35 - case TYPE_PARAMETER: 8.36 - return JCDiagnostic.fragment("kindname.type.variable"); 8.37 - 8.38 - case ENUM_CONSTANT: 8.39 - case FIELD: 8.40 - case PARAMETER: 8.41 - case LOCAL_VARIABLE: 8.42 - case EXCEPTION_PARAMETER: 8.43 - return JCDiagnostic.fragment("kindname.variable"); 8.44 - 8.45 - case METHOD: 8.46 - case CONSTRUCTOR: 8.47 - case STATIC_INIT: 8.48 - case INSTANCE_INIT: 8.49 - return JCDiagnostic.fragment("kindname.method"); 8.50 - 8.51 - default: 8.52 - if (sym.kind == VAL) 8.53 - // I don't think this can happen but it can't harm 8.54 - // playing it safe --ahe 8.55 - return JCDiagnostic.fragment("kindname.value"); 8.56 - else 8.57 - return JCDiagnostic.fragment("kindname", sym.getKind()); // debug 8.58 - } 8.59 - } 8.60 - 8.61 - /** A localized string describing a given set of kinds. 8.62 - */ 8.63 - static JCDiagnostic kindNames(int kind) { 8.64 - StringBuffer key = new StringBuffer(); 8.65 - key.append("kindname"); 8.66 - if ((kind & VAL) != 0) 8.67 - key.append(((kind & VAL) == VAR) ? ".variable" : ".value"); 8.68 - if ((kind & MTH) != 0) key.append(".method"); 8.69 - if ((kind & TYP) != 0) key.append(".class"); 8.70 - if ((kind & PCK) != 0) key.append(".package"); 8.71 - return JCDiagnostic.fragment(key.toString(), kind); 8.72 - } 8.73 - 8.74 - /** A localized string describing the kind -- either class or interface -- 8.75 - * of a given type. 8.76 - */ 8.77 - static JCDiagnostic typeKindName(Type t) { 8.78 - if (t.tag == TYPEVAR || 8.79 - t.tag == CLASS && (t.tsym.flags() & COMPOUND) != 0) 8.80 - return JCDiagnostic.fragment("kindname.type.variable.bound"); 8.81 - else if (t.tag == PACKAGE) 8.82 - return JCDiagnostic.fragment("kindname.package"); 8.83 - else if ((t.tsym.flags_field & ANNOTATION) != 0) 8.84 - return JCDiagnostic.fragment("kindname.annotation"); 8.85 - else if ((t.tsym.flags_field & INTERFACE) != 0) 8.86 - return JCDiagnostic.fragment("kindname.interface"); 8.87 - else 8.88 - return JCDiagnostic.fragment("kindname.class"); 8.89 - } 8.90 - 8.91 - /** A localized string describing the kind of a missing symbol, given an 8.92 - * error kind. 8.93 - */ 8.94 - static JCDiagnostic absentKindName(int kind) { 8.95 - switch (kind) { 8.96 - case ABSENT_VAR: 8.97 - return JCDiagnostic.fragment("kindname.variable"); 8.98 - case WRONG_MTHS: case WRONG_MTH: case ABSENT_MTH: 8.99 - return JCDiagnostic.fragment("kindname.method"); 8.100 - case ABSENT_TYP: 8.101 - return JCDiagnostic.fragment("kindname.class"); 8.102 - default: 8.103 - return JCDiagnostic.fragment("kindname", kind); 8.104 - } 8.105 - } 8.106 - 8.107 -/* *************************************************************************** 8.108 * ResolveError classes, indicating error situations when accessing symbols 8.109 ****************************************************************************/ 8.110 8.111 @@ -1633,55 +1532,77 @@ 8.112 */ 8.113 void report(Log log, DiagnosticPosition pos, Type site, Name name, 8.114 List<Type> argtypes, List<Type> typeargtypes) { 8.115 + if (argtypes == null) 8.116 + argtypes = List.nil(); 8.117 + if (typeargtypes == null) 8.118 + typeargtypes = List.nil(); 8.119 if (name != name.table.error) { 8.120 - JCDiagnostic kindname = absentKindName(kind); 8.121 - String idname = name.toString(); 8.122 - String args = ""; 8.123 - String typeargs = ""; 8.124 + KindName kindname = absentKind(kind); 8.125 + Name idname = name; 8.126 if (kind >= WRONG_MTHS && kind <= ABSENT_MTH) { 8.127 if (isOperator(name)) { 8.128 log.error(pos, "operator.cant.be.applied", 8.129 - name, Type.toString(argtypes)); 8.130 + name, argtypes); 8.131 return; 8.132 } 8.133 if (name == name.table.init) { 8.134 - kindname = JCDiagnostic.fragment("kindname.constructor"); 8.135 - idname = site.tsym.name.toString(); 8.136 + kindname = KindName.CONSTRUCTOR; 8.137 + idname = site.tsym.name; 8.138 } 8.139 - args = "(" + Type.toString(argtypes) + ")"; 8.140 - if (typeargtypes != null && typeargtypes.nonEmpty()) 8.141 - typeargs = "<" + Type.toString(typeargtypes) + ">"; 8.142 } 8.143 if (kind == WRONG_MTH) { 8.144 + Symbol ws = wrongSym.asMemberOf(site, types); 8.145 log.error(pos, 8.146 "cant.apply.symbol" + (explanation != null ? ".1" : ""), 8.147 - wrongSym.asMemberOf(site, types), 8.148 - wrongSym.location(site, types), 8.149 - typeargs, 8.150 - Type.toString(argtypes), 8.151 + kindname, 8.152 + ws.name == names.init ? ws.owner.name : ws.name, 8.153 + ws.type.getParameterTypes(), 8.154 + argtypes, 8.155 + kindName(ws.owner), 8.156 + ws.owner.type, 8.157 explanation); 8.158 } else if (site.tsym.name.len != 0) { 8.159 if (site.tsym.kind == PCK && !site.tsym.exists()) 8.160 log.error(pos, "doesnt.exist", site.tsym); 8.161 - else 8.162 - log.error(pos, "cant.resolve.location", 8.163 - kindname, idname, args, typeargs, 8.164 - typeKindName(site), site); 8.165 + else { 8.166 + String errKey = getErrorKey("cant.resolve.location", 8.167 + argtypes, typeargtypes, 8.168 + kindname); 8.169 + log.error(pos, errKey, kindname, idname, //symbol kindname, name 8.170 + typeargtypes, argtypes, //type parameters and arguments (if any) 8.171 + typeKindName(site), site); //location kindname, type 8.172 + } 8.173 } else { 8.174 - log.error(pos, "cant.resolve", kindname, idname, args, typeargs); 8.175 + String errKey = getErrorKey("cant.resolve", 8.176 + argtypes, typeargtypes, 8.177 + kindname); 8.178 + log.error(pos, errKey, kindname, idname, //symbol kindname, name 8.179 + typeargtypes, argtypes); //type parameters and arguments (if any) 8.180 } 8.181 } 8.182 } 8.183 -//where 8.184 - /** A name designates an operator if it consists 8.185 - * of a non-empty sequence of operator symbols +-~!/*%&|^<>= 8.186 - */ 8.187 - boolean isOperator(Name name) { 8.188 - int i = 0; 8.189 - while (i < name.len && 8.190 - "+-~!*/%&|^<>=".indexOf(name.byteAt(i)) >= 0) i++; 8.191 - return i > 0 && i == name.len; 8.192 + //where 8.193 + String getErrorKey(String key, List<Type> argtypes, List<Type> typeargtypes, KindName kindname) { 8.194 + String suffix = ""; 8.195 + switch (kindname) { 8.196 + case METHOD: 8.197 + case CONSTRUCTOR: { 8.198 + suffix += ".args"; 8.199 + suffix += typeargtypes.nonEmpty() ? ".params" : ""; 8.200 + } 8.201 } 8.202 + return key + suffix; 8.203 + } 8.204 + 8.205 + /** A name designates an operator if it consists 8.206 + * of a non-empty sequence of operator symbols +-~!/*%&|^<>= 8.207 + */ 8.208 + boolean isOperator(Name name) { 8.209 + int i = 0; 8.210 + while (i < name.len && 8.211 + "+-~!*/%&|^<>=".indexOf(name.byteAt(i)) >= 0) i++; 8.212 + return i > 0 && i == name.len; 8.213 + } 8.214 } 8.215 8.216 /** Resolve error class indicating that a symbol is not accessible. 8.217 @@ -1726,7 +1647,7 @@ 8.218 sym, sym.location()); 8.219 else if ((sym.flags() & (PRIVATE | PROTECTED)) != 0) 8.220 log.error(pos, "report.access", sym, 8.221 - TreeInfo.flagNames(sym.flags() & (PRIVATE | PROTECTED)), 8.222 + asFlagSet(sym.flags() & (PRIVATE | PROTECTED)), 8.223 sym.location()); 8.224 else 8.225 log.error(pos, "not.def.public.cant.access", 8.226 @@ -1759,11 +1680,11 @@ 8.227 Name name, 8.228 List<Type> argtypes, 8.229 List<Type> typeargtypes) { 8.230 - String symstr = ((sym.kind == TYP && sym.type.tag == CLASS) 8.231 - ? types.erasure(sym.type) 8.232 - : sym).toString(); 8.233 + Symbol errSym = ((sym.kind == TYP && sym.type.tag == CLASS) 8.234 + ? types.erasure(sym.type).tsym 8.235 + : sym); 8.236 log.error(pos, "non-static.cant.be.ref", 8.237 - kindName(sym), symstr); 8.238 + kindName(sym), errSym); 8.239 } 8.240 } 8.241
9.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Jul 24 11:12:41 2008 +0100 9.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Jul 24 19:06:57 2008 +0100 9.3 @@ -1331,7 +1331,7 @@ 9.4 log.warning("annotation.method.not.found.reason", 9.5 container, 9.6 name, 9.7 - failure.getMessage()); 9.8 + failure.getDetailValue());//diagnostic, if present 9.9 } 9.10 } finally { 9.11 log.useSource(prevSource);
10.1 --- a/src/share/classes/com/sun/tools/javac/parser/Keywords.java Thu Jul 24 11:12:41 2008 +0100 10.2 +++ b/src/share/classes/com/sun/tools/javac/parser/Keywords.java Thu Jul 24 19:06:57 2008 +0100 10.3 @@ -91,34 +91,6 @@ 10.4 */ 10.5 private Name[] tokenName = new Name[Token.values().length]; 10.6 10.7 - public String token2string(Token token) { 10.8 - switch (token) { 10.9 - case IDENTIFIER: 10.10 - return log.getLocalizedString("token.identifier"); 10.11 - case CHARLITERAL: 10.12 - return log.getLocalizedString("token.character"); 10.13 - case STRINGLITERAL: 10.14 - return log.getLocalizedString("token.string"); 10.15 - case INTLITERAL: 10.16 - return log.getLocalizedString("token.integer"); 10.17 - case LONGLITERAL: 10.18 - return log.getLocalizedString("token.long-integer"); 10.19 - case FLOATLITERAL: 10.20 - return log.getLocalizedString("token.float"); 10.21 - case DOUBLELITERAL: 10.22 - return log.getLocalizedString("token.double"); 10.23 - case ERROR: 10.24 - return log.getLocalizedString("token.bad-symbol"); 10.25 - case EOF: 10.26 - return log.getLocalizedString("token.end-of-input"); 10.27 - case DOT: case COMMA: case SEMI: case LPAREN: case RPAREN: 10.28 - case LBRACKET: case RBRACKET: case LBRACE: case RBRACE: 10.29 - return "'" + token.name + "'"; 10.30 - default: 10.31 - return token.name; 10.32 - } 10.33 - } 10.34 - 10.35 private void enterKeyword(String s, Token token) { 10.36 Name n = names.fromString(s); 10.37 tokenName[token.ordinal()] = n;
11.1 --- a/src/share/classes/com/sun/tools/javac/parser/Parser.java Thu Jul 24 11:12:41 2008 +0100 11.2 +++ b/src/share/classes/com/sun/tools/javac/parser/Parser.java Thu Jul 24 19:06:57 2008 +0100 11.3 @@ -272,13 +272,13 @@ 11.4 } 11.5 } 11.6 11.7 - private JCErroneous syntaxError(int pos, String key, Object... arg) { 11.8 - return syntaxError(pos, null, key, arg); 11.9 + private JCErroneous syntaxError(int pos, String key, Token... args) { 11.10 + return syntaxError(pos, null, key, args); 11.11 } 11.12 11.13 - private JCErroneous syntaxError(int pos, List<JCTree> errs, String key, Object... arg) { 11.14 + private JCErroneous syntaxError(int pos, List<JCTree> errs, String key, Token... args) { 11.15 setErrorEndPos(pos); 11.16 - reportSyntaxError(pos, key, arg); 11.17 + reportSyntaxError(pos, key, (Object[])args); 11.18 return toP(F.at(pos).Erroneous(errs)); 11.19 } 11.20 11.21 @@ -287,12 +287,12 @@ 11.22 * Report a syntax error at given position using the given 11.23 * argument unless one was already reported at the same position. 11.24 */ 11.25 - private void reportSyntaxError(int pos, String key, Object... arg) { 11.26 + private void reportSyntaxError(int pos, String key, Object... args) { 11.27 if (pos > S.errPos() || pos == Position.NOPOS) { 11.28 if (S.token() == EOF) 11.29 log.error(pos, "premature.eof"); 11.30 else 11.31 - log.error(pos, key, arg); 11.32 + log.error(pos, key, args); 11.33 } 11.34 S.errPos(pos); 11.35 if (S.pos() == errorPos) 11.36 @@ -311,7 +311,7 @@ 11.37 /** Generate a syntax error at current position unless one was 11.38 * already reported at the same position. 11.39 */ 11.40 - private JCErroneous syntaxError(String key, String arg) { 11.41 + private JCErroneous syntaxError(String key, Token arg) { 11.42 return syntaxError(S.pos(), key, arg); 11.43 } 11.44 11.45 @@ -323,7 +323,7 @@ 11.46 S.nextToken(); 11.47 } else { 11.48 setErrorEndPos(S.pos()); 11.49 - reportSyntaxError(S.prevEndPos(), "expected", keywords.token2string(token)); 11.50 + reportSyntaxError(S.prevEndPos(), "expected", token); 11.51 } 11.52 } 11.53 11.54 @@ -349,7 +349,7 @@ 11.55 if (mods != 0) { 11.56 long lowestMod = mods & -mods; 11.57 log.error(S.pos(), "mod.not.allowed.here", 11.58 - Flags.toString(lowestMod).trim()); 11.59 + Flags.asFlagSet(lowestMod)); 11.60 } 11.61 } 11.62 11.63 @@ -1180,7 +1180,7 @@ 11.64 } 11.65 accept(RPAREN); 11.66 } else { 11.67 - syntaxError(S.pos(), "expected", keywords.token2string(LPAREN)); 11.68 + syntaxError(S.pos(), "expected", LPAREN); 11.69 } 11.70 return args.toList(); 11.71 } 11.72 @@ -1253,7 +1253,7 @@ 11.73 break; 11.74 } 11.75 } else { 11.76 - syntaxError(S.pos(), "expected", keywords.token2string(LT)); 11.77 + syntaxError(S.pos(), "expected", LT); 11.78 } 11.79 return args.toList(); 11.80 } 11.81 @@ -1278,9 +1278,7 @@ 11.82 } else if (S.token() == IDENTIFIER) { 11.83 //error recovery 11.84 reportSyntaxError(S.prevEndPos(), "expected3", 11.85 - keywords.token2string(GT), 11.86 - keywords.token2string(EXTENDS), 11.87 - keywords.token2string(SUPER)); 11.88 + GT, EXTENDS, SUPER); 11.89 TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND); 11.90 JCExpression wc = toP(F.at(pos).Wildcard(t, null)); 11.91 JCIdent id = toP(F.at(S.pos()).Ident(ident())); 11.92 @@ -1392,8 +1390,7 @@ 11.93 return classCreatorRest(newpos, null, typeArgs, t); 11.94 } else { 11.95 reportSyntaxError(S.pos(), "expected2", 11.96 - keywords.token2string(LPAREN), 11.97 - keywords.token2string(LBRACKET)); 11.98 + LPAREN, LBRACKET); 11.99 t = toP(F.at(newpos).NewClass(null, typeArgs, t, List.<JCExpression>nil(), null)); 11.100 return toP(F.at(newpos).Erroneous(List.<JCTree>of(t))); 11.101 } 11.102 @@ -1500,7 +1497,7 @@ 11.103 List<JCStatement> stats = blockStatements(); 11.104 JCBlock t = F.at(pos).Block(flags, stats); 11.105 while (S.token() == CASE || S.token() == DEFAULT) { 11.106 - syntaxError("orphaned", keywords.token2string(S.token())); 11.107 + syntaxError("orphaned", S.token()); 11.108 switchBlockStatementGroups(); 11.109 } 11.110 // the Block node has a field "endpos" for first char of last token, which is 11.111 @@ -1842,9 +1839,7 @@ 11.112 default: 11.113 S.nextToken(); // to ensure progress 11.114 syntaxError(pos, "expected3", 11.115 - keywords.token2string(CASE), 11.116 - keywords.token2string(DEFAULT), 11.117 - keywords.token2string(RBRACE)); 11.118 + CASE, DEFAULT, RBRACE); 11.119 } 11.120 } 11.121 } 11.122 @@ -2110,7 +2105,7 @@ 11.123 S.nextToken(); 11.124 init = variableInitializer(); 11.125 } 11.126 - else if (reqInit) syntaxError(S.pos(), "expected", keywords.token2string(EQ)); 11.127 + else if (reqInit) syntaxError(S.pos(), "expected", EQ); 11.128 JCVariableDecl result = 11.129 toP(F.at(pos).VarDef(mods, name, type, init)); 11.130 attach(result, dc); 11.131 @@ -2241,9 +2236,7 @@ 11.132 errs = List.<JCTree>of(mods); 11.133 } 11.134 return toP(F.Exec(syntaxError(pos, errs, "expected3", 11.135 - keywords.token2string(CLASS), 11.136 - keywords.token2string(INTERFACE), 11.137 - keywords.token2string(ENUM)))); 11.138 + CLASS, INTERFACE, ENUM))); 11.139 } 11.140 } else { 11.141 if (S.token() == ENUM) { 11.142 @@ -2260,8 +2253,7 @@ 11.143 errs = List.<JCTree>of(mods); 11.144 } 11.145 return toP(F.Exec(syntaxError(pos, errs, "expected2", 11.146 - keywords.token2string(CLASS), 11.147 - keywords.token2string(INTERFACE)))); 11.148 + CLASS, INTERFACE))); 11.149 } 11.150 } 11.151 11.152 @@ -2360,9 +2352,7 @@ 11.153 } 11.154 if (S.token() != SEMI && S.token() != RBRACE) { 11.155 defs.append(syntaxError(S.pos(), "expected3", 11.156 - keywords.token2string(COMMA), 11.157 - keywords.token2string(RBRACE), 11.158 - keywords.token2string(SEMI))); 11.159 + COMMA, RBRACE, SEMI)); 11.160 S.nextToken(); 11.161 } 11.162 } 11.163 @@ -2531,7 +2521,7 @@ 11.164 ? List.<JCTree>of(toP(F.at(pos).MethodDef(mods, name, type, typarams, 11.165 List.<JCVariableDecl>nil(), List.<JCExpression>nil(), null, null))) 11.166 : null; 11.167 - return List.<JCTree>of(syntaxError(S.pos(), err, "expected", keywords.token2string(LPAREN))); 11.168 + return List.<JCTree>of(syntaxError(S.pos(), err, "expected", LPAREN)); 11.169 } 11.170 } 11.171 }
12.1 --- a/src/share/classes/com/sun/tools/javac/parser/Token.java Thu Jul 24 11:12:41 2008 +0100 12.2 +++ b/src/share/classes/com/sun/tools/javac/parser/Token.java Thu Jul 24 19:06:57 2008 +0100 12.3 @@ -25,6 +25,9 @@ 12.4 12.5 package com.sun.tools.javac.parser; 12.6 12.7 +import java.util.ResourceBundle; 12.8 + 12.9 +import com.sun.tools.javac.api.Formattable; 12.10 12.11 /** An interface that defines codes for Java source tokens 12.12 * returned from lexical analysis. 12.13 @@ -34,7 +37,7 @@ 12.14 * This code and its internal interfaces are subject to change or 12.15 * deletion without notice.</b> 12.16 */ 12.17 -public enum Token { 12.18 +public enum Token implements Formattable { 12.19 EOF, 12.20 ERROR, 12.21 IDENTIFIER, 12.22 @@ -155,4 +158,41 @@ 12.23 } 12.24 12.25 public final String name; 12.26 + 12.27 + public String toString() { 12.28 + switch (this) { 12.29 + case IDENTIFIER: 12.30 + return "token.identifier"; 12.31 + case CHARLITERAL: 12.32 + return "token.character"; 12.33 + case STRINGLITERAL: 12.34 + return "token.string"; 12.35 + case INTLITERAL: 12.36 + return "token.integer"; 12.37 + case LONGLITERAL: 12.38 + return "token.long-integer"; 12.39 + case FLOATLITERAL: 12.40 + return "token.float"; 12.41 + case DOUBLELITERAL: 12.42 + return "token.double"; 12.43 + case ERROR: 12.44 + return "token.bad-symbol"; 12.45 + case EOF: 12.46 + return "token.end-of-input"; 12.47 + case DOT: case COMMA: case SEMI: case LPAREN: case RPAREN: 12.48 + case LBRACKET: case RBRACKET: case LBRACE: case RBRACE: 12.49 + return "'" + name + "'"; 12.50 + default: 12.51 + return name; 12.52 + } 12.53 + } 12.54 + 12.55 + public String getKind() { 12.56 + return "Token"; 12.57 + } 12.58 + 12.59 + public String toString(ResourceBundle bundle) { 12.60 + String s = toString(); 12.61 + return s.startsWith("token.") ? bundle.getString("compiler.misc." + s) : s; 12.62 + } 12.63 }
13.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Jul 24 11:12:41 2008 +0100 13.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Jul 24 19:06:57 2008 +0100 13.3 @@ -81,9 +81,14 @@ 13.4 compiler.err.call.must.be.first.stmt.in.ctor=\ 13.5 call to {0} must be first statement in constructor 13.6 compiler.err.cant.apply.symbol=\ 13.7 - {0} in {1} cannot be applied to {2}({3}) 13.8 -compiler.err.cant.apply.symbol.1=\ 13.9 - {0} in {1} cannot be applied to {2}({3}); {4} 13.10 + {0} {1} in {4} {5} cannot be applied to given types\n\ 13.11 + required: {2}\n\ 13.12 + found: {3} 13.13 + compiler.err.cant.apply.symbol.1=\ 13.14 + {0} {1} in {4} {5} cannot be applied to given types;\n\ 13.15 + required: {2}\n\ 13.16 + found: {3}\n\ 13.17 + reason: {6} 13.18 compiler.err.cant.assign.val.to.final.var=\ 13.19 cannot assign a value to final variable {0} 13.20 compiler.err.cant.deref=\ 13.21 @@ -940,7 +945,7 @@ 13.22 compiler.misc.type.req.exact=\ 13.23 class or interface without bounds 13.24 compiler.misc.type.parameter=\ 13.25 - type parameter {0} 13.26 + type parameter {0} 13.27 13.28 ##### 13.29 13.30 @@ -980,16 +985,39 @@ 13.31 required: {0}\n\ 13.32 found : {1} 13.33 13.34 -## The first argument ({0}) is a "kindname". 13.35 +## The first argument {0} is a "kindname" (e.g. 'constructor', 'field', etc.) 13.36 +## The second argument {1} is the non-resolved symbol 13.37 +## The third argument {2} is a list of type parameters (non-empty if {1} is a method) 13.38 +## The fourth argument {3} is a list of argument types (non-empty if {1} is a method) 13.39 compiler.err.cant.resolve=\ 13.40 -cannot find symbol\n\ 13.41 -symbol: {0} {3}{1}{2} 13.42 + cannot find symbol\n\ 13.43 + symbol: {0} {1} 13.44 13.45 -## The first argument ({0}) and fifth argument ({4}) are "kindname"s. 13.46 +compiler.err.cant.resolve.args=\ 13.47 + cannot find symbol\n\ 13.48 + symbol: {0} {1}({3}) 13.49 + 13.50 +compiler.err.cant.resolve.args.params=\ 13.51 + cannot find symbol\n\ 13.52 + symbol: {0} <{2}>{1}({3}) 13.53 + 13.54 +## arguments from {0} to {3} have the same meaning as above 13.55 +## The fifth argument {4} is the location "kindname" (e.g. 'constructor', 'field', etc.) 13.56 +## The sixth argument {5} is the location type 13.57 compiler.err.cant.resolve.location=\ 13.58 -cannot find symbol\n\ 13.59 -symbol : {0} {3}{1}{2}\n\ 13.60 -location: {4} {5} 13.61 + cannot find symbol\n\ 13.62 + symbol : {0} {1}\n\ 13.63 + location: {4} {5} 13.64 + 13.65 +compiler.err.cant.resolve.location.args=\ 13.66 + cannot find symbol\n\ 13.67 + symbol : {0} {1}({3})\n\ 13.68 + location: {4} {5} 13.69 + 13.70 +compiler.err.cant.resolve.location.args.params=\ 13.71 + cannot find symbol\n\ 13.72 + symbol : {0} <{2}>{1}({3})\n\ 13.73 + location: {4} {5} 13.74 13.75 ## The following are all possible string for "kindname". 13.76 ## They should be called whatever the JLS calls them after it been translated 13.77 @@ -1008,55 +1036,16 @@ 13.78 type variable 13.79 compiler.misc.kindname.type.variable.bound=\ 13.80 bound of type variable 13.81 -compiler.misc.kindname=\ 13.82 - identifier({0}) 13.83 compiler.misc.kindname.variable=\ 13.84 variable 13.85 compiler.misc.kindname.value=\ 13.86 value 13.87 compiler.misc.kindname.method=\ 13.88 method 13.89 -compiler.misc.kindname.variable.method=\ 13.90 - variable, method 13.91 -compiler.misc.kindname.value.method=\ 13.92 - value, method 13.93 compiler.misc.kindname.class=\ 13.94 class 13.95 -compiler.misc.kindname.variable.class=\ 13.96 - variable, class 13.97 -compiler.misc.kindname.value.class=\ 13.98 - value, class 13.99 -compiler.misc.kindname.method.class=\ 13.100 - method, class 13.101 -compiler.misc.kindname.variable.method.class=\ 13.102 - variable, method, class 13.103 -compiler.misc.kindname.value.method.class=\ 13.104 - value, method, class 13.105 compiler.misc.kindname.package=\ 13.106 package 13.107 -compiler.misc.kindname.variable.package=\ 13.108 - variable, package 13.109 -compiler.misc.kindname.value.package=\ 13.110 - value, package 13.111 -compiler.misc.kindname.method.package=\ 13.112 - method, package 13.113 -compiler.misc.kindname.variable.method.package=\ 13.114 - variable, method, package 13.115 -compiler.misc.kindname.value.method.package=\ 13.116 - value, method, package 13.117 -compiler.misc.kindname.class.package=\ 13.118 - class, package 13.119 -compiler.misc.kindname.variable.class.package=\ 13.120 - variable, class, package 13.121 -compiler.misc.kindname.value.class.package=\ 13.122 - value, class, package 13.123 -compiler.misc.kindname.method.class.package=\ 13.124 - method, class, package 13.125 -compiler.misc.kindname.variable.method.class.package=\ 13.126 - variable, method, class, package 13.127 -compiler.misc.kindname.value.method.class.package=\ 13.128 - value, method, class, package 13.129 - 13.130 ##### 13.131 13.132 compiler.err.override.static=\
14.1 --- a/src/share/classes/com/sun/tools/javac/util/DiagnosticFormatter.java Thu Jul 24 11:12:41 2008 +0100 14.2 +++ b/src/share/classes/com/sun/tools/javac/util/DiagnosticFormatter.java Thu Jul 24 19:06:57 2008 +0100 14.3 @@ -25,6 +25,7 @@ 14.4 14.5 package com.sun.tools.javac.util; 14.6 14.7 +import java.util.Collection; 14.8 import javax.tools.JavaFileObject; 14.9 14.10 import com.sun.tools.javac.file.JavacFileManager; 14.11 @@ -145,6 +146,8 @@ 14.12 } 14.13 else if (arg instanceof JavaFileObject) 14.14 sb.append(JavacFileManager.getJavacBaseFileName((JavaFileObject) arg)); 14.15 + else if (arg instanceof Collection<?>) 14.16 + sb.append(convert((Collection<?>)arg)); 14.17 else 14.18 sb.append(arg); 14.19 sep = ", "; 14.20 @@ -152,6 +155,18 @@ 14.21 return sb.toString(); 14.22 } 14.23 14.24 + static <T> List<T> convert(Collection<T> c) { 14.25 + if (c instanceof List<?>) 14.26 + return (List<T>)c; 14.27 + else { 14.28 + List<T> l = List.<T>nil(); 14.29 + for (T t : c) { 14.30 + l = l.prepend(t); 14.31 + } 14.32 + return l.reverse(); 14.33 + } 14.34 + } 14.35 + 14.36 private String format_std(JCDiagnostic d) { 14.37 DiagnosticSource source = d.getDiagnosticSource(); 14.38 DiagnosticType type = d.getType();
15.1 --- a/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java Thu Jul 24 11:12:41 2008 +0100 15.2 +++ b/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java Thu Jul 24 19:06:57 2008 +0100 15.3 @@ -25,12 +25,15 @@ 15.4 15.5 package com.sun.tools.javac.util; 15.6 15.7 +import java.util.ResourceBundle; 15.8 +import java.util.Collection; 15.9 import java.util.Locale; 15.10 import java.util.Map; 15.11 15.12 import javax.tools.Diagnostic; 15.13 import javax.tools.JavaFileObject; 15.14 15.15 +import com.sun.tools.javac.api.Formattable; 15.16 import com.sun.tools.javac.file.JavacFileManager; 15.17 import com.sun.tools.javac.tree.JCTree; 15.18 15.19 @@ -431,6 +434,12 @@ 15.20 strings[i] = null; 15.21 else if (arg instanceof JCDiagnostic) 15.22 strings[i] = ((JCDiagnostic) arg).getMessage(null); 15.23 + else if (arg instanceof Collection<?>) 15.24 + strings[i] = DiagnosticFormatter.convert((Collection<?>)arg).toString(); 15.25 + else if (arg instanceof Formattable) { 15.26 + ResourceBundle rb = ResourceBundle.getBundle(messageBundleName); 15.27 + strings[i] = ((Formattable)arg).toString(rb); 15.28 + } 15.29 else 15.30 strings[i] = arg.toString(); 15.31 }
16.1 --- a/test/tools/javac/5045412/out Thu Jul 24 11:12:41 2008 +0100 16.2 +++ b/test/tools/javac/5045412/out Thu Jul 24 19:06:57 2008 +0100 16.3 @@ -1,2 +1,2 @@ 16.4 -Bar.java:13:29: compiler.err.cant.resolve.location: (- compiler.misc.kindname.class), Serializable, , , (- compiler.misc.kindname.package), java.io 16.5 +Bar.java:13:29: compiler.err.cant.resolve.location: kindname.class, Serializable, , , kindname.package, java.io 16.6 1 error
17.1 --- a/test/tools/javac/6330920/T6330920.out Thu Jul 24 11:12:41 2008 +0100 17.2 +++ b/test/tools/javac/6330920/T6330920.out Thu Jul 24 19:06:57 2008 +0100 17.3 @@ -1,2 +1,2 @@ 17.4 -T6330920.java:11:22: compiler.err.cant.resolve.location: (- compiler.misc.kindname.class), T6330920Missing, , , (- compiler.misc.kindname.class), T6330920 17.5 +T6330920.java:11:22: compiler.err.cant.resolve.location: kindname.class, T6330920Missing, , , kindname.class, T6330920 17.6 1 error
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 18.2 +++ b/test/tools/javac/6717241/T6717241a.java Thu Jul 24 19:06:57 2008 +0100 18.3 @@ -0,0 +1,42 @@ 18.4 +/* 18.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. 18.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.7 + * 18.8 + * This code is free software; you can redistribute it and/or modify it 18.9 + * under the terms of the GNU General Public License version 2 only, as 18.10 + * published by the Free Software Foundation. 18.11 + * 18.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 18.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 18.15 + * version 2 for more details (a copy is included in the LICENSE file that 18.16 + * accompanied this code). 18.17 + * 18.18 + * You should have received a copy of the GNU General Public License version 18.19 + * 2 along with this work; if not, write to the Free Software Foundation, 18.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18.21 + * 18.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 18.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 18.24 + * have any questions. 18.25 + */ 18.26 + 18.27 +/** 18.28 + * @test 18.29 + * @bug 6717241 18.30 + * @summary some diagnostic argument is prematurely converted into a String object 18.31 + * @author Maurizio Cimadamore 18.32 + * @compile/fail/ref=T6717241a.out -XDstdout -XDrawDiagnostics T6717241a.java 18.33 + */ 18.34 + 18.35 +class T6717241a<X extends Object & java.io.Serializable> { 18.36 + X x; 18.37 + void test() { 18.38 + //this will generate a 'cant.resolve' 18.39 + Object o = x.v; 18.40 + //this will generate a 'cant.resolve.args' 18.41 + x.m1(1, ""); 18.42 + //this will generate a 'cant.resolve.args.params' 18.43 + x.<Integer,Double>m2(1, ""); 18.44 + } 18.45 +}
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 19.2 +++ b/test/tools/javac/6717241/T6717241a.out Thu Jul 24 19:06:57 2008 +0100 19.3 @@ -0,0 +1,4 @@ 19.4 +T6717241a.java:36:21: compiler.err.cant.resolve: kindname.variable, v, , 19.5 +T6717241a.java:38:10: compiler.err.cant.resolve.args: kindname.method, m1, , int,java.lang.String 19.6 +T6717241a.java:40:10: compiler.err.cant.resolve.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String 19.7 +3 errors
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 20.2 +++ b/test/tools/javac/6717241/T6717241b.java Thu Jul 24 19:06:57 2008 +0100 20.3 @@ -0,0 +1,41 @@ 20.4 +/* 20.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. 20.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 20.7 + * 20.8 + * This code is free software; you can redistribute it and/or modify it 20.9 + * under the terms of the GNU General Public License version 2 only, as 20.10 + * published by the Free Software Foundation. 20.11 + * 20.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 20.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 20.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20.15 + * version 2 for more details (a copy is included in the LICENSE file that 20.16 + * accompanied this code). 20.17 + * 20.18 + * You should have received a copy of the GNU General Public License version 20.19 + * 2 along with this work; if not, write to the Free Software Foundation, 20.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20.21 + * 20.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 20.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 20.24 + * have any questions. 20.25 + */ 20.26 + 20.27 +/** 20.28 + * @test 20.29 + * @bug 6717241 20.30 + * @summary some diagnostic argument is prematurely converted into a String object 20.31 + * @author Maurizio Cimadamore 20.32 + * @compile/fail/ref=T6717241b.out -XDstdout -XDrawDiagnostics T6717241b.java 20.33 + */ 20.34 + 20.35 +class T6717241b { 20.36 + void test() { 20.37 + //this will generate a 'cant.resolve.location' 20.38 + Object o = v; 20.39 + //this will generate a 'cant.resolve.location.args' 20.40 + m1(1, ""); 20.41 + //this will generate a 'cant.resolve.location.args.params' 20.42 + T6717241b.<Integer,Double>m2(1, ""); 20.43 + } 20.44 +}
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 21.2 +++ b/test/tools/javac/6717241/T6717241b.out Thu Jul 24 19:06:57 2008 +0100 21.3 @@ -0,0 +1,4 @@ 21.4 +T6717241b.java:35:20: compiler.err.cant.resolve.location: kindname.variable, v, , , kindname.class, T6717241b 21.5 +T6717241b.java:37:9: compiler.err.cant.resolve.location.args: kindname.method, m1, , int,java.lang.String, kindname.class, T6717241b 21.6 +T6717241b.java:39:18: compiler.err.cant.resolve.location.args.params: kindname.method, m2, java.lang.Integer,java.lang.Double, int,java.lang.String, kindname.class, T6717241b 21.7 +3 errors
22.1 --- a/test/tools/javac/ExtendsAccess/ExtendsAccess.out Thu Jul 24 11:12:41 2008 +0100 22.2 +++ b/test/tools/javac/ExtendsAccess/ExtendsAccess.out Thu Jul 24 19:06:57 2008 +0100 22.3 @@ -1,7 +1,7 @@ 22.4 -ExtendsAccess.java:31:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), publicClass, , 22.5 -ExtendsAccess.java:32:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), defaultClass, , 22.6 -ExtendsAccess.java:33:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), protectedClass, , 22.7 -ExtendsAccess.java:34:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), privateClass, , 22.8 +ExtendsAccess.java:31:32: compiler.err.cant.resolve: kindname.class, publicClass, , 22.9 +ExtendsAccess.java:32:32: compiler.err.cant.resolve: kindname.class, defaultClass, , 22.10 +ExtendsAccess.java:33:32: compiler.err.cant.resolve: kindname.class, protectedClass, , 22.11 +ExtendsAccess.java:34:32: compiler.err.cant.resolve: kindname.class, privateClass, , 22.12 ExtendsAccess.java:39:46: compiler.err.report.access: ExtendsAccess.privateClass, private, ExtendsAccess 22.13 ExtendsAccess.java:42:48: compiler.err.not.def.public.cant.access: p.ExtendsAccess.defaultClass, p.ExtendsAccess 22.14 ExtendsAccess.java:43:48: compiler.err.report.access: p.ExtendsAccess.protectedClass, protected, p.ExtendsAccess 22.15 @@ -12,10 +12,10 @@ 22.16 ExtendsAccess.java:85:34: compiler.err.report.access: ExtendsAccess.privateClass, private, ExtendsAccess 22.17 ExtendsAccess.java:92:36: compiler.err.not.def.public.cant.access: p.ExtendsAccess.defaultClass, p.ExtendsAccess 22.18 ExtendsAccess.java:101:36: compiler.err.report.access: p.ExtendsAccess.privateClass, private, p.ExtendsAccess 22.19 -ExtendsAccess.java:104:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), publicStaticClass, , 22.20 -ExtendsAccess.java:105:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), defaultStaticClass, , 22.21 -ExtendsAccess.java:106:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), protectedStaticClass, , 22.22 -ExtendsAccess.java:107:32: compiler.err.cant.resolve: (- compiler.misc.kindname.class), privateStaticClass, , 22.23 +ExtendsAccess.java:104:32: compiler.err.cant.resolve: kindname.class, publicStaticClass, , 22.24 +ExtendsAccess.java:105:32: compiler.err.cant.resolve: kindname.class, defaultStaticClass, , 22.25 +ExtendsAccess.java:106:32: compiler.err.cant.resolve: kindname.class, protectedStaticClass, , 22.26 +ExtendsAccess.java:107:32: compiler.err.cant.resolve: kindname.class, privateStaticClass, , 22.27 ExtendsAccess.java:112:46: compiler.err.report.access: ExtendsAccess.privateStaticClass, private, ExtendsAccess 22.28 ExtendsAccess.java:115:48: compiler.err.not.def.public.cant.access: p.ExtendsAccess.defaultStaticClass, p.ExtendsAccess 22.29 ExtendsAccess.java:116:48: compiler.err.report.access: p.ExtendsAccess.protectedStaticClass, protected, p.ExtendsAccess 22.30 @@ -26,10 +26,10 @@ 22.31 ExtendsAccess.java:158:34: compiler.err.report.access: ExtendsAccess.privateStaticClass, private, ExtendsAccess 22.32 ExtendsAccess.java:165:36: compiler.err.not.def.public.cant.access: p.ExtendsAccess.defaultStaticClass, p.ExtendsAccess 22.33 ExtendsAccess.java:174:36: compiler.err.report.access: p.ExtendsAccess.privateStaticClass, private, p.ExtendsAccess 22.34 -ExtendsAccess.java:177:57: compiler.err.cant.resolve: (- compiler.misc.kindname.class), publicInterface, , 22.35 -ExtendsAccess.java:178:57: compiler.err.cant.resolve: (- compiler.misc.kindname.class), defaultInterface, , 22.36 -ExtendsAccess.java:179:57: compiler.err.cant.resolve: (- compiler.misc.kindname.class), protectedInterface, , 22.37 -ExtendsAccess.java:180:57: compiler.err.cant.resolve: (- compiler.misc.kindname.class), privateInterface, , 22.38 +ExtendsAccess.java:177:57: compiler.err.cant.resolve: kindname.class, publicInterface, , 22.39 +ExtendsAccess.java:178:57: compiler.err.cant.resolve: kindname.class, defaultInterface, , 22.40 +ExtendsAccess.java:179:57: compiler.err.cant.resolve: kindname.class, protectedInterface, , 22.41 +ExtendsAccess.java:180:57: compiler.err.cant.resolve: kindname.class, privateInterface, , 22.42 ExtendsAccess.java:186:33: compiler.err.report.access: ExtendsAccess.privateInterface, private, ExtendsAccess 22.43 ExtendsAccess.java:191:35: compiler.err.not.def.public.cant.access: p.ExtendsAccess.defaultInterface, p.ExtendsAccess 22.44 ExtendsAccess.java:193:35: compiler.err.report.access: p.ExtendsAccess.protectedInterface, protected, p.ExtendsAccess
23.1 --- a/test/tools/javac/NonStaticFieldExpr1.out Thu Jul 24 11:12:41 2008 +0100 23.2 +++ b/test/tools/javac/NonStaticFieldExpr1.out Thu Jul 24 19:06:57 2008 +0100 23.3 @@ -1,2 +1,2 @@ 23.4 -NonStaticFieldExpr1.java:10:30: compiler.err.non-static.cant.be.ref: (- compiler.misc.kindname.variable), x 23.5 +NonStaticFieldExpr1.java:10:30: compiler.err.non-static.cant.be.ref: kindname.variable, x 23.6 1 error
24.1 --- a/test/tools/javac/NonStaticFieldExpr2.out Thu Jul 24 11:12:41 2008 +0100 24.2 +++ b/test/tools/javac/NonStaticFieldExpr2.out Thu Jul 24 19:06:57 2008 +0100 24.3 @@ -1,2 +1,2 @@ 24.4 -NonStaticFieldExpr2.java:14:33: compiler.err.non-static.cant.be.ref: (- compiler.misc.kindname.variable), x 24.5 +NonStaticFieldExpr2.java:14:33: compiler.err.non-static.cant.be.ref: kindname.variable, x 24.6 1 error
25.1 --- a/test/tools/javac/NonStaticFieldExpr3.out Thu Jul 24 11:12:41 2008 +0100 25.2 +++ b/test/tools/javac/NonStaticFieldExpr3.out Thu Jul 24 19:06:57 2008 +0100 25.3 @@ -1,2 +1,2 @@ 25.4 -NonStaticFieldExpr3.java:14:30: compiler.err.non-static.cant.be.ref: (- compiler.misc.kindname.variable), x 25.5 +NonStaticFieldExpr3.java:14:30: compiler.err.non-static.cant.be.ref: kindname.variable, x 25.6 1 error
26.1 --- a/test/tools/javac/T6247324.out Thu Jul 24 11:12:41 2008 +0100 26.2 +++ b/test/tools/javac/T6247324.out Thu Jul 24 19:06:57 2008 +0100 26.3 @@ -1,2 +1,2 @@ 26.4 -T6247324.java:18:6: compiler.err.cant.resolve.location: (- compiler.misc.kindname.class), Seetharam, , , (- compiler.misc.kindname.class), Pair<X,Y> 26.5 +T6247324.java:18:6: compiler.err.cant.resolve.location: kindname.class, Seetharam, , , kindname.class, Pair<X,Y> 26.6 1 error
27.1 --- a/test/tools/javac/annotations/6365854/test1.out Thu Jul 24 11:12:41 2008 +0100 27.2 +++ b/test/tools/javac/annotations/6365854/test1.out Thu Jul 24 19:06:57 2008 +0100 27.3 @@ -1,2 +1,2 @@ 27.4 -- compiler.warn.annotation.method.not.found.reason: test.annotation.TestAnnotation, test, class file for test.annotation.TestAnnotation not found 27.5 +- compiler.warn.annotation.method.not.found.reason: test.annotation.TestAnnotation, test, (- compiler.misc.class.file.not.found: test.annotation.TestAnnotation) 27.6 1 warning
28.1 --- a/test/tools/javac/generics/inference/6611449/T6611449.out Thu Jul 24 11:12:41 2008 +0100 28.2 +++ b/test/tools/javac/generics/inference/6611449/T6611449.out Thu Jul 24 19:06:57 2008 +0100 28.3 @@ -1,5 +1,5 @@ 28.4 -T6611449.java:41:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.constructor), T6611449, (int), , (- compiler.misc.kindname.class), T6611449<S> 28.5 -T6611449.java:42:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.constructor), T6611449, (int,int), , (- compiler.misc.kindname.class), T6611449<S> 28.6 -T6611449.java:43:9: compiler.err.cant.apply.symbol: <T>m1(T), T6611449<S>, , int, null 28.7 -T6611449.java:44:9: compiler.err.cant.apply.symbol: <T>m2(T,T), T6611449<S>, , int,int, null 28.8 +T6611449.java:41:9: compiler.err.cant.resolve.location.args: kindname.constructor, T6611449, , int, kindname.class, T6611449<S> 28.9 +T6611449.java:42:9: compiler.err.cant.resolve.location.args: kindname.constructor, T6611449, , int,int, kindname.class, T6611449<S> 28.10 +T6611449.java:43:9: compiler.err.cant.apply.symbol: kindname.method, m1, T, int, kindname.class, T6611449<S>, null 28.11 +T6611449.java:44:9: compiler.err.cant.apply.symbol: kindname.method, m2, T,T, int,int, kindname.class, T6611449<S>, null 28.12 4 errors
29.1 --- a/test/tools/javac/policy/byfile.ABD.out Thu Jul 24 11:12:41 2008 +0100 29.2 +++ b/test/tools/javac/policy/byfile.ABD.out Thu Jul 24 19:06:57 2008 +0100 29.3 @@ -3,7 +3,7 @@ 29.4 [attribute A2] 29.5 [attribute B] 29.6 [attribute B1] 29.7 -B.java:12:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.variable), x, , , (- compiler.misc.kindname.class), B1 29.8 +B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, B1 29.9 [attribute B2] 29.10 [attribute D] 29.11 [attribute D1]
30.1 --- a/test/tools/javac/policy/bytodo.ABD.out Thu Jul 24 11:12:41 2008 +0100 30.2 +++ b/test/tools/javac/policy/bytodo.ABD.out Thu Jul 24 19:06:57 2008 +0100 30.3 @@ -15,7 +15,7 @@ 30.4 [desugar B] 30.5 [generate code B] 30.6 [attribute B1] 30.7 -B.java:12:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.variable), x, , , (- compiler.misc.kindname.class), B1 30.8 +B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, B1 30.9 [attribute B2] 30.10 [attribute D] 30.11 [attribute D1]
31.1 --- a/test/tools/javac/policy/simple.ABD.out Thu Jul 24 11:12:41 2008 +0100 31.2 +++ b/test/tools/javac/policy/simple.ABD.out Thu Jul 24 19:06:57 2008 +0100 31.3 @@ -3,7 +3,7 @@ 31.4 [attribute A2] 31.5 [attribute B] 31.6 [attribute B1] 31.7 -B.java:12:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.variable), x, , , (- compiler.misc.kindname.class), B1 31.8 +B.java:12:9: compiler.err.cant.resolve.location: kindname.variable, x, , , kindname.class, B1 31.9 [attribute B2] 31.10 [attribute D] 31.11 [attribute D1]