Skip to content

Commit

Permalink
[FIXED JENKINS-16259] use @DataBoundConstructor instead of newInstance()
Browse files Browse the repository at this point in the history
  • Loading branch information
imod committed Nov 16, 2013
1 parent 9e5bf7d commit fc65928
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.447</version>
<version>1.480</version>
</parent>

<artifactId>xunit</artifactId>
Expand Down Expand Up @@ -252,6 +252,12 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.100</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 6 additions & 4 deletions src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java
Expand Up @@ -29,6 +29,7 @@
import org.jenkinsci.plugins.xunit.threshold.SkippedThreshold;
import org.jenkinsci.plugins.xunit.threshold.XUnitThreshold;
import org.jenkinsci.plugins.xunit.threshold.XUnitThresholdDescriptor;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;

import java.io.File;
Expand Down Expand Up @@ -60,8 +61,9 @@ public XUnitPublisher(TestType[] types, XUnitThreshold[] thresholds) {
this.thresholds = thresholds;
}

public XUnitPublisher(TestType[] types, XUnitThreshold[] thresholds, int thresholdMode) {
this.types = types;
@DataBoundConstructor
public XUnitPublisher(TestType[] tools, XUnitThreshold[] thresholds, int thresholdMode) {
this.types = tools;
this.thresholds = thresholds;
this.thresholdMode = thresholdMode;
}
Expand Down Expand Up @@ -459,8 +461,8 @@ public XUnitThreshold[] getListXUnitThresholdInstance() {
};
}

@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException {
// @Override
public Publisher newInstance_old(StaplerRequest req, JSONObject formData) throws FormException {
List<TestType> types = Descriptor.newInstancesFromHeteroList(
req, formData, "tools", getListXUnitTypeDescriptors());
List<XUnitThreshold> thresholds = Descriptor.newInstancesFromHeteroList(
Expand Down

0 comments on commit fc65928

Please sign in to comment.