[ 
https://issues.apache.org/jira/browse/LUCENE-10185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17430219#comment-17430219
 ] 

ASF subversion and git services commented on LUCENE-10185:
----------------------------------------------------------

Commit f8d431ae4461a65ab109c0b8afffdfbcc5a12a5b in lucene's branch 
refs/heads/main from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=f8d431a ]

LUCENE-10185: pass --release 11 to ECJ linter, fix JDK 17 build (#393)

* LUCENE-10185: pass --release 11 to ECJ linter, fix JDK 17 build

Otherwise, new java releases such as JDK 18, JDK 19, ... may have even
more new deprecations, the build shouldn't fail in such cases.

Remove -source/-target now that we pass --release

Fix casting so ECJ understands it and creates correct call signature (UweSays: 
"It's ok. I know why it happens, but it's a bug in ECJ. The type safety is 
checked by the invokeexact")

Co-authored-by: Uwe Schindler <[email protected]>

> gradle check fails on java 17 (security manager deprecation)
> ------------------------------------------------------------
>
>                 Key: LUCENE-10185
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10185
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Robert Muir
>            Priority: Major
>             Fix For: main (9.0)
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> 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?
> {noformat}
> > 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
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to