Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-42268] Using Job class to avoid casing each jobtype
  • Loading branch information
v1v committed Mar 9, 2017
1 parent b660489 commit 83ac411
Showing 1 changed file with 2 additions and 14 deletions.
@@ -1,9 +1,7 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.matrix.MatrixProject;
import hudson.maven.MavenModuleSet;
import hudson.model.Item;
import hudson.model.Project;
import hudson.model.Job;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

Expand All @@ -24,17 +22,7 @@ public boolean executeCheck(Item item) {
LOG.log(Level.FINE, "executeCheck " + item);
boolean found = false;
if (Jenkins.getInstance().pluginManager.getPlugin("build-failure-analyzer") != null) {
if (Jenkins.getInstance().pluginManager.getPlugin("maven-plugin")!=null) {
if (item instanceof MavenModuleSet) {
found = isDoNotScan(((MavenModuleSet) item).getProperty("com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty"));
}
}
if (item instanceof Project) {
found = isDoNotScan(((Project) item).getProperty("com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty"));
}
if (item instanceof MatrixProject) {
found = isDoNotScan(((MatrixProject) item).getProperty("com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty"));
}
found = isDoNotScan(((Job) item).getProperty("com.sonyericsson.jenkins.plugins.bfa.model.ScannerJobProperty"));
}
return found;
}
Expand Down

0 comments on commit 83ac411

Please sign in to comment.