Skip to content

Commit

Permalink
[JENKINS-42310] Git Shallow Lint defect support Maven and Matrix proj…
Browse files Browse the repository at this point in the history
…ects
  • Loading branch information
v1v committed Feb 25, 2017
1 parent 03de2c2 commit ac23bed
Showing 1 changed file with 5 additions and 5 deletions.
@@ -1,7 +1,7 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.model.Item;
import hudson.model.Project;
import hudson.model.AbstractProject;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

Expand All @@ -21,13 +21,13 @@ public GitShallowChecker() {
}

public boolean executeCheck(Item item) {
if (item instanceof Project) {
if (item instanceof AbstractProject) {
if (Jenkins.getInstance().pluginManager.getPlugin("git")!=null) {
if (((Project) item).getScm().getClass().getName().endsWith("GitSCM")) {
if (((AbstractProject) item).getScm().getClass().getName().endsWith("GitSCM")) {
boolean status = true;
try {
Method method = ((Project) item).getScm().getClass().getMethod("getExtensions", null);
Object extensionsList = method.invoke( ((Project) item).getScm());
Method method = ((AbstractProject) item).getScm().getClass().getMethod("getExtensions", null);
Object extensionsList = method.invoke( ((AbstractProject) item).getScm());
if (extensionsList instanceof AbstractList) {
for (Object extension : ((AbstractList) extensionsList) ) {
if (extension.getClass().getName().endsWith("CloneOption")) {
Expand Down

0 comments on commit ac23bed

Please sign in to comment.