You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2012/05/09 11:47:17 UTC

Compilation errors of Pivot trunk with Java 7 in Apache Jenkins

Hi all,
I just setup another Jenkins build of Pivot trunk, this time with Java
7 to start to look at what happens (mainly to fix some warnings if
present):

https://builds.apache.org/job/Pivot-trunk%20on%20Java%207/

Without changing settings inside build.xml the first build got some
errors ... I'll try to look at this and fix sources asap.
But could be a configuration

An extract of execution log is under.

In the meantime, if someone has suggestions ...


Bye,
Sandro


At revision 1336029

[Pivot-trunk on Java 7] $ /home/hudson/tools/ant/latest/bin/ant check
clean package test doc deploy package-tests package-sources
package-javadoc

Buildfile: /home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java 7/build.xml

help:

     [echo] Using Classpath:
/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/alt-rt.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/charsets.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/deploy.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/ext/dnsns.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/ext/localedata.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/ext/sunec.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/ext/sunjce_provider.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/ext/sunpkcs11.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/ext/zipfs.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/javaws.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/jce.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/jsse.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/management-agent.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/plugin.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/resources.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/rt.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/security/US_export_policy.jar:/home/jenkins/tools/java/jdk1.7.0-32/jre/lib/security/local_policy.jar:/home/jenkins/jenkins-slave/workspace/Pivot-trunk
on Java 7/ci-builds-on-jenkins/lib/junit-4.8.2.jar:/home/jenkins/jenkins-slave/workspace/Pivot-trunk
on Java 7/ci-builds-on-jenkins/lib/maven-ant-tasks-2.1.3.jar

check:

clean:

core:
    [mkdir] Created dir:
/home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java
7/pivot_trunk/core/ant-bin
    [javac] Compiling 133 source files to
/home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java
7/pivot_trunk/core/ant-bin
    [javac]
    [javac]           WARNING
    [javac]
    [javac] The -source switch defaults to 1.7 in JDK 1.7.
    [javac] If you specify -target 1.6 you now must also specify -source 1.6.
    [javac] Ant will implicitly add -source 1.6 for you.  Please
change your build file.
    [javac] warning: [options] bootstrap class path not set in
conjunction with -source 1.6

    [javac] /home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java
7/pivot_trunk/core/src/org/apache/pivot/xml/Element.java:641: error:
name clash: remove(Node) in Element overrides a method whose erasure
is the same as another method, yet neither overrides the other
    [javac]     public int remove(Node node) {
    [javac]                ^
    [javac]   first method:  remove(K) in Dictionary
    [javac]   second method: remove(T) in Sequence
    [javac]   where K,V,T are type-variables:
    [javac]     K extends Object declared in interface Dictionary
    [javac]     V extends Object declared in interface Dictionary
    [javac]     T extends Object declared in interface Sequence
    [javac] /home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java
7/pivot_trunk/core/src/org/apache/pivot/xml/Element.java:802: error:
name clash: remove(String) in Element overrides a method whose erasure
is the same as another method, yet neither overrides the other
    [javac]     public String remove(String attributeName) {
    [javac]                   ^
    [javac]   first method:  remove(T) in Sequence
    [javac]   second method: remove(K) in Dictionary
    [javac]   where T,K,V are type-variables:
    [javac]     T extends Object declared in interface Sequence
    [javac]     K extends Object declared in interface Dictionary
    [javac]     V extends Object declared in interface Dictionary
    [javac] 2 errors
    [javac] 1 warning

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java
7/pivot_trunk/build.xml:463: The following error occurred while
executing this line:
/home/jenkins/jenkins-slave/workspace/Pivot-trunk on Java
7/pivot_trunk/build.xml:153: Compile failed; see the compiler error
output for details.

Total time: 4 seconds
Build step 'Invoke Ant' marked build as failure
Sending e-mails to: dev@pivot.apache.org
Finished: FAILURE

Re: Compilation errors of Pivot trunk with Java 7 in Apache Jenkins

Posted by Sandro Martini <sa...@gmail.com>.
Hi Roger,
thank you very much (yes, as you I think it's an important thing to
fix) ... tomorrow I'll commit the patch, so we are really near to
2.0.2 final, for next week (the vote) :-) .
After, I re-enable the daily build even for "Pivot trunk on Java 7" in
Jenkins ... could be useful to identify other things.

Note:
the open issue (with Oracle) I have with Java 7 (all versions) on
Windows 7 at 64 bit is the only thing that really prevents me to use
it as build environment in one of my PC, but maybe with the workaround
to disable the IP v6 could make it work (I hope) ... let's update on
this.


Bye

RE: Compilation errors of Pivot trunk with Java 7 in Apache Jenkins

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
I would say, yes, definitely before 2.1.  We made (many) small API
changes for 2.0.1, so I don't imagine it will affect too many users.
And 1.7 is now "in the wild" so others will probably run into this
before too long.

~Roger Whitcomb

-----Original Message-----
From: Sandro Martini [mailto:sandro.martini@gmail.com] 
Sent: Thursday, May 10, 2012 5:32 AM
To: Apache Pivot - Developers
Subject: Re: Compilation errors of Pivot trunk with Java 7 in Apache
Jenkins

Hi,
a quick update on this:
I have been able to resolve this, and in a simple way (but different
from my first proposal),
move all the Dictionary related implementation (inside Element.java)
in an inner class instance, and provide a getter method for it.

Of course this needs some little adjustements in other classes
(included in the patch), BUT even in users code ... take a look at the
patch in the issue, here:

https://issues.apache.org/jira/browse/PIVOT-855


So the real question:
I'd prefer to fix this behaviour NOW (for 2.0.2) without waiting for
the 2.1 ... what do you think ?

This is an important question, please tell me your opinions.

Unless objections I'll commit the fix tomorrow.

Sandro

Re: Compilation errors of Pivot trunk with Java 7 in Apache Jenkins

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
a quick update on this:
I have been able to resolve this, and in a simple way (but different
from my first proposal),
move all the Dictionary related implementation (inside Element.java)
in an inner class instance, and provide a getter method for it.

Of course this needs some little adjustements in other classes
(included in the patch), BUT even in users code ... take a look at the
patch in the issue, here:

https://issues.apache.org/jira/browse/PIVOT-855


So the real question:
I'd prefer to fix this behaviour NOW (for 2.0.2) without waiting for
the 2.1 ... what do you think ?

This is an important question, please tell me your opinions.

Unless objections I'll commit the fix tomorrow.

Sandro

Re: Compilation errors of Pivot trunk with Java 7 in Apache Jenkins

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
the issue is this:

https://issues.apache.org/jira/browse/PIVOT-855

but the strange thing is that I don't remember compilation errors with
JDK 7 (maybe Oracle did some fix in one of latest Updates), but now
even in my alternative dev environment (using Oracle JDK 7 Update 4) I
have the same errors ... so it's not an issue related to the JDK 7
version used by Jenkins at Apache.

So I'm thinking to take a look at this, even if it's targeted to 2.1
(and maybe for 2.0.3) ...

I have to see if instead of two versions of remove methods (first
method: remove(T) in Sequence, second method: remove(K) in
Dictionary), if it's possible to make only one and split the behaviour
inside ...

Someone has objections to try to fix it before the 2.1 ?

Sandro

Re: Compilation errors of Pivot trunk with Java 7 in Apache Jenkins

Posted by Sandro Martini <sa...@gmail.com>.
Hi all,
some info here:
http://stackoverflow.com/questions/7201231/java-erasure-with-generic-overloading-not-overriding

Note that I just committed some small changes to our build files to
show some info at the beginning of the build ...

Probably this is a thing to fix, but in the 2.1 release, I'll make an
issue asap, to not forget it.

Bye,
Sandro