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:
kohsuke committed 2007-10-23 01:19:07 +00:00
1 parent f05008839c
commit 4b831e56c0
2 files changed
+8 -2

No files matched your search

+6 -1
View File
@@ -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;