Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-17814] hudson.model.FreeStyleProject cannot be cast to org.j…
…enkinsci.plugins.jobgenerator.JobGenerator
  • Loading branch information
syl20bnr committed Jul 4, 2013
1 parent 60d0b29 commit 411c643
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/main/java/org/jenkinsci/plugins/jobgenerator/GeneratorRun.java
Expand Up @@ -429,7 +429,9 @@ private void gatherDownstreamGenerators(BuildListener listener)
bp.getAction(GeneratorRun.this, listener));
}
}
job.copyOptions((JobGenerator) p);
if (JobGenerator.class.isInstance(p)){
job.copyOptions((JobGenerator) p);
}
downstreamGenerators.add(
new DownstreamGenerator(p, importParams));
processedProjects.add(p);
Expand Down Expand Up @@ -458,7 +460,9 @@ private void gatherDownstreamGenerators(BuildListener listener)
// standard Jenkins dependencies
for(AbstractProject dp: job.getDownstreamProjects()){
if(!processedProjects.contains(dp)){
job.copyOptions((JobGenerator) dp);
if (JobGenerator.class.isInstance(dp)){
job.copyOptions((JobGenerator) dp);
}
List<List<ParametersAction>> importParams =
new ArrayList<List<ParametersAction>>();
importParams.add(new ArrayList<ParametersAction>());
Expand Down Expand Up @@ -516,7 +520,9 @@ private void gatherDownstreamGeneratorsFromTriggerBuilder(
importIndex += 1;
}
}
job.copyOptions((JobGenerator) p);
if (JobGenerator.class.isInstance(p)){
job.copyOptions((JobGenerator) p);
}
downstreamGenerators.add(
new DownstreamGenerator(p, importParams));
}
Expand Down Expand Up @@ -739,8 +745,13 @@ private String updateProjectReference(Text node){
if(result.length() > 0){
result += ",";
}
result += GeneratorRun.getExpandedJobName(
if (JobGenerator.class.isInstance(dg.job)){
result += GeneratorRun.getExpandedJobName(
(JobGenerator)dg.job, lpa);
}
else {
result += dg.job.getName();
}
}
dg.processed = true;
break;
Expand Down

0 comments on commit 411c643

Please sign in to comment.