-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-68147] Support Java 17 #75
Closed
Closed
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7faf9e2
JENKINS-68147 Support Java17 org.jenkins-ci:version-number
bulanovk 2232f5a
Merge branch 'master' into JENKINS-68147
MarkEWaite 5dab09c
Remove junitparams imports
MarkEWaite fd7654b
Exclude spotbugs warning for catching NPE
MarkEWaite f423150
Merge branch 'master' into JENKINS-68147
MarkEWaite 361e5c0
Remove white space changes
MarkEWaite 8e86584
Remove project.description, replaced earlier with index.jelly
MarkEWaite 96d74e8
Add Mark Waite as a developer
MarkEWaite 79d56df
List other developers as emeritus
MarkEWaite 503ada6
Require Jenkins 2.346.3 or newer
MarkEWaite File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/main/java/hudson/plugin/versioncolumn/JVMConstants.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package hudson.plugin.versioncolumn; | ||
|
||
|
||
import io.jenkins.lib.versionnumber.JavaSpecificationVersion; | ||
import junitparams.JUnitParamsRunner; | ||
import junitparams.Parameters; | ||
import org.junit.Test; | ||
|
@@ -23,20 +24,25 @@ public void computeMajorMinor() { | |
assertEquals("1.8", JVMVersionComparator.computeMajorMinor("1.8.1-blah_whatever$wat")); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
private Object[] parametersForCompatible() { | ||
return new Object[][]{ | ||
{"1.8.0", "1.8.0", true}, | ||
{"11.0.11", "11.0.11", true}, | ||
{"1.8.0", "1.8.0", false}, | ||
{"1.6.0", "1.6.0", true}, | ||
{"1.6.0", "1.6.1_ublah_whatever", false}, | ||
{"1.8.066", "1.8.0110", false}, | ||
}; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
private Object[] parametersForIncompatible() { | ||
return new Object[][]{ | ||
{"1.5.0", "1.5.1", true}, | ||
{"1.7.0", "1.6.0", true}, | ||
{"1.7.0", "11.0.2", true}, | ||
{"17.0.3", "11.0.2", true}, | ||
{"1.8.0_66", "1.8.0_110", true}, | ||
{"1.6.0", "1.6.1", true}, | ||
}; | ||
|
@@ -64,19 +70,23 @@ private JVMVersionComparator.ComparisonMode toExactMatch(boolean exactMatch) { | |
} | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
private Object[] parametersForCompatibleBytecodeLevel() { | ||
return new Object[][]{ | ||
{"1.8.0", JVMConstants.JAVA_8}, | ||
{"1.8.0", JVMConstants.JAVA_7}, | ||
{"1.8.0", JVMConstants.JAVA_6}, | ||
{"1.8.0", JavaSpecificationVersion.JAVA_8.toClassVersion()}, | ||
{"1.8.0", JavaSpecificationVersion.JAVA_7.toClassVersion()}, | ||
{"1.8.0", JavaSpecificationVersion.JAVA_6.toReleaseVersion()}, | ||
{"11.0.1", JavaSpecificationVersion.JAVA_11.toReleaseVersion()}, | ||
Comment on lines
+71
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why aren't these |
||
}; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
private Object[] parametersForIncompatibleBytecodeLevel() { | ||
return new Object[][]{ | ||
{"1.7.0", JVMConstants.JAVA_8}, | ||
{"1.6.1", JVMConstants.JAVA_7}, | ||
{"1.5.3", JVMConstants.JAVA_6}, | ||
{"1.7.0", JavaSpecificationVersion.JAVA_8.toClassVersion()}, | ||
{"1.6.1", JavaSpecificationVersion.JAVA_7.toClassVersion()}, | ||
{"1.5.3", JavaSpecificationVersion.JAVA_6.toClassVersion()}, | ||
{"11.0.3", JavaSpecificationVersion.JAVA_12.toClassVersion()}, | ||
}; | ||
} | ||
|
||
|
@@ -85,34 +95,34 @@ private Object[] parametersForIncompatibleBytecodeLevel() { | |
@Parameters | ||
public void compatibleBytecodeLevel(String agentVMVersion, final int masterBytecodeMajorVersion) { | ||
assertTrue(new JVMVersionComparator("whatever", agentVMVersion, | ||
JVMVersionComparator.ComparisonMode.RUNTIME_GREATER_OR_EQUAL_MASTER_BYTECODE, | ||
new JVMVersionComparator.MasterBytecodeMajorVersionNumberGetter() { | ||
@Override | ||
public int get() { | ||
return masterBytecodeMajorVersion; | ||
} | ||
}).isCompatible()); | ||
JVMVersionComparator.ComparisonMode.RUNTIME_GREATER_OR_EQUAL_MASTER_BYTECODE, | ||
new JVMVersionComparator.MasterBytecodeMajorVersionNumberGetter() { | ||
@Override | ||
public int get() { | ||
return masterBytecodeMajorVersion; | ||
} | ||
}).isCompatible()); | ||
MarkEWaite marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
@Test | ||
@Parameters | ||
public void incompatibleBytecodeLevel(String agentVMVersion, final int masterBytecodeMajorVersion) { | ||
assertTrue(new JVMVersionComparator("whatever", agentVMVersion, | ||
JVMVersionComparator.ComparisonMode.RUNTIME_GREATER_OR_EQUAL_MASTER_BYTECODE, | ||
new JVMVersionComparator.MasterBytecodeMajorVersionNumberGetter() { | ||
@Override | ||
public int get() { | ||
return masterBytecodeMajorVersion; | ||
} | ||
}).isNotCompatible()); | ||
JVMVersionComparator.ComparisonMode.RUNTIME_GREATER_OR_EQUAL_MASTER_BYTECODE, | ||
new JVMVersionComparator.MasterBytecodeMajorVersionNumberGetter() { | ||
@Override | ||
public int get() { | ||
return masterBytecodeMajorVersion; | ||
} | ||
}).isNotCompatible()); | ||
} | ||
|
||
@Issue("JENKINS-53445") | ||
@Test | ||
public void shouldNotThrowNPEWhenJVMVersionIsNotRecognized() { | ||
JVMVersionComparator jvmVersionComparator = | ||
new JVMVersionComparator("99.9", "99.9", | ||
JVMVersionComparator.ComparisonMode.RUNTIME_GREATER_OR_EQUAL_MASTER_BYTECODE); | ||
new JVMVersionComparator("99.9", "99.9", | ||
JVMVersionComparator.ComparisonMode.RUNTIME_GREATER_OR_EQUAL_MASTER_BYTECODE); | ||
assertNotNull(jvmVersionComparator); | ||
assertFalse(jvmVersionComparator.isCompatible()); | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already included in Jenkins core as of 2.342, so rather than duplicate the library in this plugin, I suggest bumping the core baseline to 2.346 or later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like deleting this new dependency and instead doing:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in 503ada6