--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java Fri Apr 07 15:46:31 2017 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java Mon Apr 10 11:08:59 2017 +0200
@@ -3908,4 +3908,16 @@
}
}
+ void checkModuleRequires(final DiagnosticPosition pos, final RequiresDirective rd) {
+ if ((rd.module.flags() & Flags.AUTOMATIC_MODULE) != 0) {
+ deferredLintHandler.report(() -> {
+ if (rd.isTransitive() && lint.isEnabled(LintCategory.REQUIRES_TRANSITIVE_AUTOMATIC)) {
+ log.warning(pos, Warnings.RequiresTransitiveAutomatic);
+ } else if (lint.isEnabled(LintCategory.REQUIRES_AUTOMATIC)) {
+ log.warning(pos, Warnings.RequiresAutomatic);
+ }
+ });
+ }
+ }
+
}