提交 e9332376 编写于 作者: K kohsuke

@QueryParameter no longer needs the value if it's the same as the parameter name.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@12848 71c3de6d-444a-0410-be80-ed276b4c234a
上级 e4515139
......@@ -34,6 +34,7 @@
<plugin>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>maven-stapler-plugin</artifactId>
<version>1.7</version>
<extensions>true</extensions>
</plugin>
<plugin>
......@@ -235,7 +236,7 @@
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
<version>1.85</version>
<version>1.86</version>
</dependency>
<dependency>
<groupId>org.jvnet.localizer</groupId>
......
......@@ -53,9 +53,9 @@ public class Api extends AbstractModelObject {
* Exposes the bean as XML.
*/
public void doXml(StaplerRequest req, StaplerResponse rsp,
@QueryParameter("xpath") String xpath,
@QueryParameter("wrapper") String wrapper,
@QueryParameter("depth") int depth) throws IOException, ServletException {
@QueryParameter String xpath,
@QueryParameter String wrapper,
@QueryParameter int depth) throws IOException, ServletException {
if(xpath==null) {
// serve the whole thing
rsp.serveExposedBean(req,bean,Flavor.XML);
......
......@@ -2135,7 +2135,7 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
/**
* Configure the logging level.
*/
public void doConfigLogger(StaplerResponse rsp, @QueryParameter("name")String name, @QueryParameter("level")String level) throws IOException {
public void doConfigLogger(StaplerResponse rsp, @QueryParameter String name, @QueryParameter String level) throws IOException {
checkPermission(ADMINISTER);
Level lv;
if(level.equals("inherit"))
......@@ -2364,7 +2364,7 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
*
* TODO: find a better home for this method.
*/
public void doRemoteFSCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter("value") final String value) throws IOException, ServletException {
public void doRemoteFSCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter final String value) throws IOException, ServletException {
new FormFieldValidator(req,rsp,false) {
protected void check() throws IOException, ServletException {
if(Util.fixEmptyAndTrim(value)==null) {
......
......@@ -1076,7 +1076,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
/**
* Returns the build time stamp in the body.
*/
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter("format") String format) throws IOException {
public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException {
rsp.setContentType("text/plain");
rsp.setCharacterEncoding("US-ASCII");
rsp.setStatus(HttpServletResponse.SC_OK);
......
......@@ -60,13 +60,13 @@ public class Search {
*
* See http://developer.mozilla.org/en/docs/Supporting_search_suggestions_in_search_plugins
*/
public void doSuggestOpenSearch(StaplerRequest req, StaplerResponse rsp, @QueryParameter("q")String query) throws IOException, ServletException {
public void doSuggestOpenSearch(StaplerRequest req, StaplerResponse rsp, @QueryParameter String q) throws IOException, ServletException {
DataWriter w = Flavor.JSON.createDataWriter(null, rsp);
w.startArray();
w.value(query);
w.value(q);
w.startArray();
for (SuggestedItem item : getSuggestions(req, query))
for (SuggestedItem item : getSuggestions(req, q))
w.value(item.getPath());
w.endArray();
w.endArray();
......@@ -75,7 +75,7 @@ public class Search {
/**
* Used by search box auto-completion. Returns JSON array.
*/
public void doSuggest(StaplerRequest req, StaplerResponse rsp, @QueryParameter("query")String query) throws IOException, ServletException {
public void doSuggest(StaplerRequest req, StaplerResponse rsp, @QueryParameter String query) throws IOException, ServletException {
Result r = new Result();
for (SuggestedItem item : getSuggestions(req, query))
r.suggestions.add(new Item(item.getPath()));
......
......@@ -244,9 +244,9 @@ public class LDAPSecurityRealm extends SecurityRealm {
return Messages.LDAPSecurityRealm_DisplayName();
}
public void doServerCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter("server") final String server,
@QueryParameter("managerDN") final String managerDN,
@QueryParameter("managerPassword") final String managerPassword
public void doServerCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter final String server,
@QueryParameter final String managerDN,
@QueryParameter final String managerPassword
) throws IOException, ServletException {
new FormFieldValidator(req,rsp,true) {
protected void check() throws IOException, ServletException {
......
......@@ -327,7 +327,7 @@ public class Mailer extends Publisher {
* Checks the URL in <tt>global.jelly</tt>
*/
public void doCheckUrl(StaplerRequest req, StaplerResponse rsp,
@QueryParameter("value") final String value) throws IOException, ServletException {
@QueryParameter final String value) throws IOException, ServletException {
new FormFieldValidator(req,rsp,false) {
protected void check() throws IOException, ServletException {
if(value.startsWith("http://localhost"))
......@@ -339,7 +339,7 @@ public class Mailer extends Publisher {
}
public void doAddressCheck(StaplerRequest req, StaplerResponse rsp,
@QueryParameter("value") final String value) throws IOException, ServletException {
@QueryParameter final String value) throws IOException, ServletException {
new FormFieldValidator(req,rsp,false) {
protected void check() throws IOException, ServletException {
try {
......
......@@ -225,10 +225,10 @@ public class AggregatedTestResultPublisher extends Publisher {
return "/help/tasks/aggregate-test/help.html";
}
public void doCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter("value") final String list) throws IOException, ServletException {
public void doCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter final String value) throws IOException, ServletException {
new FormFieldValidator(req,rsp,false) {
protected void check() throws IOException, ServletException {
for (String name : Util.tokenize(list, ",")) {
for (String name : Util.tokenize(value, ",")) {
name = name.trim();
if(Hudson.getInstance().getItemByFullName(name)==null) {
error(hudson.tasks.Messages.BuildTrigger_NoSuchProject(name,AbstractProject.findNearest(name).getName()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册