# HG changeset patch # User lana # Date 1490894641 0 # Node ID bac7a63afbcbbe3a07bfe3ea9dc5ec2d232ad377 # Parent 60e57411bc2c96dffae0ddd6595a7448e4861ee9# Parent 74af976d6798748d827725e96048fce7d1572c9b Merge diff -r 60e57411bc2c -r bac7a63afbcb langtools/src/java.compiler/share/classes/javax/annotation/processing/Generated.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/langtools/src/java.compiler/share/classes/javax/annotation/processing/Generated.java Thu Mar 30 17:24:01 2017 +0000 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2005, 2017, 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 javax.annotation.processing; + +import java.lang.annotation.*; +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +/** + * The Generated annotation is used to mark source code that has been generated. + * It can also be used to differentiate user written code from generated code in + * a single file. + * + *

Examples:

+ *
+ *   @Generated("com.example.Generator")
+ * 
+ *
+ *   @Generated(value="com.example.Generator", date= "2017-07-04T12:08:56.235-0700")
+ * 
+ *
+ *   @Generated(value="com.example.Generator", date= "2017-07-04T12:08:56.235-0700",
+ *      comments= "comment 1")
+ * 
+ * + * @since 9 + */ +@Documented +@Retention(SOURCE) +@Target({PACKAGE, TYPE, METHOD, CONSTRUCTOR, FIELD, + LOCAL_VARIABLE, PARAMETER}) +public @interface Generated { + + /** + * The value element MUST have the name of the code generator. The + * name is the fully qualified name of the code generator. + * + * @return The name of the code generator + */ + String[] value(); + + /** + * Date when the source was generated. The date element must follow the ISO + * 8601 standard. For example the date element would have the following + * value 2017-07-04T12:08:56.235-0700 which represents 2017-07-04 12:08:56 + * local time in the U.S. Pacific Time time zone. + * + * @return The date the source was generated + */ + String date() default ""; + + /** + * A place holder for any comments that the code generator may want to + * include in the generated code. + * + * @return Comments that the code generated included + */ + String comments() default ""; +} diff -r 60e57411bc2c -r bac7a63afbcb langtools/src/java.compiler/share/classes/module-info.java --- a/langtools/src/java.compiler/share/classes/module-info.java Wed Mar 29 23:33:07 2017 +0000 +++ b/langtools/src/java.compiler/share/classes/module-info.java Thu Mar 30 17:24:01 2017 +0000 @@ -30,6 +30,7 @@ * and define interfaces for tools such as compilers which can be invoked * from a program. * + * @moduleGraph * @since 9 */ module java.compiler { diff -r 60e57411bc2c -r bac7a63afbcb langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java Wed Mar 29 23:33:07 2017 +0000 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Mar 30 17:24:01 2017 +0000 @@ -334,7 +334,10 @@ currModule.complete(); PackageSymbol p = c.packge(); isAccessible = - (currModule == p.modle) || currModule.visiblePackages.get(p.fullname) == p || p == syms.rootPackage; + currModule == p.modle || + currModule.visiblePackages.get(p.fullname) == p || + p == syms.rootPackage || + (p.modle == syms.unnamedModule && currModule.readModules.contains(p.modle)); } else { isAccessible = true; } diff -r 60e57411bc2c -r bac7a63afbcb langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java Wed Mar 29 23:33:07 2017 +0000 +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java Thu Mar 30 17:24:01 2017 +0000 @@ -39,6 +39,7 @@ import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; +import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; @@ -283,23 +284,14 @@ } /** - * Processes strings containing options and operands. - * @param args the strings to be processed - * @param allowableOpts the set of option declarations that are applicable - * @param helper a help for use by Option.process - * @param allowOperands whether or not to check for files and classes - * @param checkFileManager whether or not to check if the file manager can handle - * options which are not recognized by any of allowableOpts - * @return true if all the strings were successfully processed; false otherwise - * @throws IllegalArgumentException if a problem occurs and errorMode is set to - * ILLEGAL_ARGUMENT + * Handles the {@code --release} option. + * + * @param additionalOptions a predicate to handle additional options implied by the + * {@code --release} option. The predicate should return true if all the additional + * options were processed successfully. + * @return true if successful, false otherwise */ - private boolean processArgs(Iterable args, - Set