Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7, Trunk
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Forbidden-apis 1.4 is out, new features are:

      • upgrade to ASM 5.0_BETA
      • Improved Java 8 support: support for invokedynamic to methodhandles of static methods (used by "::" closures)
      • Reduce memory usage (see LUCENE-4753)
      • some Maven improvements
      • fix signatures of commons-io (thanks Robert Muir)
      1. LUCENE-5347.patch
        7 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment - - edited

        Because there was an error in commons-io signatures, some violations were not detected with 1.3:

        -check-forbidden-base:
        [forbidden-apis] Reading bundled API signatures: jdk-unsafe-1.7
        [forbidden-apis] Reading bundled API signatures: jdk-deprecated-1.7
        [forbidden-apis] Reading bundled API signatures: commons-io-unsafe-2.1
        [forbidden-apis] Reading API signatures: C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr3\lucene\tools\forbiddenApis\base.txt
        [forbidden-apis] Reading API signatures: C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr3\lucene\tools\forbiddenApis\servlet-api.txt
        [forbidden-apis] Loading classes to check...
        [forbidden-apis] Scanning for API signatures and dependencies...
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.handler.admin.ShowFileRequestHandler (ShowFileRequestHandler.java:426)
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.handler.admin.ShowFileRequestHandler (ShowFileRequestHandler.java:450)
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.core.TestLazyCores (TestLazyCores.java:582)
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#readFileToString(java.io.File) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.handler.PingRequestHandlerTest (PingRequestHandlerTest.java:103)
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.AnalysisAfterCoreReloadTest (AnalysisAfterCoreReloadTest.java:124)
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#readFileToString(java.io.File) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.schema.ModifyConfFileTest (ModifyConfFileTest.java:97)
        [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#readFileToString(java.io.File) [Uses default charset]
        [forbidden-apis]   in org.apache.solr.schema.ModifyConfFileTest (ModifyConfFileTest.java:112)
        [forbidden-apis] Scanned 1982 (and 1319 related) class file(s) for forbidden API invocations (in 1.40s), 7 error(s).
        

        I will commit a fix, too!

        Show
        Uwe Schindler added a comment - - edited Because there was an error in commons-io signatures, some violations were not detected with 1.3: -check-forbidden-base: [forbidden-apis] Reading bundled API signatures: jdk-unsafe-1.7 [forbidden-apis] Reading bundled API signatures: jdk-deprecated-1.7 [forbidden-apis] Reading bundled API signatures: commons-io-unsafe-2.1 [forbidden-apis] Reading API signatures: C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr3\lucene\tools\forbiddenApis\base.txt [forbidden-apis] Reading API signatures: C:\Users\Uwe Schindler\Projects\lucene\trunk-lusolr3\lucene\tools\forbiddenApis\servlet-api.txt [forbidden-apis] Loading classes to check... [forbidden-apis] Scanning for API signatures and dependencies... [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset] [forbidden-apis] in org.apache.solr.handler.admin.ShowFileRequestHandler (ShowFileRequestHandler.java:426) [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset] [forbidden-apis] in org.apache.solr.handler.admin.ShowFileRequestHandler (ShowFileRequestHandler.java:450) [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset] [forbidden-apis] in org.apache.solr.core.TestLazyCores (TestLazyCores.java:582) [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#readFileToString(java.io.File) [Uses default charset] [forbidden-apis] in org.apache.solr.handler.PingRequestHandlerTest (PingRequestHandlerTest.java:103) [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#writeStringToFile(java.io.File,java.lang.String) [Uses default charset] [forbidden-apis] in org.apache.solr.AnalysisAfterCoreReloadTest (AnalysisAfterCoreReloadTest.java:124) [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#readFileToString(java.io.File) [Uses default charset] [forbidden-apis] in org.apache.solr.schema.ModifyConfFileTest (ModifyConfFileTest.java:97) [forbidden-apis] Forbidden method invocation: org.apache.commons.io.FileUtils#readFileToString(java.io.File) [Uses default charset] [forbidden-apis] in org.apache.solr.schema.ModifyConfFileTest (ModifyConfFileTest.java:112) [forbidden-apis] Scanned 1982 (and 1319 related) class file(s) for forbidden API invocations (in 1.40s), 7 error(s). I will commit a fix, too!
        Hide
        Uwe Schindler added a comment -

        Patch. Will commit after tests ran...

        Show
        Uwe Schindler added a comment - Patch. Will commit after tests ran...
        Hide
        Uwe Schindler added a comment -

        The bugs with default encodings and Zookeeper found by forbidden are very serious. If we respin 4.6, we should backport this patch!

        Solr copies files from filesystem to zookeeper by reading them as string with default charset and then writing them as byte array after converting the string to UTF-8. This corrumpts the data. Zookeeper should simply read as byte[] from disk and store as byte[] in ZK. It does this the other way round, fortunately.

        Show
        Uwe Schindler added a comment - The bugs with default encodings and Zookeeper found by forbidden are very serious. If we respin 4.6, we should backport this patch! Solr copies files from filesystem to zookeeper by reading them as string with default charset and then writing them as byte array after converting the string to UTF-8. This corrumpts the data. Zookeeper should simply read as byte[] from disk and store as byte[] in ZK. It does this the other way round, fortunately.
        Hide
        ASF subversion and git services added a comment -

        Commit 1544370 from Uwe Schindler in branch 'dev/trunk'
        [ https://svn.apache.org/r1544370 ]

        LUCENE-5347: Upgrade forbidden-apis checker to version 1.4. Fix Zookeeper bug with default encoding.

        Show
        ASF subversion and git services added a comment - Commit 1544370 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1544370 ] LUCENE-5347 : Upgrade forbidden-apis checker to version 1.4. Fix Zookeeper bug with default encoding.
        Hide
        ASF subversion and git services added a comment -

        Commit 1544376 from Uwe Schindler in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1544376 ]

        Merged revision(s) 1544370 from lucene/dev/trunk:
        LUCENE-5347: Upgrade forbidden-apis checker to version 1.4. Fix Zookeeper bug with default encoding.

        Show
        ASF subversion and git services added a comment - Commit 1544376 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1544376 ] Merged revision(s) 1544370 from lucene/dev/trunk: LUCENE-5347 : Upgrade forbidden-apis checker to version 1.4. Fix Zookeeper bug with default encoding.
        Hide
        Uwe Schindler added a comment -

        Committed to trunk and branch_4x

        Show
        Uwe Schindler added a comment - Committed to trunk and branch_4x

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Uwe Schindler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development