Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10185

gradle check fails on java 17 (security manager deprecation)

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • None
    • New

    Description

      I don't think we should add SuppressWarnings here, instead fix our ECJ linter configuration. Seems like we should be specifying something similar to "-release 11" and it shouldn't care about the new deprecations from java 17. Or if we can't do that, maybe we should disable the "deprecated for removal" check in ECJ entirely?

      > Task :lucene:core:ecjLintMain
      ----------
      1. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/NamedThreadFactory.java (at line 42)
              final SecurityManager s = System.getSecurityManager();
                    ^^^^^^^^^^^^^^^
      The type SecurityManager has been deprecated since version 17 and marked for removal
      ----------
      2. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/NamedThreadFactory.java (at line 42)
              final SecurityManager s = System.getSecurityManager();
                                               ^^^^^^^^^^^^^^^^^^^^
      The method getSecurityManager() from the type System has been deprecated since version 17 and marked for removal
      ----------
      3. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/NamedThreadFactory.java (at line 43)
              group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
                                      ^^^^^^^^^^^^^^^^
      The method getThreadGroup() from the type SecurityManager has been deprecated and marked for removal
      ----------
      ----------
      4. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java (at line 23)
              import java.security.AccessControlException;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      The type AccessControlException has been deprecated since version 17 and marked for removal
      ----------
      5. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java (at line 24)
              import java.security.AccessController;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      The type AccessController has been deprecated since version 17 and marked for removal
      ----------
      6. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java (at line 574)
              AccessController.doPrivileged((PrivilegedAction<Field[]>) target::getDeclaredFields);
              ^^^^^^^^^^^^^^^^
      The type AccessController has been deprecated since version 17 and marked for removal
      ----------
      7. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java (at line 574)
              AccessController.doPrivileged((PrivilegedAction<Field[]>) target::getDeclaredFields);
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      The method doPrivileged(PrivilegedAction<Field[]>) from the type AccessController has been deprecated and marked for removal
      ----------
      8. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java (at line 575)
              } catch (AccessControlException e) {
                       ^^^^^^^^^^^^^^^^^^^^^^
      The type AccessControlException has been deprecated since version 17 and marked for removal
      ----------
      ----------
      9. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java (at line 33)
              import java.security.AccessController;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      The type AccessController has been deprecated since version 17 and marked for removal
      ----------
      10. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java (at line 337)
              AccessController.doPrivileged((PrivilegedAction<Object>) MMapDirectory::unmapHackImpl);
              ^^^^^^^^^^^^^^^^
      The type AccessController has been deprecated since version 17 and marked for removal
      ----------
      11. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java (at line 337)
              AccessController.doPrivileged((PrivilegedAction<Object>) MMapDirectory::unmapHackImpl);
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      The method doPrivileged(PrivilegedAction<Object>) from the type AccessController has been deprecated and marked for removal
      ----------
      12. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java (at line 390)
              AccessController.doPrivileged(
              ^^^^^^^^^^^^^^^^
      The type AccessController has been deprecated since version 17 and marked for removal
      ----------
      13. ERROR in /home/rmuir/workspace/lucene/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java (at line 390)
              AccessController.doPrivileged(
                    (PrivilegedAction<Throwable>)
                        () -> {
                          try {
                            unmapper.invokeExact(buffer);
                            return null;
                          } catch (Throwable t) {
                            return t;
                          }
                        });
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      The method doPrivileged(PrivilegedAction<Throwable>) from the type AccessController has been deprecated and marked for removal
      ----------
      13 problems (13 errors)
      
      > Task :lucene:core:ecjLintMain FAILED
      > Task :lucene:expressions:ecjLintMain
      > Task :lucene:codecs:renderJavadoc
      > Task :lucene:facet:ecjLintMain
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Execution failed for task ':lucene:core:ecjLintMain'.
      > Process 'command '/usr/lib/jvm/java-17-openjdk/bin/java'' finished with non-zero exit value 255
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
      
      * Get more help at https://help.gradle.org
      
      BUILD FAILED in 1m 36s
      415 actionable tasks: 408 executed, 7 up-to-date
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rcmuir Robert Muir
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m