Skip to content

Commit

Permalink
Merge pull request #150 from bitwiseman/JENKINS-54992
Browse files Browse the repository at this point in the history
[JENKINS-54992] Do not override pronoun on projects only on their scan
  • Loading branch information
bitwiseman committed Apr 17, 2019
2 parents f1ba42f + b050869 commit ac54352
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/main/java/jenkins/branch/MultiBranchProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,18 @@ public String getIconClassName() {
}

/**
* {@inheritDoc}
* Get the term used in the UI to represent the souce for this kind of
* {@link Item}. Must start with a capital letter.
*/
@Override
public String getPronoun() {
public String getSourcePronoun() {
Set<String> result = new TreeSet<>();
for (BranchSource source : sources) {
String pronoun = Util.fixEmptyAndTrim(source.getSource().getPronoun());
if (pronoun != null) {
result.add(pronoun);
}
}
return result.isEmpty() ? super.getPronoun() : StringUtils.join(result, " / ");
return result.isEmpty() ? this.getPronoun() : StringUtils.join(result, " / ");
}

/**
Expand Down Expand Up @@ -993,7 +993,7 @@ public File getLogFile() {
*/
@Override
public String getDisplayName() {
return Messages.MultiBranchProject_BranchIndexing_displayName(getParent().getPronoun());
return Messages.MultiBranchProject_BranchIndexing_displayName(getParent().getSourcePronoun());
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/jenkins/branch/OrganizationFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -533,18 +533,18 @@ public String getIconClassName() {
}

/**
* {@inheritDoc}
* Get the term used in the UI to represent the souce for this kind of
* {@link Item}. Must start with a capital letter.
*/
@Override
public String getPronoun() {
public String getSourcePronoun() {
Set<String> result = new TreeSet<>();
for (SCMNavigator navigator: navigators) {
String pronoun = Util.fixEmptyAndTrim(navigator.getPronoun());
if (pronoun != null) {
result.add(pronoun);
}
}
return result.isEmpty() ? super.getPronoun() : StringUtils.join(result, " / ");
return result.isEmpty() ? this.getPronoun() : StringUtils.join(result, " / ");
}

/**
Expand Down Expand Up @@ -922,7 +922,7 @@ public OrganizationScan(OrganizationFolder folder, FolderComputation<MultiBranch
*/
@Override
public String getDisplayName() {
return Messages.OrganizationFolder_OrganizationScan_displayName(getParent().getPronoun());
return Messages.OrganizationFolder_OrganizationScan_displayName(((OrganizationFolder)getParent()).getSourcePronoun());
}

@Override
Expand Down

0 comments on commit ac54352

Please sign in to comment.