improved construction of query string.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@30447 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-04-27 21:09:40 +00:00
1 parent b03e53a1d9
commit b0f664dfcf
2 files changed
+37 -4

No files matched your search

@@ -285,7 +285,7 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
if(method==null)
return NONE;
return singleQuote(getDescriptorUrl() +"/check"+capitalizedFieldName+"?") + buildParameterList(method, new StringBuilder());
return singleQuote(getDescriptorUrl() +"/check"+capitalizedFieldName) + buildParameterList(method, new StringBuilder()).append(".toString()");
}
/**
@@ -300,13 +300,13 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
if (name==null || name.length()==0)
continue; // unknown parameter name. we'll report the error when the form is submitted.
if (query.length()>0) query.append('+').append(singleQuote("&"));
if (query.length()==0) query.append("+qs(this)");
if (name.equals("value")) {
// The special 'value' parameter binds to the the current field
query.append('+').append(singleQuote("value=")).append("+toValue(this)");
query.append(".addThis()");
} else {
query.append('+').append(singleQuote(name+'=')).append("+toValue(findNearBy(this,'"+name+"'))");
query.append(".nearBy('"+name+"')");
}
continue;
}