uschindler commented on PR #14939:
URL: https://github.com/apache/lucene/pull/14939#issuecomment-3065112303

   FYI, I did a quick test:
   
   ```diff
    lucene/core/src/java/org/apache/lucene/util/Bits.java | 2 ++
    1 file changed, 2 insertions(+)
   
   diff --git a/lucene/core/src/java/org/apache/lucene/util/Bits.java 
b/lucene/core/src/java/org/apache/lucene/util/Bits.java
   index 61757a1a34e..79b078f9e73 100644
   --- a/lucene/core/src/java/org/apache/lucene/util/Bits.java
   +++ b/lucene/core/src/java/org/apache/lucene/util/Bits.java
   @@ -18,6 +18,8 @@ package org.apache.lucene.util;
    
    import org.apache.lucene.search.DocIdSetIterator;
    
   +import static jdk.incubator.vector.VectorOperators.ADD;
   +
    /**
     * Interface for Bitset-like structures.
     *
   ```
   
   So I added a fake import to a class from the main sourceSet.
   
   If you invoke gradle it fails after a very short time:
   
   ```
   Execution failed for task ':lucene:core:compileJava'.
   > Compilation failed; see the compiler output below.
     C:\Users\Uwe 
Schindler\Projects\lucene\lucene\lucene\core\src\java\org\apache\lucene\util\Bits.java:21:
 Fehler: Statischer Import nur aus Klassen und Schnittstellen
     import static jdk.incubator.vector.VectorOperators.ADD;
     ^
     Hinweis: Wiederholen Sie die Kompilierung mit -Xlint:deprecation, um 
Details zu erhalten.
     C:\Users\Uwe 
Schindler\Projects\lucene\lucene\lucene\core\src\java\org\apache\lucene\util\Bits.java:21:
 Fehler: Package jdk.incubator.vector ist nicht sichtbar
     import static jdk.incubator.vector.VectorOperators.ADD;
                                ^
       (Package jdk.incubator.vector wird in Modul jdk.incubator.vector 
deklariert, aber nicht von Modul org.apache.lucene.core gelesen)
     Hinweis: Einige Eingabedateien verwenden oder ├╝berschreiben eine 
veraltete API.
     2 Fehler
   ```
   
   (sorry for being German).
   
   So basically it is already impossible to use incubator code anywhere except 
out java24 module where we have all vector code encapsulated.
   
   The checks about the `if (HAS_XY....)`` may be usefull, but the rest of this 
PR and also forbiddenapis is not needed. The type system is strong enough.
   
   And `MemorySegmentPostingDecodingUtil` is perfectly fine that it uses vector 
code because it is an implementation of the vector API. It is made for taht.
   
   -1 to merge this PR!


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

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


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

Reply via email to