diff options
4 files changed, 1 insertions, 78 deletions
diff --git a/site/versions/master/docs/bazel-user-manual.html b/site/versions/master/docs/bazel-user-manual.html index 5716b56fea..2b86fd78e4 100644 --- a/site/versions/master/docs/bazel-user-manual.html +++ b/site/versions/master/docs/bazel-user-manual.html @@ -1450,25 +1450,6 @@ $ bazel fetch //... </li> </ul> -<h4 id='flag--javawarn'><code class='flag'>--javawarn (all|cast|deprecation|empty|unchecked|fallthrough|path|rawtypes|serial|finally|overrides)</code></h4> -<p> - This option is used to enable Java warnings across an entire build. It takes - an argument which is a javac warning to be enabled, overriding any other Java - options that disable the given warning. The arguments to this option are - appended to the "-Xlint:" flag to javac, and must be exactly one of - the listed warnings. -</p> -<p> - For example: -</p> -<pre> - % bazel build --javawarn="deprecation" --javawarn="unchecked" //java/... -</pre> -<p> - Note that changing <code class='flag'>--javawarn</code> settings will force a recompilation - of all affected classes. -</p> - <h3 id='semantics-options'>Semantics options</h3> <p> These options affect the build commands and/or the output file contents. diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java index 67c3d151b1..672646e7ee 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java @@ -1047,10 +1047,6 @@ public final class JavaCompileAction extends AbstractAction { // aggregation code below should go away. final String pathSeparator = configuration.getHostPathSeparator(); List<String> jcopts = new ArrayList<>(javacOpts); - JavaConfiguration javaConfiguration = configuration.getFragment(JavaConfiguration.class); - if (!javaConfiguration.getJavaWarns().isEmpty()) { - jcopts.add("-Xlint:" + Joiner.on(',').join(javaConfiguration.getJavaWarns())); - } if (!bootclasspathEntries.isEmpty()) { jcopts.add("-bootclasspath"); jcopts.add(Artifact.joinExecPaths(pathSeparator, bootclasspathEntries)); @@ -1068,6 +1064,7 @@ public final class JavaCompileAction extends AbstractAction { } // Invariant: if java_classpath is set to 'off', dependencyArtifacts are ignored + JavaConfiguration javaConfiguration = configuration.getFragment(JavaConfiguration.class); if (javaConfiguration.getReduceJavaClasspath() == JavaClasspathMode.OFF) { compileTimeDependencyArtifacts.clear(); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java index e90eea697d..0ed3506451 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaConfiguration.java @@ -131,7 +131,6 @@ public final class JavaConfiguration extends Fragment { private final boolean generateJavaDeps; private final boolean strictDepsJavaProtos; private final JavaClasspathMode javaClasspath; - private final ImmutableList<String> javaWarns; private final ImmutableList<String> defaultJvmFlags; private final ImmutableList<String> checkedConstraints; private final StrictDepsMode strictJavaDeps; @@ -160,7 +159,6 @@ public final class JavaConfiguration extends Fragment { this.headerCompilationDirectClasspath = javaOptions.headerCompilationDirectClasspath; this.generateJavaDeps = generateJavaDeps; this.javaClasspath = javaOptions.javaClasspath; - this.javaWarns = ImmutableList.copyOf(javaOptions.javaWarns); this.defaultJvmFlags = ImmutableList.copyOf(defaultJvmFlags); this.checkedConstraints = ImmutableList.copyOf(javaOptions.checkedConstraints); this.strictJavaDeps = javaOptions.strictJavaDeps; @@ -235,13 +233,6 @@ public final class JavaConfiguration extends Fragment { return javaClasspath; } - /** - * Returns the extra warnings enabled for Java compilation. - */ - public ImmutableList<String> getJavaWarns() { - return javaWarns; - } - public ImmutableList<String> getDefaultJvmFlags() { return defaultJvmFlags; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java index 8924e00701..e1bf37b165 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java @@ -26,7 +26,6 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.cmdline.LabelSyntaxException; import com.google.devtools.build.lib.rules.java.JavaConfiguration.JavaClasspathMode; import com.google.devtools.build.lib.rules.java.JavaConfiguration.JavaOptimizationMode; -import com.google.devtools.common.options.Converters.StringSetConverter; import com.google.devtools.common.options.EnumConverter; import com.google.devtools.common.options.Option; import com.google.devtools.common.options.TriState; @@ -41,43 +40,6 @@ import java.util.Set; */ public class JavaOptions extends FragmentOptions { - /** - * Converter for the --javawarn option. - */ - public static class JavacWarnConverter extends StringSetConverter { - public JavacWarnConverter() { - super("all", - "cast", - "-cast", - "deprecation", - "-deprecation", - "divzero", - "-divzero", - "empty", - "-empty", - "fallthrough", - "-fallthrough", - "finally", - "-finally", - "none", - "options", - "-options", - "overrides", - "-overrides", - "path", - "-path", - "processing", - "-processing", - "rawtypes", - "-rawtypes", - "serial", - "-serial", - "unchecked", - "-unchecked" - ); - } - } - /** Converter for the --java_classpath option. */ public static class JavaClasspathModeConverter extends EnumConverter<JavaClasspathMode> { public JavaClasspathModeConverter() { @@ -140,14 +102,6 @@ public class JavaOptions extends FragmentOptions { + "VM startup options of each java_binary target.") public List<String> jvmOpts; - @Option(name = "javawarn", - converter = JavacWarnConverter.class, - defaultValue = "", - category = "flags", - allowMultiple = true, - help = "Additional javac warnings to enable when compiling Java source files.") - public List<String> javaWarns; - @Option(name = "use_ijars", defaultValue = "true", category = "strategy", |