Fri, 23 Aug 2013 14:17:49 -0700
Merge
test/tools/javac/defaultMethods/defaultMethodExecution/DefaultMethodRegressionTests.java | file | annotate | diff | comparison | revisions | |
test/tools/javac/diags/examples/IncompatibleThrownTypesInLambda.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/classes/com/sun/source/tree/NewArrayTree.java Thu Aug 22 09:10:22 2013 -0700 1.2 +++ b/src/share/classes/com/sun/source/tree/NewArrayTree.java Fri Aug 23 14:17:49 2013 -0700 1.3 @@ -25,7 +25,7 @@ 1.4 1.5 package com.sun.source.tree; 1.6 1.7 -import java.util.List; 1.8 +import com.sun.tools.javac.util.List; 1.9 1.10 /** 1.11 * A tree node for an expression to create a new instance of an array. 1.12 @@ -48,4 +48,6 @@ 1.13 Tree getType(); 1.14 List<? extends ExpressionTree> getDimensions(); 1.15 List<? extends ExpressionTree> getInitializers(); 1.16 + List<? extends AnnotationTree> getAnnotations(); 1.17 + List<? extends List<? extends AnnotationTree>> getDimAnnotations(); 1.18 }
2.1 --- a/src/share/classes/com/sun/source/util/TreeScanner.java Thu Aug 22 09:10:22 2013 -0700 2.2 +++ b/src/share/classes/com/sun/source/util/TreeScanner.java Fri Aug 23 14:17:49 2013 -0700 2.3 @@ -285,6 +285,10 @@ 2.4 R r = scan(node.getType(), p); 2.5 r = scanAndReduce(node.getDimensions(), p, r); 2.6 r = scanAndReduce(node.getInitializers(), p, r); 2.7 + r = scanAndReduce(node.getAnnotations(), p, r); 2.8 + for (Iterable< ? extends Tree> dimAnno : node.getDimAnnotations()) { 2.9 + r = scanAndReduce(dimAnno, p, r); 2.10 + } 2.11 return r; 2.12 } 2.13
3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java Thu Aug 22 09:10:22 2013 -0700 3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java Fri Aug 23 14:17:49 2013 -0700 3.3 @@ -159,10 +159,7 @@ 3.4 body.addContent(div); 3.5 if (configuration.showProfiles) { 3.6 Content profileSummary = configuration.getResource("doclet.Profiles"); 3.7 - Content profilesTableSummary = configuration.getResource("doclet.Member_Table_Summary", 3.8 - configuration.getResource("doclet.Profile_Summary"), 3.9 - configuration.getResource("doclet.profiles")); 3.10 - addProfilesList(profileSummary, profilesTableSummary, body); 3.11 + addProfilesList(profileSummary, body); 3.12 } 3.13 addPackagesList(packages, text, tableSummary, body); 3.14 } 3.15 @@ -214,10 +211,8 @@ 3.16 * Do nothing. This will be overridden. 3.17 * 3.18 * @param profileSummary the profile summary heading 3.19 - * @param profilesTableSummary the profiles table summary information 3.20 * @param body the content tree to which the profiles list will be added 3.21 */ 3.22 - protected void addProfilesList(Content profileSummary, Content profilesTableSummary, 3.23 - Content body) { 3.24 + protected void addProfilesList(Content profileSummary, Content body) { 3.25 } 3.26 }
4.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Thu Aug 22 09:10:22 2013 -0700 4.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Fri Aug 23 14:17:49 2013 -0700 4.3 @@ -25,8 +25,16 @@ 4.4 4.5 package com.sun.tools.doclets.formats.html; 4.6 4.7 -import java.io.*; 4.8 -import java.util.*; 4.9 +import java.io.IOException; 4.10 +import java.util.ArrayList; 4.11 +import java.util.Collections; 4.12 +import java.util.HashMap; 4.13 +import java.util.Iterator; 4.14 +import java.util.List; 4.15 +import java.util.Map; 4.16 +import java.util.Set; 4.17 +import java.util.SortedSet; 4.18 +import java.util.TreeSet; 4.19 4.20 import com.sun.javadoc.*; 4.21 import com.sun.tools.doclets.formats.html.markup.*; 4.22 @@ -95,7 +103,7 @@ 4.23 super(configuration, filename); 4.24 this.classdoc = classdoc; 4.25 if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName())) 4.26 - pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName())); 4.27 + pkgToPackageAnnotations = new TreeSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName())); 4.28 configuration.currentcd = classdoc; 4.29 this.pkgSet = new TreeSet<PackageDoc>(); 4.30 this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
5.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Thu Aug 22 09:10:22 2013 -0700 5.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Fri Aug 23 14:17:49 2013 -0700 5.3 @@ -109,7 +109,7 @@ 5.4 } 5.5 } 5.6 // Can't link so just write label. 5.7 - link.addContent(label.toString()); 5.8 + link.addContent(label); 5.9 if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { 5.10 link.addContent(getTypeParameterLinks(linkInfo)); 5.11 }
6.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Thu Aug 22 09:10:22 2013 -0700 6.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Fri Aug 23 14:17:49 2013 -0700 6.3 @@ -123,15 +123,20 @@ 6.4 /** 6.5 * {@inheritDoc} 6.6 */ 6.7 - protected void addProfilesList(Content profileSummary, String profilesTableSummary, 6.8 - Content body) { 6.9 - Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, profilesTableSummary, 6.10 - getTableCaption(profileSummary)); 6.11 - table.addContent(getSummaryTableHeader(profileTableHeader, "col")); 6.12 - Content tbody = new HtmlTree(HtmlTag.TBODY); 6.13 - addProfilesList(tbody); 6.14 - table.addContent(tbody); 6.15 - Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); 6.16 + protected void addProfilesList(Content profileSummary, Content body) { 6.17 + Content h2 = HtmlTree.HEADING(HtmlTag.H2, profileSummary); 6.18 + Content profilesDiv = HtmlTree.DIV(h2); 6.19 + Content ul = new HtmlTree(HtmlTag.UL); 6.20 + String profileName; 6.21 + for (int i = 1; i < configuration.profiles.getProfileCount(); i++) { 6.22 + profileName = Profile.lookup(i).name; 6.23 + Content profileLinkContent = getTargetProfileLink("classFrame", 6.24 + new StringContent(profileName), profileName); 6.25 + Content li = HtmlTree.LI(profileLinkContent); 6.26 + ul.addContent(li); 6.27 + } 6.28 + profilesDiv.addContent(ul); 6.29 + Content div = HtmlTree.DIV(HtmlStyle.contentContainer, profilesDiv); 6.30 body.addContent(div); 6.31 } 6.32 6.33 @@ -151,31 +156,6 @@ 6.34 } 6.35 6.36 /** 6.37 - * Adds list of profiles in the index table. Generate link to each profile. 6.38 - * 6.39 - * @param tbody the documentation tree to which the list will be added 6.40 - */ 6.41 - protected void addProfilesList(Content tbody) { 6.42 - for (int i = 1; i < configuration.profiles.getProfileCount(); i++) { 6.43 - String profileName = Profile.lookup(i).name; 6.44 - Content profileLinkContent = getTargetProfileLink("classFrame", 6.45 - new StringContent(profileName), profileName); 6.46 - Content tdProfile = HtmlTree.TD(HtmlStyle.colFirst, profileLinkContent); 6.47 - HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); 6.48 - tdSummary.addStyle(HtmlStyle.colLast); 6.49 - tdSummary.addContent(getSpace()); 6.50 - HtmlTree tr = HtmlTree.TR(tdProfile); 6.51 - tr.addContent(tdSummary); 6.52 - if (i % 2 == 0) { 6.53 - tr.addStyle(HtmlStyle.altColor); 6.54 - } else { 6.55 - tr.addStyle(HtmlStyle.rowColor); 6.56 - } 6.57 - tbody.addContent(tr); 6.58 - } 6.59 - } 6.60 - 6.61 - /** 6.62 * Adds list of packages in the index table. Generate link to each package. 6.63 * 6.64 * @param packages Packages to which link is to be generated
7.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java Thu Aug 22 09:10:22 2013 -0700 7.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java Fri Aug 23 14:17:49 2013 -0700 7.3 @@ -25,6 +25,8 @@ 7.4 7.5 package com.sun.tools.doclets.formats.html.markup; 7.6 7.7 +import java.util.Locale; 7.8 + 7.9 /** 7.10 * Enum representing HTML tags. 7.11 * 7.12 @@ -115,7 +117,7 @@ 7.13 HtmlTag(BlockType blockType, EndTag endTag ) { 7.14 this.blockType = blockType; 7.15 this.endTag = endTag; 7.16 - this.value = name().toLowerCase(); 7.17 + this.value = name().toLowerCase(Locale.US); 7.18 } 7.19 7.20 /**
8.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java Thu Aug 22 09:10:22 2013 -0700 8.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java Fri Aug 23 14:17:49 2013 -0700 8.3 @@ -70,6 +70,7 @@ 8.4 * DocletAbortException because it 8.5 * is not supported. 8.6 */ 8.7 + @Override 8.8 public void addContent(Content content) { 8.9 throw new DocletAbortException(); 8.10 } 8.11 @@ -80,6 +81,7 @@ 8.12 * 8.13 * @param strContent string content to be added 8.14 */ 8.15 + @Override 8.16 public void addContent(String strContent) { 8.17 appendChars(strContent); 8.18 } 8.19 @@ -87,10 +89,12 @@ 8.20 /** 8.21 * {@inheritDoc} 8.22 */ 8.23 + @Override 8.24 public boolean isEmpty() { 8.25 return (stringContent.length() == 0); 8.26 } 8.27 8.28 + @Override 8.29 public int charCount() { 8.30 return RawHtml.charCount(stringContent.toString()); 8.31 } 8.32 @@ -98,6 +102,7 @@ 8.33 /** 8.34 * {@inheritDoc} 8.35 */ 8.36 + @Override 8.37 public String toString() { 8.38 return stringContent.toString(); 8.39 }
9.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Thu Aug 22 09:10:22 2013 -0700 9.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Fri Aug 23 14:17:49 2013 -0700 9.3 @@ -176,25 +176,32 @@ 9.4 doclet.0_and_1={0} and {1} 9.5 9.6 #Documentation for Enums 9.7 -doclet.enum_values_doc=\n\ 9.8 +doclet.enum_values_doc.main=\n\ 9.9 Returns an array containing the constants of this enum type, in\n\ 9.10 the order they are declared. This method may be used to iterate\n\ 9.11 over the constants as follows:\n\ 9.12 <pre>\n\ 9.13 for ({0} c : {0}.values())\n\ 9.14 System.out.println(c);\n\ 9.15 - </pre>\n\ 9.16 - @return an array containing the constants of this enum type, in\n\ 9.17 - the order they are declared 9.18 + </pre> 9.19 9.20 -doclet.enum_valueof_doc=\n\ 9.21 +doclet.enum_values_doc.return=\n\ 9.22 + an array containing the constants of this enum type, in the order they are declared 9.23 + 9.24 +doclet.enum_valueof_doc.main=\n\ 9.25 Returns the enum constant of this type with the specified name.\n\ 9.26 The string must match <i>exactly</i> an identifier used to declare an\n\ 9.27 enum constant in this type. (Extraneous whitespace characters are \n\ 9.28 - not permitted.)\n\ 9.29 - \n\ 9.30 - @param name the name of the enum constant to be returned.\n\ 9.31 - @return the enum constant with the specified name\n\ 9.32 - @throws IllegalArgumentException if this enum type has no constant\n\ 9.33 - with the specified name\n\ 9.34 - @throws NullPointerException if the argument is null 9.35 + not permitted.) 9.36 + 9.37 +doclet.enum_valueof_doc.param_name=\ 9.38 + the name of the enum constant to be returned. 9.39 + 9.40 +doclet.enum_valueof_doc.return=\ 9.41 + the enum constant with the specified name 9.42 + 9.43 +doclet.enum_valueof_doc.throws_ila=\ 9.44 + if this enum type has no constant with the specified name 9.45 + 9.46 +doclet.enum_valueof_doc.throws_npe=\ 9.47 + if the argument is null
10.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java Thu Aug 22 09:10:22 2013 -0700 10.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java Fri Aug 23 14:17:49 2013 -0700 10.3 @@ -667,16 +667,28 @@ 10.4 for (int j = 0; j < methods.length; j++) { 10.5 MethodDoc currentMethod = methods[j]; 10.6 if (currentMethod.name().equals("values") && 10.7 - currentMethod.parameters().length == 0) { 10.8 - currentMethod.setRawCommentText( 10.9 - configuration.getText("doclet.enum_values_doc", classDoc.name())); 10.10 + currentMethod.parameters().length == 0) { 10.11 + StringBuilder sb = new StringBuilder(); 10.12 + sb.append(configuration.getText("doclet.enum_values_doc.main", classDoc.name())); 10.13 + sb.append("\n@return "); 10.14 + sb.append(configuration.getText("doclet.enum_values_doc.return")); 10.15 + currentMethod.setRawCommentText(sb.toString()); 10.16 } else if (currentMethod.name().equals("valueOf") && 10.17 - currentMethod.parameters().length == 1) { 10.18 + currentMethod.parameters().length == 1) { 10.19 Type paramType = currentMethod.parameters()[0].type(); 10.20 if (paramType != null && 10.21 - paramType.qualifiedTypeName().equals(String.class.getName())) { 10.22 - currentMethod.setRawCommentText( 10.23 - configuration.getText("doclet.enum_valueof_doc")); 10.24 + paramType.qualifiedTypeName().equals(String.class.getName())) { 10.25 + StringBuilder sb = new StringBuilder(); 10.26 + sb.append(configuration.getText("doclet.enum_valueof_doc.main", classDoc.name())); 10.27 + sb.append("\n@param name "); 10.28 + sb.append(configuration.getText("doclet.enum_valueof_doc.param_name")); 10.29 + sb.append("\n@return "); 10.30 + sb.append(configuration.getText("doclet.enum_valueof_doc.return")); 10.31 + sb.append("\n@throws IllegalArgumentException "); 10.32 + sb.append(configuration.getText("doclet.enum_valueof_doc.throws_ila")); 10.33 + sb.append("\n@throws NullPointerException "); 10.34 + sb.append(configuration.getText("doclet.enum_valueof_doc.throws_npe")); 10.35 + currentMethod.setRawCommentText(sb.toString()); 10.36 } 10.37 } 10.38 }
11.1 --- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java Thu Aug 22 09:10:22 2013 -0700 11.2 +++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java Fri Aug 23 14:17:49 2013 -0700 11.3 @@ -30,6 +30,7 @@ 11.4 import java.util.EnumMap; 11.5 import java.util.EnumSet; 11.6 import java.util.HashMap; 11.7 +import java.util.Locale; 11.8 import java.util.Map; 11.9 11.10 import javax.lang.model.element.Name; 11.11 @@ -345,7 +346,7 @@ 11.12 WIDTH; 11.13 11.14 public String getText() { 11.15 - return name().toLowerCase(); 11.16 + return toLowerCase(name()); 11.17 } 11.18 11.19 static final Map<String,Attr> index = new HashMap<String,Attr>(); 11.20 @@ -424,11 +425,11 @@ 11.21 } 11.22 11.23 public String getText() { 11.24 - return name().toLowerCase(); 11.25 + return toLowerCase(name()); 11.26 } 11.27 11.28 public Attr getAttr(Name attrName) { 11.29 - return Attr.index.get(attrName.toString().toLowerCase()); 11.30 + return Attr.index.get(toLowerCase(attrName.toString())); 11.31 } 11.32 11.33 public AttrKind getAttrKind(Name attrName) { 11.34 @@ -450,6 +451,10 @@ 11.35 } 11.36 11.37 static HtmlTag get(Name tagName) { 11.38 - return index.get(tagName.toString().toLowerCase()); 11.39 + return index.get(toLowerCase(tagName.toString())); 11.40 + } 11.41 + 11.42 + private static String toLowerCase(String s) { 11.43 + return s.toLowerCase(Locale.US); 11.44 } 11.45 }
12.1 --- a/src/share/classes/com/sun/tools/javac/code/Attribute.java Thu Aug 22 09:10:22 2013 -0700 12.2 +++ b/src/share/classes/com/sun/tools/javac/code/Attribute.java Fri Aug 23 14:17:49 2013 -0700 12.3 @@ -340,6 +340,14 @@ 12.4 } 12.5 } 12.6 12.7 + public static class UnresolvedClass extends Error { 12.8 + public Type classType; 12.9 + public UnresolvedClass(Type type, Type classType) { 12.10 + super(type); 12.11 + this.classType = classType; 12.12 + } 12.13 + } 12.14 + 12.15 /** A visitor type for dynamic dispatch on the kind of attribute value. */ 12.16 public static interface Visitor { 12.17 void visitConstant(Attribute.Constant value);
13.1 --- a/src/share/classes/com/sun/tools/javac/code/Scope.java Thu Aug 22 09:10:22 2013 -0700 13.2 +++ b/src/share/classes/com/sun/tools/javac/code/Scope.java Fri Aug 23 14:17:49 2013 -0700 13.3 @@ -199,7 +199,7 @@ 13.4 } 13.5 13.6 public void enter(Symbol sym, Scope s) { 13.7 - enter(sym, s, s); 13.8 + enter(sym, s, s, false); 13.9 } 13.10 13.11 /** 13.12 @@ -207,7 +207,7 @@ 13.13 * given scope `s' accessed through `origin'. The last two 13.14 * arguments are only used in import scopes. 13.15 */ 13.16 - public void enter(Symbol sym, Scope s, Scope origin) { 13.17 + public void enter(Symbol sym, Scope s, Scope origin, boolean staticallyImported) { 13.18 Assert.check(shared == 0); 13.19 if (nelems * 3 >= hashMask * 2) 13.20 dble(); 13.21 @@ -217,7 +217,7 @@ 13.22 old = sentinel; 13.23 nelems++; 13.24 } 13.25 - Entry e = makeEntry(sym, old, elems, s, origin); 13.26 + Entry e = makeEntry(sym, old, elems, s, origin, staticallyImported); 13.27 table[hash] = e; 13.28 elems = e; 13.29 13.30 @@ -227,7 +227,7 @@ 13.31 } 13.32 } 13.33 13.34 - Entry makeEntry(Symbol sym, Entry shadowed, Entry sibling, Scope scope, Scope origin) { 13.35 + Entry makeEntry(Symbol sym, Entry shadowed, Entry sibling, Scope scope, Scope origin, boolean staticallyImported) { 13.36 return new Entry(sym, shadowed, sibling, scope); 13.37 } 13.38 13.39 @@ -499,6 +499,10 @@ 13.40 else return shadowed.next(sf); 13.41 } 13.42 13.43 + public boolean isStaticallyImported() { 13.44 + return false; 13.45 + } 13.46 + 13.47 public Scope getOrigin() { 13.48 // The origin is only recorded for import scopes. For all 13.49 // other scope entries, the "enclosing" type is available 13.50 @@ -517,20 +521,19 @@ 13.51 } 13.52 13.53 @Override 13.54 - Entry makeEntry(Symbol sym, Entry shadowed, Entry sibling, Scope scope, Scope origin) { 13.55 - return new ImportEntry(sym, shadowed, sibling, scope, origin); 13.56 - } 13.57 + Entry makeEntry(Symbol sym, Entry shadowed, Entry sibling, Scope scope, 13.58 + final Scope origin, final boolean staticallyImported) { 13.59 + return new Entry(sym, shadowed, sibling, scope) { 13.60 + @Override 13.61 + public Scope getOrigin() { 13.62 + return origin; 13.63 + } 13.64 13.65 - static class ImportEntry extends Entry { 13.66 - private Scope origin; 13.67 - 13.68 - ImportEntry(Symbol sym, Entry shadowed, Entry sibling, Scope scope, Scope origin) { 13.69 - super(sym, shadowed, sibling, scope); 13.70 - this.origin = origin; 13.71 - } 13.72 - 13.73 - @Override 13.74 - public Scope getOrigin() { return origin; } 13.75 + @Override 13.76 + public boolean isStaticallyImported() { 13.77 + return staticallyImported; 13.78 + } 13.79 + }; 13.80 } 13.81 } 13.82 13.83 @@ -724,7 +727,7 @@ 13.84 } 13.85 13.86 @Override 13.87 - public void enter(Symbol sym, Scope s, Scope origin) { 13.88 + public void enter(Symbol sym, Scope s, Scope origin, boolean staticallyImported) { 13.89 throw new UnsupportedOperationException(); 13.90 } 13.91
14.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java Thu Aug 22 09:10:22 2013 -0700 14.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java Fri Aug 23 14:17:49 2013 -0700 14.3 @@ -463,26 +463,34 @@ 14.4 return false; 14.5 } 14.6 14.7 - /** Check for hiding. Note that this doesn't handle multiple 14.8 - * (interface) inheritance. */ 14.9 private boolean hiddenIn(ClassSymbol clazz, Types types) { 14.10 - if (kind == MTH && (flags() & STATIC) == 0) return false; 14.11 - while (true) { 14.12 - if (owner == clazz) return false; 14.13 - Scope.Entry e = clazz.members().lookup(name); 14.14 - while (e.scope != null) { 14.15 - if (e.sym == this) return false; 14.16 - if (e.sym.kind == kind && 14.17 + Symbol sym = hiddenInInternal(clazz, types); 14.18 + return sym != null && sym != this; 14.19 + } 14.20 + 14.21 + private Symbol hiddenInInternal(ClassSymbol c, Types types) { 14.22 + Scope.Entry e = c.members().lookup(name); 14.23 + while (e.scope != null) { 14.24 + if (e.sym.kind == kind && 14.25 (kind != MTH || 14.26 - (e.sym.flags() & STATIC) != 0 && 14.27 - types.isSubSignature(e.sym.type, type))) 14.28 - return true; 14.29 - e = e.next(); 14.30 + (e.sym.flags() & STATIC) != 0 && 14.31 + types.isSubSignature(e.sym.type, type))) { 14.32 + return e.sym; 14.33 } 14.34 - Type superType = types.supertype(clazz.type); 14.35 - if (!superType.hasTag(CLASS)) return false; 14.36 - clazz = (ClassSymbol)superType.tsym; 14.37 + e = e.next(); 14.38 } 14.39 + List<Symbol> hiddenSyms = List.nil(); 14.40 + for (Type st : types.interfaces(c.type).prepend(types.supertype(c.type))) { 14.41 + if (st != null && (st.hasTag(CLASS))) { 14.42 + Symbol sym = hiddenInInternal((ClassSymbol)st.tsym, types); 14.43 + if (sym != null) { 14.44 + hiddenSyms = hiddenSyms.prepend(hiddenInInternal((ClassSymbol)st.tsym, types)); 14.45 + } 14.46 + } 14.47 + } 14.48 + return hiddenSyms.contains(this) ? 14.49 + this : 14.50 + (hiddenSyms.isEmpty() ? null : hiddenSyms.head); 14.51 } 14.52 14.53 /** Is this symbol inherited into a given class?
15.1 --- a/src/share/classes/com/sun/tools/javac/code/Type.java Thu Aug 22 09:10:22 2013 -0700 15.2 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java Fri Aug 23 14:17:49 2013 -0700 15.3 @@ -1161,7 +1161,7 @@ 15.4 } 15.5 15.6 public boolean contains(Type elem) { 15.7 - return elem == this || contains(argtypes, elem) || restype.contains(elem); 15.8 + return elem == this || contains(argtypes, elem) || restype.contains(elem) || contains(thrown, elem); 15.9 } 15.10 15.11 public MethodType asMethodType() { return this; } 15.12 @@ -1525,7 +1525,7 @@ 15.13 } 15.14 15.15 protected void addBound(InferenceBound ib, Type bound, Types types, boolean update) { 15.16 - Type bound2 = toTypeVarMap.apply(bound); 15.17 + Type bound2 = toTypeVarMap.apply(bound).baseType(); 15.18 List<Type> prevBounds = bounds.get(ib); 15.19 for (Type b : prevBounds) { 15.20 //check for redundancy - use strict version of isSameType on tvars
16.1 --- a/src/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Aug 22 09:10:22 2013 -0700 16.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Annotate.java Fri Aug 23 14:17:49 2013 -0700 16.3 @@ -332,8 +332,20 @@ 16.4 } 16.5 if (expected.tsym == syms.classType.tsym) { 16.6 Type result = attr.attribExpr(tree, env, expected); 16.7 - if (result.isErroneous()) 16.8 - return new Attribute.Error(expected); 16.9 + if (result.isErroneous()) { 16.10 + // Does it look like a class literal? 16.11 + if (TreeInfo.name(tree) == names._class) { 16.12 + Name n = (((JCFieldAccess) tree).selected).type.tsym.flatName(); 16.13 + return new Attribute.UnresolvedClass(expected, 16.14 + types.createErrorType(n, 16.15 + syms.unknownSymbol, syms.classType)); 16.16 + } else { 16.17 + return new Attribute.Error(expected); 16.18 + } 16.19 + } 16.20 + 16.21 + // Class literals look like field accesses of a field named class 16.22 + // at the tree level 16.23 if (TreeInfo.name(tree) != names._class) { 16.24 log.error(tree.pos(), "annotation.value.must.be.class.literal"); 16.25 return new Attribute.Error(expected);
17.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Aug 22 09:10:22 2013 -0700 17.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Aug 23 14:17:49 2013 -0700 17.3 @@ -398,7 +398,7 @@ 17.4 @Override 17.5 public Symbol visitMemberSelect(MemberSelectTree node, Env<AttrContext> env) { 17.6 Symbol site = visit(node.getExpression(), env); 17.7 - if (site.kind == ERR) 17.8 + if (site.kind == ERR || site.kind == ABSENT_TYP) 17.9 return site; 17.10 Name name = (Name)node.getIdentifier(); 17.11 if (site.kind == PCK) { 17.12 @@ -2395,7 +2395,7 @@ 17.13 17.14 ResultInfo bodyResultInfo = lambdaType.getReturnType() == Type.recoveryType ? 17.15 recoveryInfo : 17.16 - new LambdaResultInfo(lambdaType.getReturnType(), funcContext); 17.17 + new ResultInfo(VAL, lambdaType.getReturnType(), funcContext); 17.18 localEnv.info.returnResult = bodyResultInfo; 17.19 17.20 Log.DeferredDiagnosticHandler lambdaDeferredHandler = new Log.DeferredDiagnosticHandler(log); 17.21 @@ -2602,35 +2602,12 @@ 17.22 } 17.23 } 17.24 17.25 - class LambdaResultInfo extends ResultInfo { 17.26 - 17.27 - LambdaResultInfo(Type pt, CheckContext checkContext) { 17.28 - super(VAL, pt, checkContext); 17.29 - } 17.30 - 17.31 - @Override 17.32 - protected Type check(DiagnosticPosition pos, Type found) { 17.33 - return super.check(pos, found.baseType()); 17.34 - } 17.35 - 17.36 - @Override 17.37 - protected ResultInfo dup(CheckContext newContext) { 17.38 - return new LambdaResultInfo(pt, newContext); 17.39 - } 17.40 - 17.41 - @Override 17.42 - protected ResultInfo dup(Type newPt) { 17.43 - return new LambdaResultInfo(newPt, checkContext); 17.44 - } 17.45 - } 17.46 - 17.47 /** 17.48 * Lambda compatibility. Check that given return types, thrown types, parameter types 17.49 * are compatible with the expected functional interface descriptor. This means that: 17.50 * (i) parameter types must be identical to those of the target descriptor; (ii) return 17.51 * types must be compatible with the return type of the expected descriptor; 17.52 - * (iii) thrown types must be 'included' in the thrown types list of the expected 17.53 - * descriptor. 17.54 + * (iii) finish inference of thrown types if required. 17.55 */ 17.56 private void checkLambdaCompatible(JCLambda tree, Type descriptor, CheckContext checkContext, boolean speculativeAttr) { 17.57 Type returnType = checkContext.inferenceContext().asFree(descriptor.getReturnType()); 17.58 @@ -2652,9 +2629,7 @@ 17.59 17.60 if (!speculativeAttr) { 17.61 List<Type> thrownTypes = checkContext.inferenceContext().asFree(descriptor.getThrownTypes()); 17.62 - if (chk.unhandled(tree.inferredThrownTypes == null ? List.<Type>nil() : tree.inferredThrownTypes, thrownTypes).nonEmpty()) { 17.63 - log.error(tree, "incompatible.thrown.types.in.lambda", tree.inferredThrownTypes); 17.64 - } 17.65 + chk.unhandled(tree.inferredThrownTypes == null ? List.<Type>nil() : tree.inferredThrownTypes, thrownTypes); 17.66 } 17.67 } 17.68
18.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Aug 22 09:10:22 2013 -0700 18.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Fri Aug 23 14:17:49 2013 -0700 18.3 @@ -875,19 +875,23 @@ 18.4 } 18.5 Type owntype = mtype; 18.6 List<Type> formals = owntype.getParameterTypes(); 18.7 + List<Type> nonInferred = sym.type.getParameterTypes(); 18.8 + if (nonInferred.length() != formals.length()) nonInferred = formals; 18.9 Type last = useVarargs ? formals.last() : null; 18.10 - if (sym.name == names.init && 18.11 - sym.owner == syms.enumSym) 18.12 - formals = formals.tail.tail; 18.13 + if (sym.name == names.init && sym.owner == syms.enumSym) { 18.14 + formals = formals.tail.tail; 18.15 + nonInferred = nonInferred.tail.tail; 18.16 + } 18.17 List<JCExpression> args = argtrees; 18.18 if (args != null) { 18.19 //this is null when type-checking a method reference 18.20 while (formals.head != last) { 18.21 JCTree arg = args.head; 18.22 - Warner warn = convertWarner(arg.pos(), arg.type, formals.head); 18.23 + Warner warn = convertWarner(arg.pos(), arg.type, nonInferred.head); 18.24 assertConvertible(arg, arg.type, formals.head, warn); 18.25 args = args.tail; 18.26 formals = formals.tail; 18.27 + nonInferred = nonInferred.tail; 18.28 } 18.29 if (useVarargs) { 18.30 Type varArg = types.elemtype(last); 18.31 @@ -903,17 +907,17 @@ 18.32 Type varParam = owntype.getParameterTypes().last(); 18.33 Type lastArg = argtypes.last(); 18.34 if (types.isSubtypeUnchecked(lastArg, types.elemtype(varParam)) && 18.35 - !types.isSameType(types.erasure(varParam), types.erasure(lastArg))) 18.36 + !types.isSameType(types.erasure(varParam), types.erasure(lastArg))) 18.37 log.warning(argtrees.last().pos(), "inexact.non-varargs.call", 18.38 - types.elemtype(varParam), varParam); 18.39 + types.elemtype(varParam), varParam); 18.40 } 18.41 } 18.42 if (useVarargs) { 18.43 Type argtype = owntype.getParameterTypes().last(); 18.44 if (!types.isReifiable(argtype) && 18.45 - (!allowSimplifiedVarargs || 18.46 - sym.attribute(syms.trustMeType.tsym) == null || 18.47 - !isTrustMeAllowedOnMethod(sym))) { 18.48 + (!allowSimplifiedVarargs || 18.49 + sym.attribute(syms.trustMeType.tsym) == null || 18.50 + !isTrustMeAllowedOnMethod(sym))) { 18.51 warnUnchecked(env.tree.pos(), 18.52 "unchecked.generic.array.creation", 18.53 argtype); 18.54 @@ -929,15 +933,15 @@ 18.55 return owntype; 18.56 } 18.57 //where 18.58 - private void assertConvertible(JCTree tree, Type actual, Type formal, Warner warn) { 18.59 - if (types.isConvertible(actual, formal, warn)) 18.60 - return; 18.61 - 18.62 - if (formal.isCompound() 18.63 - && types.isSubtype(actual, types.supertype(formal)) 18.64 - && types.isSubtypeUnchecked(actual, types.interfaces(formal), warn)) 18.65 - return; 18.66 - } 18.67 + private void assertConvertible(JCTree tree, Type actual, Type formal, Warner warn) { 18.68 + if (types.isConvertible(actual, formal, warn)) 18.69 + return; 18.70 + 18.71 + if (formal.isCompound() 18.72 + && types.isSubtype(actual, types.supertype(formal)) 18.73 + && types.isSubtypeUnchecked(actual, types.interfaces(formal), warn)) 18.74 + return; 18.75 + } 18.76 18.77 /** 18.78 * Check that type 't' is a valid instantiation of a generic class 18.79 @@ -1747,7 +1751,7 @@ 18.80 if (!sup.hasTag(CLASS)) return; 18.81 18.82 for (Type t1 = sup; 18.83 - t1.tsym.type.isParameterized(); 18.84 + t1.hasTag(CLASS) && t1.tsym.type.isParameterized(); 18.85 t1 = types.supertype(t1)) { 18.86 for (Scope.Entry e1 = t1.tsym.members().elems; 18.87 e1 != null; 18.88 @@ -3329,14 +3333,15 @@ 18.89 boolean isClassDecl = e.scope == s; 18.90 if ((isClassDecl || sym != e.sym) && 18.91 sym.kind == e.sym.kind && 18.92 - sym.name != names.error) { 18.93 + sym.name != names.error && 18.94 + (!staticImport || !e.isStaticallyImported())) { 18.95 if (!e.sym.type.isErroneous()) { 18.96 String what = e.sym.toString(); 18.97 if (!isClassDecl) { 18.98 if (staticImport) 18.99 log.error(pos, "already.defined.static.single.import", what); 18.100 else 18.101 - log.error(pos, "already.defined.single.import", what); 18.102 + log.error(pos, "already.defined.single.import", what); 18.103 } 18.104 else if (sym != e.sym) 18.105 log.error(pos, "already.defined.this.unit", what);
19.1 --- a/src/share/classes/com/sun/tools/javac/comp/Enter.java Thu Aug 22 09:10:22 2013 -0700 19.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Enter.java Fri Aug 23 14:17:49 2013 -0700 19.3 @@ -291,7 +291,7 @@ 19.4 if (tree.packageAnnotations.nonEmpty() || pkginfoOpt == PkgInfo.ALWAYS) { 19.5 if (isPkgInfo) { 19.6 addEnv = true; 19.7 - } else { 19.8 + } else if (tree.packageAnnotations.nonEmpty()){ 19.9 log.error(tree.packageAnnotations.head.pos(), 19.10 "pkg.annotations.sb.in.package-info.java"); 19.11 }
20.1 --- a/src/share/classes/com/sun/tools/javac/comp/Flow.java Thu Aug 22 09:10:22 2013 -0700 20.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java Fri Aug 23 14:17:49 2013 -0700 20.3 @@ -224,7 +224,7 @@ 20.4 } 20.5 try { 20.6 new AliveAnalyzer().analyzeTree(env, that, make); 20.7 - new FlowAnalyzer().analyzeTree(env, that, make); 20.8 + new LambdaFlowAnalyzer().analyzeTree(env, that, make); 20.9 } finally { 20.10 if (!speculative) { 20.11 log.popDiagnosticHandler(diagHandler); 20.12 @@ -1259,12 +1259,24 @@ 20.13 ListBuffer<FlowPendingExit> prevPending = pendingExits; 20.14 try { 20.15 pendingExits = ListBuffer.lb(); 20.16 - caught = List.of(syms.throwableType); //inhibit exception checking 20.17 + caught = tree.getDescriptorType(types).getThrownTypes(); 20.18 thrown = List.nil(); 20.19 scan(tree.body); 20.20 - tree.inferredThrownTypes = thrown; 20.21 - } 20.22 - finally { 20.23 + List<FlowPendingExit> exits = pendingExits.toList(); 20.24 + pendingExits = new ListBuffer<FlowPendingExit>(); 20.25 + while (exits.nonEmpty()) { 20.26 + FlowPendingExit exit = exits.head; 20.27 + exits = exits.tail; 20.28 + if (exit.thrown == null) { 20.29 + Assert.check(exit.tree.hasTag(RETURN)); 20.30 + } else { 20.31 + // uncaught throws will be reported later 20.32 + pendingExits.append(exit); 20.33 + } 20.34 + } 20.35 + 20.36 + errorUncaught(); 20.37 + } finally { 20.38 pendingExits = prevPending; 20.39 caught = prevCaught; 20.40 thrown = prevThrown; 20.41 @@ -1303,6 +1315,33 @@ 20.42 } 20.43 20.44 /** 20.45 + * Specialized pass that performs inference of thrown types for lambdas. 20.46 + */ 20.47 + class LambdaFlowAnalyzer extends FlowAnalyzer { 20.48 + @Override 20.49 + public void visitLambda(JCLambda tree) { 20.50 + if (tree.type != null && 20.51 + tree.type.isErroneous()) { 20.52 + return; 20.53 + } 20.54 + List<Type> prevCaught = caught; 20.55 + List<Type> prevThrown = thrown; 20.56 + ListBuffer<FlowPendingExit> prevPending = pendingExits; 20.57 + try { 20.58 + pendingExits = ListBuffer.lb(); 20.59 + caught = List.of(syms.throwableType); 20.60 + thrown = List.nil(); 20.61 + scan(tree.body); 20.62 + tree.inferredThrownTypes = thrown; 20.63 + } finally { 20.64 + pendingExits = prevPending; 20.65 + caught = prevCaught; 20.66 + thrown = prevThrown; 20.67 + } 20.68 + } 20.69 + } 20.70 + 20.71 + /** 20.72 * This pass implements (i) definite assignment analysis, which ensures that 20.73 * each variable is assigned when used and (ii) definite unassignment analysis, 20.74 * which ensures that no final variable is assigned more than once. This visitor
21.1 --- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Thu Aug 22 09:10:22 2013 -0700 21.2 +++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Fri Aug 23 14:17:49 2013 -0700 21.3 @@ -473,7 +473,7 @@ 21.4 //non-void to non-void conversion: 21.5 // return (TYPE)BODY; 21.6 JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype); 21.7 - return make.Block(0, List.<JCStatement>of(make.Return(retExpr))); 21.8 + return make.at(retExpr).Block(0, List.<JCStatement>of(make.Return(retExpr))); 21.9 } 21.10 } 21.11
22.1 --- a/src/share/classes/com/sun/tools/javac/comp/Lower.java Thu Aug 22 09:10:22 2013 -0700 22.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java Fri Aug 23 14:17:49 2013 -0700 22.3 @@ -356,22 +356,44 @@ 22.4 } 22.5 } 22.6 22.7 + ClassSymbol ownerToCopyFreeVarsFrom(ClassSymbol c) { 22.8 + if (!c.isLocal()) { 22.9 + return null; 22.10 + } 22.11 + Symbol currentOwner = c.owner; 22.12 + while ((currentOwner.owner.kind & TYP) != 0 && currentOwner.isLocal()) { 22.13 + currentOwner = currentOwner.owner; 22.14 + } 22.15 + if ((currentOwner.owner.kind & (VAR | MTH)) != 0 && c.isSubClass(currentOwner, types)) { 22.16 + return (ClassSymbol)currentOwner; 22.17 + } 22.18 + return null; 22.19 + } 22.20 + 22.21 /** Return the variables accessed from within a local class, which 22.22 * are declared in the local class' owner. 22.23 * (in reverse order of first access). 22.24 */ 22.25 List<VarSymbol> freevars(ClassSymbol c) { 22.26 + List<VarSymbol> fvs = freevarCache.get(c); 22.27 + if (fvs != null) { 22.28 + return fvs; 22.29 + } 22.30 if ((c.owner.kind & (VAR | MTH)) != 0) { 22.31 - List<VarSymbol> fvs = freevarCache.get(c); 22.32 - if (fvs == null) { 22.33 - FreeVarCollector collector = new FreeVarCollector(c); 22.34 - collector.scan(classDef(c)); 22.35 - fvs = collector.fvs; 22.36 - freevarCache.put(c, fvs); 22.37 - } 22.38 + FreeVarCollector collector = new FreeVarCollector(c); 22.39 + collector.scan(classDef(c)); 22.40 + fvs = collector.fvs; 22.41 + freevarCache.put(c, fvs); 22.42 return fvs; 22.43 } else { 22.44 - return List.nil(); 22.45 + ClassSymbol owner = ownerToCopyFreeVarsFrom(c); 22.46 + if (owner != null) { 22.47 + fvs = freevarCache.get(owner); 22.48 + freevarCache.put(c, fvs); 22.49 + return fvs; 22.50 + } else { 22.51 + return List.nil(); 22.52 + } 22.53 } 22.54 } 22.55 22.56 @@ -1046,7 +1068,7 @@ 22.57 boolean needsPrivateAccess(Symbol sym) { 22.58 if ((sym.flags() & PRIVATE) == 0 || sym.owner == currentClass) { 22.59 return false; 22.60 - } else if (sym.name == names.init && (sym.owner.owner.kind & (VAR | MTH)) != 0) { 22.61 + } else if (sym.name == names.init && sym.owner.isLocal()) { 22.62 // private constructor in local class: relax protection 22.63 sym.flags_field &= ~PRIVATE; 22.64 return false; 22.65 @@ -2448,6 +2470,7 @@ 22.66 tree.name = Convert.shortName(currentClass.flatName()); 22.67 22.68 // Add this$n and free variables proxy definitions to class. 22.69 + 22.70 for (List<JCVariableDecl> l = fvdefs; l.nonEmpty(); l = l.tail) { 22.71 tree.defs = tree.defs.prepend(l.head); 22.72 enterSynthetic(tree.pos(), l.head.sym, currentClass.members()); 22.73 @@ -2670,8 +2693,7 @@ 22.74 //where 22.75 private void visitMethodDefInternal(JCMethodDecl tree) { 22.76 if (tree.name == names.init && 22.77 - (currentClass.isInner() || 22.78 - (currentClass.owner.kind & (VAR | MTH)) != 0)) { 22.79 + (currentClass.isInner() || currentClass.isLocal())) { 22.80 // We are seeing a constructor of an inner class. 22.81 MethodSymbol m = tree.sym; 22.82 22.83 @@ -2818,7 +2840,7 @@ 22.84 22.85 // If created class is local, add free variables after 22.86 // explicit constructor arguments. 22.87 - if ((c.owner.kind & (VAR | MTH)) != 0) { 22.88 + if (c.isLocal()) { 22.89 tree.args = tree.args.appendList(loadFreevars(tree.pos(), freevars(c))); 22.90 } 22.91 22.92 @@ -2837,7 +2859,7 @@ 22.93 if (tree.encl != null) { 22.94 thisArg = attr.makeNullCheck(translate(tree.encl)); 22.95 thisArg.type = tree.encl.type; 22.96 - } else if ((c.owner.kind & (MTH | VAR)) != 0) { 22.97 + } else if (c.isLocal()) { 22.98 // local class 22.99 thisArg = makeThis(tree.pos(), c.type.getEnclosingType().tsym); 22.100 } else { 22.101 @@ -2966,7 +2988,7 @@ 22.102 // If we are calling a constructor of a local class, add 22.103 // free variables after explicit constructor arguments. 22.104 ClassSymbol c = (ClassSymbol)constructor.owner; 22.105 - if ((c.owner.kind & (VAR | MTH)) != 0) { 22.106 + if (c.isLocal()) { 22.107 tree.args = tree.args.appendList(loadFreevars(tree.pos(), freevars(c))); 22.108 } 22.109 22.110 @@ -2994,7 +3016,7 @@ 22.111 makeNullCheck(translate(((JCFieldAccess) tree.meth).selected)); 22.112 tree.meth = make.Ident(constructor); 22.113 ((JCIdent) tree.meth).name = methName; 22.114 - } else if ((c.owner.kind & (MTH | VAR)) != 0 || methName == names._this){ 22.115 + } else if (c.isLocal() || methName == names._this){ 22.116 // local class or this() call 22.117 thisArg = makeThis(tree.meth.pos(), c.type.getEnclosingType().tsym); 22.118 } else { 22.119 @@ -3436,7 +3458,7 @@ 22.120 eType, 22.121 List.<Type>nil()); 22.122 VarSymbol itvar = new VarSymbol(0, names.fromString("i" + target.syntheticNameChar()), 22.123 - types.erasure(iterator.type.getReturnType()), 22.124 + types.erasure(types.asSuper(iterator.type.getReturnType(), syms.iteratorType.tsym)), 22.125 currentMethodSym); 22.126 22.127 JCStatement init = make.
23.1 --- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Aug 22 09:10:22 2013 -0700 23.2 +++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Fri Aug 23 14:17:49 2013 -0700 23.3 @@ -189,7 +189,7 @@ 23.4 staticImportAccessible(sym, packge) && 23.5 sym.isMemberOf(origin, types) && 23.6 !toScope.includes(sym)) 23.7 - toScope.enter(sym, fromScope, origin.members()); 23.8 + toScope.enter(sym, fromScope, origin.members(), true); 23.9 } 23.10 } 23.11 }.importFrom(tsym); 23.12 @@ -217,7 +217,7 @@ 23.13 staticImportAccessible(sym, packge) && 23.14 !toScope.includes(sym) && 23.15 sym.isMemberOf(origin, types)) { 23.16 - toScope.enter(sym, fromScope, origin.members()); 23.17 + toScope.enter(sym, fromScope, origin.members(), true); 23.18 } 23.19 } 23.20 } 23.21 @@ -283,7 +283,7 @@ 23.22 staticImportAccessible(sym, packge) && 23.23 sym.isMemberOf(origin, types) && 23.24 chk.checkUniqueStaticImport(pos, sym, toScope)) 23.25 - toScope.enter(sym, sym.owner.members(), origin.members()); 23.26 + toScope.enter(sym, sym.owner.members(), origin.members(), true); 23.27 } 23.28 } 23.29 }.importFrom(tsym); 23.30 @@ -313,9 +313,9 @@ 23.31 staticImportAccessible(sym, packge) && 23.32 sym.isMemberOf(origin, types)) { 23.33 found = true; 23.34 - if (sym.kind == MTH || 23.35 - sym.kind != TYP && chk.checkUniqueStaticImport(pos, sym, toScope)) 23.36 - toScope.enter(sym, sym.owner.members(), origin.members()); 23.37 + if (sym.kind != TYP) { 23.38 + toScope.enter(sym, sym.owner.members(), origin.members(), true); 23.39 + } 23.40 } 23.41 } 23.42 }
24.1 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Aug 22 09:10:22 2013 -0700 24.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java Fri Aug 23 14:17:49 2013 -0700 24.3 @@ -1344,32 +1344,23 @@ 24.4 if (bestSoFar.exists()) 24.5 return bestSoFar; 24.6 24.7 - Scope.Entry e = env.toplevel.namedImportScope.lookup(name); 24.8 - for (; e.scope != null; e = e.next()) { 24.9 - sym = e.sym; 24.10 - Type origin = e.getOrigin().owner.type; 24.11 - if (sym.kind == VAR) { 24.12 - if (e.sym.owner.type != origin) 24.13 - sym = sym.clone(e.getOrigin().owner); 24.14 - return isAccessible(env, origin, sym) 24.15 - ? sym : new AccessError(env, origin, sym); 24.16 + Symbol origin = null; 24.17 + for (Scope sc : new Scope[] { env.toplevel.namedImportScope, env.toplevel.starImportScope }) { 24.18 + Scope.Entry e = sc.lookup(name); 24.19 + for (; e.scope != null; e = e.next()) { 24.20 + sym = e.sym; 24.21 + if (sym.kind != VAR) 24.22 + continue; 24.23 + // invariant: sym.kind == VAR 24.24 + if (bestSoFar.kind < AMBIGUOUS && sym.owner != bestSoFar.owner) 24.25 + return new AmbiguityError(bestSoFar, sym); 24.26 + else if (bestSoFar.kind >= VAR) { 24.27 + origin = e.getOrigin().owner; 24.28 + bestSoFar = isAccessible(env, origin.type, sym) 24.29 + ? sym : new AccessError(env, origin.type, sym); 24.30 + } 24.31 } 24.32 - } 24.33 - 24.34 - Symbol origin = null; 24.35 - e = env.toplevel.starImportScope.lookup(name); 24.36 - for (; e.scope != null; e = e.next()) { 24.37 - sym = e.sym; 24.38 - if (sym.kind != VAR) 24.39 - continue; 24.40 - // invariant: sym.kind == VAR 24.41 - if (bestSoFar.kind < AMBIGUOUS && sym.owner != bestSoFar.owner) 24.42 - return new AmbiguityError(bestSoFar, sym); 24.43 - else if (bestSoFar.kind >= VAR) { 24.44 - origin = e.getOrigin().owner; 24.45 - bestSoFar = isAccessible(env, origin.type, sym) 24.46 - ? sym : new AccessError(env, origin.type, sym); 24.47 - } 24.48 + if (bestSoFar.exists()) break; 24.49 } 24.50 if (bestSoFar.kind == VAR && bestSoFar.owner.type != origin.type) 24.51 return bestSoFar.clone(origin);
25.1 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Thu Aug 22 09:10:22 2013 -0700 25.2 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Fri Aug 23 14:17:49 2013 -0700 25.3 @@ -363,6 +363,7 @@ 25.4 throw new Abort(); 25.5 } 25.6 source = Source.instance(context); 25.7 + Target target = Target.instance(context); 25.8 attr = Attr.instance(context); 25.9 chk = Check.instance(context); 25.10 gen = Gen.instance(context); 25.11 @@ -403,6 +404,8 @@ 25.12 } 25.13 } 25.14 25.15 + checkForObsoleteOptions(target); 25.16 + 25.17 verboseCompilePolicy = options.isSet("verboseCompilePolicy"); 25.18 25.19 if (attrParseOnly) 25.20 @@ -432,6 +435,26 @@ 25.21 log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context)); 25.22 } 25.23 25.24 + private void checkForObsoleteOptions(Target target) { 25.25 + // Unless lint checking on options is disabled, check for 25.26 + // obsolete source and target options. 25.27 + boolean obsoleteOptionFound = false; 25.28 + if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) { 25.29 + if (source.compareTo(Source.JDK1_5) <= 0) { 25.30 + log.warning(LintCategory.OPTIONS, "option.obsolete.source", source.name); 25.31 + obsoleteOptionFound = true; 25.32 + } 25.33 + 25.34 + if (target.compareTo(Target.JDK1_5) <= 0) { 25.35 + log.warning(LintCategory.OPTIONS, "option.obsolete.target", source.name); 25.36 + obsoleteOptionFound = true; 25.37 + } 25.38 + 25.39 + if (obsoleteOptionFound) 25.40 + log.warning(LintCategory.OPTIONS, "option.obsolete.suppression"); 25.41 + } 25.42 + } 25.43 + 25.44 /* Switches: 25.45 */ 25.46
26.1 --- a/src/share/classes/com/sun/tools/javac/main/Main.java Thu Aug 22 09:10:22 2013 -0700 26.2 +++ b/src/share/classes/com/sun/tools/javac/main/Main.java Fri Aug 23 14:17:49 2013 -0700 26.3 @@ -262,6 +262,11 @@ 26.4 } 26.5 } 26.6 26.7 + if (options.get(PROFILE) != null && options.get(BOOTCLASSPATH) != null) { 26.8 + error("err.profile.bootclasspath.conflict"); 26.9 + return null; 26.10 + } 26.11 + 26.12 if (this.classnames != null && classNames != null) { 26.13 this.classnames.addAll(Arrays.asList(classNames)); 26.14 }
27.1 --- a/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java Thu Aug 22 09:10:22 2013 -0700 27.2 +++ b/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java Fri Aug 23 14:17:49 2013 -0700 27.3 @@ -244,7 +244,10 @@ 27.4 } 27.5 27.6 public void visitError(Attribute.Error e) { 27.7 - value = null; // indicates a type mismatch 27.8 + if (e instanceof Attribute.UnresolvedClass) 27.9 + value = new MirroredTypeExceptionProxy(((Attribute.UnresolvedClass)e).classType); 27.10 + else 27.11 + value = null; // indicates a type mismatch 27.12 } 27.13 27.14
28.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Aug 22 09:10:22 2013 -0700 28.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties Fri Aug 23 14:17:49 2013 -0700 28.3 @@ -733,10 +733,6 @@ 28.4 {0} 28.5 28.6 # 0: list of type 28.7 -compiler.err.incompatible.thrown.types.in.lambda=\ 28.8 - incompatible thrown types {0} in lambda expression 28.9 - 28.10 -# 0: list of type 28.11 compiler.err.incompatible.thrown.types.in.mref=\ 28.12 incompatible thrown types {0} in method reference 28.13 28.14 @@ -1444,6 +1440,17 @@ 28.15 compiler.warn.source.no.bootclasspath=\ 28.16 bootstrap class path not set in conjunction with -source {0} 28.17 28.18 +# 0: string 28.19 +compiler.warn.option.obsolete.source=\ 28.20 + source value {0} is obsolete and will be removed in a future release 28.21 + 28.22 +# 0: string 28.23 +compiler.warn.option.obsolete.target=\ 28.24 + target value {0} is obsolete and will be removed in a future release 28.25 + 28.26 +compiler.warn.option.obsolete.suppression=\ 28.27 + To suppress warnings about obsolete options, use -Xlint:-options. 28.28 + 28.29 # 0: name, 1: number, 2: number, 3: number, 4: number 28.30 compiler.warn.future.attr=\ 28.31 {0} attribute introduced in version {1}.{2} class files is ignored in version {3}.{4} class files
29.1 --- a/src/share/classes/com/sun/tools/javac/resources/javac.properties Thu Aug 22 09:10:22 2013 -0700 29.2 +++ b/src/share/classes/com/sun/tools/javac/resources/javac.properties Fri Aug 23 14:17:49 2013 -0700 29.3 @@ -185,6 +185,8 @@ 29.4 key in annotation processor option ''{0}'' is not a dot-separated sequence of identifiers 29.5 javac.err.invalid.flag=\ 29.6 invalid flag: {0} 29.7 +javac.err.profile.bootclasspath.conflict=\ 29.8 + profile and bootclasspath options cannot be used together 29.9 javac.err.invalid.profile=\ 29.10 invalid profile: {0} 29.11 javac.err.invalid.target=\
30.1 --- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java Thu Aug 22 09:10:22 2013 -0700 30.2 +++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java Fri Aug 23 14:17:49 2013 -0700 30.3 @@ -645,7 +645,7 @@ 30.4 public List<Type> targets; 30.5 30.6 public Type getDescriptorType(Types types) { 30.7 - return types.findDescriptorType(targets.head); 30.8 + return targets.nonEmpty() ? types.findDescriptorType(targets.head) : types.createErrorType(null); 30.9 } 30.10 } 30.11 30.12 @@ -1571,6 +1571,16 @@ 30.13 public Tag getTag() { 30.14 return NEWARRAY; 30.15 } 30.16 + 30.17 + @Override 30.18 + public List<JCAnnotation> getAnnotations() { 30.19 + return annotations; 30.20 + } 30.21 + 30.22 + @Override 30.23 + public List<List<JCAnnotation>> getDimAnnotations() { 30.24 + return dimAnnotations; 30.25 + } 30.26 } 30.27 30.28 /**
31.1 --- a/src/share/classes/com/sun/tools/javadoc/Start.java Thu Aug 22 09:10:22 2013 -0700 31.2 +++ b/src/share/classes/com/sun/tools/javadoc/Start.java Fri Aug 23 14:17:49 2013 -0700 31.3 @@ -269,6 +269,8 @@ 31.4 setDocletInvoker(docletClass, fileManager, argv); 31.5 31.6 compOpts = Options.instance(context); 31.7 + // Make sure no obsolete source/target messages are reported 31.8 + compOpts.put("-Xlint:-options", "-Xlint:-options"); 31.9 31.10 // Parse arguments 31.11 for (int i = 0 ; i < argv.length ; i++) {
32.1 --- a/src/share/classes/com/sun/tools/sjavac/JavacState.java Thu Aug 22 09:10:22 2013 -0700 32.2 +++ b/src/share/classes/com/sun/tools/sjavac/JavacState.java Fri Aug 23 14:17:49 2013 -0700 32.3 @@ -808,7 +808,10 @@ 32.4 32.5 // Create a set of filenames with full paths. 32.6 for (Source s : now.sources().values()) { 32.7 - calculatedSources.add(s.file().getPath()); 32.8 + // Don't include link only sources when comparing sources to compile 32.9 + if (!s.isLinkedOnly()) { 32.10 + calculatedSources.add(s.file().getPath()); 32.11 + } 32.12 } 32.13 // Read in the file and create another set of filenames with full paths. 32.14 try {
33.1 --- a/src/share/classes/com/sun/tools/sjavac/Main.java Thu Aug 22 09:10:22 2013 -0700 33.2 +++ b/src/share/classes/com/sun/tools/sjavac/Main.java Fri Aug 23 14:17:49 2013 -0700 33.3 @@ -249,16 +249,19 @@ 33.4 return -1; 33.5 } 33.6 33.7 - // Find all source files allowable for linking. 33.8 + // Create a map of all source files that are available for linking. Both -src and 33.9 + // -sourcepath point to such files. It is possible to specify multiple 33.10 + // -sourcepath options to enable different filtering rules. If the 33.11 + // filters are the same for multiple sourcepaths, they may be concatenated 33.12 + // using :(;). Before sending the list of sourcepaths to javac, they are 33.13 + // all concatenated. The list created here is used by the SmartFileWrapper to 33.14 + // make sure only the correct sources are actually available. 33.15 // We might find more modules here as well. 33.16 Map<String,Source> sources_to_link_to = new HashMap<String,Source>(); 33.17 - // Always reuse -src for linking as well! This means that we might 33.18 - // get two -sourcepath on the commandline after the rewrite, which is 33.19 - // fine. We can have as many as we like. You need to have separate -src/-sourcepath/-classpath 33.20 - // if you need different filtering rules for different roots. If you have the same filtering 33.21 - // rules for all sourcepath roots, you can concatenate them using :(;) as before. 33.22 - rewriteOptions(args, "-src", "-sourcepath"); 33.23 + findFiles(args, "-src", Util.set(".java"), sources_to_link_to, modules, current_module, true); 33.24 findFiles(args, "-sourcepath", Util.set(".java"), sources_to_link_to, modules, current_module, true); 33.25 + // Rewrite the -src option to make it through to the javac instances. 33.26 + rewriteOptions(args, "-src", "-sourcepath"); 33.27 33.28 // Find all class files allowable for linking. 33.29 // And pickup knowledge of all modules found here.
34.1 --- a/src/share/classes/javax/tools/JavaCompiler.java Thu Aug 22 09:10:22 2013 -0700 34.2 +++ b/src/share/classes/javax/tools/JavaCompiler.java Fri Aug 23 14:17:49 2013 -0700 34.3 @@ -1,5 +1,5 @@ 34.4 /* 34.5 - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 34.6 + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 34.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.8 * 34.9 * This code is free software; you can redistribute it and/or modify it 34.10 @@ -251,8 +251,8 @@ 34.11 * occurred in a user supplied component. The 34.12 * {@linkplain Throwable#getCause() cause} will be the error in 34.13 * user code. 34.14 - * @throws IllegalArgumentException if any of the given 34.15 - * compilation units are of other kind than 34.16 + * @throws IllegalArgumentException if any of the options are invalid, 34.17 + * or if any of the given compilation units are of other kind than 34.18 * {@linkplain JavaFileObject.Kind#SOURCE source} 34.19 */ 34.20 CompilationTask getTask(Writer out,
35.1 --- a/test/com/sun/javadoc/testProfiles/TestProfiles.java Thu Aug 22 09:10:22 2013 -0700 35.2 +++ b/test/com/sun/javadoc/testProfiles/TestProfiles.java Fri Aug 23 14:17:49 2013 -0700 35.3 @@ -23,7 +23,7 @@ 35.4 35.5 /* 35.6 * @test 35.7 - * @bug 8006124 8009684 35.8 + * @bug 8006124 8009684 8016921 35.9 * @summary Test javadoc support for profiles. 35.10 * @author Bhavesh Patel 35.11 * @library ../lib/ 35.12 @@ -33,7 +33,7 @@ 35.13 public class TestProfiles extends JavadocTester { 35.14 35.15 //Test information. 35.16 - private static final String BUG_ID = "8006124-8009684"; 35.17 + private static final String BUG_ID = "8006124-8009684-8016921"; 35.18 private static final String PROFILE_BUG_ID = BUG_ID + "-1"; 35.19 private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; 35.20 //Javadoc arguments. 35.21 @@ -105,6 +105,14 @@ 35.22 {PROFILE_BUG_ID + FS + "index.html", 35.23 "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " + 35.24 "title=\"All Packages\">" 35.25 + }, 35.26 + //Test for "overview-summary.html" showing the profile list. 35.27 + {PROFILE_BUG_ID + FS + "overview-summary.html", 35.28 + "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + 35.29 + "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " + 35.30 + "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + 35.31 + "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + 35.32 + "</ul>" 35.33 } 35.34 }; 35.35 private static final String[][] PROFILES_NEGATED_TEST = { 35.36 @@ -159,6 +167,13 @@ 35.37 }, 35.38 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", 35.39 "<div class=\"subTitle\">compact1, compact2, compact3</div>" 35.40 + }, 35.41 + {PACKAGE_BUG_ID + FS + "overview-summary.html", 35.42 + "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + 35.43 + "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " + 35.44 + "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + 35.45 + "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + 35.46 + "</ul>" 35.47 } 35.48 }; 35.49
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 36.2 +++ b/test/com/sun/javadoc/testSeeTag/TestSeeTag.java Fri Aug 23 14:17:49 2013 -0700 36.3 @@ -0,0 +1,80 @@ 36.4 +/* 36.5 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 36.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 36.7 + * 36.8 + * This code is free software; you can redistribute it and/or modify it 36.9 + * under the terms of the GNU General Public License version 2 only, as 36.10 + * published by the Free Software Foundation. 36.11 + * 36.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 36.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 36.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36.15 + * version 2 for more details (a copy is included in the LICENSE file that 36.16 + * accompanied this code). 36.17 + * 36.18 + * You should have received a copy of the GNU General Public License version 36.19 + * 2 along with this work; if not, write to the Free Software Foundation, 36.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 36.21 + * 36.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 36.23 + * or visit www.oracle.com if you need additional information or have any 36.24 + * questions. 36.25 + */ 36.26 + 36.27 +/* 36.28 + * @test 36.29 + * @bug 8017191 36.30 + * @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages 36.31 + * @author jjg 36.32 + * @library ../lib/ 36.33 + * @build JavadocTester TestSeeTag 36.34 + * @run main TestSeeTag 36.35 + */ 36.36 + 36.37 +public class TestSeeTag extends JavadocTester { 36.38 + 36.39 + //Test information. 36.40 + private static final String BUG_ID = "8017191"; 36.41 + private static final String OUTPUT_DIR = BUG_ID; 36.42 + 36.43 + //Javadoc arguments. 36.44 + private static final String[] ARGS = new String[] { 36.45 + "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" 36.46 + }; 36.47 + 36.48 + //Input for string search tests. 36.49 + private static final String[][] TEST = { 36.50 + { OUTPUT_DIR + FS + "pkg" + FS + "Test.html", 36.51 + "<code>List</code>" 36.52 + } 36.53 + }; 36.54 + private static final String[][] NEGATED_TEST = { 36.55 + { OUTPUT_DIR + FS + "pkg" + FS + "Test.html", 36.56 + "<code>List</code>" 36.57 + } 36.58 + }; 36.59 + 36.60 + /** 36.61 + * The entry point of the test. 36.62 + * @param args the array of command line arguments. 36.63 + */ 36.64 + public static void main(String[] args) { 36.65 + TestSeeTag tester = new TestSeeTag(); 36.66 + run(tester, ARGS, TEST, NEGATED_TEST); 36.67 + tester.printSummary(); 36.68 + } 36.69 + 36.70 + /** 36.71 + * {@inheritDoc} 36.72 + */ 36.73 + public String getBugId() { 36.74 + return BUG_ID; 36.75 + } 36.76 + 36.77 + /** 36.78 + * {@inheritDoc} 36.79 + */ 36.80 + public String getBugName() { 36.81 + return getClass().getName(); 36.82 + } 36.83 +}
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 37.2 +++ b/test/com/sun/javadoc/testSeeTag/pkg/Test.java Fri Aug 23 14:17:49 2013 -0700 37.3 @@ -0,0 +1,29 @@ 37.4 +/* 37.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 37.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 37.7 + * 37.8 + * This code is free software; you can redistribute it and/or modify it 37.9 + * under the terms of the GNU General Public License version 2 only, as 37.10 + * published by the Free Software Foundation. 37.11 + * 37.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 37.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 37.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 37.15 + * version 2 for more details (a copy is included in the LICENSE file that 37.16 + * accompanied this code). 37.17 + * 37.18 + * You should have received a copy of the GNU General Public License version 37.19 + * 2 along with this work; if not, write to the Free Software Foundation, 37.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 37.21 + * 37.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 37.23 + * or visit www.oracle.com if you need additional information or have any 37.24 + * questions. 37.25 + */ 37.26 + 37.27 +package pkg; 37.28 +import java.util.List; 37.29 + 37.30 +/** @see List */ 37.31 +public class Test { } 37.32 +
38.1 --- a/test/tools/javac/4980495/static/Test.out Thu Aug 22 09:10:22 2013 -0700 38.2 +++ b/test/tools/javac/4980495/static/Test.out Fri Aug 23 14:17:49 2013 -0700 38.3 @@ -1,2 +1,2 @@ 38.4 -Test.java:9:1: compiler.err.already.defined.static.single.import: f 38.5 +Test.java:15:9: compiler.err.ref.ambiguous: f, kindname.variable, f, p1.A1, kindname.variable, f, p2.A2 38.6 1 error
39.1 --- a/test/tools/javac/6758789/T6758789b.out Thu Aug 22 09:10:22 2013 -0700 39.2 +++ b/test/tools/javac/6758789/T6758789b.out Fri Aug 23 14:17:49 2013 -0700 39.3 @@ -1,5 +1,5 @@ 39.4 T6758789b.java:16:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6758789a.Foo<X>, T6758789a.Foo, kindname.class, T6758789a 39.5 -T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo<java.lang.Object> 39.6 +T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo<X> 39.7 - compiler.err.warnings.and.werror 39.8 1 error 39.9 2 warnings
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 40.2 +++ b/test/tools/javac/7182350/T7182350.java Fri Aug 23 14:17:49 2013 -0700 40.3 @@ -0,0 +1,14 @@ 40.4 +/** 40.5 + * @test /nodynamiccopyright/ 40.6 + * @bug 7182350 40.7 + * @summary verify correct output of -Xlint:unchecked on methods with unchecked conversations in parameters 40.8 + * @compile/ref=T7182350.out -XDrawDiagnostics -Xlint:unchecked T7182350.java 40.9 + */ 40.10 + 40.11 +import java.util.*; 40.12 + 40.13 +class T7182350 { 40.14 + public static void quicksort(Vector vector, Comparator compare) { 40.15 + Collections.sort(vector,compare); 40.16 + } 40.17 +}
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 41.2 +++ b/test/tools/javac/7182350/T7182350.out Fri Aug 23 14:17:49 2013 -0700 41.3 @@ -0,0 +1,4 @@ 41.4 +T7182350.java:12:25: compiler.warn.unchecked.meth.invocation.applied: kindname.method, sort, java.util.List<T>,java.util.Comparator<? super T>, java.util.Vector,java.util.Comparator, kindname.class, java.util.Collections 41.5 +T7182350.java:12:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.Vector, java.util.List<T> 41.6 +T7182350.java:12:33: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.Comparator, java.util.Comparator<? super T> 41.7 +3 warnings
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 42.2 +++ b/test/tools/javac/T8009640/CheckRejectProfileBCPOptionsIfUsedTogetherTest.java Fri Aug 23 14:17:49 2013 -0700 42.3 @@ -0,0 +1,66 @@ 42.4 +/* 42.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 42.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 42.7 + * 42.8 + * This code is free software; you can redistribute it and/or modify it 42.9 + * under the terms of the GNU General Public License version 2 only, as 42.10 + * published by the Free Software Foundation. Oracle designates this 42.11 + * particular file as subject to the "Classpath" exception as provided 42.12 + * by Oracle in the LICENSE file that accompanied this code. 42.13 + * 42.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 42.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 42.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42.17 + * version 2 for more details (a copy is included in the LICENSE file that 42.18 + * accompanied this code). 42.19 + * 42.20 + * You should have received a copy of the GNU General Public License version 42.21 + * 2 along with this work; if not, write to the Free Software Foundation, 42.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 42.23 + * 42.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 42.25 + * or visit www.oracle.com if you need additional information or have any 42.26 + * questions. 42.27 + */ 42.28 + 42.29 +/* 42.30 + * @test 42.31 + * @bug 8009640 42.32 + * @summary -profile <compact> does not work when -bootclasspath specified 42.33 + * @library /tools/javac/lib 42.34 + * @build ToolBox 42.35 + * @run main CheckRejectProfileBCPOptionsIfUsedTogetherTest 42.36 + */ 42.37 + 42.38 +import com.sun.tools.javac.util.Assert; 42.39 +import java.util.ArrayList; 42.40 +import java.util.List; 42.41 + 42.42 +public class CheckRejectProfileBCPOptionsIfUsedTogetherTest { 42.43 + 42.44 + private static final String TestSrc = 42.45 + "public class Test {\n" + 42.46 + " javax.swing.JButton b;\n" + 42.47 + "}"; 42.48 + 42.49 + public static void main(String args[]) throws Exception { 42.50 + List<String> errOutput = new ArrayList<>(); 42.51 + String testJDK = ToolBox.jdkUnderTest; 42.52 + ToolBox.createJavaFileFromSource(TestSrc); 42.53 + 42.54 + ToolBox.AnyToolArgs javacParams = 42.55 + new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL) 42.56 + .appendArgs(ToolBox.javacBinary) 42.57 + .appendArgs(ToolBox.testToolVMOpts) 42.58 + .appendArgs("-profile", "compact1", "-bootclasspath", 42.59 + testJDK + "/jre/lib/rt.jar", "Test.java") 42.60 + .setErrOutput(errOutput); 42.61 + 42.62 + ToolBox.executeCommand(javacParams); 42.63 + 42.64 + Assert.check(errOutput.get(0).startsWith( 42.65 + "javac: profile and bootclasspath options cannot be used together"), 42.66 + "Incorrect javac error output"); 42.67 + } 42.68 + 42.69 +}
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 43.2 +++ b/test/tools/javac/T8013394/CompileErrorWithIteratorTest.java Fri Aug 23 14:17:49 2013 -0700 43.3 @@ -0,0 +1,85 @@ 43.4 +/* 43.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 43.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 43.7 + * 43.8 + * This code is free software; you can redistribute it and/or modify it 43.9 + * under the terms of the GNU General Public License version 2 only, as 43.10 + * published by the Free Software Foundation. Oracle designates this 43.11 + * particular file as subject to the "Classpath" exception as provided 43.12 + * by Oracle in the LICENSE file that accompanied this code. 43.13 + * 43.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 43.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 43.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 43.17 + * version 2 for more details (a copy is included in the LICENSE file that 43.18 + * accompanied this code). 43.19 + * 43.20 + * You should have received a copy of the GNU General Public License version 43.21 + * 2 along with this work; if not, write to the Free Software Foundation, 43.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 43.23 + * 43.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 43.25 + * or visit www.oracle.com if you need additional information or have any 43.26 + * questions. 43.27 + */ 43.28 + 43.29 +/* 43.30 + * @test 43.31 + * @bug 8013394 43.32 + * @summary compile of iterator use fails with error "defined in an inaccessible class or interface" 43.33 + * @library /tools/javac/lib 43.34 + * @build ToolBox 43.35 + * @run main CompileErrorWithIteratorTest 43.36 + */ 43.37 + 43.38 +public class CompileErrorWithIteratorTest { 43.39 + 43.40 + private static final String TestCollectionSrc = 43.41 + "package pkg;\n" + 43.42 + 43.43 + "import java.util.Iterator;\n" + 43.44 + "import java.util.NoSuchElementException;\n" + 43.45 + 43.46 + "public class TestCollection<E> implements Iterable<E> {\n" + 43.47 + " public testCollectionIterator iterator() {\n" + 43.48 + " return new testCollectionIterator();\n" + 43.49 + " }\n" + 43.50 + " class testCollectionIterator implements Iterator<E> {\n" + 43.51 + " public boolean hasNext() { return true; }\n" + 43.52 + " public E next() throws NoSuchElementException\n" + 43.53 + " {\n" + 43.54 + " return null;\n" + 43.55 + " }\n" + 43.56 + " public void remove() {}\n" + 43.57 + " }\n" + 43.58 + "}"; 43.59 + 43.60 + private static final String TestSrc = 43.61 + "import pkg.TestCollection;\n" + 43.62 + "\n" + 43.63 + "public class Test {\n" + 43.64 + "\n" + 43.65 + " public static void main(String[] args) {\n" + 43.66 + " TestCollection<String> tc1 = new TestCollection<String>();\n" + 43.67 + " for (String s : tc1) {\n" + 43.68 + " System.out.println(s);\n" + 43.69 + " }\n" + 43.70 + " }\n" + 43.71 + "}"; 43.72 + 43.73 + public static void main(String args[]) throws Exception { 43.74 + new CompileErrorWithIteratorTest().run(); 43.75 + } 43.76 + 43.77 + void run() throws Exception { 43.78 + compile(); 43.79 + } 43.80 + 43.81 + void compile() throws Exception { 43.82 + ToolBox.JavaToolArgs javacParams = 43.83 + new ToolBox.JavaToolArgs() 43.84 + .setSources(TestCollectionSrc, TestSrc); 43.85 + ToolBox.javac(javacParams); 43.86 + } 43.87 + 43.88 +}
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 44.2 +++ b/test/tools/javac/T8019486/WrongLVTForLambdaTest.java Fri Aug 23 14:17:49 2013 -0700 44.3 @@ -0,0 +1,111 @@ 44.4 +/* 44.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 44.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 44.7 + * 44.8 + * This code is free software; you can redistribute it and/or modify it 44.9 + * under the terms of the GNU General Public License version 2 only, as 44.10 + * published by the Free Software Foundation. Oracle designates this 44.11 + * particular file as subject to the "Classpath" exception as provided 44.12 + * by Oracle in the LICENSE file that accompanied this code. 44.13 + * 44.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 44.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 44.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 44.17 + * version 2 for more details (a copy is included in the LICENSE file that 44.18 + * accompanied this code). 44.19 + * 44.20 + * You should have received a copy of the GNU General Public License version 44.21 + * 2 along with this work; if not, write to the Free Software Foundation, 44.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 44.23 + * 44.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 44.25 + * or visit www.oracle.com if you need additional information or have any 44.26 + * questions. 44.27 + */ 44.28 + 44.29 +/* 44.30 + * @test 44.31 + * @bug 8019486 44.32 + * @summary javac, generates erroneous LVT for a test case with lambda code 44.33 + * @library /tools/javac/lib 44.34 + * @build ToolBox 44.35 + * @run main WrongLVTForLambdaTest 44.36 + */ 44.37 + 44.38 +import java.io.File; 44.39 +import java.nio.file.Paths; 44.40 + 44.41 +import com.sun.tools.classfile.ClassFile; 44.42 +import com.sun.tools.classfile.Code_attribute; 44.43 +import com.sun.tools.classfile.LineNumberTable_attribute; 44.44 +import com.sun.tools.classfile.Method; 44.45 +import com.sun.tools.javac.util.Assert; 44.46 + 44.47 +public class WrongLVTForLambdaTest { 44.48 + 44.49 + static final String testSource = 44.50 + /* 01 */ "import java.util.List;\n" + 44.51 + /* 02 */ "import java.util.Arrays;\n" + 44.52 + /* 03 */ "import java.util.stream.Collectors;\n" + 44.53 + /* 04 */ "\n" + 44.54 + /* 05 */ "public class Foo {\n" + 44.55 + /* 06 */ " void bar(int value) {\n" + 44.56 + /* 07 */ " final List<Integer> numbers = Arrays.asList(1, 2, 3);\n" + 44.57 + /* 08 */ " final List<Integer> numbersPlusOne = \n" + 44.58 + /* 09 */ " numbers.stream().map(number -> number / 1).collect(Collectors.toList());\n" + 44.59 + /* 10 */ " }\n" + 44.60 + /* 11 */ "}"; 44.61 + 44.62 + static final int[][] expectedLNT = { 44.63 + // {line-number, start-pc}, 44.64 + {9, 0}, //number -> number / 1 44.65 + }; 44.66 + 44.67 + static final String methodToLookFor = "lambda$0"; 44.68 + 44.69 + public static void main(String[] args) throws Exception { 44.70 + new WrongLVTForLambdaTest().run(); 44.71 + } 44.72 + 44.73 + void run() throws Exception { 44.74 + compileTestClass(); 44.75 + checkClassFile(new File(Paths.get(System.getProperty("user.dir"), 44.76 + "Foo.class").toUri()), methodToLookFor); 44.77 + } 44.78 + 44.79 + void compileTestClass() throws Exception { 44.80 + ToolBox.JavaToolArgs javacSuccessArgs = 44.81 + new ToolBox.JavaToolArgs().setSources(testSource); 44.82 + ToolBox.javac(javacSuccessArgs); 44.83 + } 44.84 + 44.85 + void checkClassFile(final File cfile, String methodToFind) throws Exception { 44.86 + ClassFile classFile = ClassFile.read(cfile); 44.87 + boolean methodFound = false; 44.88 + for (Method method : classFile.methods) { 44.89 + if (method.getName(classFile.constant_pool).equals(methodToFind)) { 44.90 + methodFound = true; 44.91 + Code_attribute code = (Code_attribute) method.attributes.get("Code"); 44.92 + LineNumberTable_attribute lnt = 44.93 + (LineNumberTable_attribute) code.attributes.get("LineNumberTable"); 44.94 + Assert.check(lnt.line_number_table_length == expectedLNT.length, 44.95 + "The LineNumberTable found has a length different to the expected one"); 44.96 + int i = 0; 44.97 + for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) { 44.98 + Assert.check(entry.line_number == expectedLNT[i][0] && 44.99 + entry.start_pc == expectedLNT[i][1], 44.100 + "LNT entry at pos " + i + " differ from expected." + 44.101 + "Found " + entry.line_number + ":" + entry.start_pc + 44.102 + ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]); 44.103 + i++; 44.104 + } 44.105 + } 44.106 + } 44.107 + Assert.check(methodFound, "The seek method was not found"); 44.108 + } 44.109 + 44.110 + void error(String msg) { 44.111 + throw new AssertionError(msg); 44.112 + } 44.113 + 44.114 +}
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 45.2 +++ b/test/tools/javac/T8022053/UnverifiableInitForNestedLocalClassTest.java Fri Aug 23 14:17:49 2013 -0700 45.3 @@ -0,0 +1,73 @@ 45.4 +/* 45.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 45.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 45.7 + * 45.8 + * This code is free software; you can redistribute it and/or modify it 45.9 + * under the terms of the GNU General Public License version 2 only, as 45.10 + * published by the Free Software Foundation. 45.11 + * 45.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 45.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 45.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 45.15 + * version 2 for more details (a copy is included in the LICENSE file that 45.16 + * accompanied this code). 45.17 + * 45.18 + * You should have received a copy of the GNU General Public License version 45.19 + * 2 along with this work; if not, write to the Free Software Foundation, 45.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 45.21 + * 45.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 45.23 + * or visit www.oracle.com if you need additional information or have any 45.24 + * questions. 45.25 + */ 45.26 + 45.27 +/* 45.28 + * @test 45.29 + * @bug 8022053 45.30 + * @summary 8022053: javac generates unverifiable initializer for nested subclass of local class 45.31 + * @run main UnverifiableInitForNestedLocalClassTest 45.32 + */ 45.33 + 45.34 +public class UnverifiableInitForNestedLocalClassTest { 45.35 + 45.36 + public static void main(final String[] args) { 45.37 + test("test"); 45.38 + } 45.39 + 45.40 + static void test(final String arg) { 45.41 + final String inlined = " inlined "; 45.42 + class LocalClass { 45.43 + String m() { 45.44 + return "LocalClass " + arg + inlined; 45.45 + } 45.46 + 45.47 + class SubClass extends LocalClass { 45.48 + @Override 45.49 + String m() { 45.50 + return "SubClass " + arg + inlined; 45.51 + } 45.52 + } 45.53 + 45.54 + class SubSubClass extends SubClass { 45.55 + @Override 45.56 + String m() { 45.57 + return "SubSubClass " + arg + inlined; 45.58 + } 45.59 + } 45.60 + 45.61 + class AnotherLocal { 45.62 + class AnotherSub extends LocalClass { 45.63 + @Override 45.64 + String m() { 45.65 + return "AnotherSub " + arg + inlined; 45.66 + } 45.67 + } 45.68 + } 45.69 + } 45.70 + System.out.println(new LocalClass().m()); 45.71 + System.out.println(new LocalClass().new SubClass().m()); 45.72 + System.out.println(new LocalClass().new SubSubClass().m()); 45.73 + System.out.println(new LocalClass().new AnotherLocal().new AnotherSub().m()); 45.74 + } 45.75 + 45.76 +}
46.1 --- a/test/tools/javac/TestPkgInfo.java Thu Aug 22 09:10:22 2013 -0700 46.2 +++ b/test/tools/javac/TestPkgInfo.java Fri Aug 23 14:17:49 2013 -0700 46.3 @@ -1,5 +1,5 @@ 46.4 /* 46.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 46.6 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 46.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 46.8 * 46.9 * This code is free software; you can redistribute it and/or modify it 46.10 @@ -23,8 +23,10 @@ 46.11 46.12 /* 46.13 * @test 46.14 - * @bug 6960424 46.15 - * @summary new option -Xpkginfo for better control of when package-info.class is generated 46.16 + * @bug 6960424 8022161 46.17 + * @summary new option -Xpkginfo for better control of when package-info.class 46.18 + * is generated, also ensures no failures if package-info.java is 46.19 + * not available. 46.20 */ 46.21 46.22 import java.io.*; 46.23 @@ -43,8 +45,11 @@ 46.24 public static void main(String... args) throws Exception { 46.25 new TestPkgInfo().run(args); 46.26 } 46.27 - 46.28 public void run(String... args) throws Exception { 46.29 + testPositive(); 46.30 + testNoExceptions(); 46.31 + } 46.32 + public void testPositive(String... args) throws Exception { 46.33 boolean[] booleanValues = { false, true }; 46.34 for (OptKind ok: OptKind.values()) { 46.35 for (boolean sr: booleanValues) { 46.36 @@ -65,6 +70,32 @@ 46.37 throw new Exception(errors + " errors occurred"); 46.38 } 46.39 46.40 + /** this should throw no exceptions **/ 46.41 + void testNoExceptions() throws Exception { 46.42 + count++; 46.43 + System.err.println("Test " + count + ": ALWAYS nofile"); 46.44 + 46.45 + StringBuilder sb = new StringBuilder(); 46.46 + sb.append("package test; class Hello{}"); 46.47 + 46.48 + // test specific tmp directory 46.49 + File tmpDir = new File("tmp.test" + count); 46.50 + File classesDir = new File(tmpDir, "classes"); 46.51 + classesDir.mkdirs(); 46.52 + File javafile = new File(new File(tmpDir, "src"), "Hello.java"); 46.53 + writeFile(javafile, sb.toString()); 46.54 + // build up list of options and files to be compiled 46.55 + List<String> opts = new ArrayList<>(); 46.56 + List<File> files = new ArrayList<>(); 46.57 + 46.58 + opts.add("-d"); 46.59 + opts.add(classesDir.getPath()); 46.60 + opts.add("-Xpkginfo:always"); 46.61 + files.add(javafile); 46.62 + 46.63 + compile(opts, files); 46.64 + } 46.65 + 46.66 void test(OptKind ok, boolean sr, boolean cr, boolean rr) throws Exception { 46.67 count++; 46.68 System.err.println("Test " + count + ": ok:" + ok + " sr:" + sr + " cr:" + cr + " rr:" + rr); 46.69 @@ -91,15 +122,15 @@ 46.70 writeFile(pkginfo_java, sb.toString()); 46.71 46.72 // build up list of options and files to be compiled 46.73 - List<String> opts = new ArrayList<String>(); 46.74 - List<File> files = new ArrayList<File>(); 46.75 + List<String> opts = new ArrayList<>(); 46.76 + List<File> files = new ArrayList<>(); 46.77 46.78 opts.add("-d"); 46.79 opts.add(classesDir.getPath()); 46.80 if (ok.opt != null) 46.81 opts.add(ok.opt); 46.82 //opts.add("-verbose"); 46.83 - files.add(pkginfo_java); 46.84 + files.add(pkginfo_java); 46.85 46.86 compile(opts, files); 46.87 46.88 @@ -134,7 +165,7 @@ 46.89 /** Compile files with options provided. */ 46.90 void compile(List<String> opts, List<File> files) throws Exception { 46.91 System.err.println("javac: " + opts + " " + files); 46.92 - List<String> args = new ArrayList<String>(); 46.93 + List<String> args = new ArrayList<>(); 46.94 args.addAll(opts); 46.95 for (File f: files) 46.96 args.add(f.getPath());
47.1 --- a/test/tools/javac/defaultMethods/defaultMethodExecution/DefaultMethodRegressionTests.java Thu Aug 22 09:10:22 2013 -0700 47.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 47.3 @@ -1,138 +0,0 @@ 47.4 -/* 47.5 - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 47.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 47.7 - * 47.8 - * This code is free software; you can redistribute it and/or modify it 47.9 - * under the terms of the GNU General Public License version 2 only, as 47.10 - * published by the Free Software Foundation. Oracle designates this 47.11 - * particular file as subject to the "Classpath" exception as provided 47.12 - * by Oracle in the LICENSE file that accompanied this code. 47.13 - * 47.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 47.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 47.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 47.17 - * version 2 for more details (a copy is included in the LICENSE file that 47.18 - * accompanied this code). 47.19 - * 47.20 - * You should have received a copy of the GNU General Public License version 47.21 - * 2 along with this work; if not, write to the Free Software Foundation, 47.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 47.23 - * 47.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 47.25 - * or visit www.oracle.com if you need additional information or have any 47.26 - * questions. 47.27 - */ 47.28 - 47.29 -/** 47.30 - * @test 47.31 - * @ignore 8007517: DefaultMethodRegressionTests.java fail in TL 47.32 - * @bug 8003639 47.33 - * @summary convert lambda testng tests to jtreg and add them 47.34 - * @run testng DefaultMethodRegressionTests 47.35 - */ 47.36 - 47.37 -import java.util.ArrayList; 47.38 -import java.util.Arrays; 47.39 -import java.util.List; 47.40 -import org.testng.annotations.Test; 47.41 - 47.42 -import static org.testng.Assert.*; 47.43 - 47.44 -/** 47.45 - * This set of classes/interfaces (K/I/C) is specially designed to expose a 47.46 - * bug in the JVM where it did not find some overloaded methods in some 47.47 - * specific situations. (fixed by hotspot changeset ffb9316fd9ed) 47.48 - */ 47.49 -interface K { 47.50 - int bbb(Long l); 47.51 -} 47.52 - 47.53 -interface I extends K { 47.54 - default void aaa() {} 47.55 - default void aab() {} 47.56 - default void aac() {} 47.57 - 47.58 - default int bbb(Integer i) { return 22; } 47.59 - default int bbb(Float f) { return 33; } 47.60 - default int bbb(Long l) { return 44; } 47.61 - default int bbb(Double d) { return 55; } 47.62 - default int bbb(String s) { return 66; } 47.63 - 47.64 - default void caa() {} 47.65 - default void cab() {} 47.66 - default void cac() {} 47.67 -} 47.68 - 47.69 -class C implements I {} 47.70 - 47.71 -public class DefaultMethodRegressionTests { 47.72 - 47.73 - @Test(groups = "vm") 47.74 - public void testLostOverloadedMethod() { 47.75 - C c = new C(); 47.76 - assertEquals(c.bbb(new Integer(1)), 22); 47.77 - assertEquals(c.bbb(new Float(1.1)), 33); 47.78 - assertEquals(c.bbb(new Long(1L)), 44); 47.79 - assertEquals(c.bbb(new Double(0.01)), 55); 47.80 - assertEquals(c.bbb(new String("")), 66); 47.81 - } 47.82 - 47.83 - // Test to ensure that the inference verifier accepts older classfiles 47.84 - // with classes that implement interfaces with defaults. 47.85 - @Test(groups = "vm") 47.86 - public void testInferenceVerifier() { 47.87 - // interface I { int m() default { return 99; } } 47.88 - byte I_bytes[] = { 47.89 - (byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x33, 47.90 - 0x00, 0x08, 0x07, 0x00, 0x06, 0x07, 0x00, 0x07, 47.91 - 0x01, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x01, 0x00, 47.92 - 0x03, 0x28, 0x29, 0x49, 0x01, 0x00, 0x04, 0x43, 47.93 - 0x6f, 0x64, 0x65, 0x01, 0x00, 0x01, 0x49, 0x01, 47.94 - 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 47.95 - 0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 47.96 - 0x63, 0x74, 0x06, 0x00, 0x00, 0x01, 0x00, 0x02, 47.97 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, 47.98 - 0x00, 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0x05, 47.99 - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x01, 47.100 - 0x00, 0x00, 0x00, 0x03, 0x10, 0x63, (byte)0xac, 0x00, 47.101 - 0x00, 0x00, 0x00, 0x00, 0x00 47.102 - }; 47.103 - // public class C implements I {} /* -target 1.5 */ 47.104 - byte C_bytes[] = { 47.105 - (byte)0xca, (byte)0xfe, (byte)0xba, (byte)0xbe, 0x00, 0x00, 0x00, 0x31, 47.106 - 0x00, 0x0c, 0x0a, 0x00, 0x03, 0x00, 0x08, 0x07, 47.107 - 0x00, 0x09, 0x07, 0x00, 0x0a, 0x07, 0x00, 0x0b, 47.108 - 0x01, 0x00, 0x06, 0x3c, 0x69, 0x6e, 0x69, 0x74, 47.109 - 0x3e, 0x01, 0x00, 0x03, 0x28, 0x29, 0x56, 0x01, 47.110 - 0x00, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x0c, 0x00, 47.111 - 0x05, 0x00, 0x06, 0x01, 0x00, 0x01, 0x43, 0x01, 47.112 - 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 47.113 - 0x61, 0x6e, 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 47.114 - 0x63, 0x74, 0x01, 0x00, 0x01, 0x49, 0x00, 0x21, 47.115 - 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 47.116 - 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x05, 47.117 - 0x00, 0x06, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 47.118 - 0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 47.119 - 0x00, 0x05, 0x2a, (byte)0xb7, 0x00, 0x01, (byte)0xb1, 0x00, 47.120 - 0x00, 0x00, 0x00, 0x00, 0x00 47.121 - }; 47.122 - 47.123 - ClassLoader cl = new ClassLoader() { 47.124 - protected Class<?> findClass(String name) { 47.125 - if (name.equals("I")) { 47.126 - return defineClass("I", I_bytes, 0, I_bytes.length); 47.127 - } else if (name.equals("C")) { 47.128 - return defineClass("C", C_bytes, 0, C_bytes.length); 47.129 - } else { 47.130 - return null; 47.131 - } 47.132 - } 47.133 - }; 47.134 - try { 47.135 - Class.forName("C", true, cl); 47.136 - } catch (Exception e) { 47.137 - // unmodified verifier will throw VerifyError 47.138 - fail("No exception should be thrown"); 47.139 - } 47.140 - } 47.141 -}
48.1 --- a/test/tools/javac/diags/examples/AlreadyDefinedStaticImport/AlreadDefinedStaticImport.java Thu Aug 22 09:10:22 2013 -0700 48.2 +++ b/test/tools/javac/diags/examples/AlreadyDefinedStaticImport/AlreadDefinedStaticImport.java Fri Aug 23 14:17:49 2013 -0700 48.3 @@ -23,5 +23,5 @@ 48.4 48.5 // key: compiler.err.already.defined.static.single.import 48.6 48.7 -import static p.E1.A; 48.8 +import p.E1.A; 48.9 import static p.E2.A;
49.1 --- a/test/tools/javac/diags/examples/AlreadyDefinedStaticImport/p/E1.java Thu Aug 22 09:10:22 2013 -0700 49.2 +++ b/test/tools/javac/diags/examples/AlreadyDefinedStaticImport/p/E1.java Fri Aug 23 14:17:49 2013 -0700 49.3 @@ -23,4 +23,6 @@ 49.4 49.5 package p; 49.6 49.7 -public enum E1 { A, B, C} 49.8 +public class E1 { 49.9 + public static class A { } 49.10 +}
50.1 --- a/test/tools/javac/diags/examples/AlreadyDefinedStaticImport/p/E2.java Thu Aug 22 09:10:22 2013 -0700 50.2 +++ b/test/tools/javac/diags/examples/AlreadyDefinedStaticImport/p/E2.java Fri Aug 23 14:17:49 2013 -0700 50.3 @@ -23,4 +23,6 @@ 50.4 50.5 package p; 50.6 50.7 -public enum E2 { A, B, C } 50.8 +public class E2 { 50.9 + public static class A { } 50.10 +}
51.1 --- a/test/tools/javac/diags/examples/IncompatibleThrownTypesInLambda.java Thu Aug 22 09:10:22 2013 -0700 51.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 51.3 @@ -1,32 +0,0 @@ 51.4 -/* 51.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 51.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 51.7 - * 51.8 - * This code is free software; you can redistribute it and/or modify it 51.9 - * under the terms of the GNU General Public License version 2 only, as 51.10 - * published by the Free Software Foundation. 51.11 - * 51.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 51.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 51.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 51.15 - * version 2 for more details (a copy is included in the LICENSE file that 51.16 - * accompanied this code). 51.17 - * 51.18 - * You should have received a copy of the GNU General Public License version 51.19 - * 2 along with this work; if not, write to the Free Software Foundation, 51.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 51.21 - * 51.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 51.23 - * or visit www.oracle.com if you need additional information or have any 51.24 - * questions. 51.25 - */ 51.26 - 51.27 -// key: compiler.err.incompatible.thrown.types.in.lambda 51.28 - 51.29 -class IncompatibleThrownTypesInLambda { 51.30 - interface SAM { 51.31 - void m(); 51.32 - } 51.33 - 51.34 - SAM s = ()-> { throw new Exception(); }; 51.35 -}
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 52.2 +++ b/test/tools/javac/diags/examples/ObsoleteSourceAndTarget.java Fri Aug 23 14:17:49 2013 -0700 52.3 @@ -0,0 +1,32 @@ 52.4 +/* 52.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 52.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 52.7 + * 52.8 + * This code is free software; you can redistribute it and/or modify it 52.9 + * under the terms of the GNU General Public License version 2 only, as 52.10 + * published by the Free Software Foundation. 52.11 + * 52.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 52.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 52.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 52.15 + * version 2 for more details (a copy is included in the LICENSE file that 52.16 + * accompanied this code). 52.17 + * 52.18 + * You should have received a copy of the GNU General Public License version 52.19 + * 2 along with this work; if not, write to the Free Software Foundation, 52.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 52.21 + * 52.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 52.23 + * or visit www.oracle.com if you need additional information or have any 52.24 + * questions. 52.25 + */ 52.26 + 52.27 +// key: compiler.warn.option.obsolete.source 52.28 +// key: compiler.warn.option.obsolete.target 52.29 +// key: compiler.warn.option.obsolete.suppression 52.30 +// key: compiler.warn.source.no.bootclasspath 52.31 +// options: -source 1.5 -target 1.5 52.32 + 52.33 +class ObsoleteSourceAndTarget { 52.34 + public static void foo() {;} 52.35 +}
53.1 --- a/test/tools/javac/generics/7015430/T7015430_1.out Thu Aug 22 09:10:22 2013 -0700 53.2 +++ b/test/tools/javac/generics/7015430/T7015430_1.out Fri Aug 23 14:17:49 2013 -0700 53.3 @@ -1,13 +1,13 @@ 53.4 T7015430.java:42:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 53.5 T7015430.java:42:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 53.6 T7015430.java:51:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 53.7 -T7015430.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 53.8 +T7015430.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 53.9 T7015430.java:69:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 53.10 T7015430.java:69:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 53.11 T7015430.java:78:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 53.12 -T7015430.java:78:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 53.13 +T7015430.java:78:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 53.14 T7015430.java:105:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 53.15 -T7015430.java:105:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 53.16 +T7015430.java:105:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 53.17 T7015430.java:114:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 53.18 T7015430.java:114:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 53.19 T7015430.java:42:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
54.1 --- a/test/tools/javac/generics/7015430/T7015430_2.out Thu Aug 22 09:10:22 2013 -0700 54.2 +++ b/test/tools/javac/generics/7015430/T7015430_2.out Fri Aug 23 14:17:49 2013 -0700 54.3 @@ -1,15 +1,15 @@ 54.4 T7015430.java:42:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 54.5 -T7015430.java:42:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 54.6 +T7015430.java:42:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 54.7 T7015430.java:51:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 54.8 -T7015430.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 54.9 +T7015430.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 54.10 T7015430.java:69:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 54.11 -T7015430.java:69:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 54.12 +T7015430.java:69:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 54.13 T7015430.java:78:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 54.14 -T7015430.java:78:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 54.15 +T7015430.java:78:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 54.16 T7015430.java:105:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 54.17 -T7015430.java:105:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 54.18 +T7015430.java:105:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 54.19 T7015430.java:114:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430 54.20 -T7015430.java:114:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException> 54.21 +T7015430.java:114:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<E> 54.22 T7015430.java:130:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception 54.23 1 error 54.24 12 warnings
55.1 --- a/test/tools/javac/generics/7151802/T7151802.out Thu Aug 22 09:10:22 2013 -0700 55.2 +++ b/test/tools/javac/generics/7151802/T7151802.out Fri Aug 23 14:17:49 2013 -0700 55.3 @@ -1,6 +1,6 @@ 55.4 T7151802.java:14:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get1, Z, T7151802.Foo, kindname.class, T7151802 55.5 T7151802.java:22:30: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get3, T7151802.Foo<Z>, T7151802.Foo, kindname.class, T7151802 55.6 -T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo<java.lang.Object> 55.7 +T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo<Z> 55.8 T7151802.java:30:36: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get5, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T7151802 55.9 T7151802.java:38:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get7, T7151802.Foo<java.lang.String>, T7151802.Foo, kindname.class, T7151802 55.10 T7151802.java:38:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo<java.lang.String>
56.1 --- a/test/tools/javac/generics/8016640/T8016640.java Thu Aug 22 09:10:22 2013 -0700 56.2 +++ b/test/tools/javac/generics/8016640/T8016640.java Fri Aug 23 14:17:49 2013 -0700 56.3 @@ -1,10 +1,11 @@ 56.4 /* 56.5 * @test /nodynamiccopyright/ 56.6 - * @bug 8016640 56.7 + * @bug 8016640 8022508 56.8 * @summary compiler hangs if the generics arity of a base class is wrong 56.9 * @compile/fail/ref=T8016640.out -XDrawDiagnostics T8016640.java 56.10 */ 56.11 class T8016640 { 56.12 static class Foo<X,Y> { } 56.13 static class BadFoo<T> extends Foo<T> { } 56.14 + static class SubBadFoo<T> extends BadFoo<T> { } 56.15 }
57.1 --- a/test/tools/javac/generics/inference/6718364/T6718364.out Thu Aug 22 09:10:22 2013 -0700 57.2 +++ b/test/tools/javac/generics/inference/6718364/T6718364.out Fri Aug 23 14:17:49 2013 -0700 57.3 @@ -1,3 +1,3 @@ 57.4 T6718364.java:13:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6718364.X<T>,T, T6718364.X<T6718364.X<java.lang.Integer>>,T6718364.X, kindname.class, T6718364 57.5 -T6718364.java:13:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6718364.X, T6718364.X<java.lang.Integer> 57.6 +T6718364.java:13:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6718364.X, T 57.7 2 warnings
58.1 --- a/test/tools/javac/generics/inference/7177306/T7177306a.out Thu Aug 22 09:10:22 2013 -0700 58.2 +++ b/test/tools/javac/generics/inference/7177306/T7177306a.out Fri Aug 23 14:17:49 2013 -0700 58.3 @@ -1,5 +1,5 @@ 58.4 T7177306a.java:13:33: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, java.util.List<E>, java.util.List, kindname.class, T7177306a 58.5 -T7177306a.java:13:34: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.List, java.util.List<java.lang.Object> 58.6 +T7177306a.java:13:34: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.util.List, java.util.List<E> 58.7 T7177306a.java:13:33: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7177306a, T7177306a<java.lang.Object> 58.8 - compiler.err.warnings.and.werror 58.9 1 error
59.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 59.2 +++ b/test/tools/javac/lambda/8021567/T8021567.java Fri Aug 23 14:17:49 2013 -0700 59.3 @@ -0,0 +1,26 @@ 59.4 +/* 59.5 + * @test /nodynamiccopyright/ 59.6 + * @bug 8021567 59.7 + * @summary Javac doesn't report "java: reference to method is ambiguous" any more 59.8 + * @compile/fail/ref=T8021567.out -XDrawDiagnostics T8021567.java 59.9 + */ 59.10 + 59.11 +class T8021567 { 59.12 + 59.13 + interface I_int { int m(); } 59.14 + 59.15 + interface I_char { char m(); } 59.16 + 59.17 + interface I_byte { byte m(); } 59.18 + 59.19 + void m(I_byte b) { } 59.20 + void m(I_char b) { } 59.21 + void m(I_int b) { } 59.22 + 59.23 + void test() { 59.24 + m(() -> 1); //ambiguous 59.25 + m(() -> 256); //ok - only method(I_int) applicable 59.26 + m(() -> { int i = 1; return i; }); //ok - only method(I_int) applicable 59.27 + m(() -> { int i = 256; return i; }); //ok - only method(I_int) applicable 59.28 + } 59.29 +}
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 60.2 +++ b/test/tools/javac/lambda/8021567/T8021567.out Fri Aug 23 14:17:49 2013 -0700 60.3 @@ -0,0 +1,2 @@ 60.4 +T8021567.java:21:9: compiler.err.ref.ambiguous: m, kindname.method, m(T8021567.I_byte), T8021567, kindname.method, m(T8021567.I_char), T8021567 60.5 +1 error
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 61.2 +++ b/test/tools/javac/lambda/8021567/T8021567b.java Fri Aug 23 14:17:49 2013 -0700 61.3 @@ -0,0 +1,45 @@ 61.4 +/* 61.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 61.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 61.7 + * 61.8 + * This code is free software; you can redistribute it and/or modify it 61.9 + * under the terms of the GNU General Public License version 2 only, as 61.10 + * published by the Free Software Foundation. 61.11 + * 61.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 61.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 61.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 61.15 + * version 2 for more details (a copy is included in the LICENSE file that 61.16 + * accompanied this code). 61.17 + * 61.18 + * You should have received a copy of the GNU General Public License version 61.19 + * 2 along with this work; if not, write to the Free Software Foundation, 61.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 61.21 + * 61.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 61.23 + * or visit www.oracle.com if you need additional information or have any 61.24 + * questions. 61.25 + */ 61.26 + 61.27 +/* 61.28 + * @test 61.29 + * @bug 8021567 61.30 + * @summary Javac doesn't report "java: reference to method is ambiguous" any more 61.31 + */ 61.32 + 61.33 +public class T8021567b { 61.34 + 61.35 + interface SAM { 61.36 + int m(); 61.37 + } 61.38 + 61.39 + public static void main(String argv[]) { 61.40 + test(); 61.41 + } 61.42 + 61.43 + static boolean test() { 61.44 + final int i = 0; 61.45 + SAM s = () -> i; 61.46 + return (s.m() == 0); 61.47 + } 61.48 +}
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 62.2 +++ b/test/tools/javac/lambda/ExceptionsInLambda.java Fri Aug 23 14:17:49 2013 -0700 62.3 @@ -0,0 +1,61 @@ 62.4 +/* 62.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 62.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 62.7 + * 62.8 + * This code is free software; you can redistribute it and/or modify it 62.9 + * under the terms of the GNU General Public License version 2 only, as 62.10 + * published by the Free Software Foundation. 62.11 + * 62.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 62.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 62.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 62.15 + * version 2 for more details (a copy is included in the LICENSE file that 62.16 + * accompanied this code). 62.17 + * 62.18 + * You should have received a copy of the GNU General Public License version 62.19 + * 2 along with this work; if not, write to the Free Software Foundation, 62.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 62.21 + * 62.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 62.23 + * or visit www.oracle.com if you need additional information or have any 62.24 + * questions. 62.25 + */ 62.26 + 62.27 +/* 62.28 + * @test 62.29 + * @bug 8015809 62.30 + * @summary Producing individual errors for uncaught undeclared exceptions inside lambda expressions, instead of one error for whole lambda 62.31 + * @compile/fail/ref=ExceptionsInLambda.out -XDrawDiagnostics ExceptionsInLambda.java 62.32 + */ 62.33 + 62.34 +import java.io.File; 62.35 +import java.io.FileInputStream; 62.36 +import java.io.FileReader; 62.37 +import java.io.InputStream; 62.38 +import java.io.Reader; 62.39 + 62.40 +public class ExceptionsInLambda { 62.41 + 62.42 + public static void main(Runnable p, File f) { 62.43 + main(() -> { 62.44 + StringBuilder sb = new StringBuilder(); 62.45 + 62.46 + Reader in = new FileReader(f); 62.47 + int r; 62.48 + 62.49 + while ((r = in.read()) != (-1)) { 62.50 + sb.append((char) r); 62.51 + } 62.52 + }, f); 62.53 + 62.54 + doOpen(() -> new FileInputStream(f)); 62.55 + } 62.56 + 62.57 + public static InputStream doOpen(Open open) { 62.58 + return open.open(); 62.59 + } 62.60 + 62.61 + public interface Open { 62.62 + public InputStream open(); 62.63 + } 62.64 +}
63.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 63.2 +++ b/test/tools/javac/lambda/ExceptionsInLambda.out Fri Aug 23 14:17:49 2013 -0700 63.3 @@ -0,0 +1,4 @@ 63.4 +ExceptionsInLambda.java:43:25: compiler.err.unreported.exception.need.to.catch.or.throw: java.io.FileNotFoundException 63.5 +ExceptionsInLambda.java:46:32: compiler.err.unreported.exception.need.to.catch.or.throw: java.io.IOException 63.6 +ExceptionsInLambda.java:51:22: compiler.err.unreported.exception.need.to.catch.or.throw: java.io.FileNotFoundException 63.7 +3 errors
64.1 --- a/test/tools/javac/lambda/TargetType21.out Thu Aug 22 09:10:22 2013 -0700 64.2 +++ b/test/tools/javac/lambda/TargetType21.out Fri Aug 23 14:17:49 2013 -0700 64.3 @@ -1,6 +1,5 @@ 64.4 TargetType21.java:28:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM2), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21 64.5 -TargetType21.java:28:14: compiler.err.incompatible.thrown.types.in.lambda: java.lang.Exception 64.6 TargetType21.java:29:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM2), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21 64.7 TargetType21.java:30:13: compiler.err.prob.found.req: (compiler.misc.cyclic.inference: A) 64.8 TargetType21.java:31:9: compiler.err.ref.ambiguous: call, kindname.method, call(TargetType21.SAM1), TargetType21, kindname.method, <R,A>call(TargetType21.SAM3<R,A>), TargetType21 64.9 -5 errors 64.10 +4 errors
65.1 --- a/test/tools/javac/lambda/TargetType59.java Thu Aug 22 09:10:22 2013 -0700 65.2 +++ b/test/tools/javac/lambda/TargetType59.java Fri Aug 23 14:17:49 2013 -0700 65.3 @@ -34,15 +34,15 @@ 65.4 65.5 class TargetType59 { 65.6 65.7 - <T, R> Collector<T, R> m(Supplier<? extends R> supplier, BiConsumer<R, T> accumulator) { 65.8 + <T, R> Collector<T, String, R> m(Supplier<? extends R> supplier, BiConsumer<R, T> accumulator) { 65.9 return null; 65.10 } 65.11 65.12 - <T, C extends Collection<T>> Collector<T,C> test1(Supplier<C> collectionFactory) { 65.13 + <T, C extends Collection<T>> Collector<T, String, C> test1(Supplier<C> collectionFactory) { 65.14 return m(collectionFactory, Collection::add); 65.15 } 65.16 65.17 - Collector<String, StringBuilder> test2(Supplier<StringBuilder> sb) { 65.18 + Collector<String, String, StringBuilder> test2(Supplier<StringBuilder> sb) { 65.19 return m(sb, StringBuilder::append); 65.20 } 65.21 }
66.1 --- a/test/tools/javac/lambda/TargetType62.java Thu Aug 22 09:10:22 2013 -0700 66.2 +++ b/test/tools/javac/lambda/TargetType62.java Fri Aug 23 14:17:49 2013 -0700 66.3 @@ -38,8 +38,8 @@ 66.4 return g(classifier, TreeMap::new, m(HashSet::new)); 66.5 } 66.6 66.7 - <R> Collector<Integer, R> m(Supplier<R> s) { return null; } 66.8 + <R> Collector<Integer, String, R> m(Supplier<R> s) { return null; } 66.9 66.10 <T, K, D, M extends Map<K, D>> 66.11 - Collector<T, M> g(Function<T, K> classifier, Supplier<M> mapFactory, Collector<T, D> downstream) { return null; } 66.12 + Collector<T, String, M> g(Function<T, K> classifier, Supplier<M> mapFactory, Collector<T, String, D> downstream) { return null; } 66.13 }
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 67.2 +++ b/test/tools/javac/processing/errors/EnsureMirroredTypeException/Processor.java Fri Aug 23 14:17:49 2013 -0700 67.3 @@ -0,0 +1,100 @@ 67.4 +/* 67.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 67.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 67.7 + * 67.8 + * This code is free software; you can redistribute it and/or modify it 67.9 + * under the terms of the GNU General Public License version 2 only, as 67.10 + * published by the Free Software Foundation. 67.11 + * 67.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 67.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 67.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 67.15 + * version 2 for more details (a copy is included in the LICENSE file that 67.16 + * accompanied this code). 67.17 + * 67.18 + * You should have received a copy of the GNU General Public License version 67.19 + * 2 along with this work; if not, write to the Free Software Foundation, 67.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 67.21 + * 67.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 67.23 + * or visit www.oracle.com if you need additional information or have any 67.24 + * questions. 67.25 + */ 67.26 + 67.27 +import java.lang.annotation.*; 67.28 +import java.util.*; 67.29 +import javax.annotation.processing.*; 67.30 +import javax.lang.model.element.*; 67.31 +import javax.lang.model.type.DeclaredType; 67.32 +import javax.lang.model.type.MirroredTypeException; 67.33 +import javax.lang.model.type.TypeMirror; 67.34 +import javax.lang.model.type.TypeKind; 67.35 +import javax.tools.*; 67.36 + 67.37 +import com.sun.tools.javac.util.Assert; 67.38 +import com.sun.tools.javac.code.Symbol; 67.39 +import static com.sun.tools.javac.code.Symbol.TypeSymbol; 67.40 + 67.41 +public class Processor extends JavacTestingAbstractProcessor { 67.42 + 67.43 + @Override 67.44 + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 67.45 + for (Element e : roundEnv.getElementsAnnotatedWith(A.class)) { 67.46 + A rtg = e.getAnnotation(A.class); 67.47 + 67.48 + try { 67.49 + rtg.a(); 67.50 + Assert.check(false); //Should not reach here 67.51 + } catch (MirroredTypeException ex) { 67.52 + TypeMirror tm = ex.getTypeMirror(); 67.53 + Assert.check(tm.getKind() == TypeKind.ERROR); 67.54 + 67.55 + TypeElement elm = (TypeElement)((DeclaredType)tm).asElement(); 67.56 + Assert.check(elm.getQualifiedName().toString(). 67.57 + endsWith("some.path.to.SomeUnknownClass$Inner")); 67.58 + 67.59 + TypeSymbol sym = (TypeSymbol)elm; 67.60 + Assert.check(sym.name.contentEquals("some.path.to.SomeUnknownClass$Inner")); 67.61 + } 67.62 + } 67.63 + for (Element e : roundEnv.getElementsAnnotatedWith(B.class)) { 67.64 + B rtg = e.getAnnotation(B.class); 67.65 + 67.66 + try { 67.67 + rtg.a(); 67.68 + Assert.check(false); //Should not reach here 67.69 + } catch (MirroredTypeException ex) { 67.70 + TypeMirror tm = ex.getTypeMirror(); 67.71 + Assert.check(tm.getKind() == TypeKind.ERROR); 67.72 + 67.73 + TypeElement elm = (TypeElement)((DeclaredType)tm).asElement(); 67.74 + Assert.check(elm.getQualifiedName().toString(). 67.75 + endsWith("SomeUnknownClass")); 67.76 + 67.77 + TypeSymbol sym = (TypeSymbol)elm; 67.78 + Assert.check(sym.name.contentEquals("SomeUnknownClass")); 67.79 + } 67.80 + } 67.81 + for (Element e : roundEnv.getElementsAnnotatedWith(C.class)) { 67.82 + C rtg = e.getAnnotation(C.class); 67.83 + 67.84 + try { 67.85 + rtg.a(); 67.86 + Assert.check(false); //Should not reach here 67.87 + } catch (AnnotationTypeMismatchException ex) { 67.88 + ; 67.89 + } 67.90 + } 67.91 + return true; 67.92 + } 67.93 + 67.94 + @interface A { 67.95 + Class<?> a(); 67.96 + } 67.97 + @interface B { 67.98 + Class<?> a(); 67.99 + } 67.100 + @interface C { 67.101 + Class<?> a(); 67.102 + } 67.103 +}
68.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 68.2 +++ b/test/tools/javac/processing/errors/EnsureMirroredTypeException/Source.java Fri Aug 23 14:17:49 2013 -0700 68.3 @@ -0,0 +1,17 @@ 68.4 +/* 68.5 + * @test /nodynamiccopyright/ 68.6 + * @bug 8019243 68.7 + * @summary AnnotationTypeMismatchException instead of MirroredTypeException 68.8 + * @library /tools/javac/lib 68.9 + * @build JavacTestingAbstractProcessor Processor 68.10 + * @compile/fail/ref=Source.out -XDrawDiagnostics -processor Processor Source.java 68.11 + */ 68.12 + 68.13 +@Processor.A(a=some.path.to.SomeUnknownClass$Inner.class) 68.14 +class Source1{} 68.15 + 68.16 +@Processor.B(a=SomeUnknownClass.class) 68.17 +class Source2{} 68.18 + 68.19 +@Processor.C(a=SomeUnknownClass.clas) // this is not a class literal 68.20 +class Source3{}
69.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 69.2 +++ b/test/tools/javac/processing/errors/EnsureMirroredTypeException/Source.out Fri Aug 23 14:17:49 2013 -0700 69.3 @@ -0,0 +1,4 @@ 69.4 +Source.java:10:28: compiler.err.doesnt.exist: some.path.to 69.5 +Source.java:13:16: compiler.err.cant.resolve: kindname.class, SomeUnknownClass, , 69.6 +Source.java:16:16: compiler.err.cant.resolve: kindname.variable, SomeUnknownClass, , 69.7 +3 errors
70.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 70.2 +++ b/test/tools/javac/processing/errors/TestClassNames.java Fri Aug 23 14:17:49 2013 -0700 70.3 @@ -0,0 +1,47 @@ 70.4 +/* 70.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 70.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 70.7 + * 70.8 + * This code is free software; you can redistribute it and/or modify it 70.9 + * under the terms of the GNU General Public License version 2 only, as 70.10 + * published by the Free Software Foundation. 70.11 + * 70.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 70.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 70.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 70.15 + * version 2 for more details (a copy is included in the LICENSE file that 70.16 + * accompanied this code). 70.17 + * 70.18 + * You should have received a copy of the GNU General Public License version 70.19 + * 2 along with this work; if not, write to the Free Software Foundation, 70.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 70.21 + * 70.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 70.23 + * or visit www.oracle.com if you need additional information or have any 70.24 + * questions. 70.25 + */ 70.26 + 70.27 +/* 70.28 + * @test 70.29 + * @bug 7071377 70.30 + * @summary verify if erroneous class names are rejected 70.31 + * @library /tools/javac/lib 70.32 + * @build TestClassNames JavacTestingAbstractProcessor CompileFail 70.33 + * @run main CompileFail ERROR -processor TestClassNames TestClassNames.x.y 70.34 + * @run main CompileFail ERROR -processor TestClassNames x.y.TestClassNames 70.35 + * @run main CompileFail ERROR -processor NoClass NoClass.x.y 70.36 + */ 70.37 + 70.38 +import java.util.Set; 70.39 +import javax.annotation.processing.*; 70.40 +import javax.lang.model.element.*; 70.41 + 70.42 +/** 70.43 + * No-op processor; should not be run. 70.44 + */ 70.45 +public class TestClassNames extends JavacTestingAbstractProcessor { 70.46 + public boolean process(Set<? extends TypeElement> annotations, 70.47 + RoundEnvironment roundEnvironment) { 70.48 + return true; 70.49 + } 70.50 +}
71.1 --- a/test/tools/javac/processing/model/testgetallmembers/Main.java Thu Aug 22 09:10:22 2013 -0700 71.2 +++ b/test/tools/javac/processing/model/testgetallmembers/Main.java Fri Aug 23 14:17:49 2013 -0700 71.3 @@ -1,5 +1,5 @@ 71.4 /* 71.5 - * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. 71.6 + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. 71.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 71.8 * 71.9 * This code is free software; you can redistribute it and/or modify it 71.10 @@ -31,7 +31,6 @@ 71.11 71.12 import java.io.File; 71.13 import java.util.*; 71.14 -import javax.lang.model.SourceVersion; 71.15 import javax.lang.model.element.Element; 71.16 import javax.lang.model.element.ElementKind; 71.17 import javax.lang.model.element.PackageElement; 71.18 @@ -60,7 +59,10 @@ 71.19 static Elements elements; 71.20 71.21 public static void main(String[] args) throws Exception { 71.22 - 71.23 + if (haveAltRt()) { 71.24 + System.out.println("Warning: alt-rt.jar detected, test skipped"); 71.25 + return; 71.26 + } 71.27 JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); 71.28 StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null); 71.29 fm.setLocation(CLASS_PATH, Collections.<File>emptyList()); 71.30 @@ -123,4 +125,23 @@ 71.31 if (nestedClasses < 3000) 71.32 throw new AssertionError("Too few nested classes in PLATFORM_CLASS_PATH ;-)"); 71.33 } 71.34 + /* 71.35 + * If -XX:+AggressiveOpts has been used to test, the option currently 71.36 + * instructs the VM to prepend alt-rt.jar onto the bootclasspath. This 71.37 + * overrides the default TreeMap implemation in rt.jar causing symbol 71.38 + * resolution problems (caused by inconsistent inner class), although 71.39 + * alt-rt.jar is being eliminated, we have this sanity check to detect this 71.40 + * case and skip the test. 71.41 + */ 71.42 + static boolean haveAltRt() { 71.43 + String bootClassPath = System.getProperty("sun.boot.class.path"); 71.44 + for (String cp : bootClassPath.split(File.pathSeparator)) { 71.45 + if (cp.endsWith("alt-rt.jar")) { 71.46 + System.err.println("Warning: detected alt-rt.jar in " 71.47 + + "sun.boot.class.path"); 71.48 + return true; 71.49 + } 71.50 + } 71.51 + return false; 71.52 + } 71.53 }
72.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 72.2 +++ b/test/tools/javac/staticImport/6537020/T6537020.java Fri Aug 23 14:17:49 2013 -0700 72.3 @@ -0,0 +1,26 @@ 72.4 +/* 72.5 + * @test /nodynamiccopyright/ 72.6 + * @bug 6537020 72.7 + * @summary JCK tests: a compile-time error should be given in case of ambiguously imported fields (types, methods) 72.8 + * 72.9 + * @compile/fail/ref=T6537020.out -XDrawDiagnostics T6537020.java 72.10 + */ 72.11 + 72.12 +package p; 72.13 + 72.14 +import static p.T6537020.C.s; 72.15 + 72.16 +class T6537020 { 72.17 + 72.18 + static class A { 72.19 + static String s; 72.20 + } 72.21 + 72.22 + interface B { 72.23 + String s = ""; 72.24 + } 72.25 + 72.26 + static class C extends A implements B { } 72.27 + 72.28 + Object o = s; 72.29 +}
73.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 73.2 +++ b/test/tools/javac/staticImport/6537020/T6537020.out Fri Aug 23 14:17:49 2013 -0700 73.3 @@ -0,0 +1,2 @@ 73.4 +T6537020.java:25:16: compiler.err.ref.ambiguous: s, kindname.variable, s, p.T6537020.B, kindname.variable, s, p.T6537020.A 73.5 +1 error
74.1 --- a/test/tools/javac/tree/SourceTreeScannerTest.java Thu Aug 22 09:10:22 2013 -0700 74.2 +++ b/test/tools/javac/tree/SourceTreeScannerTest.java Fri Aug 23 14:17:49 2013 -0700 74.3 @@ -140,13 +140,6 @@ 74.4 // not part of public API 74.5 continue; 74.6 } 74.7 - if (JCTree.JCNewArray.class.isAssignableFrom(tree.getClass()) 74.8 - && (f.getName().equals("annotations") 74.9 - || f.getName().equals("dimAnnotations"))) { 74.10 - // these fields are incorrectly missing from the public API 74.11 - // (CR 6983297) 74.12 - continue; 74.13 - } 74.14 try { 74.15 //System.err.println("FIELD: " + f.getName()); 74.16 reflectiveScan(f.get(tree));
75.1 --- a/test/tools/sjavac/SJavac.java Thu Aug 22 09:10:22 2013 -0700 75.2 +++ b/test/tools/sjavac/SJavac.java Fri Aug 23 14:17:49 2013 -0700 75.3 @@ -82,11 +82,13 @@ 75.4 compileWithOverrideSource(); 75.5 compileWithInvisibleSources(); 75.6 compileCircularSources(); 75.7 + compileExcludingDependency(); 75.8 75.9 delete(gensrc); 75.10 delete(gensrc2); 75.11 delete(gensrc3); 75.12 delete(bin); 75.13 + delete(headers); 75.14 } 75.15 75.16 void initialCompile() throws Exception { 75.17 @@ -381,6 +383,33 @@ 75.18 delete(bin); 75.19 } 75.20 75.21 + /** 75.22 + * Tests compiling class A that depends on class B without compiling class B 75.23 + * @throws Exception If test fails 75.24 + */ 75.25 + void compileExcludingDependency() throws Exception { 75.26 + System.out.println("\nVerify that excluding classes from compilation but not from linking works."); 75.27 + System.out.println("---------------------------------------------------------------------------"); 75.28 + 75.29 + delete(gensrc); 75.30 + delete(bin); 75.31 + previous_bin_state = collectState(bin); 75.32 + 75.33 + populate(gensrc, 75.34 + "alfa/A.java", 75.35 + "package alfa; public class A { beta.B b; }", 75.36 + "beta/B.java", 75.37 + "package beta; public class B { }"); 75.38 + 75.39 + compile("-x", "beta", "-src", "gensrc", "-x", "alfa", "-sourcepath", "gensrc", 75.40 + "-d", "bin", "--server:portfile=testserver,background=false"); 75.41 + 75.42 + Map<String,Long> new_bin_state = collectState(bin); 75.43 + verifyThatFilesHaveBeenAdded(previous_bin_state, new_bin_state, 75.44 + "bin/alfa/A.class", 75.45 + "bin/javac_state"); 75.46 + } 75.47 + 75.48 void removeFrom(Path dir, String... args) throws IOException { 75.49 for (String filename : args) { 75.50 Path p = dir.resolve(filename); 75.51 @@ -405,7 +434,7 @@ 75.52 } 75.53 } 75.54 75.55 - void delete(Path root) throws IOException { 75.56 + void delete(final Path root) throws IOException { 75.57 if (!Files.exists(root)) return; 75.58 Files.walkFileTree(root, new SimpleFileVisitor<Path>() { 75.59 @Override