Quantcast

Unable to compile Jenkins itself with compilation level set to Java 8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unable to compile Jenkins itself with compilation level set to Java 8

Marcin Zajączkowski
Hi,

I was playing with the issue related to searchable nested views [1] and it turned out that the implementation would be much easier with Java 8's default methods in interfaces. Unfortunately after switching compiler in Maven configuration to Java 8 the compilation fails with quite complex looking generics related error:

<code>
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1046 source files to /home/foo/code/jenkins/core/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/foo/code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
[ERROR]   required: Iterable<? extends J#1>
  found: Iterable<Job>
  reason: inferred type does not conform to lower bound(s)
    inferred: J#2
    lower bound(s): T,Job
  where J#1,R#1,R#2,J#2,R#3,T are type-variables:
    J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
    R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
    R#2 extends Run declared in class RunList
    J#2 extends Job<J#2,R#3>
    R#3 extends Run<J#2,R#3>
    T extends J#2
/home/foo/code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
[INFO] 2 errors
</code>

I wonder if it is a known issue or maybe even anyone gave a look at it already?

Changes in the configuration triggering that error are available in my branch [2] (just in case :) ).

[1] - https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs
[2] - https://github.com/szpak/jenkins/tree/feature/searchableNestedViews

Marcin

--
http://blog.solidsoft.info - Solid Soft - Working code is not enough

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/106496b6-f670-4914-bf92-c01acc184208%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile Jenkins itself with compilation level set to Java 8

Marcin Zajączkowski
I created an issue for that: https://issues.jenkins-ci.org/browse/JENKINS-42709\

Marcin


On Friday, February 3, 2017 at 1:46:41 PM UTC+1, Marcin Zajączkowski wrote:
Hi,

I was playing with the issue related to searchable nested views [1] and it turned out that the implementation would be much easier with Java 8's default methods in interfaces. Unfortunately after switching compiler in Maven configuration to Java 8 the compilation fails with quite complex looking generics related error:

<code>
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1046 source files to /home/foo/code/jenkins/core/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/foo/code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
[ERROR]   required: Iterable<? extends J#1>
  found: Iterable<Job>
  reason: inferred type does not conform to lower bound(s)
    inferred: J#2
    lower bound(s): T,Job
  where J#1,R#1,R#2,J#2,R#3,T are type-variables:
    J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
    R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
    R#2 extends Run declared in class RunList
    J#2 extends Job<J#2,R#3>
    R#3 extends Run<J#2,R#3>
    T extends J#2
/home/foo/code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
[INFO] 2 errors
</code>

I wonder if it is a known issue or maybe even anyone gave a look at it already?

Changes in the configuration triggering that error are available in my branch [2] (just in case :) ).

[1] - <a href="https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs&#39;;return true;">https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs
[2] - <a href="https://github.com/szpak/jenkins/tree/feature/searchableNestedViews" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fszpak%2Fjenkins%2Ftree%2Ffeature%2FsearchableNestedViews\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFXcIDZDESCyqJbH12FYm10wRo8XQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fszpak%2Fjenkins%2Ftree%2Ffeature%2FsearchableNestedViews\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFXcIDZDESCyqJbH12FYm10wRo8XQ&#39;;return true;">https://github.com/szpak/jenkins/tree/feature/searchableNestedViews

Marcin

--
<a href="http://blog.solidsoft.info" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fblog.solidsoft.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFUqxyDjGqodVPzqX-e86cnX-Vb0g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fblog.solidsoft.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFUqxyDjGqodVPzqX-e86cnX-Vb0g&#39;;return true;">http://blog.solidsoft.info - Solid Soft - Working code is not enough

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7319e614-d888-4134-9565-9d9d29858a90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Unable to compile Jenkins itself with compilation level set to Java 8

Marcin Zajączkowski


On Monday, March 13, 2017 at 1:25:06 PM UTC+1, Marcin Zajączkowski wrote:
I created an issue for that: <a href="https://issues.jenkins-ci.org/browse/JENKINS-42709%5C" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-42709%255C\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZLcpWM6hsnytt1G_WZFyvoczTJw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fissues.jenkins-ci.org%2Fbrowse%2FJENKINS-42709%255C\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZLcpWM6hsnytt1G_WZFyvoczTJw&#39;;return true;">https://issues.jenkins-ci.org/browse/JENKINS-42709\

Corrected URL: https://issues.jenkins-ci.org/browse/JENKINS-42709
 



Marcin


On Friday, February 3, 2017 at 1:46:41 PM UTC+1, Marcin Zajączkowski wrote:
Hi,

I was playing with the issue related to searchable nested views [1] and it turned out that the implementation would be much easier with Java 8's default methods in interfaces. Unfortunately after switching compiler in Maven configuration to Java 8 the compilation fails with quite complex looking generics related error:

<code>
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ jenkins-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1046 source files to /home/foo/code/jenkins/core/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/foo/code/jenkins/core/src/main/java/hudson/model/User.java:[658,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
[ERROR]   required: Iterable<? extends J#1>
  found: Iterable<Job>
  reason: inferred type does not conform to lower bound(s)
    inferred: J#2
    lower bound(s): T,Job
  where J#1,R#1,R#2,J#2,R#3,T are type-variables:
    J#1 extends Job<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
    R#1 extends Run<J#1,R#1> declared in method <J#1,R#1>fromJobs(Iterable<? extends J#1>)
    R#2 extends Run declared in class RunList
    J#2 extends Job<J#2,R#3>
    R#3 extends Run<J#2,R#3>
    T extends J#2
/home/foo/code/jenkins/core/src/main/java/hudson/model/Computer.java:[781,22] error: method fromJobs in class RunList<R#2> cannot be applied to given types;
[INFO] 2 errors
</code>

I wonder if it is a known issue or maybe even anyone gave a look at it already?

Changes in the configuration triggering that error are available in my branch [2] (just in case :) ).

[1] - <a href="https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs&#39;;return true;">https://groups.google.com/forum/#!topic/jenkinsci-dev/GTjiXQkN4Fs
[2] - <a href="https://github.com/szpak/jenkins/tree/feature/searchableNestedViews" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fszpak%2Fjenkins%2Ftree%2Ffeature%2FsearchableNestedViews\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFXcIDZDESCyqJbH12FYm10wRo8XQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fszpak%2Fjenkins%2Ftree%2Ffeature%2FsearchableNestedViews\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFXcIDZDESCyqJbH12FYm10wRo8XQ&#39;;return true;">https://github.com/szpak/jenkins/tree/feature/searchableNestedViews

Marcin

--
<a href="http://blog.solidsoft.info" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fblog.solidsoft.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFUqxyDjGqodVPzqX-e86cnX-Vb0g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fblog.solidsoft.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFUqxyDjGqodVPzqX-e86cnX-Vb0g&#39;;return true;">http://blog.solidsoft.info - Solid Soft - Working code is not enough

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/963e31b8-ab36-46f7-9acc-1af1edb1d5d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...