Skip to content

Commit

Permalink
[JENKINS-19843] Removed setters frpm RebuildParameterPage. Developers…
Browse files Browse the repository at this point in the history
… set its properties with the constructor.
  • Loading branch information
ikedam committed Oct 8, 2013
1 parent 9da2497 commit c91995e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/sonyericsson/rebuild/RebuildAction.java
Expand Up @@ -459,9 +459,10 @@ public RebuildParameterPage getRebuildParameterPage(ParameterValue value) {
}

// No provider available, use a view provided by rebuild plugin.
RebuildParameterPage page = new RebuildParameterPage();
page.setClazz(getClass());
page.setPage(String.format("%s.jelly", value.getClass().getSimpleName()));
RebuildParameterPage page = new RebuildParameterPage(
getClass(),
String.format("%s.jelly", value.getClass().getSimpleName())
);
return page;
}
}
17 changes: 7 additions & 10 deletions src/main/java/com/sonyericsson/rebuild/RebuildParameterPage.java
Expand Up @@ -25,34 +25,31 @@
package com.sonyericsson.rebuild;

/**
* A bean contains information of the view to show parameters in rebuild page.
* An object contains information of the view to show parameters in rebuild page.
*/
public class RebuildParameterPage {
private Class<?> clazz = null;
private final Class<?> clazz;
/**
* @return the class for the view.
*/
public Class<?> getClazz() {
return clazz;
}
/**
* @param clazz the class for the view.
*/
public void setClazz(Class<?> clazz) {
this.clazz = clazz;
}

private String page = null;
private final String page;
/**
* @return the path of jelly(or groovy) file.
*/
public String getPage() {
return page;
}

/**
* @param clazz the class for the view.
* @param page the path of jelly(or groovy) file.
*/
public void setPage(String page) {
public RebuildParameterPage(Class<?> clazz, String page) {
this.clazz = clazz;
this.page = page;
}
}
Expand Up @@ -318,9 +318,7 @@ public RebuildParameterPage getRebuildPage(ParameterValue value) {
if (!(value instanceof SupportedUnknownParameterValue)) {
return null;
}
RebuildParameterPage page = new RebuildParameterPage();
page.setClazz(SupportedUnknownParameterValue.class);
page.setPage("rebuild.groovy");
RebuildParameterPage page = new RebuildParameterPage(SupportedUnknownParameterValue.class, "rebuild.groovy");
return page;
}
}
Expand Down

0 comments on commit c91995e

Please sign in to comment.