Skip to content
Permalink
Browse files
[JENKINS-42268] Using Job class to avoid casing each jobtype
  • Loading branch information
v1v committed Jul 27, 2017
1 parent f606483 commit e527537df7c978708837b4a1d5ddb788dc934f19
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;

@@ -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;
}

0 comments on commit e527537

Please sign in to comment.