Lucene - Core
  1. Lucene - Core
  2. LUCENE-5514

Backport Java 7 changes from trunk to Lucene 4.8

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.8
    • Component/s: general/build
    • Labels:
    • Lucene Fields:
      New

      Description

      This issue tracks the backporting of various issues that are related to Java 7 to 4.8.
      It will also revert "build fixes" that worked around compile failures (especially stuff like Long/Integer.compare().

      I will attach a patch soon (for review).

      Here is the vote thread: http://mail-archives.apache.org/mod_mbox/lucene-dev/201403.mbox/%3C02be01cf3ae9%24e3735090%24aa59f1b0%24%40thetaphi.de%3E
      Preliminary result: http://mail-archives.apache.org/mod_mbox/lucene-dev/201403.mbox/%3C001001cf3c45%248d2adc00%24a7809400%24%40thetaphi.de%3E

      1. LUCENE-5514.patch
        89 kB
        Uwe Schindler
      2. LUCENE-5514.patch
        88 kB
        Uwe Schindler
      3. LUCENE-5514.patch
        86 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -

        Here is the backport / revert of the following commits:

        Merged revision(s) 1575519, 1575446 from lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java:
        SOLR-5818: Prevent overflow in Hoss' fix for Java 1.6 source compatibility
        ........
        SOLR-5818: Fix java1.6 source compatibility
        ........
        Merged revision(s) 1531667 from lucene/dev/branches/branch_4x:
        LUCENE-5260: don't use java7-only API
        ........
        
        Merged revision(s) 1450248 from lucene/dev/branches/branch_4x:
        LUCENE-4798: use java6 compatible method
        ........
        
        Merged revision(s) 1509017 from lucene/dev/branches/branch_4x:
        SOLR-4221: Fix compile error on Java6 due to use of diamond operator
        ........
        
        Merged revision(s) 1520642 from lucene/dev/branches/branch_4x:
        java6
        ........
        
        Merged revision(s) 1544816 from lucene/dev/branches/branch_4x:
        SOLR-5378: Fix compile issues on Java6
        ........
        
        Merged revision(s) 1571338 from lucene/dev/branches/branch_4x:
        fixing  build failure. remove use of java 7 API
        ........
        
        Merged revision(s) 1571338 from lucene/dev/branches/branch_4x:
        fixing  build failure. remove use of java 7 API
        ........
        
        Merged revision(s) 1575318 from lucene/dev/branches/branch_4x:
        avoid Integer.compare
        ........
        
        Merged revision(s) 1466733 from lucene/dev/branches/branch_4x:
        AssertionError(String,Throwable) doesn't exist in Java 6.
        
        ........
        
        Merged revision(s) 1538895 from lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/sorter/TestBlockJoinSorter.java:
        Fix test: Java 6 doesn't have Long.compare.
        
        ........
        
        Merged revision(s) 1538895 from lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/sorter/TestBlockJoinSorter.java:
        Fix test: Java 6 doesn't have Long.compare.
        
        ........
        
        Merged revision(s) 1457751 from lucene/dev/trunk:
        LUCENE-4747: Remove reflection from IOUtils for supressing caughth Exceptions
        ........
        
        Merged revision(s) 1459437, 1499935 from lucene/dev/trunk:
        LUCENE-4848: Use Java 7 NIO2-FileChannel instead of RandomAccessFile for NIOFSDirectory and MMapDirectory
        ........
        LUCENE-5086: RamUsageEstimator now uses official Java 7 API or a proprietary Oracle Java 6 API to get Hotspot MX bean, preventing AWT classes to be loaded on MacOSX
        ........
        
        Show
        Uwe Schindler added a comment - Here is the backport / revert of the following commits: Merged revision(s) 1575519, 1575446 from lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java: SOLR-5818: Prevent overflow in Hoss' fix for Java 1.6 source compatibility ........ SOLR-5818: Fix java1.6 source compatibility ........ Merged revision(s) 1531667 from lucene/dev/branches/branch_4x: LUCENE-5260: don't use java7-only API ........ Merged revision(s) 1450248 from lucene/dev/branches/branch_4x: LUCENE-4798: use java6 compatible method ........ Merged revision(s) 1509017 from lucene/dev/branches/branch_4x: SOLR-4221: Fix compile error on Java6 due to use of diamond operator ........ Merged revision(s) 1520642 from lucene/dev/branches/branch_4x: java6 ........ Merged revision(s) 1544816 from lucene/dev/branches/branch_4x: SOLR-5378: Fix compile issues on Java6 ........ Merged revision(s) 1571338 from lucene/dev/branches/branch_4x: fixing build failure. remove use of java 7 API ........ Merged revision(s) 1571338 from lucene/dev/branches/branch_4x: fixing build failure. remove use of java 7 API ........ Merged revision(s) 1575318 from lucene/dev/branches/branch_4x: avoid Integer.compare ........ Merged revision(s) 1466733 from lucene/dev/branches/branch_4x: AssertionError(String,Throwable) doesn't exist in Java 6. ........ Merged revision(s) 1538895 from lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/sorter/TestBlockJoinSorter.java: Fix test: Java 6 doesn't have Long.compare. ........ Merged revision(s) 1538895 from lucene/dev/branches/branch_4x/lucene/misc/src/test/org/apache/lucene/index/sorter/TestBlockJoinSorter.java: Fix test: Java 6 doesn't have Long.compare. ........ Merged revision(s) 1457751 from lucene/dev/trunk: LUCENE-4747: Remove reflection from IOUtils for supressing caughth Exceptions ........ Merged revision(s) 1459437, 1499935 from lucene/dev/trunk: LUCENE-4848: Use Java 7 NIO2-FileChannel instead of RandomAccessFile for NIOFSDirectory and MMapDirectory ........ LUCENE-5086: RamUsageEstimator now uses official Java 7 API or a proprietary Oracle Java 6 API to get Hotspot MX bean, preventing AWT classes to be loaded on MacOSX ........
        Hide
        Uwe Schindler added a comment -

        I think this is fine as a first step. It does not contain all the changes needed to have identical Java 7 code in trunk and 4.x. The problem are merged stuff that was fixed to be Java 6 compliant while merging. This is hard to detect. Some of those were already fixed (like compare methods implemented with Long.signum), but others like multi-catch not. I don't think we should put too much effort in fixing this. It is important that the optimized methods for Java 7 are used in the comparators (intrinsics) and also the new FileChannel APIs are used.

        Show
        Uwe Schindler added a comment - I think this is fine as a first step. It does not contain all the changes needed to have identical Java 7 code in trunk and 4.x. The problem are merged stuff that was fixed to be Java 6 compliant while merging. This is hard to detect. Some of those were already fixed (like compare methods implemented with Long.signum), but others like multi-catch not. I don't think we should put too much effort in fixing this. It is important that the optimized methods for Java 7 are used in the comparators (intrinsics) and also the new FileChannel APIs are used.
        Hide
        Uwe Schindler added a comment -

        I will first commit this stuff and later cleanup the documentation / changes.txt. This needs to be done in trunk first and separately backported.

        Show
        Uwe Schindler added a comment - I will first commit this stuff and later cleanup the documentation / changes.txt. This needs to be done in trunk first and separately backported.
        Hide
        Uwe Schindler added a comment -

        Last patch missed changes in RAMUsageEstimator. We no longer need reflection to get managament bean without proxy (that starts crazy AWT on OSX). This is the code from trunk.

        Show
        Uwe Schindler added a comment - Last patch missed changes in RAMUsageEstimator . We no longer need reflection to get managament bean without proxy (that starts crazy AWT on OSX). This is the code from trunk.
        Hide
        Uwe Schindler added a comment -

        More fixes after synchronizing build files (they went a little bit out of order). Now also missing stuff like IDEA and Netbeans are correct.

        I will commit this soon, the 72 hours vote is over.

        Show
        Uwe Schindler added a comment - More fixes after synchronizing build files (they went a little bit out of order). Now also missing stuff like IDEA and Netbeans are correct. I will commit this soon, the 72 hours vote is over.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5514: Move to Java 7 on branch_4x. There will come more commits to move changes entries and documentation.

        Show
        ASF subversion and git services added a comment - Commit 1576728 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1576728 ] LUCENE-5514 : Move to Java 7 on branch_4x. There will come more commits to move changes entries and documentation.
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5514: Remove outdated constants

        Show
        ASF subversion and git services added a comment - Commit 1576729 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1576729 ] LUCENE-5514 : Remove outdated constants
        Hide
        ASF subversion and git services added a comment -

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

        Merged revision(s) 1576729 from lucene/dev/trunk:
        LUCENE-5514: Remove outdated constants

        Show
        ASF subversion and git services added a comment - Commit 1576731 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1576731 ] Merged revision(s) 1576729 from lucene/dev/trunk: LUCENE-5514 : Remove outdated constants
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5514: Update changes.txt

        Show
        ASF subversion and git services added a comment - Commit 1576736 from Uwe Schindler in branch 'dev/trunk' [ https://svn.apache.org/r1576736 ] LUCENE-5514 : Update changes.txt
        Hide
        ASF subversion and git services added a comment -

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

        Merged revision(s) 1576736 from lucene/dev/trunk:
        LUCENE-5514: Update changes.txt

        Show
        ASF subversion and git services added a comment - Commit 1576737 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1576737 ] Merged revision(s) 1576736 from lucene/dev/trunk: LUCENE-5514 : Update changes.txt
        Show
        Uwe Schindler added a comment - Committed after the vote passed! http://mail-archives.apache.org/mod_mbox/lucene-dev/201403.mbox/%3C008401cf3df4%24b6345030%24229cf090%24%40thetaphi.de%3E
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5514: Update bytecode version

        Show
        ASF subversion and git services added a comment - Commit 1576812 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1576812 ] LUCENE-5514 : Update bytecode version
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5514: Remove one more Java 6 hack

        Show
        ASF subversion and git services added a comment - Commit 1582557 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1582557 ] LUCENE-5514 : Remove one more Java 6 hack
        Hide
        ASF subversion and git services added a comment -

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

        LUCENE-5514: Remove one more Java 6 hack

        Show
        ASF subversion and git services added a comment - Commit 1582559 from Uwe Schindler in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1582559 ] LUCENE-5514 : Remove one more Java 6 hack
        Hide
        Uwe Schindler added a comment -

        Close issue after release of 4.8.0

        Show
        Uwe Schindler added a comment - Close issue after release of 4.8.0

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development