Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[JENKINS-11846] Fixed naming of undefined packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Nov 24, 2011
1 parent f2874e0 commit 603ad77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -10,7 +10,9 @@
* @author Ulli Hafner
*/
public final class PackageDetectors {
/** The detectors to use. */
/** If no package could be assigned this value is used as package name. */
public static final String UNDEFINED_PACKAGE = "-";

private static final List<AbstractPackageDetector> DETECTORS = Arrays.asList(
new JavaPackageDetector(), new CsharpNamespaceDetector());

Expand All @@ -28,7 +30,7 @@ public static String detectPackageName(final String fileName) {
return detector.detectPackageName(fileName);
}
}
return "undefined";
return UNDEFINED_PACKAGE;
}

/**
Expand Down
Expand Up @@ -15,6 +15,8 @@
import hudson.model.Item;
import hudson.model.AbstractBuild;

import hudson.plugins.analysis.util.PackageDetectors;

/**
* A base class for annotations.
*
Expand Down Expand Up @@ -155,7 +157,7 @@ public String getLinkName() {
public boolean hasPackageName() {
String actualPackageName = StringUtils.trim(packageName);

return StringUtils.isNotBlank(actualPackageName) && !StringUtils.equals(actualPackageName, "-");
return StringUtils.isNotBlank(actualPackageName) && !StringUtils.equals(actualPackageName, PackageDetectors.UNDEFINED_PACKAGE);
}

/**
Expand Down

0 comments on commit 603ad77

Please sign in to comment.