Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: BIGDATA_RELEASE_1_1_0
    • Fix Version/s: None
    • Component/s: Other

      Description

      There appear to be a few changes in Java 7 which cause valid Java 6 code to not compile.

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        Compatibility fixes for java 7. private fields in an outer static class are not visible to the inner class and visa versa.

        This fixes all of the errors exception the one in Filter. That error will require a little more inspection. It is:

            [javac] /root/workspace/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/striterator/ChunkedFilter.java:101: error: name clash: filter(IBLZG-208) in ChunkedFilter overrides a method whose erasure is the same as another method, yet neither overrides the other
            [javac]     public IChunkedOrderedIterator<F> filter(final I src) {
            [javac]                                       ^
            [javac]   first method:  filter(Iterator) in ChunkedFilter
            [javac]   second method: filter(IBLZG-209) in IFilter
            [javac]   where IBLZG-208,EBLZG-208,FBLZG-208,IBLZG-209,EBLZG-209,FBLZG-209 are type-variables:
            [javac]     IBLZG-208 extends IChunkedIterator<EBLZG-208> declared in class ChunkedFilter
            [javac]     EBLZG-208 extends Object declared in class ChunkedFilter
            [javac]     FBLZG-208 extends Object declared in class ChunkedFilter
            [javac]     IBLZG-209 extends Iterator<EBLZG-209> declared in interface IFilter
            [javac]     EBLZG-209 extends Object declared in interface IFilter
            [javac]     FBLZG-209 extends Object declared in interface IFilter
            [javac] /root/workspace/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/striterator/ChunkedFilter.java:111: error: name clash: filter(Iterator) in ChunkedFilter and filter(I) in IFilter have the same erasure, yet neither overrides the other
            [javac]     public IChunkedOrderedIterator<F> filter(final Iterator src) {
            [javac]                                       ^
            [javac]   where FBLZG-208,I,E,FBLZG-209 are type-variables:
            [javac]     FBLZG-208 extends Object declared in class ChunkedFilter
            [javac]     I extends Iterator<E> declared in interface IFilter
            [javac]     E extends Object declared in interface IFilter
            [javac]     FBLZG-209 extends Object declared in interface IFilter
        

        Committed revision r6132.

        Show
        bryanthompson bryanthompson added a comment - Compatibility fixes for java 7. private fields in an outer static class are not visible to the inner class and visa versa. This fixes all of the errors exception the one in Filter. That error will require a little more inspection. It is: [javac] /root/workspace/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/striterator/ChunkedFilter.java:101: error: name clash: filter(IBLZG-208) in ChunkedFilter overrides a method whose erasure is the same as another method, yet neither overrides the other [javac] public IChunkedOrderedIterator<F> filter(final I src) { [javac] ^ [javac] first method: filter(Iterator) in ChunkedFilter [javac] second method: filter(IBLZG-209) in IFilter [javac] where IBLZG-208,EBLZG-208,FBLZG-208,IBLZG-209,EBLZG-209,FBLZG-209 are type-variables: [javac] IBLZG-208 extends IChunkedIterator<EBLZG-208> declared in class ChunkedFilter [javac] EBLZG-208 extends Object declared in class ChunkedFilter [javac] FBLZG-208 extends Object declared in class ChunkedFilter [javac] IBLZG-209 extends Iterator<EBLZG-209> declared in interface IFilter [javac] EBLZG-209 extends Object declared in interface IFilter [javac] FBLZG-209 extends Object declared in interface IFilter [javac] /root/workspace/BIGDATA_RELEASE_1_1_0/bigdata/src/java/com/bigdata/striterator/ChunkedFilter.java:111: error: name clash: filter(Iterator) in ChunkedFilter and filter(I) in IFilter have the same erasure, yet neither overrides the other [javac] public IChunkedOrderedIterator<F> filter(final Iterator src) { [javac] ^ [javac] where FBLZG-208,I,E,FBLZG-209 are type-variables: [javac] FBLZG-208 extends Object declared in class ChunkedFilter [javac] I extends Iterator<E> declared in interface IFilter [javac] E extends Object declared in interface IFilter [javac] FBLZG-209 extends Object declared in interface IFilter Committed revision r6132.
        Hide
        bryanthompson bryanthompson added a comment -

        I am taking out the offending method. It appears to compile under both Java 6 and Java 7 now.

        The relevant code block is:

            /**
             * {@inheritDoc}
             * <p>
             * Note: There was a historical compiler problem with this method when
             * generics were not specified.
             * 
             * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/517"> Java
             *      7 Compatibility </a>
             */
            public IChunkedOrderedIterator<F> filter(final I src) {
        
                return new ChunkedFilteringIterator<I, E, F>(src, this);
        
            }
            
        //    /**
        //     * TODO The need for this variant is worrysome - it is required if you do
        //     * NOT specify the generic types and then try to use this class. It is now
        //     * an error with Java 7.  I have taken this variant out.  Hopefully it is
        //     * no longer required by recent Java 6 compilers....
        //     * 
        //     * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/517"> Java
        //     *      7 Compatibility </a>
        //     */
        //    public IChunkedOrderedIterator<F> filter(final Iterator src) {
        //        
        //        return new ChunkedFilteringIterator<I, E, F>((I) src, this);
        //        
        //    }
        

        Committed revision r6133.

        Show
        bryanthompson bryanthompson added a comment - I am taking out the offending method. It appears to compile under both Java 6 and Java 7 now. The relevant code block is: /** * {@inheritDoc} * <p> * Note: There was a historical compiler problem with this method when * generics were not specified. * * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/517"> Java * 7 Compatibility </a> */ public IChunkedOrderedIterator<F> filter(final I src) { return new ChunkedFilteringIterator<I, E, F>(src, this); } // /** // * TODO The need for this variant is worrysome - it is required if you do // * NOT specify the generic types and then try to use this class. It is now // * an error with Java 7. I have taken this variant out. Hopefully it is // * no longer required by recent Java 6 compilers.... // * // * @see <a href="https://sourceforge.net/apps/trac/bigdata/ticket/517"> Java // * 7 Compatibility </a> // */ // public IChunkedOrderedIterator<F> filter(final Iterator src) { // // return new ChunkedFilteringIterator<I, E, F>((I) src, this); // // } Committed revision r6133.
        Hide
        bryanthompson bryanthompson added a comment -

        Please note that we are NOT running Java 7 in CI. This ticket just addressed compiler compatibility for Java 6 and Java 7.

        Show
        bryanthompson bryanthompson added a comment - Please note that we are NOT running Java 7 in CI. This ticket just addressed compiler compatibility for Java 6 and Java 7.

          People

          • Assignee:
            bryanthompson bryanthompson
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: