You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/04/06 22:06:09 UTC

[GitHub] [lucene] rmuir opened a new pull request #68: LUCENE-9910: maximize javac lint

rmuir opened a new pull request #68:
URL: https://github.com/apache/lucene/pull/68


   This enables quite a few javac warnings from java11+ that weren't
   enabled for some reason. None of them fail, so lock them in.
   
   Additionally some newer checks are only recognized for newer JDK
   versions, so they are only enabled based on the javac version used. They
   will cause no annoyance because they relate to newer language features.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir merged pull request #68: LUCENE-9910: maximize javac lint

Posted by GitBox <gi...@apache.org>.
rmuir merged pull request #68:
URL: https://github.com/apache/lucene/pull/68


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on a change in pull request #68: LUCENE-9910: maximize javac lint

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #68:
URL: https://github.com/apache/lucene/pull/68#discussion_r608459574



##########
File path: gradle/java/javac.gradle
##########
@@ -33,27 +33,51 @@ allprojects {
       options.compilerArgs += [
         "-Xlint:-deprecation",
         "-Xlint:-serial",
+        "-Xlint:auxiliaryclass",
         "-Xlint:cast",
         "-Xlint:classfile",
         "-Xlint:dep-ann",
         "-Xlint:divzero",
         "-Xlint:empty",
+        "-Xlint:exports",
         "-Xlint:fallthrough",
         "-Xlint:finally",
+        "-Xlint:opens",
         "-Xlint:options",
+        "-Xlint:overloads",
         "-Xlint:overrides",
+        // TODO: some tests seem to have bad classpaths?
+        // this check seems to be a good sanity check for gradle?
+        // "-Xlint:path",

Review comment:
       A dumb workaround is to place an empty file in input resources folder.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on a change in pull request #68: LUCENE-9910: maximize javac lint

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #68:
URL: https://github.com/apache/lucene/pull/68#discussion_r608459064



##########
File path: gradle/java/javac.gradle
##########
@@ -33,27 +33,51 @@ allprojects {
       options.compilerArgs += [
         "-Xlint:-deprecation",
         "-Xlint:-serial",
+        "-Xlint:auxiliaryclass",
         "-Xlint:cast",
         "-Xlint:classfile",
         "-Xlint:dep-ann",
         "-Xlint:divzero",
         "-Xlint:empty",
+        "-Xlint:exports",
         "-Xlint:fallthrough",
         "-Xlint:finally",
+        "-Xlint:opens",
         "-Xlint:options",
+        "-Xlint:overloads",
         "-Xlint:overrides",
+        // TODO: some tests seem to have bad classpaths?
+        // this check seems to be a good sanity check for gradle?
+        // "-Xlint:path",

Review comment:
       These are the default locations for output resource compilation. If the source doesn't have a corresponding input, the output doesn't exist. Looks like a gradle bug to me. Don't know how to fix this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #68: LUCENE-9910: maximize javac lint

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #68:
URL: https://github.com/apache/lucene/pull/68#discussion_r608213508



##########
File path: gradle/java/javac.gradle
##########
@@ -33,27 +33,51 @@ allprojects {
       options.compilerArgs += [
         "-Xlint:-deprecation",
         "-Xlint:-serial",
+        "-Xlint:auxiliaryclass",
         "-Xlint:cast",
         "-Xlint:classfile",
         "-Xlint:dep-ann",
         "-Xlint:divzero",
         "-Xlint:empty",
+        "-Xlint:exports",
         "-Xlint:fallthrough",
         "-Xlint:finally",
+        "-Xlint:opens",
         "-Xlint:options",
+        "-Xlint:overloads",
         "-Xlint:overrides",
+        // TODO: some tests seem to have bad classpaths?
+        // this check seems to be a good sanity check for gradle?
+        // "-Xlint:path",

Review comment:
       I left this TODO because this check seems genuinely useful. But currently it provokes some failures that must be addressed:
   ```
   $ RUNTIME_JAVA_HOME=/home/rmuir/Downloads/jdk-17 ./gradlew compileJava compileTestJava
   
   > Task :lucene:classification:compileTestJava FAILED
   warning: [path] bad path element "/home/rmuir/workspace/lucene/lucene/classification/build/resources/main": no such file or directory
   error: warnings found and -Werror specified
   1 error
   1 warning
   
   > Task :lucene:benchmark:compileTestJava
   warning: [path] bad path element "/home/rmuir/workspace/lucene/lucene/benchmark/build/resources/main": no such file or directory
   error: warnings found and -Werror specified
   1 error
   1 warning
   
   > Task :lucene:benchmark:compileTestJava FAILED
   > Task :lucene:codecs:compileTestJava
   
   > Task :lucene:backward-codecs:compileTestJava
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   
   FAILURE: Build completed with 2 failures.
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org