mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
eliminate the JDK configuration option altogether if there's only one JDK configured in the system, since the intention is obviously to use that JDK (#659)
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5409 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
f05008839c
commit
4b831e56c0
2 files changed
+8
-2
No files matched your search
@@ -667,7 +667,12 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
|
||||
* Gets the JDK installation of the given name, or returns null.
|
||||
*/
|
||||
public JDK getJDK(String name) {
|
||||
if(name==null) return null;
|
||||
if(name==null) {
|
||||
// if only one JDK is configured, "default JDK" should mean that JDK.
|
||||
List<JDK> jdks = getJDKs();
|
||||
if(jdks.size()==1) return jdks.get(0);
|
||||
return null;
|
||||
}
|
||||
for (JDK j : getJDKs()) {
|
||||
if(j.getName().equals(name))
|
||||
return j;
|
||||
|
||||
Reference in new issue
Block a user