Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 132178a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 2 additions & 4 deletions pom.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -66,7 +65,7 @@ public List<? extends Descriptor<? extends BuildStep>> getAllowedBuilders(final
continue;
}
BuildStepDescriptor<? extends Builder> buildStepDescriptor = (BuildStepDescriptor) descriptor;
if (buildStepDescriptor.isApplicable(project.getClass()) && hasDbc(buildStepDescriptor.clazz)){
if (buildStepDescriptor.isApplicable(project.getClass())){
builders.add(buildStepDescriptor);
}
}
Expand All @@ -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> {

Expand Down

3 comments on commit 132178a

@imod
Copy link
Member

@imod imod commented on 132178a Aug 26, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Member

@imod imod commented on 132178a Sep 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.