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 2023/01/01 20:07:44 UTC

[GitHub] [lucene] rmuir commented on issue #12057: Forbidden-apis "built-in" signatures don't appear to be working?

rmuir commented on issue #12057:
URL: https://github.com/apache/lucene/issues/12057#issuecomment-1368524586

   Here's how to reproduce: apply this patch, then run `gradlew check -x test`. I would expect the build to fail, because we added a deprecated finalizer. Maybe forbidden doesn't fail because we don't actually call Object.finalize()? This method is a little special in that overriding it is enough to be bad. Maybe we should try to fix javac or ECJ to fail on deprecated usages instead?
   
   
   ```
   diff --git a/lucene/core/src/test/org/apache/lucene/TestDemo.java b/lucene/core/src/test/org/apache/lucene/TestDemo.java
   index 6c608e1d0b1..8bcbdc813ee 100644
   --- a/lucene/core/src/test/org/apache/lucene/TestDemo.java
   +++ b/lucene/core/src/test/org/apache/lucene/TestDemo.java
   @@ -46,6 +46,11 @@ import org.apache.lucene.util.IOUtils;
     */
    public class TestDemo extends LuceneTestCase {
   
   +  @Override
   +  protected void finalize() {
   +    System.out.println("YOLO");
   +  }
   +
      public void testDemo() throws IOException {
        String longTerm =
            "longtermlongtermlongtermlongtermlongtermlongtermlongtermlong"
   ```
   


-- 
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-unsubscribe@lucene.apache.org

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