OpenJDK / jigsaw / jake / langtools
changeset 4174:0aa1c15fd0c3
Merge
line wrap: on
line diff
--- a/.hgtags Fri Jul 29 19:53:52 2016 -0700 +++ b/.hgtags Thu Aug 11 18:52:55 2016 -0700 @@ -372,3 +372,5 @@ a42768b48cb0c5af9063e12093975baeeca3b5fa jdk-9+127 2764986661b6d339ba73af52d69d3506ce12e648 jdk-9+128 e181909291981038b041ed4d22714c4760e049cd jdk-9+129 +3665ebc22a42c8f33777ee025ba0e300e6086a8c jdk-9+130 +aebfafc43714d5a27d5064d8a0011eaccde633cf jdk-9+131
--- a/make/gensrc/GensrcCommon.gmk Fri Jul 29 19:53:52 2016 -0700 +++ b/make/gensrc/GensrcCommon.gmk Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -117,7 +117,7 @@ $$(addprefix _SPACE_, $$(PARSEPROPALLDIRS)))) # Now setup the rule for the generation of the resource bundles. - $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props: $(PARSEPROPSOURCES) + $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props: $$(PARSEPROPSOURCES) $(MKDIR) -p $$(@D) $$(PARSEPROPDIRS) $(FIND) $$(@D) -name "*Properties.java" $(FIND_DELETE) $(ECHO) Parsing $$(words $$(PARSEPROPSOURCES)) properties into enum-like class for $(MODULE)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTool.java Thu Aug 11 18:52:55 2016 -0700 @@ -97,7 +97,7 @@ PrintWriter pw = (charset == null) ? new PrintWriter(System.err, true) : new PrintWriter(new OutputStreamWriter(System.err, charset), true); - context.put(Log.outKey, pw); + context.put(Log.errKey, pw); CacheFSInfo.preRegister(context); return new JavacFileManager(context, true, charset); } @@ -161,9 +161,9 @@ context.put(DiagnosticListener.class, ccw.wrap(diagnosticListener)); if (out == null) - context.put(Log.outKey, new PrintWriter(System.err, true)); + context.put(Log.errKey, new PrintWriter(System.err, true)); else - context.put(Log.outKey, new PrintWriter(out, true)); + context.put(Log.errKey, new PrintWriter(out, true)); if (fileManager == null) { fileManager = getStandardFileManager(diagnosticListener, null, null);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -296,6 +296,8 @@ */ int nelems = 0; + int removeCount = 0; + /** Use as a "not-found" result for lookup. * Also used to mark deleted entries in the table. */ @@ -474,6 +476,8 @@ te = te.sibling; } + removeCount++; + //notify listeners listeners.symbolRemoved(sym, this); } @@ -569,15 +573,29 @@ return new Iterator<Symbol>() { private ScopeImpl currScope = ScopeImpl.this; private Scope.Entry currEntry = elems; + private int seenRemoveCount = currScope.removeCount; { update(); } public boolean hasNext() { + if (seenRemoveCount != currScope.removeCount && + currEntry != null && + !currEntry.scope.includes(currEntry.sym)) { + doNext(); //skip entry that is no longer in the Scope + seenRemoveCount = currScope.removeCount; + } return currEntry != null; } public Symbol next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + + return doNext(); + } + private Symbol doNext() { Symbol sym = (currEntry == null ? null : currEntry.sym); if (currEntry != null) { currEntry = currEntry.sibling; @@ -596,6 +614,7 @@ while (currEntry == null && currScope.next != null) { currScope = currScope.next; currEntry = currScope.elems; + seenRemoveCount = currScope.removeCount; skipToNextMatchingEntry(); } } @@ -618,13 +637,26 @@ public Iterator<Symbol> iterator() { return new Iterator<Symbol>() { Scope.Entry currentEntry = lookup(name, sf); + int seenRemoveCount = currentEntry.scope != null ? + currentEntry.scope.removeCount : -1; public boolean hasNext() { + if (currentEntry.scope != null && + seenRemoveCount != currentEntry.scope.removeCount && + !currentEntry.scope.includes(currentEntry.sym)) { + doNext(); //skip entry that is no longer in the Scope + } return currentEntry.scope != null && (lookupKind == RECURSIVE || currentEntry.scope == ScopeImpl.this); } public Symbol next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return doNext(); + } + private Symbol doNext() { Scope.Entry prevEntry = currentEntry; currentEntry = currentEntry.next(sf); return prevEntry.sym; @@ -686,9 +718,9 @@ /** The entry's scope. * scope == null iff this == sentinel */ - public Scope scope; + public ScopeImpl scope; - public Entry(Symbol sym, Entry shadowed, Entry sibling, Scope scope) { + public Entry(Symbol sym, Entry shadowed, Entry sibling, ScopeImpl scope) { this.sym = sym; this.shadowed = shadowed; this.sibling = sibling;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java Thu Aug 11 18:52:55 2016 -0700 @@ -55,7 +55,9 @@ import com.sun.tools.javac.comp.AttrContext; import com.sun.tools.javac.comp.Env; import com.sun.tools.javac.jvm.*; +import com.sun.tools.javac.tree.JCTree.JCFieldAccess; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; +import com.sun.tools.javac.tree.JCTree.Tag; import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.DefinedBy.Api; import com.sun.tools.javac.util.Name; @@ -64,9 +66,15 @@ import static com.sun.tools.javac.code.Kinds.*; import static com.sun.tools.javac.code.Kinds.Kind.*; import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE; +import static com.sun.tools.javac.code.Symbol.OperatorSymbol.AccessCode.FIRSTASGOP; import static com.sun.tools.javac.code.TypeTag.CLASS; import static com.sun.tools.javac.code.TypeTag.FORALL; import static com.sun.tools.javac.code.TypeTag.TYPEVAR; +import static com.sun.tools.javac.jvm.ByteCodes.iadd; +import static com.sun.tools.javac.jvm.ByteCodes.ishll; +import static com.sun.tools.javac.jvm.ByteCodes.lushrl; +import static com.sun.tools.javac.jvm.ByteCodes.lxor; +import static com.sun.tools.javac.jvm.ByteCodes.string_add; /** Root class for Java symbols. It contains subclasses * for specific sorts of symbols, such as variables, methods and operators, @@ -1950,15 +1958,90 @@ public static class OperatorSymbol extends MethodSymbol { public int opcode; + private int accessCode = Integer.MIN_VALUE; public OperatorSymbol(Name name, Type type, int opcode, Symbol owner) { super(PUBLIC | STATIC, name, type, owner); this.opcode = opcode; } + @Override public <R, P> R accept(Symbol.Visitor<R, P> v, P p) { return v.visitOperatorSymbol(this, p); } + + public int getAccessCode(Tag tag) { + if (accessCode != Integer.MIN_VALUE && !tag.isIncOrDecUnaryOp()) { + return accessCode; + } + accessCode = AccessCode.from(tag, opcode); + return accessCode; + } + + /** Access codes for dereferencing, assignment, + * and pre/post increment/decrement. + + * All access codes for accesses to the current class are even. + * If a member of the superclass should be accessed instead (because + * access was via a qualified super), add one to the corresponding code + * for the current class, making the number odd. + * This numbering scheme is used by the backend to decide whether + * to issue an invokevirtual or invokespecial call. + * + * @see Gen#visitSelect(JCFieldAccess tree) + */ + public enum AccessCode { + UNKNOWN(-1, Tag.NO_TAG), + DEREF(0, Tag.NO_TAG), + ASSIGN(2, Tag.ASSIGN), + PREINC(4, Tag.PREINC), + PREDEC(6, Tag.PREDEC), + POSTINC(8, Tag.POSTINC), + POSTDEC(10, Tag.POSTDEC), + FIRSTASGOP(12, Tag.NO_TAG); + + public final int code; + public final Tag tag; + public static final int numberOfAccessCodes = (lushrl - ishll + lxor + 2 - iadd) * 2 + FIRSTASGOP.code + 2; + + AccessCode(int code, Tag tag) { + this.code = code; + this.tag = tag; + } + + static public AccessCode getFromCode(int code) { + for (AccessCode aCodes : AccessCode.values()) { + if (aCodes.code == code) { + return aCodes; + } + } + return UNKNOWN; + } + + static int from(Tag tag, int opcode) { + /** Map bytecode of binary operation to access code of corresponding + * assignment operation. This is always an even number. + */ + switch (tag) { + case PREINC: + return AccessCode.PREINC.code; + case PREDEC: + return AccessCode.PREDEC.code; + case POSTINC: + return AccessCode.POSTINC.code; + case POSTDEC: + return AccessCode.POSTDEC.code; + } + if (iadd <= opcode && opcode <= lxor) { + return (opcode - iadd) * 2 + FIRSTASGOP.code; + } else if (opcode == string_add) { + return (lxor + 1 - iadd) * 2 + FIRSTASGOP.code; + } else if (ishll <= opcode && opcode <= lushrl) { + return (opcode - ishll + lxor + 2 - iadd) * 2 + FIRSTASGOP.code; + } + return -1; + } + } } /** Symbol completer interface.
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java Thu Aug 11 18:52:55 2016 -0700 @@ -3159,7 +3159,7 @@ Type operand = attribExpr(tree.rhs, env); // Find operator. Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag().noAssignOp(), owntype, operand); - if (operator.kind == MTH && + if (operator != operators.noOpSymbol && !owntype.isErroneous() && !operand.isErroneous()) { chk.checkDivZero(tree.rhs.pos(), operator, operand); @@ -3179,7 +3179,7 @@ // Find operator. Symbol operator = tree.operator = operators.resolveUnary(tree, tree.getTag(), argtype); Type owntype = types.createErrorType(tree.type); - if (operator.kind == MTH && + if (operator != operators.noOpSymbol && !argtype.isErroneous()) { owntype = (tree.getTag().isIncOrDecUnaryOp()) ? tree.arg.type @@ -3204,7 +3204,7 @@ // Find operator. Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag(), left, right); Type owntype = types.createErrorType(tree.type); - if (operator.kind == MTH && + if (operator != operators.noOpSymbol && !left.isErroneous() && !right.isErroneous()) { owntype = operator.type.getReturnType();
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java Thu Aug 11 18:52:55 2016 -0700 @@ -38,6 +38,7 @@ import com.sun.tools.javac.util.List; import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.code.Symbol.OperatorSymbol.AccessCode; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.code.Type.*; @@ -49,7 +50,9 @@ import static com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE; import static com.sun.tools.javac.code.TypeTag.*; import static com.sun.tools.javac.code.Kinds.Kind.*; +import static com.sun.tools.javac.code.Symbol.OperatorSymbol.AccessCode.DEREF; import static com.sun.tools.javac.jvm.ByteCodes.*; +import static com.sun.tools.javac.tree.JCTree.JCOperatorExpression.OperandPos.LEFT; import static com.sun.tools.javac.tree.JCTree.Tag.*; /** This pass translates away some syntactic sugar: inner classes, @@ -816,33 +819,6 @@ * Access methods *************************************************************************/ - /** Access codes for dereferencing, assignment, - * and pre/post increment/decrement. - * Access codes for assignment operations are determined by method accessCode - * below. - * - * All access codes for accesses to the current class are even. - * If a member of the superclass should be accessed instead (because - * access was via a qualified super), add one to the corresponding code - * for the current class, making the number odd. - * This numbering scheme is used by the backend to decide whether - * to issue an invokevirtual or invokespecial call. - * - * @see Gen#visitSelect(JCFieldAccess tree) - */ - private static final int - DEREFcode = 0, - ASSIGNcode = 2, - PREINCcode = 4, - PREDECcode = 6, - POSTINCcode = 8, - POSTDECcode = 10, - FIRSTASGOPcode = 12; - - /** Number of access codes - */ - private static final int NCODES = accessCode(ByteCodes.lushrl) + 2; - /** A mapping from symbols to their access numbers. */ private Map<Symbol,Integer> accessNums; @@ -864,20 +840,6 @@ */ private ListBuffer<Symbol> accessed; - /** Map bytecode of binary operation to access code of corresponding - * assignment operation. This is always an even number. - */ - private static int accessCode(int bytecode) { - if (ByteCodes.iadd <= bytecode && bytecode <= ByteCodes.lxor) - return (bytecode - iadd) * 2 + FIRSTASGOPcode; - else if (bytecode == ByteCodes.string_add) - return (ByteCodes.lxor + 1 - iadd) * 2 + FIRSTASGOPcode; - else if (ByteCodes.ishll <= bytecode && bytecode <= ByteCodes.lushrl) - return (bytecode - ishll + ByteCodes.lxor + 2 - iadd) * 2 + FIRSTASGOPcode; - else - return -1; - } - /** return access code for identifier, * @param tree The tree representing the identifier use. * @param enclOp The closest enclosing operation node of tree, @@ -885,24 +847,21 @@ */ private static int accessCode(JCTree tree, JCTree enclOp) { if (enclOp == null) - return DEREFcode; + return AccessCode.DEREF.code; else if (enclOp.hasTag(ASSIGN) && tree == TreeInfo.skipParens(((JCAssign) enclOp).lhs)) - return ASSIGNcode; - else if (enclOp.getTag().isIncOrDecUnaryOp() && - tree == TreeInfo.skipParens(((JCUnary) enclOp).arg)) - return mapTagToUnaryOpCode(enclOp.getTag()); - else if (enclOp.getTag().isAssignop() && - tree == TreeInfo.skipParens(((JCAssignOp) enclOp).lhs)) - return accessCode(((OperatorSymbol) ((JCAssignOp) enclOp).operator).opcode); + return AccessCode.ASSIGN.code; + else if ((enclOp.getTag().isIncOrDecUnaryOp() || enclOp.getTag().isAssignop()) && + tree == TreeInfo.skipParens(((JCOperatorExpression) enclOp).getOperand(LEFT))) + return (((JCOperatorExpression) enclOp).operator).getAccessCode(enclOp.getTag()); else - return DEREFcode; + return AccessCode.DEREF.code; } /** Return binary operator that corresponds to given access code. */ - private OperatorSymbol binaryAccessOperator(int acode) { - return (OperatorSymbol)operators.lookupBinaryOp(sym -> accessCode(((OperatorSymbol)sym).opcode) == acode); + private OperatorSymbol binaryAccessOperator(int acode, Tag tag) { + return operators.lookupBinaryOp(op -> op.getAccessCode(tag) == acode); } /** Return tree tag for assignment operation corresponding @@ -984,7 +943,7 @@ if (anum == null) { anum = accessed.length(); accessNums.put(vsym, anum); - accessSyms.put(vsym, new MethodSymbol[NCODES]); + accessSyms.put(vsym, new MethodSymbol[AccessCode.numberOfAccessCodes]); accessed.append(vsym); // System.out.println("accessing " + vsym + " in " + vsym.location()); } @@ -996,13 +955,13 @@ switch (vsym.kind) { case VAR: acode = accessCode(tree, enclOp); - if (acode >= FIRSTASGOPcode) { - OperatorSymbol operator = binaryAccessOperator(acode); + if (acode >= AccessCode.FIRSTASGOP.code) { + OperatorSymbol operator = binaryAccessOperator(acode, enclOp.getTag()); if (operator.opcode == string_add) argtypes = List.of(syms.objectType); else argtypes = operator.type.getParameterTypes().tail; - } else if (acode == ASSIGNcode) + } else if (acode == AccessCode.ASSIGN.code) argtypes = List.of(vsym.erasure(types)); else argtypes = List.nil(); @@ -1010,7 +969,7 @@ thrown = List.nil(); break; case MTH: - acode = DEREFcode; + acode = AccessCode.DEREF.code; argtypes = vsym.erasure(types).getParameterTypes(); restype = vsym.erasure(types).getReturnType(); thrown = vsym.type.getThrownTypes(); @@ -1306,7 +1265,7 @@ accessConstructorDef(cdef.pos, sym, accessConstrs.get(sym))); } else { MethodSymbol[] accessors = accessSyms.get(sym); - for (int i = 0; i < NCODES; i++) { + for (int i = 0; i < AccessCode.numberOfAccessCodes; i++) { if (accessors[i] != null) cdef.defs = cdef.defs.prepend( accessDef(cdef.pos, sym, accessors[i], i)); @@ -1314,42 +1273,6 @@ } } - /** Maps unary operator integer codes to JCTree.Tag objects - * @param unaryOpCode the unary operator code - */ - private static Tag mapUnaryOpCodeToTag(int unaryOpCode){ - switch (unaryOpCode){ - case PREINCcode: - return PREINC; - case PREDECcode: - return PREDEC; - case POSTINCcode: - return POSTINC; - case POSTDECcode: - return POSTDEC; - default: - return NO_TAG; - } - } - - /** Maps JCTree.Tag objects to unary operator integer codes - * @param tag the JCTree.Tag - */ - private static int mapTagToUnaryOpCode(Tag tag){ - switch (tag){ - case PREINC: - return PREINCcode; - case PREDEC: - return PREDECcode; - case POSTINC: - return POSTINCcode; - case POSTDEC: - return POSTDECcode; - default: - return -1; - } - } - /** Construct definition of an access method. * @param pos The source code position of the definition. * @param vsym The private or protected symbol. @@ -1388,20 +1311,21 @@ int acode1 = acode - (acode & 1); JCExpression expr; // The access method's return value. - switch (acode1) { - case DEREFcode: + AccessCode aCode = AccessCode.getFromCode(acode1); + switch (aCode) { + case DEREF: expr = ref; break; - case ASSIGNcode: + case ASSIGN: expr = make.Assign(ref, args.head); break; - case PREINCcode: case POSTINCcode: case PREDECcode: case POSTDECcode: - expr = makeUnary(mapUnaryOpCodeToTag(acode1), ref); + case PREINC: case POSTINC: case PREDEC: case POSTDEC: + expr = makeUnary(aCode.tag, ref); break; default: expr = make.Assignop( - treeTag(binaryAccessOperator(acode1)), ref, args.head); - ((JCAssignOp) expr).operator = binaryAccessOperator(acode1); + treeTag(binaryAccessOperator(acode1, JCTree.Tag.NO_TAG)), ref, args.head); + ((JCAssignOp) expr).operator = binaryAccessOperator(acode1, JCTree.Tag.NO_TAG); } stat = make.Return(expr.setType(sym.type)); } else { @@ -3276,7 +3200,7 @@ // tree.lhs. However, we can still get the // unerased type of tree.lhs as it is stored // in tree.type in Attr. - Symbol newOperator = operators.resolveBinary(tree, + OperatorSymbol newOperator = operators.resolveBinary(tree, newTag, tree.type, tree.rhs.type); @@ -3305,7 +3229,7 @@ JCMethodInvocation app = (JCMethodInvocation)tree.lhs; // if operation is a += on strings, // make sure to convert argument to string - JCExpression rhs = (((OperatorSymbol)tree.operator).opcode == string_add) + JCExpression rhs = tree.operator.opcode == string_add ? makeString(tree.rhs) : tree.rhs; app.args = List.of(rhs).prependList(app.args);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java Thu Aug 11 18:52:55 2016 -0700 @@ -38,6 +38,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.function.Consumer; import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -109,8 +110,6 @@ import static com.sun.tools.javac.code.Flags.ABSTRACT; import static com.sun.tools.javac.code.Flags.ENUM; import static com.sun.tools.javac.code.Flags.PUBLIC; -import com.sun.tools.javac.tree.JCTree.JCImport; -import static com.sun.tools.javac.tree.JCTree.Tag.MODULEDEF; /** * TODO: fill in @@ -150,7 +149,7 @@ private final String addModsOpt; private final String limitModsOpt; - private Set<ModuleSymbol> rootModules = Collections.emptySet(); + private Set<ModuleSymbol> rootModules = null; public static Modules instance(Context context) { Modules instance = context.get(Modules.class); @@ -196,7 +195,31 @@ System.err.println(msg); } + boolean inInitModules; + public void initModules(List<JCCompilationUnit> trees, Collection<String> extraAddMods, Collection<String> extraLimitMods) { + Assert.check(!inInitModules); + try { + inInitModules = true; + Assert.checkNull(rootModules); + enter(trees, modules -> { + Assert.checkNull(rootModules); + Assert.checkNull(allModules); + this.rootModules = modules; + setupAllModules(extraAddMods, extraLimitMods); //initialize the module graph + Assert.checkNonNull(allModules); + inInitModules = false; + }, null); + } finally { + inInitModules = false; + } + } + public boolean enter(List<JCCompilationUnit> trees, ClassSymbol c) { + Assert.check(rootModules != null || inInitModules || !allowModules); + return enter(trees, modules -> {}, c); + } + + private boolean enter(List<JCCompilationUnit> trees, Consumer<Set<ModuleSymbol>> init, ClassSymbol c) { if (!allowModules) { for (JCCompilationUnit tree: trees) { tree.modle = syms.noModule; @@ -214,10 +237,7 @@ setCompilationUnitModules(trees, roots); - if (!roots.isEmpty() && this.rootModules.isEmpty()) { - this.rootModules = roots; - allModules(); //ensure errors reported - } + init.accept(roots); for (ModuleSymbol msym: roots) { msym.complete(); @@ -397,6 +417,7 @@ defaultModule.completer = sym -> completeModule((ModuleSymbol) sym); } else { Assert.check(rootModules.isEmpty()); + rootModules.add(defaultModule); } if (defaultModule != syms.unnamedModule) { @@ -461,7 +482,7 @@ msym.requires = List.nil(); msym.uses = List.nil(); } else if ((msym.flags_field & Flags.AUTOMATIC_MODULE) != 0) { - completeAutomaticModule(msym); + setupAutomaticModule(msym); } else { msym.module_info.complete(); } @@ -484,7 +505,7 @@ } }; - private void completeAutomaticModule(ModuleSymbol msym) throws CompletionFailure { + private void setupAutomaticModule(ModuleSymbol msym) throws CompletionFailure { try { ListBuffer<Directive> directives = new ListBuffer<>(); ListBuffer<ExportsDirective> exports = new ListBuffer<>(); @@ -500,28 +521,9 @@ } } - ListBuffer<RequiresDirective> requires = new ListBuffer<>(); - - //ensure all modules are found: - moduleFinder.findAllModules(); - - for (ModuleSymbol ms : allModules()) { - if (ms == syms.unnamedModule || ms == msym) - continue; - Set<RequiresFlag> flags = (ms.flags_field & Flags.AUTOMATIC_MODULE) != 0 ? - EnumSet.of(RequiresFlag.TRANSITIVE) : EnumSet.noneOf(RequiresFlag.class); - RequiresDirective d = new RequiresDirective(ms, flags); - directives.add(d); - requires.add(d); - } - - RequiresDirective requiresUnnamed = new RequiresDirective(syms.unnamedModule); - directives.add(requiresUnnamed); - requires.add(requiresUnnamed); - msym.exports = exports.toList(); msym.provides = List.nil(); - msym.requires = requires.toList(); + msym.requires = List.nil(); msym.uses = List.nil(); msym.directives = directives.toList(); msym.flags_field |= Flags.ACYCLIC; @@ -530,6 +532,31 @@ } } + private void completeAutomaticModule(ModuleSymbol msym) throws CompletionFailure { + ListBuffer<Directive> directives = new ListBuffer<>(); + + directives.addAll(msym.directives); + + ListBuffer<RequiresDirective> requires = new ListBuffer<>(); + + for (ModuleSymbol ms : allModules()) { + if (ms == syms.unnamedModule || ms == msym) + continue; + Set<RequiresFlag> flags = (ms.flags_field & Flags.AUTOMATIC_MODULE) != 0 ? + EnumSet.of(RequiresFlag.TRANSITIVE) : EnumSet.noneOf(RequiresFlag.class); + RequiresDirective d = new RequiresDirective(ms, flags); + directives.add(d); + requires.add(d); + } + + RequiresDirective requiresUnnamed = new RequiresDirective(syms.unnamedModule); + directives.add(requiresUnnamed); + requires.add(requiresUnnamed); + + msym.requires = requires.toList(); + msym.directives = directives.toList(); + } + private Completer getSourceCompleter(JCCompilationUnit tree) { return new Completer() { @Override @@ -664,6 +691,9 @@ public Completer getUsesProvidesCompleter() { return sym -> { ModuleSymbol msym = (ModuleSymbol) sym; + + msym.complete(); + Env<AttrContext> env = typeEnvs.get(msym); UsesProvidesVisitor v = new UsesProvidesVisitor(msym, env); JavaFileObject prev = log.useSource(env.toplevel.sourcefile); @@ -761,7 +791,9 @@ @Override public void visitRequires(JCRequires tree) { - msym.directives = msym.directives.prepend(tree.directive); + if (tree.directive != null) { + msym.directives = msym.directives.prepend(tree.directive); + } } @Override @@ -825,19 +857,29 @@ } } - private Set<ModuleSymbol> allModulesCache; + private Set<ModuleSymbol> allModules; - private Set<ModuleSymbol> allModules() { - if (allModulesCache != null) - return allModulesCache; + public Set<ModuleSymbol> allModules() { + Assert.checkNonNull(allModules); + return allModules; + } + + private void setupAllModules(Collection<String> extraAddMods, Collection<String> extraLimitMods) { + Assert.checkNonNull(rootModules); + Assert.checkNull(allModules); Set<ModuleSymbol> observable; - if (limitModsOpt == null) { + if (limitModsOpt == null && extraLimitMods.isEmpty()) { observable = null; } else { Set<ModuleSymbol> limitMods = new HashSet<>(); - for (String limit : limitModsOpt.split(",")) { + if (limitModsOpt != null) { + for (String limit : limitModsOpt.split(",")) { + limitMods.add(syms.enterModule(names.fromString(limit))); + } + } + for (String limit : extraLimitMods) { limitMods.add(syms.enterModule(names.fromString(limit))); } observable = computeTransitiveClosure(limitMods, null); @@ -872,8 +914,15 @@ enabledRoot.addAll(rootModules); - if (addModsOpt != null) { - for (String added : addModsOpt.split(",")) { + if (addModsOpt != null || !extraAddMods.isEmpty()) { + Set<String> fullAddMods = new HashSet<>(); + fullAddMods.addAll(extraAddMods); + + if (addModsOpt != null) { + fullAddMods.addAll(Arrays.asList(addModsOpt.split(","))); + } + + for (String added : fullAddMods) { Stream<ModuleSymbol> modules; switch (added) { case ALL_SYSTEM: @@ -902,24 +951,11 @@ result.add(syms.unnamedModule); - if (!rootModules.isEmpty()) - allModulesCache = result; - - return result; + allModules = result; } public boolean isInModuleGraph(ModuleSymbol msym) { - return allModulesCache == null || allModulesCache.contains(msym); - } - - public void enableAllModules() { - allModulesCache = new HashSet<>(); - - moduleFinder.findAllModules(); - - for (ModuleSymbol msym : syms.getAllModules()) { - allModulesCache.add(msym); - } + return allModules == null || allModules.contains(msym); } private Set<ModuleSymbol> computeTransitiveClosure(Iterable<? extends ModuleSymbol> base, Set<ModuleSymbol> observable) { @@ -981,6 +1017,15 @@ private final Map<ModuleSymbol, Set<ModuleSymbol>> requiresPublicCache = new HashMap<>(); private void completeModule(ModuleSymbol msym) { + if (inInitModules) { + msym.completer = sym -> completeModule(msym); + return ; + } + + if ((msym.flags_field & Flags.AUTOMATIC_MODULE) != 0) { + completeAutomaticModule(msym); + } + Assert.checkNonNull(msym.requires); initAddReads(); @@ -1227,10 +1272,8 @@ private void checkCyclicDependencies(JCModuleDecl mod) { for (JCDirective d : mod.directives) { - if (!d.hasTag(Tag.REQUIRES)) - continue; - JCRequires rd = (JCRequires) d; - if (rd.directive == null) + JCRequires rd; + if (!d.hasTag(Tag.REQUIRES) || (rd = (JCRequires) d).directive == null) continue; Set<ModuleSymbol> nonSyntheticDeps = new HashSet<>(); List<ModuleSymbol> queue = List.of(rd.directive.module); @@ -1239,9 +1282,9 @@ queue = queue.tail; if (!nonSyntheticDeps.add(current)) continue; + current.complete(); if ((current.flags() & Flags.ACYCLIC) != 0) continue; - current.complete(); Assert.checkNonNull(current.requires, () -> current.toString()); for (RequiresDirective dep : current.requires) { if (!dep.flags.contains(RequiresFlag.EXTRA)) @@ -1277,5 +1320,7 @@ } public void newRound() { + rootModules = null; + allModules = null; } }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java Thu Aug 11 18:52:55 2016 -0700 @@ -95,6 +95,7 @@ names = Names.instance(context); log = Log.instance(context); types = Types.instance(context); + noOpSymbol = new OperatorSymbol(names.empty, Type.noType, -1, syms.noSymbol); initOperatorNames(); initUnaryOperators(); initBinaryOperators(); @@ -145,7 +146,7 @@ /** * Entry point for resolving a unary operator given an operator tag and an argument type. */ - Symbol resolveUnary(DiagnosticPosition pos, JCTree.Tag tag, Type op) { + OperatorSymbol resolveUnary(DiagnosticPosition pos, JCTree.Tag tag, Type op) { return resolve(tag, unaryOperators, unop -> unop.test(op), @@ -156,7 +157,7 @@ /** * Entry point for resolving a binary operator given an operator tag and a pair of argument types. */ - Symbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) { + OperatorSymbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) { return resolve(tag, binaryOperators, binop -> binop.test(op1, op2), @@ -169,8 +170,8 @@ * map. If there's a matching operator, its resolve routine is called and the result is returned; * otherwise the result of a fallback function is returned. */ - private <O> Symbol resolve(Tag tag, Map<Name, List<O>> opMap, Predicate<O> opTestFunc, - Function<O, Symbol> resolveFunc, Supplier<Symbol> noResultFunc) { + private <O> OperatorSymbol resolve(Tag tag, Map<Name, List<O>> opMap, Predicate<O> opTestFunc, + Function<O, OperatorSymbol> resolveFunc, Supplier<OperatorSymbol> noResultFunc) { return opMap.get(operatorName(tag)).stream() .filter(opTestFunc) .map(resolveFunc) @@ -181,7 +182,7 @@ /** * Creates an operator symbol. */ - private Symbol makeOperator(Name name, List<OperatorType> formals, OperatorType res, int... opcodes) { + private OperatorSymbol makeOperator(Name name, List<OperatorType> formals, OperatorType res, int... opcodes) { MethodType opType = new MethodType( formals.stream() .map(o -> o.asType(syms)) @@ -201,10 +202,14 @@ ((opcodes[0] << ByteCodes.preShift) | opcodes[1]); } + /** A symbol that stands for a missing operator. + */ + public final OperatorSymbol noOpSymbol; + /** * Report an operator lookup error. */ - private Symbol reportErrorIfNeeded(DiagnosticPosition pos, Tag tag, Type... args) { + private OperatorSymbol reportErrorIfNeeded(DiagnosticPosition pos, Tag tag, Type... args) { if (Stream.of(args).noneMatch(Type::isErroneous)) { Name opName = operatorName(tag); JCDiagnostic.Error opError = (args.length) == 1 ? @@ -212,7 +217,7 @@ Errors.OperatorCantBeApplied1(opName, args[0], args[1]); log.error(pos, opError); } - return syms.noSymbol; + return noOpSymbol; } /** @@ -263,10 +268,10 @@ final Name name; /** The list of symbols associated with this operator (lazily populated). */ - Optional<Symbol[]> alternatives = Optional.empty(); + Optional<OperatorSymbol[]> alternatives = Optional.empty(); /** An array of operator symbol suppliers (used to lazily populate the symbol list). */ - List<Supplier<Symbol>> operatorSuppliers = List.nil(); + List<Supplier<OperatorSymbol>> operatorSuppliers = List.nil(); @SuppressWarnings("varargs") OperatorHelper(Tag tag) { @@ -278,21 +283,21 @@ * using an applicability predicate; if the test suceeds that same operator is returned, * otherwise a dummy symbol is returned. */ - final Symbol doLookup(Predicate<Symbol> applicabilityTest) { + final OperatorSymbol doLookup(Predicate<OperatorSymbol> applicabilityTest) { return Stream.of(alternatives.orElseGet(this::initOperators)) .filter(applicabilityTest) .findFirst() - .orElse(syms.noSymbol); + .orElse(noOpSymbol); } /** * This routine performs lazy instantiation of the operator symbols supported by this helper. * After initialization is done, the suppliers are cleared, to free up memory. */ - private Symbol[] initOperators() { - Symbol[] operators = operatorSuppliers.stream() + private OperatorSymbol[] initOperators() { + OperatorSymbol[] operators = operatorSuppliers.stream() .map(op -> op.get()) - .toArray(Symbol[]::new); + .toArray(OperatorSymbol[]::new); alternatives = Optional.of(operators); operatorSuppliers = null; //let GC do its work return operators; @@ -311,10 +316,10 @@ /** * This routine implements the unary operator lookup process. It customizes the behavior * of the shared lookup routine in {@link OperatorHelper}, by using an unary applicability test - * (see {@link UnaryOperatorHelper#isUnaryOperatorApplicable(OperatorSymbol, Type)} + * (see {@link UnaryOperatorHelper#isUnaryOperatorApplicable(OperatorOperatorSymbol, Type)} */ - final Symbol doLookup(Type t) { - return doLookup(op -> isUnaryOperatorApplicable((OperatorSymbol)op, t)); + final OperatorSymbol doLookup(Type t) { + return doLookup(op -> isUnaryOperatorApplicable(op, t)); } /** @@ -336,7 +341,7 @@ * This method will be overridden by unary operator helpers to provide custom resolution * logic. */ - abstract Symbol resolve(Type t); + abstract OperatorSymbol resolve(Type t); } abstract class BinaryOperatorHelper extends OperatorHelper implements BiPredicate<Type, Type> { @@ -350,8 +355,8 @@ * of the shared lookup routine in {@link OperatorHelper}, by using an unary applicability test * (see {@link BinaryOperatorHelper#isBinaryOperatorApplicable(OperatorSymbol, Type, Type)} */ - final Symbol doLookup(Type t1, Type t2) { - return doLookup(op -> isBinaryOperatorApplicable((OperatorSymbol)op, t1, t2)); + final OperatorSymbol doLookup(Type t1, Type t2) { + return doLookup(op -> isBinaryOperatorApplicable(op, t1, t2)); } /** @@ -375,7 +380,7 @@ * This method will be overridden by binary operator helpers to provide custom resolution * logic. */ - abstract Symbol resolve(Type t1, Type t2); + abstract OperatorSymbol resolve(Type t1, Type t2); } /** @@ -393,7 +398,7 @@ } @Override - public Symbol resolve(Type arg) { + public OperatorSymbol resolve(Type arg) { return doLookup(syms.objectType); } } @@ -421,7 +426,7 @@ } @Override - public Symbol resolve(Type arg) { + public OperatorSymbol resolve(Type arg) { return doLookup(unaryPromotion(arg)); } } @@ -442,7 +447,7 @@ } @Override - public Symbol resolve(Type arg) { + public OperatorSymbol resolve(Type arg) { return doLookup(syms.booleanType); } } @@ -458,7 +463,7 @@ } @Override - public Symbol resolve(Type arg) { + public OperatorSymbol resolve(Type arg) { return doLookup(types.unboxedTypeOrType(arg)); } } @@ -481,7 +486,7 @@ } @Override - public Symbol resolve(Type arg1, Type arg2) { + public OperatorSymbol resolve(Type arg1, Type arg2) { Type t = binaryPromotion(arg1, arg2); return doLookup(t, t); } @@ -504,7 +509,7 @@ } @Override - public Symbol resolve(Type arg1, Type arg2) { + public OperatorSymbol resolve(Type arg1, Type arg2) { return doLookup(syms.booleanType, syms.booleanType); } @@ -527,7 +532,7 @@ } @Override - public Symbol resolve(Type arg1, Type arg2) { + public OperatorSymbol resolve(Type arg1, Type arg2) { return doLookup(stringPromotion(arg1), stringPromotion(arg2)); } @@ -570,7 +575,7 @@ } @Override - public Symbol resolve(Type arg1, Type arg2) { + public OperatorSymbol resolve(Type arg1, Type arg2) { return doLookup(unaryPromotion(arg1), unaryPromotion(arg2)); } @@ -613,7 +618,7 @@ } @Override - public Symbol resolve(Type t1, Type t2) { + public OperatorSymbol resolve(Type t1, Type t2) { ComparisonKind kind = getKind(t1, t2); Type t = (kind == ComparisonKind.NUMERIC_OR_BOOLEAN) ? binaryPromotion(t1, t2) : @@ -798,12 +803,12 @@ .addBinaryOperator(BOOLEAN, BOOLEAN, BOOLEAN, bool_or)); } - Symbol lookupBinaryOp(Predicate<Symbol> applicabilityTest) { + OperatorSymbol lookupBinaryOp(Predicate<OperatorSymbol> applicabilityTest) { return binaryOperators.values().stream() .flatMap(List::stream) .map(helper -> helper.doLookup(applicabilityTest)) .distinct() - .filter(sym -> sym != syms.noSymbol) + .filter(sym -> sym != noOpSymbol) .findFirst().get(); }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Aug 11 18:52:55 2016 -0700 @@ -1795,7 +1795,7 @@ } public void visitAssignop(JCAssignOp tree) { - OperatorSymbol operator = (OperatorSymbol) tree.operator; + OperatorSymbol operator = tree.operator; Item l; if (operator.opcode == string_add) { l = concat.makeConcat(tree); @@ -1827,7 +1827,7 @@ } public void visitUnary(JCUnary tree) { - OperatorSymbol operator = (OperatorSymbol)tree.operator; + OperatorSymbol operator = tree.operator; if (tree.hasTag(NOT)) { CondItem od = genCond(tree.arg, false); result = od.negate(); @@ -1909,7 +1909,7 @@ } public void visitBinary(JCBinary tree) { - OperatorSymbol operator = (OperatorSymbol)tree.operator; + OperatorSymbol operator = tree.operator; if (operator.opcode == string_add) { result = concat.makeConcat(tree); } else if (tree.hasTag(AND)) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java Thu Aug 11 18:52:55 2016 -0700 @@ -131,8 +131,7 @@ tree = TreeInfo.skipParens(tree); if (tree.hasTag(PLUS) && tree.type.constValue() == null) { JCTree.JCBinary op = (JCTree.JCBinary) tree; - if (op.operator.kind == MTH && - ((Symbol.OperatorSymbol) op.operator).opcode == string_add) { + if (op.operator.kind == MTH && op.operator.opcode == string_add) { return res .appendList(collect(op.lhs, res)) .appendList(collect(op.rhs, res));
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Thu Aug 11 18:52:55 2016 -0700 @@ -27,6 +27,7 @@ import java.io.*; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -1009,15 +1010,10 @@ } public List<JCCompilationUnit> initModules(List<JCCompilationUnit> roots) { - List<JCCompilationUnit> result = initModules(roots, null); + modules.initModules(roots, Collections.emptySet(), Collections.emptySet()); if (roots.isEmpty()) { enterDone = true; } - return result; - } - - List<JCCompilationUnit> initModules(List<JCCompilationUnit> roots, ClassSymbol c) { - modules.enter(roots, c); return roots; }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java Thu Aug 11 18:52:55 2016 -0700 @@ -62,9 +62,13 @@ */ String ownName; + /** The writer to use for normal output. + */ + PrintWriter stdOut; + /** The writer to use for diagnostic output. */ - PrintWriter out; + PrintWriter stdErr; /** The log to use for diagnostic output. */ @@ -102,7 +106,7 @@ * @param name the name of this tool */ public Main(String name) { - this(name, new PrintWriter(System.err, true)); + this.ownName = name; } /** @@ -112,7 +116,7 @@ */ public Main(String name, PrintWriter out) { this.ownName = name; - this.out = out; + this.stdOut = this.stdErr = out; } /** Report a usage error. @@ -161,7 +165,14 @@ * @return the result of the compilation */ public Result compile(String[] argv, Context context) { - context.put(Log.outKey, out); + if (stdOut != null) { + context.put(Log.outKey, stdOut); + } + + if (stdErr != null) { + context.put(Log.errKey, stdErr); + } + log = Log.instance(context); if (argv.length == 0) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java Thu Aug 11 18:52:55 2016 -0700 @@ -106,19 +106,19 @@ @Override protected void help(Log log) { super.help(log); - log.printRawLines(WriterKind.NOTICE, + log.printRawLines(WriterKind.STDOUT, String.format(LINT_KEY_FORMAT, "all", log.localize(PrefixKind.JAVAC, "opt.Xlint.all"))); for (LintCategory lc : LintCategory.values()) { if (lc.hidden) continue; - log.printRawLines(WriterKind.NOTICE, + log.printRawLines(WriterKind.STDOUT, String.format(LINT_KEY_FORMAT, lc.option, log.localize(PrefixKind.JAVAC, "opt.Xlint.desc." + lc.option))); } - log.printRawLines(WriterKind.NOTICE, + log.printRawLines(WriterKind.STDOUT, String.format(LINT_KEY_FORMAT, "none", log.localize(PrefixKind.JAVAC, "opt.Xlint.none"))); @@ -351,7 +351,7 @@ public boolean process(OptionHelper helper, String option) { Log log = helper.getLog(); String ownName = helper.getOwnName(); - log.printLines(PrefixKind.JAVAC, "version", ownName, JavaCompiler.version()); + log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "version", ownName, JavaCompiler.version()); return super.process(helper, option); } }, @@ -361,7 +361,7 @@ public boolean process(OptionHelper helper, String option) { Log log = helper.getLog(); String ownName = helper.getOwnName(); - log.printLines(PrefixKind.JAVAC, "fullVersion", ownName, JavaCompiler.fullVersion()); + log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "fullVersion", ownName, JavaCompiler.fullVersion()); return super.process(helper, option); } }, @@ -372,9 +372,9 @@ public boolean process(OptionHelper helper, String option) { Log log = helper.getLog(); String ownName = helper.getOwnName(); - log.printLines(PrefixKind.JAVAC, "msg.usage.header", ownName); + log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "msg.usage.header", ownName); showHelp(log, OptionKind.STANDARD); - log.printNewline(); + log.printNewline(WriterKind.STDOUT); return super.process(helper, option); } }, @@ -414,8 +414,8 @@ public boolean process(OptionHelper helper, String option) { Log log = helper.getLog(); showHelp(log, OptionKind.EXTENDED); - log.printNewline(); - log.printLines(PrefixKind.JAVAC, "msg.usage.nonstandard.footer"); + log.printNewline(WriterKind.STDOUT); + log.printLines(WriterKind.STDOUT, PrefixKind.JAVAC, "msg.usage.nonstandard.footer"); return super.process(helper, option); } }, @@ -1088,22 +1088,22 @@ if (synopses.length() < DEFAULT_SYNOPSIS_WIDTH && !descr.contains("\n") && (SMALL_INDENT.length() + DEFAULT_SYNOPSIS_WIDTH + 1 + descr.length() <= DEFAULT_MAX_LINE_LENGTH)) { - log.printRawLines(WriterKind.NOTICE, String.format(COMPACT_FORMAT, synopses, descr)); + log.printRawLines(WriterKind.STDOUT, String.format(COMPACT_FORMAT, synopses, descr)); return; } // If option synopses fit on a single line of reasonable length, show that; // otherwise, show 1 per line if (synopses.length() <= DEFAULT_MAX_LINE_LENGTH) { - log.printRawLines(WriterKind.NOTICE, SMALL_INDENT + synopses); + log.printRawLines(WriterKind.STDOUT, SMALL_INDENT + synopses); } else { for (String name: names) { - log.printRawLines(WriterKind.NOTICE, SMALL_INDENT + helpSynopsis(name, log)); + log.printRawLines(WriterKind.STDOUT, SMALL_INDENT + helpSynopsis(name, log)); } } // Finally, show the description - log.printRawLines(WriterKind.NOTICE, LARGE_INDENT + descr.replace("\n", "\n" + LARGE_INDENT)); + log.printRawLines(WriterKind.STDOUT, LARGE_INDENT + descr.replace("\n", "\n" + LARGE_INDENT)); } /**
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacTypes.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,9 @@ @DefinedBy(Api.LANGUAGE_MODEL) public boolean isSameType(TypeMirror t1, TypeMirror t2) { + if (t1.getKind() == TypeKind.WILDCARD || t2.getKind() == TypeKind.WILDCARD) { + return false; + } return types.isSameType((Type) t1, (Type) t2); }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -604,7 +604,7 @@ * Debugging function to display internal state. */ public void displayState() { - PrintWriter xout = context.get(Log.outKey); + PrintWriter xout = context.get(Log.logKey).getWriter(Log.WriterKind.STDERR); xout.println("File Object History : " + fileObjectHistory); xout.println("Open Type Names : " + openTypeNames); xout.println("Gen. Src Names : " + generatedSourceNames);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Aug 11 18:52:55 2016 -0700 @@ -26,12 +26,10 @@ package com.sun.tools.javac.processing; import java.io.Closeable; -import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; -import java.lang.reflect.Constructor; import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Path;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_ja.properties Thu Aug 11 18:52:55 2016 -0700 @@ -841,7 +841,7 @@ ## All errors which do not refer to a particular line in the source code are ## preceded by this string. -compiler.err.error=\u30A8\u30E9\u30FC: +compiler.err.error=\u30A8\u30E9\u30FC: # The following error messages do not refer to a line in the source code. compiler.err.cant.read.file={0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093 @@ -1021,7 +1021,7 @@ ## Warning messages may also include the following prefix to identify a ## lint option # 0: option name -compiler.warn.lintOption=[{0}] +compiler.warn.lintOption=[{0}] # 0: symbol compiler.warn.constant.SVUID=serialVersionUID\u306F\u30AF\u30E9\u30B9{0}\u306E\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 @@ -1328,6 +1328,8 @@ compiler.misc.class.file.wrong.class=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0D\u6B63\u306A\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u3059 +compiler.misc.module.info.invalid.super.class=\u7121\u52B9\u306A\u30B9\u30FC\u30D1\u30FC\u30FB\u30AF\u30E9\u30B9\u3092\u542B\u3080module-info + compiler.misc.class.file.not.found={0}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 # 0: string (classfile major version), 1: string (classfile minor version)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties Thu Aug 11 18:52:55 2016 -0700 @@ -841,7 +841,7 @@ ## All errors which do not refer to a particular line in the source code are ## preceded by this string. -compiler.err.error=\u9519\u8BEF: +compiler.err.error=\u9519\u8BEF: # The following error messages do not refer to a line in the source code. compiler.err.cant.read.file=\u65E0\u6CD5\u8BFB\u53D6: {0} @@ -927,7 +927,7 @@ # 0: boolean, 1: symbol compiler.note.mref.stat.1=\u8F6C\u6362\u65B9\u6CD5\u5F15\u7528\n\u66FF\u4EE3 metafactory = {0}\nbridge \u65B9\u6CD5 = {1} -compiler.note.note=\u6CE8: +compiler.note.note=\u6CE8: # 0: file name compiler.note.deprecated.filename={0}\u4F7F\u7528\u6216\u8986\u76D6\u4E86\u5DF2\u8FC7\u65F6\u7684 API\u3002 @@ -1016,12 +1016,12 @@ ## ## All warning messages are preceded by the following string. -compiler.warn.warning=\u8B66\u544A: +compiler.warn.warning=\u8B66\u544A: ## Warning messages may also include the following prefix to identify a ## lint option # 0: option name -compiler.warn.lintOption=[{0}] +compiler.warn.lintOption=[{0}] # 0: symbol compiler.warn.constant.SVUID=serialVersionUID \u5728\u7C7B{0}\u4E2D\u5FC5\u987B\u662F\u5E38\u91CF @@ -1328,6 +1328,8 @@ compiler.misc.class.file.wrong.class=\u7C7B\u6587\u4EF6\u5305\u542B\u9519\u8BEF\u7684\u7C7B: {0} +compiler.misc.module.info.invalid.super.class=\u5E26\u6709\u65E0\u6548\u8D85\u7C7B\u7684 module-info + compiler.misc.class.file.not.found=\u627E\u4E0D\u5230{0}\u7684\u7C7B\u6587\u4EF6 # 0: string (classfile major version), 1: string (classfile minor version)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac_ja.properties Thu Aug 11 18:52:55 2016 -0700 @@ -91,7 +91,7 @@ javac.opt.version=\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831 javac.opt.arg.pathname=<pathname> javac.opt.arg.file=<filename> -javac.opt.Xbootclasspath.p=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u4ED8\u52A0\u3059\u308B +javac.opt.Xbootclasspath.p=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u5148\u982D\u306B\u4ED8\u52A0\u3059\u308B javac.opt.Xbootclasspath.a=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306B\u8FFD\u52A0\u3059\u308B javac.opt.Xlint=\u63A8\u5968\u306E\u8B66\u544A\u3092\u6709\u52B9\u306B\u3059\u308B javac.opt.Xlint.all=\u3059\u3079\u3066\u306E\u8B66\u544A\u3092\u6709\u52B9\u306B\u3057\u307E\u3059
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java Thu Aug 11 18:52:55 2016 -0700 @@ -1879,15 +1879,34 @@ } } + public static abstract class JCOperatorExpression extends JCExpression { + public enum OperandPos { + LEFT, + RIGHT + } + + protected Tag opcode; + public OperatorSymbol operator; + + public OperatorSymbol getOperator() { + return operator; + } + + @Override + public Tag getTag() { + return opcode; + } + + public abstract JCExpression getOperand(OperandPos pos); + } + /** * An assignment with "+=", "|=" ... */ - public static class JCAssignOp extends JCExpression implements CompoundAssignmentTree { - private Tag opcode; + public static class JCAssignOp extends JCOperatorExpression implements CompoundAssignmentTree { public JCExpression lhs; public JCExpression rhs; - public Symbol operator; - protected JCAssignOp(Tag opcode, JCTree lhs, JCTree rhs, Symbol operator) { + protected JCAssignOp(Tag opcode, JCTree lhs, JCTree rhs, OperatorSymbol operator) { this.opcode = opcode; this.lhs = (JCExpression)lhs; this.rhs = (JCExpression)rhs; @@ -1902,26 +1921,21 @@ public JCExpression getVariable() { return lhs; } @DefinedBy(Api.COMPILER_TREE) public JCExpression getExpression() { return rhs; } - public Symbol getOperator() { - return operator; - } @Override @DefinedBy(Api.COMPILER_TREE) public <R,D> R accept(TreeVisitor<R,D> v, D d) { return v.visitCompoundAssignment(this, d); } @Override - public Tag getTag() { - return opcode; + public JCExpression getOperand(OperandPos pos) { + return pos == OperandPos.LEFT ? lhs : rhs; } } /** * A unary operation. */ - public static class JCUnary extends JCExpression implements UnaryTree { - private Tag opcode; + public static class JCUnary extends JCOperatorExpression implements UnaryTree { public JCExpression arg; - public Symbol operator; protected JCUnary(Tag opcode, JCExpression arg) { this.opcode = opcode; this.arg = arg; @@ -1933,35 +1947,29 @@ public Kind getKind() { return TreeInfo.tagToKind(getTag()); } @DefinedBy(Api.COMPILER_TREE) public JCExpression getExpression() { return arg; } - public Symbol getOperator() { - return operator; - } @Override @DefinedBy(Api.COMPILER_TREE) public <R,D> R accept(TreeVisitor<R,D> v, D d) { return v.visitUnary(this, d); } - @Override - public Tag getTag() { - return opcode; - } - public void setTag(Tag tag) { opcode = tag; } + @Override + public JCExpression getOperand(OperandPos pos) { + return arg; + } } /** * A binary operation. */ - public static class JCBinary extends JCExpression implements BinaryTree { - private Tag opcode; + public static class JCBinary extends JCOperatorExpression implements BinaryTree { public JCExpression lhs; public JCExpression rhs; - public Symbol operator; protected JCBinary(Tag opcode, JCExpression lhs, JCExpression rhs, - Symbol operator) { + OperatorSymbol operator) { this.opcode = opcode; this.lhs = lhs; this.rhs = rhs; @@ -1976,16 +1984,13 @@ public JCExpression getLeftOperand() { return lhs; } @DefinedBy(Api.COMPILER_TREE) public JCExpression getRightOperand() { return rhs; } - public Symbol getOperator() { - return operator; - } @Override @DefinedBy(Api.COMPILER_TREE) public <R,D> R accept(TreeVisitor<R,D> v, D d) { return v.visitBinary(this, d); } @Override - public Tag getTag() { - return opcode; + public JCExpression getOperand(OperandPos pos) { + return pos == OperandPos.LEFT ? lhs : rhs; } }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java Thu Aug 11 18:52:55 2016 -0700 @@ -36,14 +36,19 @@ import com.sun.tools.javac.tree.JCTree.JCPolyExpression.*; import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; + import static com.sun.tools.javac.code.Flags.*; import static com.sun.tools.javac.code.Kinds.Kind.*; import static com.sun.tools.javac.code.TypeTag.BOT; import static com.sun.tools.javac.tree.JCTree.Tag.*; import static com.sun.tools.javac.tree.JCTree.Tag.BLOCK; import static com.sun.tools.javac.tree.JCTree.Tag.SYNCHRONIZED; + import javax.tools.JavaFileObject; +import static com.sun.tools.javac.tree.JCTree.JCOperatorExpression.OperandPos.LEFT; +import static com.sun.tools.javac.tree.JCTree.JCOperatorExpression.OperandPos.RIGHT; + /** Utility class containing inspector methods for trees. * * <p><b>This is NOT part of any supported API. @@ -391,7 +396,6 @@ case SL_ASG: case SR_ASG: case USR_ASG: case PLUS_ASG: case MINUS_ASG: case MUL_ASG: case DIV_ASG: case MOD_ASG: - return getStartPos(((JCAssignOp) tree).lhs); case OR: case AND: case BITOR: case BITXOR: case BITAND: case EQ: case NE: case LT: case GT: @@ -399,7 +403,9 @@ case SR: case USR: case PLUS: case MINUS: case MUL: case DIV: case MOD: - return getStartPos(((JCBinary) tree).lhs); + case POSTINC: + case POSTDEC: + return getStartPos(((JCOperatorExpression) tree).getOperand(LEFT)); case CLASSDEF: { JCClassDecl node = (JCClassDecl)tree; if (node.mods.pos != Position.NOPOS) @@ -428,9 +434,6 @@ return getStartPos(((JCArrayTypeTree) tree).elemtype); case TYPETEST: return getStartPos(((JCInstanceOf) tree).expr); - case POSTINC: - case POSTDEC: - return getStartPos(((JCUnary) tree).arg); case ANNOTATED_TYPE: { JCAnnotatedType node = (JCAnnotatedType) tree; if (node.annotations.nonEmpty()) { @@ -491,7 +494,6 @@ case SL_ASG: case SR_ASG: case USR_ASG: case PLUS_ASG: case MINUS_ASG: case MUL_ASG: case DIV_ASG: case MOD_ASG: - return getEndPos(((JCAssignOp) tree).rhs, endPosTable); case OR: case AND: case BITOR: case BITXOR: case BITAND: case EQ: case NE: case LT: case GT: @@ -499,7 +501,13 @@ case SR: case USR: case PLUS: case MINUS: case MUL: case DIV: case MOD: - return getEndPos(((JCBinary) tree).rhs, endPosTable); + case POS: + case NEG: + case NOT: + case COMPL: + case PREINC: + case PREDEC: + return getEndPos(((JCOperatorExpression) tree).getOperand(RIGHT), endPosTable); case CASE: return getEndPos(((JCCase) tree).stats.last(), endPosTable); case CATCH: @@ -542,13 +550,6 @@ return getEndPos(((JCTypeCast) tree).expr, endPosTable); case TYPETEST: return getEndPos(((JCInstanceOf) tree).clazz, endPosTable); - case POS: - case NEG: - case NOT: - case COMPL: - case PREINC: - case PREDEC: - return getEndPos(((JCUnary) tree).arg, endPosTable); case WHILELOOP: return getEndPos(((JCWhileLoop) tree).body, endPosTable); case ANNOTATED_TYPE:
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java Thu Aug 11 18:52:55 2016 -0700 @@ -27,10 +27,13 @@ import java.io.*; import java.util.Arrays; +import java.util.EnumMap; import java.util.EnumSet; import java.util.HashSet; +import java.util.Map; import java.util.Queue; import java.util.Set; + import javax.tools.DiagnosticListener; import javax.tools.JavaFileObject; @@ -56,9 +59,12 @@ /** The context key for the log. */ public static final Context.Key<Log> logKey = new Context.Key<>(); - /** The context key for the output PrintWriter. */ + /** The context key for the standard output PrintWriter. */ public static final Context.Key<PrintWriter> outKey = new Context.Key<>(); + /** The context key for the diagnostic PrintWriter. */ + public static final Context.Key<PrintWriter> errKey = new Context.Key<>(); + /* TODO: Should unify this with prefix handling in JCDiagnostic.Factory. */ public enum PrefixKind { JAVAC("javac."), @@ -111,6 +117,7 @@ install(log); } + @Override public void report(JCDiagnostic diag) { } } @@ -134,6 +141,7 @@ install(log); } + @Override public void report(JCDiagnostic diag) { if (!diag.isFlagSet(JCDiagnostic.DiagnosticFlag.NON_DEFERRABLE) && (filter == null || filter.accepts(diag))) { @@ -163,13 +171,9 @@ } } - public enum WriterKind { NOTICE, WARNING, ERROR } + public enum WriterKind { NOTICE, WARNING, ERROR, STDOUT, STDERR } - protected PrintWriter errWriter; - - protected PrintWriter warnWriter; - - protected PrintWriter noticeWriter; + private final Map<WriterKind, PrintWriter> writers; /** The maximum number of errors/warnings that are reported. */ @@ -223,14 +227,130 @@ */ private DiagnosticHandler diagnosticHandler; - /** Construct a log with given I/O redirections. + /** Get the Log instance for this context. */ + public static Log instance(Context context) { + Log instance = context.get(logKey); + if (instance == null) + instance = new Log(context); + return instance; + } + + /** + * Register a Context.Factory to create a Log. */ + public static void preRegister(Context context, PrintWriter w) { + context.put(Log.class, (Context.Factory<Log>) (c -> new Log(c, w))); + } + + /** + * Construct a log with default settings. + * If no streams are set in the context, the log will be initialized to use + * System.out for normal output, and System.err for all diagnostic output. + * If one stream is set in the context, with either Log.outKey or Log.errKey, + * it will be used for all output. + * Otherwise, the log will be initialized to use both streams found in the context. + */ + protected Log(Context context) { + this(context, initWriters(context)); + } + + /** + * Initialize a map of writers based on values found in the context + * @param context the context in which to find writers to use + * @return a map of writers + */ + private static Map<WriterKind, PrintWriter> initWriters(Context context) { + PrintWriter out = context.get(outKey); + PrintWriter err = context.get(errKey); + if (out == null && err == null) { + out = new PrintWriter(System.out, true); + err = new PrintWriter(System.err, true); + return initWriters(out, err); + } else if (out == null || err == null) { + PrintWriter pw = (out != null) ? out : err; + return initWriters(pw, pw); + } else { + return initWriters(out, err); + } + } + + /** + * Construct a log with all output sent to a single output stream. + */ + protected Log(Context context, PrintWriter writer) { + this(context, initWriters(writer, writer)); + } + + /** + * Construct a log. + * The log will be initialized to use stdOut for normal output, and stdErr + * for all diagnostic output. + */ + protected Log(Context context, PrintWriter out, PrintWriter err) { + this(context, initWriters(out, err)); + } + + /** + * Initialize a writer map for a stream for normal output, and a stream for diagnostics. + * @param out a stream to be used for normal output + * @param err a stream to be used for diagnostic messages, such as errors, warnings, etc + * @return a map of writers + */ + private static Map<WriterKind, PrintWriter> initWriters(PrintWriter out, PrintWriter err) { + Map<WriterKind, PrintWriter> writers = new EnumMap<>(WriterKind.class); + writers.put(WriterKind.ERROR, err); + writers.put(WriterKind.WARNING, err); + writers.put(WriterKind.NOTICE, err); + + writers.put(WriterKind.STDOUT, out); + writers.put(WriterKind.STDERR, err); + + return writers; + } + + /** + * Construct a log with given I/O redirections. + * @deprecated + * This constructor is provided to support the supported but now-deprecated javadoc entry point + * com.sun.tools.javadoc.Main.execute(String programName, + * PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter, + * String defaultDocletClassName, String... args) + */ + @Deprecated protected Log(Context context, PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter) { + this(context, initWriters(errWriter, warnWriter, noticeWriter)); + } + + /** + * Initialize a writer map with different streams for different types of diagnostics. + * @param errWriter a stream for writing error messages + * @param warnWriter a stream for writing warning messages + * @param noticeWriter a stream for writing notice messages + * @return a map of writers + * @deprecated This method exists to support a supported but now deprecated javadoc entry point. + */ + @Deprecated + private static Map<WriterKind, PrintWriter> initWriters(PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter) { + Map<WriterKind, PrintWriter> writers = new EnumMap<>(WriterKind.class); + writers.put(WriterKind.ERROR, errWriter); + writers.put(WriterKind.WARNING, warnWriter); + writers.put(WriterKind.NOTICE, noticeWriter); + + writers.put(WriterKind.STDOUT, noticeWriter); + writers.put(WriterKind.STDERR, errWriter); + + return writers; + } + + /** + * Creates a log. + * @param context the context in which the log should be registered + * @param writers a map of writers that can be accessed by the kind of writer required + */ + private Log(Context context, Map<WriterKind, PrintWriter> writers) { super(JCDiagnostic.Factory.instance(context)); context.put(logKey, this); - this.errWriter = errWriter; - this.warnWriter = warnWriter; - this.noticeWriter = noticeWriter; + this.writers = writers; @SuppressWarnings("unchecked") // FIXME DiagnosticListener<? super JavaFileObject> dl = @@ -245,6 +365,7 @@ final Options options = Options.instance(context); initOptions(options); options.addListener(new Runnable() { + @Override public void run() { initOptions(options); } @@ -293,42 +414,6 @@ return 100; } - /** The default writer for diagnostics - */ - static PrintWriter defaultWriter(Context context) { - PrintWriter result = context.get(outKey); - if (result == null) - context.put(outKey, result = new PrintWriter(System.err)); - return result; - } - - /** Construct a log with default settings. - */ - protected Log(Context context) { - this(context, defaultWriter(context)); - } - - /** Construct a log with all output redirected. - */ - protected Log(Context context, PrintWriter defaultWriter) { - this(context, defaultWriter, defaultWriter, defaultWriter); - } - - /** Get the Log instance for this context. */ - public static Log instance(Context context) { - Log instance = context.get(logKey); - if (instance == null) - instance = new Log(context); - return instance; - } - - /** - * Register a Context.Factory to create a Log. - */ - public static void preRegister(Context context, PrintWriter w) { - context.put(Log.class, (Context.Factory<Log>) (c -> new Log(c, w))); - } - /** The number of errors encountered so far. */ public int nerrors = 0; @@ -371,26 +456,18 @@ } public PrintWriter getWriter(WriterKind kind) { - switch (kind) { - case NOTICE: return noticeWriter; - case WARNING: return warnWriter; - case ERROR: return errWriter; - default: throw new IllegalArgumentException(); - } + return writers.get(kind); } public void setWriter(WriterKind kind, PrintWriter pw) { Assert.checkNonNull(pw); - switch (kind) { - case NOTICE: noticeWriter = pw; break; - case WARNING: warnWriter = pw; break; - case ERROR: errWriter = pw; break; - default: throw new IllegalArgumentException(); - } + writers.put(kind, pw); } public void setWriters(PrintWriter pw) { - noticeWriter = warnWriter = errWriter = Assert.checkNonNull(pw); + Assert.checkNonNull(pw); + for (WriterKind k: WriterKind.values()) + writers.put(k, pw); } /** @@ -407,9 +484,9 @@ /** Flush the logs */ public void flush() { - errWriter.flush(); - warnWriter.flush(); - noticeWriter.flush(); + for (PrintWriter pw: writers.values()) { + pw.flush(); + } } public void flush(WriterKind kind) { @@ -470,6 +547,7 @@ } public void printNewline() { + PrintWriter noticeWriter = writers.get(WriterKind.NOTICE); noticeWriter.println(); } @@ -478,10 +556,12 @@ } public void printLines(String key, Object... args) { + PrintWriter noticeWriter = writers.get(WriterKind.NOTICE); printRawLines(noticeWriter, localize(key, args)); } public void printLines(PrefixKind pk, String key, Object... args) { + PrintWriter noticeWriter = writers.get(WriterKind.NOTICE); printRawLines(noticeWriter, localize(pk, key, args)); } @@ -497,6 +577,7 @@ * for the platform. */ public void printRawLines(String msg) { + PrintWriter noticeWriter = writers.get(WriterKind.NOTICE); printRawLines(noticeWriter, msg); } @@ -524,10 +605,13 @@ * noticeWriter stream. */ public void printVerbose(String key, Object... args) { + PrintWriter noticeWriter = writers.get(WriterKind.NOTICE); printRawLines(noticeWriter, localize("verbose." + key, args)); } + @Override protected void directError(String key, Object... args) { + PrintWriter errWriter = writers.get(WriterKind.ERROR); printRawLines(errWriter, localize(key, args)); errWriter.flush(); } @@ -546,6 +630,7 @@ * Primary method to report a diagnostic. * @param diagnostic */ + @Override public void report(JCDiagnostic diagnostic) { diagnosticHandler.report(diagnostic); } @@ -556,6 +641,7 @@ * reported so far, the diagnostic may be handed off to writeDiagnostic. */ private class DefaultDiagnosticHandler extends DiagnosticHandler { + @Override public void report(JCDiagnostic diagnostic) { if (expectDiagKeys != null) expectDiagKeys.remove(diagnostic.getCode()); @@ -631,13 +717,13 @@ throw new IllegalArgumentException(); case NOTE: - return noticeWriter; + return writers.get(WriterKind.NOTICE); case WARNING: - return warnWriter; + return writers.get(WriterKind.WARNING); case ERROR: - return errWriter; + return writers.get(WriterKind.ERROR); default: throw new Error(); @@ -691,26 +777,27 @@ /** print an error or warning message: */ - private void printRawError(int pos, String msg) { + private void printRawDiag(PrintWriter pw, String prefix, int pos, String msg) { if (source == null || pos == Position.NOPOS) { - printRawLines(errWriter, "error: " + msg); + printRawLines(pw, prefix + msg); } else { int line = source.getLineNumber(pos); JavaFileObject file = source.getFile(); if (file != null) - printRawLines(errWriter, + printRawLines(pw, file.getName() + ":" + line + ": " + msg); - printErrLine(pos, errWriter); + printErrLine(pos, pw); } - errWriter.flush(); + pw.flush(); } /** report an error: */ public void rawError(int pos, String msg) { + PrintWriter errWriter = writers.get(WriterKind.ERROR); if (nerrors < MaxErrors && shouldReport(currentSourceFile(), pos)) { - printRawError(pos, msg); + printRawDiag(errWriter, "error: ", pos, msg); prompt(); nerrors++; } @@ -720,12 +807,13 @@ /** report a warning: */ public void rawWarning(int pos, String msg) { + PrintWriter warnWriter = writers.get(WriterKind.ERROR); if (nwarnings < MaxWarnings && emitWarnings) { - printRawError(pos, "warning: " + msg); + printRawDiag(warnWriter, "warning: ", pos, msg); } prompt(); nwarnings++; - errWriter.flush(); + warnWriter.flush(); } public static String format(String fmt, Object... args) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javah/JavahFileManager.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javah/JavahFileManager.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ if (dl != null) javac_context.put(DiagnosticListener.class, dl); - javac_context.put(com.sun.tools.javac.util.Log.outKey, log); + javac_context.put(com.sun.tools.javac.util.Log.errKey, log); return new JavahFileManager(javac_context, null); }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTool.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/JavadocTool.java Thu Aug 11 18:52:55 2016 -0700 @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.util.Collection; +import java.util.Collections; import java.util.EnumSet; import java.util.HashSet; import java.util.LinkedHashMap; @@ -44,6 +45,7 @@ import com.sun.tools.javac.code.ClassFinder; import com.sun.tools.javac.code.Symbol.Completer; import com.sun.tools.javac.code.Symbol.ModuleSymbol; +import com.sun.tools.javac.code.Symbol.PackageSymbol; import com.sun.tools.javac.comp.Enter; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.JCClassDecl; @@ -52,6 +54,7 @@ import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; +import com.sun.tools.javac.util.Name; /** @@ -183,9 +186,8 @@ // Parse file objects provide via the DocumentationTool API parse(fileObjects, classTrees, true); - modules.enter(classTrees.toList(), null); - syms.unnamedModule.complete(); // TEMP to force reading all named modules + modules.initModules(classTrees.toList(), Collections.emptySet(), Collections.emptySet()); // Build up the complete list of any packages to be documented Location location = modules.multiModuleMode ? StandardLocation.MODULE_SOURCE_PATH @@ -386,8 +388,16 @@ private Location getLocation(String packageName) throws IOException { if (location == StandardLocation.MODULE_SOURCE_PATH) { // TODO: handle invalid results - ModuleSymbol msym = syms.inferModule(names.fromString(packageName)); - return fm.getModuleLocation(location, msym.name.toString()); + Name pack = names.fromString(packageName); + + for (ModuleSymbol msym : modules.allModules()) { + PackageSymbol p = syms.getPackage(msym, pack); + if (p != null && !p.members().isEmpty()) { + return fm.getModuleLocation(location, msym.name.toString()); + } + } + + return null; } else { return location; }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -174,6 +174,7 @@ if (nerrors < MaxErrors) { String prefix = (pos == null) ? programName : pos.toString(); + PrintWriter errWriter = getWriter(WriterKind.ERROR); errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg); errWriter.flush(); prompt(); @@ -206,6 +207,7 @@ if (nwarnings < MaxWarnings) { String prefix = (pos == null) ? programName : pos.toString(); + PrintWriter warnWriter = getWriter(WriterKind.WARNING); warnWriter.println(prefix + ": " + getText("javadoc.warning") +" - " + msg); warnWriter.flush(); nwarnings++; @@ -235,6 +237,7 @@ return; } + PrintWriter noticeWriter = getWriter(WriterKind.NOTICE); if (pos == null) noticeWriter.println(msg); else
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java Thu Aug 11 18:52:55 2016 -0700 @@ -160,7 +160,7 @@ if (log instanceof Messager) messager = (Messager) log; else { - PrintWriter out = context.get(Log.outKey); + PrintWriter out = context.get(Log.errKey); messager = (out == null) ? new Messager(context, javadocName) : new Messager(context, javadocName, out, out, out); }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTool.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTool.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,11 +107,11 @@ context.put(DiagnosticListener.class, ccw.wrap(diagnosticListener)); if (out == null) - context.put(Log.outKey, new PrintWriter(System.err, true)); + context.put(Log.errKey, new PrintWriter(System.err, true)); else if (out instanceof PrintWriter) - context.put(Log.outKey, ((PrintWriter) out)); + context.put(Log.errKey, ((PrintWriter) out)); else - context.put(Log.outKey, new PrintWriter(out, true)); + context.put(Log.errKey, new PrintWriter(out, true)); if (fileManager == null) { fileManager = getStandardFileManager(diagnosticListener, null, null); @@ -141,7 +141,7 @@ PrintWriter pw = (charset == null) ? new PrintWriter(System.err, true) : new PrintWriter(new OutputStreamWriter(System.err, charset), true); - context.put(Log.outKey, pw); + context.put(Log.errKey, pw); return new JavacFileManager(context, true, charset); }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Thu Aug 11 18:52:55 2016 -0700 @@ -275,6 +275,7 @@ int i = 0; for (ModuleElement mdle : mdles) { ModulePackageIndexFrameWriter.generate(configuration, mdle); + ModuleFrameWriter.generate(configuration, mdle); nextModule = (i + 1 < mdles.size()) ? mdles.get(i + 1) : null; AbstractBuilder moduleSummaryBuilder = configuration.getBuilderFactory().getModuleSummaryBuilder(
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleFrameWriter.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.javadoc.internal.doclets.formats.html; + +import java.io.*; +import java.util.*; + +import javax.lang.model.element.ModuleElement; +import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.ElementFilter; + +import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants; +import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; +import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; +import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; +import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; +import jdk.javadoc.internal.doclets.toolkit.Content; +import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; +import jdk.javadoc.internal.doclets.toolkit.util.DocletAbortException; + + +/** + * Class to generate file for each module contents in the left-hand bottom + * frame. This will list all the Class Kinds in the module. A click on any + * class-kind will update the right-hand frame with the clicked class-kind page. + * + * <p><b>This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice.</b> + * + * @author Bhavesh Patel + */ +public class ModuleFrameWriter extends HtmlDocletWriter { + + /** + * The module being documented. + */ + private ModuleElement mdle; + + /** + * The classes to be documented. Use this to filter out classes + * that will not be documented. + */ + private SortedSet<TypeElement> documentedClasses; + + /** + * Constructor to construct ModuleFrameWriter object and to generate + * "module_name-type-frame.html" file. For example for module "java.base" this will generate file + * "java.base-type-frame.html" file. + * + * @param configuration the configuration of the doclet. + * @param moduleElement moduleElement under consideration. + */ + public ModuleFrameWriter(ConfigurationImpl configuration, ModuleElement moduleElement) + throws IOException { + super(configuration, DocPaths.moduleTypeFrame(moduleElement)); + this.mdle = moduleElement; + if (utils.getSpecifiedPackages().isEmpty()) { + documentedClasses = new TreeSet<>(utils.makeGeneralPurposeComparator()); + documentedClasses.addAll(configuration.docEnv.getIncludedClasses()); + } + } + + /** + * Generate a module type summary page for the left-hand bottom frame. + * + * @param configuration the current configuration of the doclet. + * @param moduleElement The package for which "module_name-type-frame.html" is to be generated. + */ + public static void generate(ConfigurationImpl configuration, ModuleElement moduleElement) { + ModuleFrameWriter mdlgen; + try { + mdlgen = new ModuleFrameWriter(configuration, moduleElement); + String mdlName = moduleElement.getQualifiedName().toString(); + Content mdlLabel = new StringContent(mdlName); + HtmlTree body = mdlgen.getBody(false, mdlgen.getWindowTitle(mdlName)); + HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) + ? HtmlTree.MAIN() + : body; + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, + mdlgen.getHyperLink(DocPaths.moduleSummary(moduleElement), mdlLabel, "", "classFrame")); + htmlTree.addContent(heading); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.indexContainer); + mdlgen.addClassListing(div); + htmlTree.addContent(div); + if (configuration.allowTag(HtmlTag.MAIN)) { + body.addContent(htmlTree); + } + mdlgen.printHtmlDocument( + configuration.metakeywords.getMetaKeywordsForModule(moduleElement), false, body); + mdlgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), DocPaths.moduleTypeFrame(moduleElement).getPath()); + throw new DocletAbortException(exc); + } + } + + /** + * Add class listing for all the classes in this module. Divide class + * listing as per the class kind and generate separate listing for + * Classes, Interfaces, Exceptions and Errors. + * + * @param contentTree the content tree to which the listing will be added + */ + protected void addClassListing(HtmlTree contentTree) { + List<PackageElement> packagesIn = ElementFilter.packagesIn(mdle.getEnclosedElements()); + SortedSet<TypeElement> interfaces = new TreeSet<>(utils.makeGeneralPurposeComparator()); + SortedSet<TypeElement> classes = new TreeSet<>(utils.makeGeneralPurposeComparator()); + SortedSet<TypeElement> enums = new TreeSet<>(utils.makeGeneralPurposeComparator()); + SortedSet<TypeElement> exceptions = new TreeSet<>(utils.makeGeneralPurposeComparator()); + SortedSet<TypeElement> errors = new TreeSet<>(utils.makeGeneralPurposeComparator()); + SortedSet<TypeElement> annotationTypes = new TreeSet<>(utils.makeGeneralPurposeComparator()); + for (PackageElement pkg : packagesIn) { + if (utils.isIncluded(pkg)) { + interfaces.addAll(utils.getInterfaces(pkg)); + classes.addAll(utils.getOrdinaryClasses(pkg)); + enums.addAll(utils.getEnums(pkg)); + exceptions.addAll(utils.getExceptions(pkg)); + errors.addAll(utils.getErrors(pkg)); + annotationTypes.addAll(utils.getAnnotationTypes(pkg)); + } + } + addClassKindListing(interfaces, getResource("doclet.Interfaces"), contentTree); + addClassKindListing(classes, getResource("doclet.Classes"), contentTree); + addClassKindListing(enums, getResource("doclet.Enums"), contentTree); + addClassKindListing(exceptions, getResource("doclet.Exceptions"), contentTree); + addClassKindListing(errors, getResource("doclet.Errors"), contentTree); + addClassKindListing(annotationTypes, getResource("doclet.AnnotationTypes"), contentTree); + } + + /** + * Add specific class kind listing. Also add label to the listing. + * + * @param list Iterable list of TypeElements + * @param labelContent content tree of the label to be added + * @param contentTree the content tree to which the class kind listing will be added + */ + protected void addClassKindListing(Iterable<TypeElement> list, Content labelContent, + HtmlTree contentTree) { + SortedSet<TypeElement> tset = utils.filterOutPrivateClasses(list, configuration.javafx); + if (!tset.isEmpty()) { + boolean printedHeader = false; + HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) + ? HtmlTree.SECTION() + : contentTree; + HtmlTree ul = new HtmlTree(HtmlTag.UL); + ul.setTitle(labelContent); + for (TypeElement typeElement : tset) { + if (documentedClasses != null && !documentedClasses.contains(typeElement)) { + continue; + } + if (!utils.isCoreClass(typeElement) || !configuration.isGeneratedDoc(typeElement)) { + continue; + } + if (!printedHeader) { + Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + true, labelContent); + htmlTree.addContent(heading); + printedHeader = true; + } + Content arr_i_name = new StringContent(utils.getSimpleName(typeElement)); + if (utils.isInterface(typeElement)) { + arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); + } + Content link = getLink(new LinkInfoImpl(configuration, + LinkInfoImpl.Kind.ALL_CLASSES_FRAME, typeElement).label(arr_i_name).target("classFrame")); + Content li = HtmlTree.LI(link); + ul.addContent(li); + } + htmlTree.addContent(ul); + if (configuration.allowTag(HtmlTag.SECTION)) { + contentTree.addContent(htmlTree); + } + } + } +}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexFrameWriter.java Thu Aug 11 18:52:55 2016 -0700 @@ -110,15 +110,13 @@ /** * Returns each module name as a separate link. * - * @param moduleName the module being documented + * @param mdle the module being documented * @return content for the module link */ protected Content getModuleLink(ModuleElement mdle) { Content moduleLinkContent; - Content moduleLabel; - moduleLabel = new StringContent(mdle.getQualifiedName().toString()); - moduleLinkContent = getHyperLink(DocPaths.moduleFrame(mdle), - moduleLabel, "", "packageListFrame"); + Content mdlLabel = new StringContent(mdle.getQualifiedName()); + moduleLinkContent = getModuleFramesHyperLink(mdle, mdlLabel, "packageListFrame"); Content li = HtmlTree.LI(moduleLinkContent); return li; }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlAttr.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlAttr.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,7 @@ ID, LANG, NAME, + ONCLICK, ONLOAD, REL, ROLE,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Thu Aug 11 18:52:55 2016 -0700 @@ -28,6 +28,7 @@ import java.io.*; import java.util.*; +import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; @@ -282,6 +283,21 @@ return anchor; } + public Content getModuleFramesHyperLink(ModuleElement mdle, Content label, String target) { + DocLink mdlLink = new DocLink(DocPaths.moduleFrame(mdle)); + DocLink mtFrameLink = new DocLink(DocPaths.moduleTypeFrame(mdle)); + DocLink cFrameLink = new DocLink(DocPaths.moduleSummary(mdle)); + HtmlTree anchor = HtmlTree.A(mdlLink.toString(), label); + StringBuilder onclickStr = new StringBuilder("updateModuleFrame('") + .append(mtFrameLink.toString()) + .append("','") + .append(cFrameLink.toString()) + .append("');"); + anchor.addAttr(HtmlAttr.TARGET, target); + anchor.addAttr(HtmlAttr.ONCLICK, onclickStr.toString()); + return anchor; + } + /** * Get the enclosed name of the package *
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_ja.properties Thu Aug 11 18:52:55 2016 -0700 @@ -99,7 +99,7 @@ doclet.Subinterfaces=\u65E2\u77E5\u306E\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8: doclet.Implementing_Classes=\u65E2\u77E5\u306E\u5B9F\u88C5\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8: doclet.Functional_Interface=\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Functional_Interface_Message=\u3053\u308C\u306F\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306A\u306E\u3067\u3001\u30E9\u30E0\u30C0\u5F0F\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u5272\u5F53\u3066\u30BF\u30FC\u30B2\u30C3\u30C8\u3068\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 +doclet.Functional_Interface_Message=\u3053\u308C\u306F\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306A\u306E\u3067\u3001\u30E9\u30E0\u30C0\u5F0F\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u5272\u5F53\u3066\u30BF\u30FC\u30B2\u30C3\u30C8\u3068\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 doclet.also=\u540C\u69D8\u306B doclet.Frames=\u30D5\u30EC\u30FC\u30E0 doclet.No_Frames=\u30D5\u30EC\u30FC\u30E0\u306A\u3057 @@ -185,6 +185,7 @@ doclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} doclet.exception_encountered={1}\u306E\u51E6\u7406\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n{0} +# option specifiers doclet.usage.d.name=d doclet.usage.d.parameters=<directory> doclet.usage.d.description=\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA @@ -244,7 +245,7 @@ doclet.usage.excludedocfilessubdir.name=excludedocfilessubdir doclet.usage.excludedocfilessubdir.parameters=<name>:.. -doclet.usage.excludedocfilessubdir.description=\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3057\u307E\u3059 +doclet.usage.excludedocfilessubdir.description=\n \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3057\u307E\u3059 doclet.usage.group.name=group doclet.usage.group.parameters=<name> <p1>:<p2>.. @@ -289,7 +290,7 @@ doclet.usage.tag.name=tag doclet.usage.tag.parameters=<name>:<locations>:<header> -doclet.usage.tag.description=\u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059 +doclet.usage.tag.description=\n \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059 doclet.usage.taglet.name=taglet doclet.usage.taglet.description=\u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3057\u307E\u3059 @@ -333,8 +334,8 @@ doclet.xusage.xdoclint-extended.name=Xdoclint: doclet.xusage.xdoclint-extended.parameters=(all|none|[-]<group>) # L10N: do not localize these words: all none accessibility html missing reference syntax -doclet.xusage.xdoclint-extended.description=javadoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u554F\u984C\u306B\u5BFE\u3059\u308B\u7279\u5B9A\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\n javadoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u554F\u984C\u306B\u5BFE\u3059\u308B\u7279\u5B9A\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\n \u3053\u3053\u3067\u3001<group>\u306Faccessibility\u3001html\u3001missing\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002\n +doclet.xusage.xdoclint-extended.description=javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306B\u95A2\u3059\u308B\u7279\u5B9A\u306E\u30C1\u30A7\u30C3\u30AF\u3092\n \u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\n \u3053\u3053\u3067\u3001<group>\u306Faccessibility\u3001html\u3001\n missing\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002\n doclet.xusage.xdoclint-package.name=Xdoclint/package: doclet.xusage.xdoclint-package.parameters=([-]<packages>) -doclet.xusage.xdoclint-package.description=\n \u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002<packages>\u306F\n \u30AB\u30F3\u30DE\u3067\u533A\u5207\u3089\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306F\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B.*'\u6307\u5B9A(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u524D\u306B-\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\n \u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002\n +doclet.xusage.xdoclint-package.description=\n \u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002<packages>\u306F\n \u30AB\u30F3\u30DE\u3067\u533A\u5207\u3089\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306F\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B.*'\u6307\u5B9A(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u524D\u306B-\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\n \u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002\n
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard_zh_CN.properties Thu Aug 11 18:52:55 2016 -0700 @@ -185,6 +185,7 @@ doclet.Same_package_name_used=\u7A0B\u5E8F\u5305\u540D\u79F0\u5F62\u5F0F\u4F7F\u7528\u4E86\u4E24\u6B21: {0} doclet.exception_encountered=\u5904\u7406{1}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\n{0} +# option specifiers doclet.usage.d.name=d doclet.usage.d.parameters=<directory> doclet.usage.d.description=\u8F93\u51FA\u6587\u4EF6\u7684\u76EE\u6807\u76EE\u5F55 @@ -244,7 +245,7 @@ doclet.usage.excludedocfilessubdir.name=excludedocfilessubdir doclet.usage.excludedocfilessubdir.parameters=<name>:.. -doclet.usage.excludedocfilessubdir.description=\u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55 +doclet.usage.excludedocfilessubdir.description=\n \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55 doclet.usage.group.name=group doclet.usage.group.parameters=<name> <p1>:<p2>.. @@ -289,7 +290,7 @@ doclet.usage.tag.name=tag doclet.usage.tag.parameters=<name>:<locations>:<header> -doclet.usage.tag.description=\u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0 +doclet.usage.tag.description=\n \u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0 doclet.usage.taglet.name=taglet doclet.usage.taglet.description=\u8981\u6CE8\u518C\u7684 Taglet \u7684\u5168\u9650\u5B9A\u540D\u79F0 @@ -313,7 +314,7 @@ doclet.usage.sourcetab.description=\u6307\u5B9A\u6E90\u4E2D\u6BCF\u4E2A\u5236\u8868\u7B26\u5360\u636E\u7684\u7A7A\u683C\u6570 doclet.usage.keywords.name=keywords -doclet.usage.keywords.description=\u968F\u7A0B\u5E8F\u5305, \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u4E00\u8D77\u9644\u5E26 HTML \u5143\u6807\u8BB0 +doclet.usage.keywords.description=\u968F\u7A0B\u5E8F\u5305,\n \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u4E00\u8D77\u9644\u5E26 HTML \u5143\u6807\u8BB0 doclet.usage.stylesheetfile.name=stylesheetfile doclet.usage.stylesheetfile.parameters=<path> @@ -325,16 +326,16 @@ doclet.xusage.xdocrootparent.name=Xdocrootparent doclet.xusage.xdocrootparent.parameters=<url> -doclet.xusage.xdocrootparent.description=\u5C06\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\u6240\u6709\u540E\u8DDF /.. \u7684 @docRoot \u66FF\u6362\u4E3A <url> +doclet.xusage.xdocrootparent.description=\u5C06\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\u6240\u6709\u540E\u8DDF /..\n \u7684 @docRoot \u66FF\u6362\u4E3A <url> doclet.xusage.xdoclint.name=Xdoclint -doclet.xusage.xdoclint.description=\u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u5EFA\u8BAE\u7684\u68C0\u67E5 +doclet.xusage.xdoclint.description=\u4E3A\n javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u5EFA\u8BAE\u7684\u68C0\u67E5 doclet.xusage.xdoclint-extended.name=Xdoclint: doclet.xusage.xdoclint-extended.parameters=(all|none|[-]<group>) # L10N: do not localize these words: all none accessibility html missing reference syntax -doclet.xusage.xdoclint-extended.description=\u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5,\n \u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5,\n \u5176\u4E2D <group> \u4E3A accessibility, html, missing, reference \u6216 syntax \u4E4B\u4E00\u3002\n +doclet.xusage.xdoclint-extended.description=\u9488\u5BF9 javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\n \u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5,\n \u5176\u4E2D <\u7EC4> \u4E3A accessibility, html,\n missing, reference \u6216 syntax \u4E4B\u4E00\u3002\n doclet.xusage.xdoclint-package.name=Xdoclint/package: doclet.xusage.xdoclint-package.parameters=([-]<packages>) -doclet.xusage.xdoclint-package.description=\n \u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\u68C0\u67E5\u3002<\u7A0B\u5E8F\u5305> \u662F\u9017\u53F7\u5206\u9694\u7684\n \u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u5217\u8868\u3002\u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u662F\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\u540D\u79F0\n \u6216\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u540E\u8DDF .*, \u5B83\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\n \u6240\u6709\u5B50\u7A0B\u5E8F\u5305\u3002\u5728\u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u524D\u9762\u52A0\u4E0A - \u53EF\u4EE5\u4E3A\n \u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002\n +doclet.xusage.xdoclint-package.description=\n \u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\n \u68C0\u67E5\u3002<\u7A0B\u5E8F\u5305> \u662F\u9017\u53F7\u5206\u9694\u7684\n \u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u5217\u8868\u3002\n \u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u662F\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\n \u540D\u79F0\u6216\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u540E\u8DDF .*, \n \u5B83\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\n \u6240\u6709\u5B50\u7A0B\u5E8F\u5305\u3002\u5728\u7A0B\u5E8F\u5305\n \u8BF4\u660E\u7B26\u524D\u9762\u52A0\u4E0A - \u53EF\u4EE5\u4E3A\n \u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002\n
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,3 +107,9 @@ } } } + +function updateModuleFrame(pFrame, cFrame) +{ + top.packageFrame.location = pFrame; + top.classFrame.location = cFrame; +}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java Thu Aug 11 18:52:55 2016 -0700 @@ -155,6 +155,11 @@ return DocPath.create(mdle.getQualifiedName() + "-summary.html"); } + /** The name of the file for the module frame. */ + public static DocPath moduleTypeFrame(ModuleElement mdle) { + return DocPath.create(mdle.getQualifiedName() + "-type-frame.html"); + } + /** The name of the file for the module overview frame. */ public static final DocPath MODULE_OVERVIEW_FRAME = DocPath.create("module-overview-frame.html");
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocTool.java Thu Aug 11 18:52:55 2016 -0700 @@ -49,6 +49,7 @@ import com.sun.tools.javac.code.Symbol.Completer; import com.sun.tools.javac.code.Symbol.CompletionFailure; import com.sun.tools.javac.code.Symbol.ModuleSymbol; +import com.sun.tools.javac.code.Symbol.PackageSymbol; import com.sun.tools.javac.comp.Enter; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.JCClassDecl; @@ -56,6 +57,7 @@ import com.sun.tools.javac.util.Abort; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.ListBuffer; +import com.sun.tools.javac.util.Name; import com.sun.tools.javac.util.Position; import jdk.javadoc.doclet.DocletEnvironment; @@ -187,9 +189,8 @@ // Parse file objects provide via the DocumentationTool API parse(fileObjects, classTrees, true); - modules.enter(classTrees.toList(), null); - syms.unnamedModule.complete(); // TEMP to force reading all named modules + modules.initModules(classTrees.toList(), Collections.emptySet(), Collections.emptySet()); // Build up the complete list of any packages to be documented Location location = modules.multiModuleMode ? StandardLocation.MODULE_SOURCE_PATH @@ -394,11 +395,16 @@ private Location getLocation(String packageName) throws IOException { if (location == StandardLocation.MODULE_SOURCE_PATH) { // TODO: handle invalid results better. - ModuleSymbol msym = syms.inferModule(names.fromString(packageName)); - if (msym == null) { - return null; + Name pack = names.fromString(packageName); + + for (ModuleSymbol msym : modules.allModules()) { + PackageSymbol p = syms.getPackage(msym, pack); + if (p != null && !p.members().isEmpty()) { + return fm.getModuleLocation(location, msym.name.toString()); + } } - return fm.getModuleLocation(location, msym.name.toString()); + + return null; } else { return location; }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Messager.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Messager.java Thu Aug 11 18:52:55 2016 -0700 @@ -165,8 +165,8 @@ /** * Constructor * @param programName Name of the program (for error messages). - * @param outWriter Stream for notices etc. - * @param errWriter Stream for errors and warnings + * @param stdOut Stream for notices etc. + * @param stdErr Stream for errors and warnings */ @SuppressWarnings("deprecation") public Messager(Context context, String programName, PrintWriter outWriter, PrintWriter errWriter) { @@ -254,6 +254,7 @@ private void incrementErrorCount(String prefix, String msg) { if (nerrors < MaxErrors) { + PrintWriter errWriter = getWriter(WriterKind.ERROR); errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg); errWriter.flush(); prompt(); @@ -291,6 +292,7 @@ private void incrementWarningCount(String prefix, String msg) { if (nwarnings < MaxWarnings) { + PrintWriter warnWriter = getWriter(WriterKind.WARNING); warnWriter.println(prefix + ": " + getText("javadoc.warning") + " - " + msg); warnWriter.flush(); nwarnings++; @@ -314,6 +316,7 @@ return; } + PrintWriter noticeWriter = getWriter(WriterKind.NOTICE); if (path == null) { noticeWriter.println(msg); } else { @@ -329,6 +332,7 @@ return; } + PrintWriter noticeWriter = getWriter(WriterKind.NOTICE); if (e == null) { noticeWriter.println(msg); } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java Thu Aug 11 18:52:55 2016 -0700 @@ -155,7 +155,7 @@ if (log instanceof Messager) { messager = (Messager) log; } else { - PrintWriter out = context.get(Log.outKey); + PrintWriter out = context.get(Log.errKey); messager = (out == null) ? new Messager(context, ProgramName) : new Messager(context, ProgramName, out, out);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java Thu Aug 11 18:52:55 2016 -0700 @@ -812,7 +812,7 @@ } private String esc(char c, char quote) { - if (32 <= c && c <= 126 && c != quote) + if (32 <= c && c <= 126 && c != quote && c != '\\') return String.valueOf(c); else switch (c) { case '\b': return "\\b";
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java Thu Aug 11 18:52:55 2016 -0700 @@ -385,6 +385,10 @@ sb.append('\\').append('\\'); break; default: + if (Character.isISOControl(c)) { + sb.append(String.format("\\u%04x", (int) c)); + break; + } sb.append(c); } }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapFileManager.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapFileManager.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ if (dl != null) javac_context.put(DiagnosticListener.class, dl); - javac_context.put(com.sun.tools.javac.util.Log.outKey, log); + javac_context.put(com.sun.tools.javac.util.Log.errKey, log); return new JavapFileManager(javac_context, null); }
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n_ja.properties Thu Aug 11 18:52:55 2016 -0700 @@ -126,7 +126,7 @@ jshell.console.see.more = <\u8A73\u7D30\u306F\u3001\u30BF\u30D6\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044> jshell.console.do.nothing = \u4F55\u3082\u3057\u306A\u3044 -jshell.console.choice = \u9078\u629E: +jshell.console.choice = \u9078\u629E: jshell.console.create.variable = \u5909\u6570\u306E\u4F5C\u6210 jshell.console.resolvable = \n\u8B58\u5225\u5B50\u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u89E3\u6C7A\u3067\u304D\u307E\u3059\u3002 jshell.console.no.candidate = \n\u30A4\u30F3\u30DD\u30FC\u30C8\u3059\u308B\u5019\u88DC\u306E\u5B8C\u5168\u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 @@ -231,7 +231,7 @@ help.set.format = \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u3092\u30EC\u30DD\u30FC\u30C8\u3059\u308B\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\n\n\t/set format <mode> <field> "<format>" <selector>...\n\n<mode>\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059 -- '/help /set mode'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n<field>\u306F\u5B9A\u7FA9\u3059\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u56FA\u6709\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u306E\u540D\u524D\u3067\u3059\u3002\n<format>\u306F\u5F15\u7528\u7B26\u306B\u56F2\u307E\u308C\u305F\u6587\u5B57\u5217\u3067\u3001\u6B21\u306E\u5834\u5408\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u3059: \n\u30BB\u30EC\u30AF\u30BF\u304C\u4E00\u81F4\u3059\u308B(\u307E\u305F\u306F\u30BB\u30EC\u30AF\u30BF\u304C\u306A\u3044)\u3002\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u4F7F\u7528\u3055\u308C\u308B\u5834\u5408\u3001\n\u4E2D\u30AB\u30C3\u30B3\u3067\u56F2\u307E\u308C\u3066\u3044\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u304C\u305D\u306E\u3068\u304D\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3059\n\u3053\u308C\u3089\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u3001\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u3082\u3001\n\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u56FA\u6709\u306E\u3053\u308C\u3089\u306E\u4E8B\u524D\u5B9A\u7FA9\u6E08\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5834\u5408\u3082\u3042\u308A\u307E\u3059:\n\t{name} == \u540D\u524D\u3001\u4F8B: \u5909\u6570\u540D\u3001 ...\n\t{type} == \u30BF\u30A4\u30D7\u540D\u3002\u5909\u6570\u307E\u305F\u306F\u5F0F\u306E\u30BF\u30A4\u30D7\u3001\n\t\t\t\u30E1\u30BD\u30C3\u30C9\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\n\t{value} == \u5F0F\u307E\u305F\u306F\u5909\u6570\u306E\u521D\u671F\u5316\u306E\u7D50\u679C\u5024\n\t{unresolved} == \u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u30EA\u30B9\u30C8\n\t{errors} == \u30EA\u30AB\u30D0\u30EA\u53EF\u80FD\u306A\u30A8\u30E9\u30FC\u306E\u30EA\u30B9\u30C8(\u51E6\u7406\u6642-\n\t\t\t"display"\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u307F)\n\t{err} == \u672A\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u30FB\u30A8\u30E9\u30FC\u884C(\u51E6\u7406\u6642-\n\t\t\t"errorline"\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u307F)\n\u6B21\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u3001\u8868\u793A\u3055\u308C\u308B\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u6C7A\u5B9A\u3057\u307E\u3059:\n\t{display} == \u30B9\u30CB\u30DA\u30C3\u30C8\u30FB\u30A4\u30D9\u30F3\u30C8\u306B\u5BFE\u3057\u3066\u8868\u793A\u3055\u308C\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\n\t{errorline} == \u300Cerrors\u300D\u30D5\u30A3\u30FC\u30EB\u30C9\u5185\u306E\u30A8\u30E9\u30FC\u884C\u306E\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\n\t{pre} == \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u63A5\u982D\u8F9E(\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u958B\u59CB\u3059\u308B)\n\t{post} == \u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u63A5\u5C3E\u8F9E(\u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u7D42\u4E86\u3059\u308B)\n\t{errorpre} == \u30A8\u30E9\u30FC\u63A5\u982D\u8F9E(\u30A8\u30E9\u30FC\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u958B\u59CB\u3059\u308B)\n\t{errorpost} == \ \u30A8\u30E9\u30FC\u63A5\u5C3E\u8F9E(\u30A8\u30E9\u30FC\u30FB\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3092\u7D42\u4E86\u3059\u308B)\n\u3053\u308C\u3089\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u306F\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u8A2D\u5B9A\u304C\u3042\u308A\u307E\u3059(\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)\u3002\n<selector>\u306F\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304C\u9069\u7528\u3055\u308C\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u69CB\u9020\u306F\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306E\u30CF\u30A4\u30D5\u30F3\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\u30011\u3064\u306E\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306E\u5024\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u306F\u5404\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\n\u3044\u305A\u308C\u304B\u306E\u5024\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\n\n\u30B1\u30FC\u30B9\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u7A2E\u985E\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\timport -- \u30A4\u30F3\u30DD\u30FC\u30C8\u5BA3\u8A00\n\tclass -- \u30AF\u30E9\u30B9\u5BA3\u8A00\n\tinterface -- \u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5BA3\u8A00\n\tenum -- \u5217\u6319\u578B\u306E\u5BA3\u8A00\n\tannotation -- \u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5BA3\u8A00\n\tmethod -- \u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00 -- \u6CE8\u610F: {type}==parameter-types\n\tvardecl -- \u521D\u671F\u5316\u3057\u306A\u3044\u5909\u6570\u5BA3\u8A00\n\tvarinit -- \u521D\u671F\u5316\u3059\u308B\u5909\u6570\u5BA3\u8A00\n\texpression -- \u5F0F -- \u6CE8\u610F: {name}==scratch-variable-name\n\tvarvalue -- \u5909\u6570\u5024\u5F0F\n\tassignment -- \u5909\u6570\u3092\u5272\u308A\u5F53\u3066\u307E\u3059\n\tstatement -- \u6587\n\u30A2\u30AF\u30B7\u30E7\u30F3\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u767A\u751F\u3057\u305F\u5185\u5BB9\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tadded -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F\n\tmodified -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u5909\u66F4\u3055\u308C\u307E\u3057\u305F\n\treplaced -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u65B0\u898F\u30B9\u30CB\u30DA\u30C3\u30C8\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\n\toverwrote -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u307E\u3057\u305F\n\tdropped -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u524A\u9664\u3055\u308C\u307E\u3057\u305F\n\tused -- \u4F7F\u7528\u3067\u304D\u306A\u3044\u3068\u304D\u306B\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\n\u767A\u751F\u6642\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u3053\u308C\u304C\u76F4\u63A5\u307E\u305F\u306F\u9593\u63A5\u30A2\u30AF\u30B7\u30E7\u30F3\u3067\u3042\u308B\u304B\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tprimary -- \u5165\u529B\u3057\u305F\u30B9\u30CB\u30DA\u30C3\u30C8\n\tupdate -- \u4F9D\u5B58\u30B9\u30CB\u30DA\u30C3\u30C8\u3078\u306E\u66F4\u65B0\n\u89E3\u6C7A\u72B6\u614B\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u89E3\u6C7A/\u5B9A\u7FA9\u306E\u72B6\u614B\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tok -- \ -\u6B63\u3057\u304F\u89E3\u6C7A\u3055\u308C\u307E\u3057\u305F\n\tdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u5B9A\u7FA9\u3055\u308C\u307E\u3057\u305F\n\tnotdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u305F\u3081\u5B9A\u7FA9\u3055\u308C\u307E\u305B\u3093\n\u672A\u89E3\u6C7A\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tunresolved0 -- \u672A\u89E3\u6C7A\u306E\u540D\u524D\u306F\u3042\u308A\u307E\u305B\u3093\n\tunresolved1 -- 1\u3064\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\tunresolved2 -- 2\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\u30A8\u30E9\u30FC\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30A8\u30E9\u30FC\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\terror0 -- \u30A8\u30E9\u30FC\u306A\u3057\n\terror1 -- 1\u3064\u306E\u30A8\u30E9\u30FC\n\terror2 -- 2\u3064\u4EE5\u4E0A\u306E\u30A8\u30E9\u30FC\n\n\u4F8B:\n\t/set format myformat action 'Created' added-primary\n\t/set format myformat action 'Update replaced' replaced-update\n\t/set format myformat display '{pre}{action} class {name}{post}' class-ok\n\t/set format myformat display '{pre}{action} variable {name}, reset to null{post}' replaced-vardecl,varinit-ok-update\n\n\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u5BFE\u3059\u308B\u5F8C\u7D9A\u306E\u30BB\u30EC\u30AF\u30BF\u306B\u3088\u308A\u3001\u4EE5\u524D\u306B\u4F7F\u7528\u3055\u308C\u305F\u30BB\u30EC\u30AF\u30C8\u306E\u4E00\u90E8\u307E\u305F\u306F\u3059\u3079\u3066\u304C\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 -- \u6700\u5F8C\u306E\u30BB\u30EC\u30AF\u30BF\u304C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059\n +\u6B63\u3057\u304F\u89E3\u6C7A\u3055\u308C\u307E\u3057\u305F\n\tdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306B\u3082\u304B\u304B\u308F\u3089\u305A\u5B9A\u7FA9\u3055\u308C\u307E\u3057\u305F\n\tnotdefined -- \u5FA9\u5143\u53EF\u80FD\u3067\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u305F\u3081\u5B9A\u7FA9\u3055\u308C\u307E\u305B\u3093\n\u672A\u89E3\u6C7A\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u672A\u89E3\u6C7A\u306E\u53C2\u7167\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tunresolved0 -- \u672A\u89E3\u6C7A\u306E\u540D\u524D\u306F\u3042\u308A\u307E\u305B\u3093\n\tunresolved1 -- 1\u3064\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\tunresolved2 -- 2\u3064\u4EE5\u4E0A\u306E\u540D\u524D\u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n\u30A8\u30E9\u30FC\u6570\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30A8\u30E9\u30FC\u306E\u6570\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\terror0 -- \u30A8\u30E9\u30FC\u306A\u3057\n\terror1 -- 1\u3064\u306E\u30A8\u30E9\u30FC\n\terror2 -- 2\u3064\u4EE5\u4E0A\u306E\u30A8\u30E9\u30FC\n\n\u4F8B:\n\t/set format myformat action 'Created' added-primary\n\t/set format myformat action 'Update replaced' replaced-update\n\t/set format myformat display '{pre}{action} class {name}{post}' class-ok\n\t/set format myformat display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update\n\n\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u5BFE\u3059\u308B\u5F8C\u7D9A\u306E\u30BB\u30EC\u30AF\u30BF\u306B\u3088\u308A\u3001\u4EE5\u524D\u306B\u4F7F\u7528\u3055\u308C\u305F\u30BB\u30EC\u30AF\u30C8\u306E\u4E00\u90E8\u307E\u305F\u306F\u3059\u3079\u3066\u304C\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 -- \u6700\u5F8C\u306E\u30BB\u30EC\u30AF\u30BF\u304C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059\n help.set.truncation = \u8868\u793A\u3055\u308C\u308B\u5024\u306E\u6700\u5927\u9577\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002\n\n\t/set truncation <mode> <length> <selector>...\n\n<mode>\u306F\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u30FB\u30E2\u30FC\u30C9\u306E\u540D\u524D\u3067\u3059 -- '/help /set mode'\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\n<length>\u306F\u6700\u5927\u9577\u3092\u8868\u3059\u7B26\u53F7\u306A\u3057\u6574\u6570\u3067\u3059\u3002\n<format>\u306F\u5F15\u7528\u7B26\u306B\u56F2\u307E\u308C\u305F\u6587\u5B57\u5217\u3067\u3001\u6B21\u306E\u5834\u5408\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5024\u3067\u3059:\n<selector>\u306F\u3001\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u3088\u3063\u3066\u5207\u6368\u3066\u9577\u306E\u5024\u3092\u5FAE\u8ABF\u6574\u3059\u308B\u5834\u5408\u306B\u306E\u307F\n\u5FC5\u8981\u3067\u3059\u3002<selector>\u306F\u3001\u5207\u6368\u3066\u304C\u9069\u7528\u3055\u308C\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u69CB\u9020\u306F\u3001\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306E\u30CF\u30A4\u30D5\u30F3\u533A\u5207\u308A\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\u30011\u3064\u306E\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306E\u5024\u306E\u30AB\u30F3\u30DE\u533A\u5207\u308A\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\n\u30BB\u30EC\u30AF\u30BF\u306F\u5404\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u30EA\u30B9\u30C8\u306F\n\u3044\u305A\u308C\u304B\u306E\u5024\u304C\u4E00\u81F4\u3059\u308C\u3070\u4E00\u81F4\u3068\u306A\u308A\u307E\u3059\u3002\n\n\u6B21\u306B\u793A\u3059\u306E\u306F\u3001\u5207\u6368\u3066\u306B\u95A2\u9023\u3059\u308B\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u3067\u3059\u3002\n\n\u30B1\u30FC\u30B9\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306E\u7A2E\u985E\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tvardecl -- \u521D\u671F\u5316\u3057\u306A\u3044\u5909\u6570\u5BA3\u8A00\n\tvarinit -- \u521D\u671F\u5316\u3057\u306A\u3044\u5909\u6570\u5BA3\u8A00\n\texpression -- \u5F0F -- \u6CE8\u610F: {name}==scratch-variable-name\n\tvarvalue -- \u5909\u6570\u5024\u5F0F\n\tassignment -- \u5909\u6570\u3092\u5272\u308A\u5F53\u3066\u307E\u3059\n\t\u30A2\u30AF\u30B7\u30E7\u30F3\u30FB\u30BB\u30EC\u30AF\u30BF\u7A2E\u985E\u306F\u3001\u30B9\u30CB\u30DA\u30C3\u30C8\u306B\u767A\u751F\u3057\u305F\u5185\u5BB9\u3092\u793A\u3057\u307E\u3059\u3002\u5024\u306F\u6B21\u306E\u3068\u304A\u308A\u3067\u3059:\n\tadded -- \u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u8FFD\u52A0\u3055\u308C\u307E\u3057\u305F\n\tmodified -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u5909\u66F4\u3055\u308C\u307E\u3057\u305F\n\treplaced -- \u65E2\u5B58\u306E\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\u65B0\u898F\u30B9\u30CB\u30DA\u30C3\u30C8\u3067\u7F6E\u63DB\u3055\u308C\u307E\u3057\u305F\n\u4F8B:\n\t/set trunc mymode 80\n\t/set truncation mymode 45 expression\n\t/set truncation mymode 0 vardecl-modified,replaced\n\n\u30D5\u30A3\u30FC\u30EB\u30C9\u306B\u5BFE\u3059\u308B\u5F8C\u7D9A\u306E\u30BB\u30EC\u30AF\u30BF\u306B\u3088\u308A\u3001\u4EE5\u524D\u306B\u4F7F\u7528\u3055\u308C\u305F\u30BB\u30EC\u30AF\u30BF\u306E\u4E00\u90E8\u307E\u305F\u306F\u3059\u3079\u3066\u304C\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 -- \u6700\u5F8C\u306E\u30BB\u30EC\u30AF\u30BF\u304C\u6709\u52B9\u306B\u306A\u308A\u307E\u3059\n @@ -253,4 +253,4 @@ help.retain.start =\u8D77\u52D5\u69CB\u6210\u3092\u8A2D\u5B9A\u3057\u307E\u3059 -- \u8D77\u52D5\u6642\u306B\u8AAD\u307F\u53D6\u3089\u308C\u308B\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30B3\u30DE\u30F3\u30C9\u306E\n\u30B7\u30FC\u30B1\u30F3\u30B9\u3002\n\n\t/retain start [<file>|-default|-none]\n\n<file>\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u6307\u5B9A\u3057\u305F<file>\u306E\u5185\u5BB9\u304C\n\u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u304A\u3088\u3073\u30B3\u30DE\u30F3\u30C9\u306B\n\u306A\u308A\u307E\u3059\u3002\n\u304B\u308F\u308A\u306B-default\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u4E8B\u524D\u306B\u5B9A\u7FA9\u3055\u308C\u305F\u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u304C\n\u8D77\u52D5\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n-none\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001\u8D77\u52D5\u304C\u7A7A\u306B\u306A\u308A\u307E\u3059 -- \u8D77\u52D5\u30B9\u30CB\u30DA\u30C3\u30C8\u307E\u305F\u306F\n\u30B3\u30DE\u30F3\u30C9\u304C\u4F7F\u7528\u3055\u308C\u307E\u305B\u3093\u3002\n\u3053\u308C\u3089\u3092\u4F55\u3082\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u3001\u8D77\u52D5\u306F'/set start''\u307E\u305F\u306F''/retain start'\u30B3\u30DE\u30F3\u30C9\u3067\n\u6700\u5F8C\u306B\u6307\u5B9A\u3055\u308C\u305F\u3082\u306E\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059\u3002\n\u8D77\u52D5\u306F\u4FDD\u6301\u3055\u308C\u3001jshell\u30C4\u30FC\u30EB\u304C\u8D77\u52D5\u307E\u305F\u306F\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u305F\u3068\u304D\u306B\u4F7F\u7528\u3055\u308C\u307E\u3059 startup.feedback = /set mode verbose -command \n\n/set prompt verbose '\\njshell> ' ' ...> ' \n\n/set format verbose pre '| ' \n/set format verbose post '%n' \n/set format verbose errorpre '| ' \n/set format verbose errorpost '%n' \n\n/set format verbose errorline '{post}{pre} {err}' \n\n/set format verbose action '\u4F5C\u6210\u6E08' added-primary \n/set format verbose action '\u5909\u66F4\u6E08' modified-primary \n/set format verbose action '\u7F6E\u63DB\u6E08' replaced-primary \n/set format verbose action '\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u6E08' overwrote-primary \n/set format verbose action '\u524A\u9664\u6E08' dropped-primary \n/set format verbose action ' \u66F4\u65B0\u4F5C\u6210\u6E08' added-update \n/set format verbose action ' \u66F4\u65B0\u5909\u66F4\u6E08' modified-update \n/set format verbose action ' \u66F4\u65B0\u7F6E\u63DB\u6E08' replaced-update \n/set format verbose action ' \u66F4\u65B0\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u6E08' overwrote-update \n/set format verbose action ' \u66F4\u65B0\u524A\u9664\u6E08' dropped-update \n\n/set format verbose until '\u3001\u305F\u3060\u3057\u3001\u6B21\u307E\u3067\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044\u304B\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093:' defined-class-primary \n/set format verbose until '\u3001\u305F\u3060\u3057\u3001\u6B21\u307E\u3067\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093:' defined-interface-primary \n/set format verbose until '\u3001\u305F\u3060\u3057\u3001\u6B21\u307E\u3067\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093:' defined-enum,annotation-primary \n/set format verbose until '\u3001\u305F\u3060\u3057\u3001\u6B21\u307E\u3067\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093:' defined-method-primary \n/set format verbose until '\u3001\u305F\u3060\u3057\u3001\u6B21\u307E\u3067\u53C2\u7167\u3067\u304D\u307E\u305B\u3093:' notdefined-primary \n/set format verbose until ' \u6B21\u307E\u3067\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044\u304B\u3001\u305D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093:' defined-class-update \n/set format verbose until ' \u6B21\u307E\u3067\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093:' defined-interface-update \n/set format verbose until ' \u6B21\u307E\u3067\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093:' defined-method-update \n/set format verbose until ' \u6B21\u307E\u3067\u53C2\u7167\u3067\u304D\u307E\u305B\u3093:' notdefined-update \n\n/set format verbose unrerr '{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u307E\u3057\u305F' unresolved1-error0 \n/set format verbose unrerr '{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u307E\u3057\u305F' unresolved2-error0 \n/set format verbose unrerr ' \u3053\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved0-error1 \n/set format verbose unrerr '{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved1-error1 \n/set format verbose unrerr '{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved2-error1 \n/set format verbose unrerr ' \u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved0-error2 \n/set format verbose unrerr \ -'{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved1-error2 \n/set format verbose unrerr '{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved2-error2 \n\n/set format verbose resolve '{until}{unrerr}' added,modified,replaced,used \n\n/set format verbose typeKind '\u30AF\u30E9\u30B9' class \n/set format verbose typeKind '\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' interface \n/set format verbose typeKind '\u5217\u6319\u578B' enum \n/set format verbose typeKind '\u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' annotation \n\n/set format verbose result '{name} ==> {value}{post}' added,modified,replaced-ok-primary \n\n/set format verbose display '{result}{pre}\u30B9\u30AF\u30E9\u30C3\u30C1\u5909\u6570{name}\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F : {type}{post}' expression-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name}\u306E\u5024 : {type}{post}' varvalue-primary \n/set format verbose display '{result}{pre}{name}\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u307E\u3057\u305F : {type}{post}' assignment-primary \n/set format verbose display '{result}{pre}{action} \u5909\u6570 {name} : {type}{resolve}{post}' varinit,vardecl \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{resolve}{post}' vardecl,varinit-notdefined \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{post}' dropped-vardecl,varinit,expression \n/set format verbose display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n\n/set format verbose display '{pre}{action} {typeKind} {name}{resolve}{post}' class,interface,enum,annotation \n/set format verbose display '{pre}{action} \u30E1\u30BD\u30C3\u30C9 {name}({type})\u3092\u547C\u3073\u51FA\u305D\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' method \n\n/set format verbose display '{pre}{typeKind} {name}\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-class,interface,enum,annotation \n/set format verbose display '{pre}\u30E1\u30BD\u30C3\u30C9{name}({type})\u3092\u547C\u3073\u51FA\u305D\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-method \n\n/set truncation verbose 80\n/set truncation verbose 1000 varvalue,expression\n\n/set mode normal -command verbose \n/set format normal display '' added,modified,replaced,overwrote,dropped-update \n/set format normal display '{pre}{action} variable {name}, reset to null{post}' replaced-vardecl,varinit-ok-update \n/set format normal display '{result}' added,modified,replaced-expression,varvalue,assignment,varinit,vardecl-ok-primary \n/set mode concise -quiet normal \n\n/set prompt concise 'jshell> ' ' ...> ' \n\n/set format concise display '' class,interface,enum,annotation,method,assignment,varinit,vardecl-ok \n\n/set feedback normal \n\n/set mode silent -quiet \n/set prompt silent '-> ' '>> ' \n/set format silent pre '| ' \n/set format silent post '%n' \n/set format silent errorpre '| ' \n/set format silent errorpost '%n' \n/set format silent display '' \n +'{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved1-error2 \n/set format verbose unrerr '{unresolved}\u304C\u5BA3\u8A00\u3055\u308C\u3001\u3053\u308C\u3089\u306E\u30A8\u30E9\u30FC\u306F\u4FEE\u6B63\u3055\u308C\u307E\u3057\u305F: {errors}' unresolved2-error2 \n\n/set format verbose resolve '{until}{unrerr}' added,modified,replaced,used \n\n/set format verbose typeKind '\u30AF\u30E9\u30B9' class \n/set format verbose typeKind '\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' interface \n/set format verbose typeKind '\u5217\u6319\u578B' enum \n/set format verbose typeKind '\u6CE8\u91C8\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9' annotation \n\n/set format verbose result '{name} ==> {value}{post}' added,modified,replaced-ok-primary \n\n/set format verbose display '{result}{pre}\u30B9\u30AF\u30E9\u30C3\u30C1\u5909\u6570{name}\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F : {type}{post}' expression-added,modified,replaced-primary \n/set format verbose display '{result}{pre}{name}\u306E\u5024 : {type}{post}' varvalue-primary \n/set format verbose display '{result}{pre}{name}\u306B\u5272\u308A\u5F53\u3066\u3089\u308C\u307E\u3057\u305F : {type}{post}' assignment-primary \n/set format verbose display '{result}{pre}{action} \u5909\u6570 {name} : {type}{resolve}{post}' varinit,vardecl \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{resolve}{post}' vardecl,varinit-notdefined \n/set format verbose display '{pre}{action} \u5909\u6570 {name}{post}' dropped-vardecl,varinit,expression \n/set format verbose display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n\n/set format verbose display '{pre}{action} {typeKind} {name}{resolve}{post}' class,interface,enum,annotation \n/set format verbose display '{pre}{action} \u30E1\u30BD\u30C3\u30C9 {name}({type})\u3092\u547C\u3073\u51FA\u305D\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' method \n\n/set format verbose display '{pre}{typeKind} {name}\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-class,interface,enum,annotation \n/set format verbose display '{pre}\u30E1\u30BD\u30C3\u30C9{name}({type})\u3092\u547C\u3073\u51FA\u305D\u3046\u3068\u3057\u307E\u3057\u305F{resolve}{post}' used-method \n\n/set truncation verbose 80\n/set truncation verbose 1000 varvalue,expression\n\n/set mode normal -command verbose \n/set format normal display '' added,modified,replaced,overwrote,dropped-update \n/set format normal display '{pre}{action} \u5909\u6570 {name}\u3001null\u306B\u30EA\u30BB\u30C3\u30C8\u3055\u308C\u307E\u3057\u305F{post}' replaced-vardecl,varinit-ok-update \n/set format normal display '{result}' added,modified,replaced-expression,varvalue,assignment,varinit,vardecl-ok-primary \n/set mode concise -quiet normal \n\n/set prompt concise 'jshell> ' ' ...> ' \n\n/set format concise display '' class,interface,enum,annotation,method,assignment,varinit,vardecl-ok \n\n/set feedback normal \n\n/set mode silent -quiet \n/set prompt silent '-> ' '>> ' \n/set format silent pre '| ' \n/set format silent post '%n' \n/set format silent errorpre '| ' \n/set format silent errorpost '%n' \n/set format silent display '' \n
--- a/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java Fri Jul 29 19:53:52 2016 -0700 +++ b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java Thu Aug 11 18:52:55 2016 -0700 @@ -110,14 +110,13 @@ private static CaLog createLog(Context context) { PrintWriter pw = new PrintWriter(new StringWriter()); - CaLog log = new CaLog(context, pw, pw, pw); - context.put(outKey, pw); + CaLog log = new CaLog(context, pw); context.put(logKey, log); return log; } - private CaLog(Context context, PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter) { - super(context, errWriter, warnWriter, noticeWriter); + private CaLog(Context context, PrintWriter pw) { + super(context, pw); } @Override
--- a/test/jdk/javadoc/doclet/testModules/TestModules.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/jdk/javadoc/doclet/testModules/TestModules.java Thu Aug 11 18:52:55 2016 -0700 @@ -23,7 +23,7 @@ /* * @test - * @bug 8154119 8154262 8156077 8157987 8154261 + * @bug 8154119 8154262 8156077 8157987 8154261 8154817 * @summary Test modules support in javadoc. * @author bpatel * @library ../lib @@ -50,6 +50,8 @@ testNoDescription(false); testOverviewSummaryModules(); testModuleLink(); + testModuleClickThroughLinks(); + testModuleClickThrough(true); } @Test @@ -63,6 +65,8 @@ testHtml5NoDescription(false); testHtml5OverviewSummaryModules(); testModuleLink(); + testModuleClickThroughLinks(); + testModuleClickThrough(true); } @Test @@ -96,6 +100,7 @@ "testpkgnomodule", "testpkgnomodule1"); checkExit(Exit.OK); testOverviewSummaryPackages(); + testModuleClickThrough(false); } @Test @@ -442,4 +447,27 @@ + "<!-- -->\n" + "</a>"); } + + void testModuleClickThroughLinks() { + checkOutput("module-overview-frame.html", true, + "<li><a href=\"module1-frame.html\" target=\"packageListFrame\" " + + "onclick=\"updateModuleFrame('module1-type-frame.html','module1-summary.html');" + + "\">module1</a></li>"); + checkOutput("module-overview-frame.html", true, + "<li><a href=\"module2-frame.html\" target=\"packageListFrame\" " + + "onclick=\"updateModuleFrame('module2-type-frame.html','module2-summary.html');" + + "\">module2</a></li>"); + checkOutput("script.js", true, + "function updateModuleFrame(pFrame, cFrame)\n" + + "{\n" + + " top.packageFrame.location = pFrame;\n" + + " top.classFrame.location = cFrame;\n" + + "}"); } + + void testModuleClickThrough(boolean found) { + checkFiles(found, + "module1-type-frame.html", + "module2-type-frame.html"); + } +}
--- a/test/tools/javac/6330997/T6330997.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/6330997/T6330997.java Thu Aug 11 18:52:55 2016 -0700 @@ -44,9 +44,7 @@ import com.sun.tools.javac.api.JavacTaskImpl; import com.sun.tools.javac.code.ClassFinder.BadClassFile; import com.sun.tools.javac.code.Symtab; -import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.util.List; import javax.tools.ToolProvider; public class T6330997 { @@ -57,8 +55,7 @@ JavacTaskImpl task = (JavacTaskImpl)tool.getTask(null, null, null, null, null, null); JavaCompiler compiler = JavaCompiler.instance(task.getContext()); Symtab syms = Symtab.instance(task.getContext()); - Modules modules = Modules.instance(task.getContext()); - modules.enter(List.nil(), null); + task.ensureEntered(); try { compiler.resolveIdent(syms.unnamedModule, "T1").complete(); } catch (Exception e) {
--- a/test/tools/javac/T6435291/T6435291.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/T6435291/T6435291.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,9 +38,7 @@ import com.sun.tools.javac.api.JavacTaskImpl; import com.sun.tools.javac.code.ClassFinder.BadClassFile; import com.sun.tools.javac.code.Symtab; -import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.util.List; import javax.tools.ToolProvider; public class T6435291 { @@ -48,8 +46,7 @@ javax.tools.JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); JavacTaskImpl task = (JavacTaskImpl)tool.getTask(null, null, null, null, null, null); Symtab syms = Symtab.instance(task.getContext()); - //initialize unnamed module: - Modules.instance(task.getContext()).enter(List.nil(), syms.errSymbol); + task.ensureEntered(); JavaCompiler compiler = JavaCompiler.instance(task.getContext()); try { compiler.resolveIdent(syms.unnamedModule, "T").complete();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/T8161277/IsSameTypeWildcardTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8161277 + * @summary javax.lang.model.util.Types.isSameType(...) returns true on wildcards + * @library /tools/lib/types + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.code + * jdk.compiler/com.sun.tools.javac.comp + * jdk.compiler/com.sun.tools.javac.tree + * jdk.compiler/com.sun.tools.javac.util + * jdk.compiler/com.sun.tools.javac.file + * jdk.compiler/com.sun.tools.javac.model + * @build TypeHarness + * @run main IsSameTypeWildcardTest + */ + +import java.util.ArrayList; +import java.util.List; + +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.util.Assert; +import com.sun.tools.javac.model.JavacTypes; + +public class IsSameTypeWildcardTest extends TypeHarness { + StrToTypeFactory strToTypeFactory; + JavacTypes javacTypes; + + public static void main(String... args) throws Exception { + new IsSameTypeWildcardTest().runTest(); + } + + public IsSameTypeWildcardTest() { + javacTypes = JavacTypes.instance(context); + } + + void runTest() { + List<String> imports = new ArrayList<>(); + imports.add("java.util.*"); + strToTypeFactory = new StrToTypeFactory(null, imports, null); + + Type listOfWildcard = strToTypeFactory.getType("List<?>"); + com.sun.tools.javac.util.List<Type> arguments = listOfWildcard.getTypeArguments(); + Assert.check(!javacTypes.isSameType(arguments.head, arguments.head), + "if any argument is a wildcard then result must be false"); + } +}
--- a/test/tools/javac/annotations/repeatingAnnotations/combo/ReflectionTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/annotations/repeatingAnnotations/combo/ReflectionTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 8001457 8027477 + * @bug 8001457 8027477 8163113 * @author sogoel * @summary Reflection api tests * @modules jdk.compiler @@ -483,17 +483,17 @@ BasicContainer_Legacy( "@ExpectedBase(value = Foo.class, " + "getAnnotationVal = \"NULL\"," - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnoVal = \"NULL\", " + "getAnnosArgs = {}, " + "getDeclAnnosArgs = {} )", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"} )") { + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"} )") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -583,21 +583,21 @@ "@ExpectedBase(value = Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\"," + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnoVal = \"@Foo(value=0)\", " + "getAnnosArgs = {\"@Foo(value=0)\"}, " + "getDeclAnnosArgs = {\"@Foo(value=0)\"} )", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"} )") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"} )") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -691,17 +691,17 @@ BasicContainer_Inherited_Legacy( "@ExpectedBase(value = Foo.class, " + "getAnnotationVal = \"NULL\"," - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\"}, " + "getDeclAnnoVal = \"NULL\", " + "getAnnosArgs = {}, " + "getDeclAnnosArgs = {} )", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\"}, " + "getDeclAnnoVal = \"NULL\", " - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosArgs = {} )") { @Override @@ -765,18 +765,18 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=0)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=0)\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"@Foo(value=0)\"," + "getAnnosArgs = {\"@Foo(value=0)\"}," + "getDeclAnnosArgs = {\"@Foo(value=0)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=0)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=0)\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"NULL\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosArgs = {})") { @Override @@ -844,18 +844,18 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=0)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=0)\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"@Foo(value=0)\"," + "getAnnosArgs = {\"@Foo(value=0)\"}," + "getDeclAnnosArgs = {\"@Foo(value=0)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=0)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=0)\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"NULL\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosArgs = {})") { @Override @@ -923,19 +923,19 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnoVal = \"NULL\"," + "getAnnosArgs = {\"@Foo(value=0)\"}," + "getDeclAnnosArgs = {})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"})") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"})") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1000,21 +1000,21 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=3)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}," + "getDeclAnnoVal = \"@Foo(value=3)\"," + "getAnnosArgs = {\"@Foo(value=3)\"}," + "getDeclAnnosArgs = {\"@Foo(value=3)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}," - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"})") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}," + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"})") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1077,18 +1077,18 @@ BasicRepeatable( "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"NULL\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\" }, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\" }, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnoVal = \"NULL\"," + "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"}," + "getDeclAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"} )") { + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"} )") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1179,21 +1179,21 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"NULL\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnoVal = \"NULL\"," + "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"}," + "getDeclAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"} )") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"} )") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1283,17 +1283,17 @@ BasicContainerRepeatable_Inherited( "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"NULL\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\"}, " + "getDeclAnnoVal = \"NULL\", " + "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"}, " + "getDeclAnnosArgs = {})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = { \"ExpectedBase\", \"ExpectedContainer\"}, " + "getDeclAnnoVal = \"NULL\", " - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosArgs = {})") { @Override @@ -1356,7 +1356,7 @@ RepeatableAnnoInherited( "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"NULL\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\"}, " + // ignores inherited annotations "getDeclAnnoVal = \"NULL\", " @@ -1364,13 +1364,13 @@ "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"}, " + "getDeclAnnosArgs = {})", // ignores inherited "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " - + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + + "getAnnotationsVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = { \"ExpectedBase\", \"ExpectedContainer\"}, " + // ignores inherited annotations "getDeclAnnoVal = \"NULL\", " + // ignores inherited - "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosArgs = {})") { // ignores inherited @Override @@ -1436,21 +1436,21 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnoVal = \"@Foo(value=0)\"," + "getAnnosArgs = {\"@Foo(value=0)\", \"@Foo(value=1)\", \"@Foo(value=2)\"}," + "getDeclAnnosArgs = {\"@Foo(value=0)\", \"@Foo(value=1)\",\"@Foo(value=2)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"})") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"})") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1624,7 +1624,7 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=3)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=3)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=3)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + //override every annotation on superClass "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=3)\"}, " + // ignores inherited annotations @@ -1632,13 +1632,13 @@ + "getAnnosArgs = {\"@Foo(value=3)\"}, " + "getDeclAnnosArgs = { \"@Foo(value=3)\" })", // ignores inherited "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=3)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=3)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=3)\"}, " + // ignores inherited annotations "getDeclAnnoVal = \"NULL\", " - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosArgs = {}) // ignores inherited ") { @Override @@ -1704,22 +1704,22 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + //override every annotation on superClass - "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + // ignores inherited annotations "getDeclAnnoVal = \"NULL\","// ignores inherited + "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"}, " + "getDeclAnnosArgs = { \"@Foo(value=1)\", \"@Foo(value=2)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + // ignores inherited annotations - "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", "// ignores inherited - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"})") { + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", "// ignores inherited + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"})") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1785,18 +1785,18 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"@Foo(value=0)\"," + "getAnnosArgs = {\"@Foo(value=0)\"}," + "getDeclAnnosArgs = {\"@Foo(value=0)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"NULL\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosArgs = {})") { @Override @@ -1863,19 +1863,19 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnoVal = \"NULL\"," + "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"}," + "getDeclAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " - + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"})") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"})") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -1941,21 +1941,21 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=3)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}," + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}," + "getDeclAnnoVal = \"@Foo(value=3)\"," + "getAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\", \"@Foo(value=3)\"}," + "getDeclAnnosArgs = {\"@Foo(value=1)\", \"@Foo(value=2)\", \"@Foo(value=3)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}, " + "getDeclAnnosVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", \"@Foo(value=3)\"}," - + "getDeclAnnoVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," - + "getDeclAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"})") { + + "\"ExpectedBase\", \"ExpectedContainer\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", \"@Foo(value=3)\"}," + + "getDeclAnnoVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + + "getDeclAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"})") { @Override public Iterable<? extends JavaFileObject> getTestFiles(SrcType srcType, @@ -2021,18 +2021,18 @@ "@ExpectedBase(value=Foo.class, " + "getAnnotationVal = \"@Foo(value=0)\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"@Foo(value=0)\"," + "getAnnosArgs = {\"@Foo(value=0)\"}," + "getDeclAnnosArgs = {\"@Foo(value=0)\"})", "@ExpectedContainer(value=FooContainer.class, " - + "getAnnotationVal = \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\", " + + "getAnnotationVal = \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\", " + "getAnnotationsVals = {" - + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}, " + + "\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\", \"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}, " + "getDeclAnnosVals = {\"ExpectedBase\", \"ExpectedContainer\", \"@Foo(value=0)\"}," + "getDeclAnnoVal = \"NULL\"," - + "getAnnosArgs = {\"@FooContainer(value=[@Foo(value=1), @Foo(value=2)])\"}," + + "getAnnosArgs = {\"@FooContainer(value={@Foo(value=1), @Foo(value=2)})\"}," + "getDeclAnnosArgs = {})") { @Override
--- a/test/tools/javac/api/6400303/T6400303.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/api/6400303/T6400303.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,17 +41,14 @@ import com.sun.tools.javac.api.JavacTaskImpl; import com.sun.tools.javac.code.Symbol.CompletionFailure; import com.sun.tools.javac.code.Symtab; -import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.util.List; public class T6400303 { public static void main(String... args) { javax.tools.JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); JavacTaskImpl task = (JavacTaskImpl)tool.getTask(null, null, null, null, null, null); Symtab syms = Symtab.instance(task.getContext()); - //initialize unnamed module: - Modules.instance(task.getContext()).enter(List.nil(), syms.errSymbol); + task.ensureEntered(); JavaCompiler compiler = JavaCompiler.instance(task.getContext()); try { compiler.resolveIdent(syms.unnamedModule, "Test$1").complete();
--- a/test/tools/javac/api/TestResolveIdent.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/api/TestResolveIdent.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,9 +36,7 @@ import com.sun.tools.javac.api.JavacTaskImpl; import com.sun.tools.javac.code.Symtab; -import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.util.List; import java.io.IOException; import javax.tools.ToolProvider; @@ -54,8 +52,7 @@ JavacTaskImpl task = (JavacTaskImpl)tool.getTask(null, null, null, null, null, null); JavaCompiler compiler = JavaCompiler.instance(task.getContext()); Symtab syms = Symtab.instance(task.getContext()); - Modules modules = Modules.instance(task.getContext()); - modules.enter(List.nil(), null); + task.ensureEntered(); System.out.println(compiler.resolveIdent(syms.unnamedModule, getDeprecatedClass().getCanonicalName())); }
--- a/test/tools/javac/defaultMethods/BadClassfile.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/defaultMethods/BadClassfile.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,11 +42,9 @@ import com.sun.tools.javac.code.ClassFinder.BadClassFile; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Symtab; -import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.jvm.Target; import com.sun.tools.javac.util.Assert; import com.sun.tools.javac.util.JCDiagnostic; -import com.sun.tools.javac.util.List; import java.io.File; import java.util.Arrays; import java.util.Objects; @@ -74,8 +72,7 @@ JavacTaskImpl task = (JavacTaskImpl) c.getTask(null, null, null, Arrays.asList("-classpath", System.getProperty("test.classes", ".")), null, null); Symtab syms = Symtab.instance(task.getContext()); - //initialize unnamed module: - Modules.instance(task.getContext()).enter(List.nil(), syms.errSymbol); + task.ensureEntered(); try { Symbol clazz = com.sun.tools.javac.main.JavaCompiler.instance(task.getContext()).resolveIdent(syms.unnamedModule, classname);
--- a/test/tools/javac/lib/DPrinter.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/lib/DPrinter.java Thu Aug 11 18:52:55 2016 -0700 @@ -138,7 +138,7 @@ protected DPrinter(Context context) { context.put(DPrinter.class, this); - out = context.get(Log.outKey); + out = context.get(Log.logKey).getWriter(Log.WriterKind.STDERR); trees = JavacTrees.instance(context); }
--- a/test/tools/javac/lib/combo/ReusableContext.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/lib/combo/ReusableContext.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ import com.sun.tools.javac.comp.Check; import com.sun.tools.javac.comp.CompileStates; import com.sun.tools.javac.comp.Enter; +import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.main.Arguments; import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.tree.JCTree.JCClassDecl; @@ -82,6 +83,7 @@ drop(Arguments.argsKey); drop(DiagnosticListener.class); drop(Log.outKey); + drop(Log.errKey); drop(JavaFileManager.class); drop(JavacTask.class); @@ -92,6 +94,7 @@ ((ReusableJavaCompiler)ReusableJavaCompiler.instance(this)).clear(); Types.instance(this).newRound(); Check.instance(this).newRound(); + Modules.instance(this).newRound(); CompileStates.instance(this).clear(); MultiTaskListener.instance(this).clear();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/main/StreamsTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8162359 + * @summary extra space in javac -help for -J and @ options + * @modules jdk.compiler + * @library /tools/lib + * @build toolbox.TestRunner toolbox.ToolBox + * @run main StreamsTest + */ + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import static java.util.Arrays.asList; + +import toolbox.TestRunner; +import toolbox.ToolBox; + +public class StreamsTest extends TestRunner { + public static void main(String... args) throws Exception { + new StreamsTest().runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + StreamsTest() { + super(System.err); + } + + ToolBox tb = new ToolBox(); + static final String LINESEP = System.getProperty("line.separator"); + + @Test // errors should be written to stderr + public void testError(Path base) throws Exception { + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + "import java.util.*; class C { # }"); + test(asList("-d", classes.toString(), src.resolve("C.java").toString()), + null, "illegal character: '#'"); + } + + @Test // warnings should be written to stderr + public void testWarning(Path base) throws Exception { + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + "import java.util.*; class C { List list = new ArrayList(); }"); + test(asList("-d", classes.toString(), "-Xlint", src.resolve("C.java").toString()), + null, "warning: [rawtypes]"); + } + + @Test // notes should be written to stderr + public void testNote(Path base) throws Exception { + Path src = base.resolve("src"); + Path classes = base.resolve("classes"); + tb.writeJavaFiles(src, + "import java.util.*; class C { List<String> list = (List<String>) new ArrayList(); }"); + test(asList("-d", classes.toString(), src.resolve("C.java").toString()), + null, "uses unchecked or unsafe operations."); + } + + @Test // help output should be written to stdout + public void testHelp(Path base) throws Exception { + test(asList("-help"), "Usage: javac <options> <source files>", null); + } + + @Test // version output should be written to stdout + public void testVersion(Path base) throws Exception { + test(asList("-version"), "javac", null); + } + + @Test // version output should be written to stdout + public void testFullVersion(Path base) throws Exception { + test(asList("-fullversion"), "javac full version", null); + } + + /** + * Run javac as though run from the command line (but avoiding the entry point that + * calls System.exit()), and that that expected output appears on appropriate output streams. + * @param options the command-line options for javac + * @param expectOut a string that should be contained in the output generated on stdout, + * or null, if no output should be generated to stdout + * @param expectErra string that should be contained in the output generated on stderr, + * or null, if no output should be generated to stderr + * @throws IOException if a problem occurs while setting up the streams + */ + void test(List<String> options, String expectOut, String expectErr) throws IOException { + out.println("test " + options); + ByteArrayOutputStream bsOut = new ByteArrayOutputStream(); + ByteArrayOutputStream bsErr = new ByteArrayOutputStream(); + try (PrintStream psOut = new PrintStream(bsOut); PrintStream psErr = new PrintStream(bsErr)) { + int rc; + PrintStream saveOut = System.out; + PrintStream saveErr = System.err; + try { + System.setOut(psOut); + System.setErr(psErr); + rc = com.sun.tools.javac.Main.compile(options.toArray(new String[0])); + } finally { + System.setErr(saveErr); + System.setOut(saveOut); + } + System.err.println("javac exit code: " + rc); + } + check("stdout", bsOut.toString(), expectOut); + check("stderr", bsErr.toString(), expectErr); + } + + /** + * Check that output is as expected. + * @param name the name of the stream on which the output was found + * @param actual the contents written to the stream + * @param expect string that should be contained in the output, or null, if the output should be empty + */ + void check(String name, String actual, String expect) { + out.println("Check " + name); + out.println("Expected: " + (expect == null ? "(nothing)" : expect)); + out.println("Actual:"); + out.println(actual.replace("\n", LINESEP)); + if (expect == null) { + if (!actual.isEmpty()) { + error(name + ": unexpected output"); + } + } else if (!actual.contains(expect)) { + error(name + ": expected output not found"); + } + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/modules/T8158224/Processor.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.Set; +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.element.TypeElement; +import javax.lang.model.SourceVersion; + +@SupportedAnnotationTypes("Blah") +@SupportedSourceVersion(SourceVersion.RELEASE_6) +public class Processor extends AbstractProcessor { + + @Override + public boolean process(Set<? extends TypeElement> tE, RoundEnvironment env) { + return true; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/modules/T8158224/T8158224.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8158224 + * @summary NullPointerException in com.sun.tools.javac.comp.Modules.checkCyclicDependencies when module missing + * @build Processor + * @compile/fail/ref=T8158224.out -XDrawDiagnostics -processor Processor mods/foo/module-info.java + */ + +// No code here, this file is just to host test description.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/modules/T8158224/T8158224.out Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,2 @@ +module-info.java:4:14: compiler.err.module.not.found: nonexistent +1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/modules/T8158224/mods/foo/module-info.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,5 @@ +/* /nodynamiccopyright/ */ + +module foo { + requires nonexistent; +}
--- a/test/tools/javac/newlines/NewLineTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/newlines/NewLineTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -42,17 +42,23 @@ import toolbox.ToolBox; //original test: test/tools/javac/newlines/Newlines.sh +/* + * Checks that the usage message, contained in the properties in the + * resource file javac.properties, is correctly rendered, including + * embedded newlines in the resource strings. For more context, + * see JDK-4110560. + */ public class NewLineTest { public static void main(String args[]) throws Exception { ToolBox tb = new ToolBox(); - File javacErrOutput = new File("output.txt"); + File javacOutput = new File("output.txt"); new JavacTask(tb, Task.Mode.EXEC) - .redirect(Task.OutputKind.STDERR, javacErrOutput.getPath()) + .redirect(Task.OutputKind.STDOUT, javacOutput.getPath()) .options("-J-Dline.separator='@'") .run(Task.Expect.FAIL); - List<String> lines = Files.readAllLines(javacErrOutput.toPath(), + List<String> lines = Files.readAllLines(javacOutput.toPath(), Charset.defaultCharset()); if (lines.size() != 1) { throw new AssertionError("The compiler output should have one line only");
--- a/test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ @Override public void init(ProcessingEnvironment env) { super.init(env); - out = ((JavacProcessingEnvironment) env).getContext().get(Log.outKey); + out = ((JavacProcessingEnvironment) env).getContext().get(Log.logKey).getWriter(Log.WriterKind.STDERR); } @Override
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerBasicTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerBasicTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -57,8 +57,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @Bar(value = 0) @BarContainer(value = {@Bar(value = 1), @Bar(value = 2)}) class MixRepeatableAndOfficialContainerBasicTest { @@ -85,8 +85,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @Bar(value = 0) @BarContainer(value = {@Bar(value = 1), @Bar(value = 2)}) int testField = 0; @@ -113,8 +113,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @Bar(value = 0) @BarContainer(value = {@Bar(value = 1), @Bar(value = 2)}) void testMethod() {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedA1Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedA1Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 8007961 + * @bug 8004822 8007961 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -59,8 +59,8 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) @BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)}) class MixRepeatableAndOfficialContainerInheritedA1Test extends E {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedA2Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedA2Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -61,9 +61,9 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) @BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)}) @BarInherited(value = 3) class MixRepeatableAndOfficialContainerInheritedA2Test extends N {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedB1Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedB1Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 8007961 + * @bug 8004822 8007961 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -56,8 +56,8 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) @BarInherited(value = 0) class MixRepeatableAndOfficialContainerInheritedB1Test extends M {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedB2Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixRepeatableAndOfficialContainerInheritedB2Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 8007961 + * @bug 8004822 8007961 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -57,8 +57,8 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) @BarInherited(value = 0) class MixRepeatableAndOfficialContainerInheritedB2Test extends H {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerBasicTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerBasicTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -53,9 +53,9 @@ @ExpectedContainer( value = UnofficialContainer.class, getAnnotation = "@UnofficialContainer(" - + "value=[@Foo(value=1), @Foo(value=2)])", + + "value={@Foo(value=1), @Foo(value=2)})", getAnnotationsByType = {"@UnofficialContainer(" - + "value=[@Foo(value=1), @Foo(value=2)])"}) + + "value={@Foo(value=1), @Foo(value=2)})"}) @Foo(value = 0) @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) class MixSingularAndUnofficialContainerBasicTest { @@ -79,9 +79,9 @@ @ExpectedContainer( value = UnofficialContainer.class, getAnnotation = "@UnofficialContainer(" - + "value=[@Foo(value=1), @Foo(value=2)])", + + "value={@Foo(value=1), @Foo(value=2)})", getAnnotationsByType = {"@UnofficialContainer(" - + "value=[@Foo(value=1), @Foo(value=2)])"}) + + "value={@Foo(value=1), @Foo(value=2)})"}) @Foo(value = 0) @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) int testField = 0; @@ -105,9 +105,9 @@ @ExpectedContainer( value = UnofficialContainer.class, getAnnotation = "@UnofficialContainer(" - + "value=[@Foo(value=1), @Foo(value=2)])", + + "value={@Foo(value=1), @Foo(value=2)})", getAnnotationsByType = {"@UnofficialContainer(" - + "value=[@Foo(value=1), @Foo(value=2)])"}) + + "value={@Foo(value=1), @Foo(value=2)})"}) @Foo(value = 0) @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) void testMethod() {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedA1Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedA1Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -56,8 +56,8 @@ @ExpectedContainer( value = UnofficialInheritedContainer.class, getAnnotation = "@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])", + + "value={@FooInherited(value=1), @FooInherited(value=2)})", getAnnotationsByType = {"@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])"}) + + "value={@FooInherited(value=1), @FooInherited(value=2)})"}) @UnofficialInheritedContainer(value = {@FooInherited(value = 1), @FooInherited(value = 2)}) class MixSingularAndUnofficialContainerInheritedA1Test extends L {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedA2Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedA2Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -57,9 +57,9 @@ @ExpectedContainer( value = UnofficialInheritedContainer.class, getAnnotation = "@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])", + + "value={@FooInherited(value=1), @FooInherited(value=2)})", getAnnotationsByType = {"@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])"}) + + "value={@FooInherited(value=1), @FooInherited(value=2)})"}) @UnofficialInheritedContainer(value = {@FooInherited(value = 1), @FooInherited(value = 2)}) @FooInherited(value = 3) class MixSingularAndUnofficialContainerInheritedA2Test extends K {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedB1Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedB1Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -56,8 +56,8 @@ @ExpectedContainer( value = UnofficialInheritedContainer.class, getAnnotation = "@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])", + + "value={@FooInherited(value=1), @FooInherited(value=2)})", getAnnotationsByType = {"@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])"}) + + "value={@FooInherited(value=1), @FooInherited(value=2)})"}) @FooInherited(value = 0) class MixSingularAndUnofficialContainerInheritedB1Test extends J {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedB2Test.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/MixSingularAndUnofficialContainerInheritedB2Test.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -57,8 +57,8 @@ @ExpectedContainer( value = UnofficialInheritedContainer.class, getAnnotation = "@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])", + + "value={@FooInherited(value=1), @FooInherited(value=2)})", getAnnotationsByType = {"@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])"}) + + "value={@FooInherited(value=1), @FooInherited(value=2)})"}) @FooInherited(value = 0) class MixSingularAndUnofficialContainerInheritedB2Test extends G{}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/OfficialContainerBasicTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/OfficialContainerBasicTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -53,8 +53,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @BarContainer(value = {@Bar(value = 1), @Bar(value = 2)}) class OfficialContainerBasicTest { @@ -77,8 +77,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @BarContainer(value = {@Bar(value = 1), @Bar(value = 2)}) int testField = 0; @@ -101,8 +101,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @BarContainer(value = {@Bar(value = 1), @Bar(value = 2)}) void testMethod() {} }
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/OfficialContainerInheritedTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/OfficialContainerInheritedTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -56,7 +56,7 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) class OfficialContainerInheritedTest extends D {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableBasicTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableBasicTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -53,8 +53,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @Bar(value = 1) @Bar(value = 2) class RepeatableBasicTest { @@ -78,8 +78,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @Bar(value = 1) @Bar(value = 2) int testField = 0; @@ -103,8 +103,8 @@ }) @ExpectedContainer( value = BarContainer.class, - getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])", - getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"}) + getAnnotation = "@BarContainer(value={@Bar(value=1), @Bar(value=2)})", + getAnnotationsByType = {"@BarContainer(value={@Bar(value=1), @Bar(value=2)})"}) @Bar(value = 1) @Bar(value = 2) void testMethod() {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableInheritedTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableInheritedTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -57,7 +57,7 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) class RepeatableInheritedTest extends I {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOfficialContainerBasicTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOfficialContainerBasicTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -52,8 +52,8 @@ value = BarContainer.class, getAnnotation = "null", getAnnotationsByType = { - "@BarContainer(value=[@Bar(value=1)])", - "@BarContainer(value=[@Bar(value=2)])"}) + "@BarContainer(value={@Bar(value=1)})", + "@BarContainer(value={@Bar(value=2)})"}) @BarContainer(value = {@Bar(value = 1)}) @BarContainer(value = {@Bar(value = 2)}) class RepeatableOfficialContainerBasicTest { @@ -76,8 +76,8 @@ value = BarContainer.class, getAnnotation = "null", getAnnotationsByType = { - "@BarContainer(value=[@Bar(value=1)])", - "@BarContainer(value=[@Bar(value=2)])"}) + "@BarContainer(value={@Bar(value=1)})", + "@BarContainer(value={@Bar(value=2)})"}) @BarContainer(value = {@Bar(value = 1)}) @BarContainer(value = {@Bar(value = 2)}) int testField = 0; @@ -100,8 +100,8 @@ value = BarContainer.class, getAnnotation = "null", getAnnotationsByType = { - "@BarContainer(value=[@Bar(value=1)])", - "@BarContainer(value=[@Bar(value=2)])"}) + "@BarContainer(value={@Bar(value=1)})", + "@BarContainer(value={@Bar(value=2)})"}) @BarContainer(value = {@Bar(value = 1)}) @BarContainer(value = {@Bar(value = 2)}) void testMethod() {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOfficialContainerInheritedTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOfficialContainerInheritedTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -43,8 +43,8 @@ value = BarInheritedContainer.class, getAnnotation = "null", getAnnotationsByType = { - "@BarInheritedContainer(value=[@BarInherited(value=1)])", - "@BarInheritedContainer(value=[@BarInherited(value=2)])" + "@BarInheritedContainer(value={@BarInherited(value=1)})", + "@BarInheritedContainer(value={@BarInherited(value=2)})" }, getAllAnnotationMirrors = { "@BarInheritedContainerContainer(" @@ -60,9 +60,9 @@ @ExpectedContainer( value = BarInheritedContainerContainer.class, getAnnotation = "@BarInheritedContainerContainer(" - + "value=[@BarInheritedContainer(value=[@BarInherited(value=1)])," - + " @BarInheritedContainer(value=[@BarInherited(value=2)])])", + + "value={@BarInheritedContainer(value={@BarInherited(value=1)})," + + " @BarInheritedContainer(value={@BarInherited(value=2)})})", getAnnotationsByType = {"@BarInheritedContainerContainer(" - + "value=[@BarInheritedContainer(value=[@BarInherited(value=1)])," - + " @BarInheritedContainer(value=[@BarInherited(value=2)])])"}) + + "value={@BarInheritedContainer(value={@BarInherited(value=1)})," + + " @BarInheritedContainer(value={@BarInherited(value=2)})})"}) class RepeatableOfficialContainerInheritedTest extends O {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideATest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideATest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 8007961 + * @bug 8004822 8007961 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -56,8 +56,8 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) @BarInherited(value = 3) class RepeatableOverrideATest extends B {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideBTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/RepeatableOverrideBTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 8007961 + * @bug 8004822 8007961 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -58,9 +58,9 @@ @ExpectedContainer( value = BarInheritedContainer.class, getAnnotation = "@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])", + + "value={@BarInherited(value=1), @BarInherited(value=2)})", getAnnotationsByType = {"@BarInheritedContainer(" - + "value=[@BarInherited(value=1), @BarInherited(value=2)])"}) + + "value={@BarInherited(value=1), @BarInherited(value=2)})"}) @BarInherited(value = 1) @BarInherited(value = 2) class RepeatableOverrideBTest extends C {}
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/UnofficialContainerBasicTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/UnofficialContainerBasicTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -50,8 +50,8 @@ }) @ExpectedContainer( value = UnofficialContainer.class, - getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])", - getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"}) + getAnnotation = "@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})", + getAnnotationsByType = {"@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})"}) @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) class UnofficialContainerBasicTest { @@ -71,8 +71,8 @@ }) @ExpectedContainer( value = UnofficialContainer.class, - getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])", - getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"}) + getAnnotation = "@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})", + getAnnotationsByType = {"@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})"}) @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) int testField = 0; @@ -92,8 +92,8 @@ }) @ExpectedContainer( value = UnofficialContainer.class, - getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])", - getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"}) + getAnnotation = "@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})", + getAnnotationsByType = {"@UnofficialContainer(value={@Foo(value=1), @Foo(value=2)})"}) @UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)}) void testMethod() {} }
--- a/test/tools/javac/processing/model/element/repeatingAnnotations/UnofficialContainerInheritedTest.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/javac/processing/model/element/repeatingAnnotations/UnofficialContainerInheritedTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8004822 + * @bug 8004822 8163113 * @author mnunez * @summary Language model api test basics for repeating annotations * @library /tools/javac/lib @@ -54,7 +54,7 @@ @ExpectedContainer( value = UnofficialInheritedContainer.class, getAnnotation = "@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])", + + "value={@FooInherited(value=1), @FooInherited(value=2)})", getAnnotationsByType = {"@UnofficialInheritedContainer(" - + "value=[@FooInherited(value=1), @FooInherited(value=2)])"}) + + "value={@FooInherited(value=1), @FooInherited(value=2)})"}) class UnofficialContainerInheritedTest extends F {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/scope/IterateAndRemove.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8144733 + * @summary Verify that Scope.remove removes the Symbol also from already running iterations. + * @modules jdk.compiler/com.sun.tools.javac.code + * jdk.compiler/com.sun.tools.javac.util + */ + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; + +import com.sun.tools.javac.code.Scope; +import com.sun.tools.javac.code.Scope.WriteableScope; +import com.sun.tools.javac.code.Symbol; +import com.sun.tools.javac.code.Symbol.PackageSymbol; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Names; + +public class IterateAndRemove { + public static void main(String... args) { + new IterateAndRemove().run(); + } + + void run() { + Context ctx = new Context(); + Names names = Names.instance(ctx); + Symbol root = new PackageSymbol(names.empty, null); + Name one = names.fromString("1"); + PackageSymbol sym1 = new PackageSymbol(one, new PackageSymbol(names.fromString("a"), root)); + PackageSymbol sym2 = new PackageSymbol(one, new PackageSymbol(names.fromString("b"), root)); + PackageSymbol sym3 = new PackageSymbol(one, new PackageSymbol(names.fromString("c"), root)); + List<Symbol> symbols = Arrays.asList(sym1, sym2, sym3); + + List<Function<Scope, Iterable<Symbol>>> getters = Arrays.asList( + scope -> scope.getSymbols(), + scope -> scope.getSymbolsByName(one) + ); + for (Function<Scope, Iterable<Symbol>> scope2Content : getters) { + for (int removeAt : new int[] {0, 1, 2, 3}) { + for (Symbol removeWhat : new Symbol[] {sym1, sym2, sym3}) { + WriteableScope s = WriteableScope.create(root); + + symbols.forEach(s :: enter); + + Iterator<Symbol> it = scope2Content.apply(s).iterator(); + List<PackageSymbol> actual = new ArrayList<>(); + int count = 0; + + while (true) { + if (count++ == removeAt) + s.remove(removeWhat); + if (!it.hasNext()) + break; + actual.add((PackageSymbol) it.next()); + } + + List<Symbol> copy = new ArrayList<>(symbols); + + Collections.reverse(copy); + + count = 0; + + while (true) { + if (count == removeAt && copy.indexOf(removeWhat) >= count) + copy.remove(removeWhat); + count++; + if (count >= copy.size()) + break; + } + + if (!copy.equals(actual)) { + throw new AssertionError("differs: actual: " + actual + "; expected: " + copy); + } + } + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javap/ControlCharTest.java Thu Aug 11 18:52:55 2016 -0700 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143366 + * @summary Check that control chars are displayed correctly + * @modules jdk.jdeps/com.sun.tools.javap + * @run testng ControlCharTest + */ + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Scanner; +import java.util.regex.Pattern; + +public class ControlCharTest { + private String classpath; + private Path output; + private Pattern ptrn; + + @BeforeClass + public void initialize() throws Exception { + String testClasses = System.getProperty("test.classes", "."); + classpath = "-classpath " + testClasses + " ControlCharTest$Strings"; + String userdir = System.getProperty("user.dir", "."); + output = Paths.get(userdir, "output.txt"); + String regex = Pattern.quote("\\u0001\\u0002\\u0003") // \u0001\u0002\u0003 + + ".+123.+" // 123 + + Pattern.quote("\\\\u0000") // \\u0000 + + ".+" + + Pattern.quote("\\u0000") // \u0000 + ; + ptrn = Pattern.compile(regex, Pattern.DOTALL); + } + + @AfterClass + public void close() throws IOException { + Files.deleteIfExists(output); + } + + @DataProvider(name = "options") + public Object[][] createData() { + return new Object[][] { + { "-v", ""}, + { "-constants", ""} + }; + } + @Test(dataProvider = "options") + public void test(String option, String ignore) throws Exception { + String cmdline = option + " " + classpath; + javap(cmdline.split(" +")); + try (Scanner scnr = new Scanner(output)) { + Assert.assertNotNull(scnr.findWithinHorizon(ptrn, 0)); + } + } + + private void javap(String... args) throws Exception { + try (PrintWriter out = new PrintWriter(output.toFile())) { + int rc = com.sun.tools.javap.Main.run(args, out); + if (rc < 0) + throw new Exception("javap exited, rc=" + rc); + } + } + + // small class to test + static class Strings { + static final String s = "\1\2\3"; + static final String s1 = "123"; + static final String s2 = "\\u0000"; + static final String s3 = "\0"; + static String f() { return s + s1 + s2 + s3; } + } +} + +
--- a/test/tools/lib/toolbox/TestRunner.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/lib/toolbox/TestRunner.java Thu Aug 11 18:52:55 2016 -0700 @@ -117,7 +117,7 @@ } } - protected void error(String message) { + public void error(String message) { out.println("Error: " + message); errorCount++; }
--- a/test/tools/lib/types/TypeHarness.java Fri Jul 29 19:53:52 2016 -0700 +++ b/test/tools/lib/types/TypeHarness.java Thu Aug 11 18:52:55 2016 -0700 @@ -22,6 +22,7 @@ */ import java.net.URI; +import java.util.ArrayList; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -40,6 +41,7 @@ import com.sun.tools.javac.comp.Check; import com.sun.tools.javac.comp.Infer; import com.sun.tools.javac.comp.InferenceContext; +import com.sun.tools.javac.comp.Modules; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Name; @@ -82,6 +84,7 @@ * The code then verifies that {@code [X:=Object,Y:=Object]A<X,Y> == A<Object,Object>}. * * @author mcimadamore + * @author vromero */ public class TypeHarness { @@ -91,19 +94,20 @@ protected Names names; protected ReusableJavaCompiler tool; protected Infer infer; + protected Context context; protected Factory fac; protected TypeHarness() { - Context ctx = new Context(); - JavacFileManager.preRegister(ctx); - MyAttr.preRegister(ctx); - tool = new ReusableJavaCompiler(ctx); - types = Types.instance(ctx); - infer = Infer.instance(ctx); - chk = Check.instance(ctx); - predef = Symtab.instance(ctx); - names = Names.instance(ctx); + context = new Context(); + JavacFileManager.preRegister(context); + MyAttr.preRegister(context); + tool = new ReusableJavaCompiler(context); + types = Types.instance(context); + infer = Infer.instance(context); + chk = Check.instance(context); + predef = Symtab.instance(context); + names = Names.instance(context); fac = new Factory(); } @@ -411,8 +415,8 @@ public StrToTypeFactory(String pkg, java.util.List<String> imports, java.util.List<String> typeVarDecls) { this.pkg = pkg; this.imports = imports; - this.typeVarDecls = typeVarDecls; - this.typeVariables = from(typeVarDecls.stream() + this.typeVarDecls = typeVarDecls == null ? new ArrayList<>() : typeVarDecls; + this.typeVariables = from(this.typeVarDecls.stream() .map(this::typeVarName) .map(this::getType) .collect(Collectors.toList()) @@ -420,7 +424,7 @@ } TypeVar getTypeVarFromStr(String name) { - if (typeVarDecls == null) { + if (typeVarDecls.isEmpty()) { return null; } int index = typeVarDecls.indexOf(name); @@ -476,7 +480,7 @@ public CharSequence getCharContent(boolean ignoreEncodingErrors) { String impStmts = imports.size() > 0 ? imports.stream().map(i -> "import " + i + ";").collect(Collectors.joining("\n")) : ""; - String tvars = typeVarDecls.size() > 0 ? + String tvars = !typeVarDecls.isEmpty() ? typeVarDecls.stream().collect(Collectors.joining(",", "<", ">")) : ""; return template .replace("#Package", (pkg == null) ? "" : "package " + pkg + ";") @@ -534,6 +538,7 @@ void clear() { newRound(); + Modules.instance(context).newRound(); } } // </editor-fold>