Skip to content
Permalink
Browse files

[FIXED JENKINS-15445] rely on 1.536 so JENKINS-18629 doesn’t prevent …

…BuildStep without a @DataBoundConstructor to be used.
  • Loading branch information
ndeloof committed Aug 26, 2014
1 parent f085788 commit 132178a305c0d8ece4bd58622811497745816667
@@ -6,9 +6,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.480.3</version>
<!-- <version>1.424.6</version> -->
<!-- <version>1.460</version> e.g. https://issues.jenkins-ci.org/browse/JENKINS-13469 -->
<version>1.536</version>
</parent>

<artifactId>conditional-buildstep</artifactId>
@@ -63,7 +61,7 @@
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>${project.parent.version}</version>
<version>2.0</version>
</dependency>
</dependencies>

@@ -32,7 +32,6 @@
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;

import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;

@@ -66,7 +65,7 @@ public DefaultBuilderDescriptorLister() {
continue;
}
BuildStepDescriptor<? extends Builder> buildStepDescriptor = (BuildStepDescriptor) descriptor;
if (buildStepDescriptor.isApplicable(project.getClass()) && hasDbc(buildStepDescriptor.clazz)){
if (buildStepDescriptor.isApplicable(project.getClass())){
builders.add(buildStepDescriptor);
}
}
@@ -77,14 +76,6 @@ public DescriptorImpl getDescriptor() {
return Hudson.getInstance().getDescriptorByType(DescriptorImpl.class);
}

private boolean hasDbc(final Class<?> clazz) {
for (Constructor<?> constructor : clazz.getConstructors()) {
if (constructor.isAnnotationPresent(DataBoundConstructor.class))
return true;
}
return false;
}

@Extension
public static class DescriptorImpl extends Descriptor<BuilderDescriptorLister> {

3 comments on commit 132178a

@imod

This comment has been minimized.

Copy link
Member

imod replied Aug 26, 2014

@ndeloof I think we had this before already once and we had to revert it because jenkins could not handle it. Is there anything fixed in core which now makes you think this would work?
If you refer to the fix for https://issues.jenkins-ci.org/browse/JENKINS-20262, then this will not work - because this change was reverted in core 1.537 again.

@ndeloof

This comment has been minimized.

Copy link
Member Author

ndeloof replied Aug 26, 2014

@imod yes, I re-applied this based on fix made on stappler (so requirement for 1.536), didn't know this has been reverted in 1.537. What a pity. reverting this commit.

@imod

This comment has been minimized.

Copy link
Member

imod replied Sep 1, 2014

@ndeloof yeah, its quite a shame I was so hopping this is going to work now :(

Please sign in to comment.
You can’t perform that action at this time.