Skip to content
Permalink
Browse files

[FIXED JENKINS-16259] use @DataBoundConstructor instead of newInstance()

  • Loading branch information
imod committed Nov 16, 2013
1 parent 9e5bf7d commit fc659284e78c0700f70ccea87966d0e85ed5b3fc
Showing with 13 additions and 5 deletions.
  1. +7 −1 pom.xml
  2. +6 −4 src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java
@@ -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>
@@ -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>
@@ -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;
@@ -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;
}
@@ -459,8 +461,8 @@ public String getHelpFile() {
};
}

@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(

0 comments on commit fc65928

Please sign in to comment.