Skip to content

Commit

Permalink
[FIXED JENKINS-16935] Give the default no-name package a non-empty name.
Browse files Browse the repository at this point in the history
The empty name breaks the display and hyperlinks.
  • Loading branch information
kohsuke committed Feb 22, 2013
1 parent 0a13b5c commit b798592
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -33,7 +33,7 @@ public void setName(String name) {
}

public String getDisplayName() {
return name;
return getName();
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/hudson/plugins/jacoco/report/PackageReport.java
Expand Up @@ -15,6 +15,15 @@
*/
public final class PackageReport extends AggregatedReport<CoverageReport,PackageReport,ClassReport> {

/**
* Give the default no-name package a non-empty name.
*/
@Override
public String getName() {
String n = super.getName();
return n.length() == 0 ? "(default)" : n;
}

@Override
public void setName(String name) {
super.setName(name.replaceAll("/", "."));
Expand Down

0 comments on commit b798592

Please sign in to comment.