Skip to content
Permalink
Browse files

[JENKINS-41124] Findbugs catches a bug

  • Loading branch information...
stephenc committed Jan 18, 2017
1 parent 89d7ade commit 76db05c5c323c3597a14e2ce36fe0ea198110dac
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/main/java/jenkins/branch/OrganizationFolder.java
@@ -1133,7 +1133,8 @@ public void complete() throws IllegalStateException, InterruptedException {
if (factory == null) {
return;
}
MultiBranchProject<?, ?> existing = observer.shouldUpdate(projectName);
String folderName = NameEncoder.encode(projectName);
MultiBranchProject<?, ?> existing = observer.shouldUpdate(folderName);
if (existing != null) {
BulkChange bc = new BulkChange(existing);
try {
@@ -1154,16 +1155,16 @@ public void complete() throws IllegalStateException, InterruptedException {
existing.scheduleBuild();
return;
}
if (!observer.mayCreate(projectName)) {
listener.getLogger().println("Ignoring duplicate child " + projectName);
if (!observer.mayCreate(folderName)) {
listener.getLogger().println("Ignoring duplicate child " + projectName + " named " + folderName);
return;
}
MultiBranchProject<?, ?> project = factory.createNewProject(
OrganizationFolder.this, projectName, sources, attributes, listener
OrganizationFolder.this, folderName, sources, attributes, listener
);
BulkChange bc = new BulkChange(project);
try {
if (!projectName.equals(projectName)) {
if (!projectName.equals(folderName)) {
project.setDisplayName(projectName);
}
project.addProperty(new ProjectNameProperty(projectName));

0 comments on commit 76db05c

Please sign in to comment.
You can’t perform that action at this time.