Skip to content

Commit 505b161

Browse files
vladakVladimir Kotal
authored andcommitted
check project name exactly in Project.getByName()
fixes #1541
1 parent c0e6416 commit 505b161

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/org/opensolaris/opengrok/configuration/Project.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,15 @@ public static Project getProject(File file) {
215215
* @return project that fits the name
216216
*/
217217
public static Project getByName(String name) {
218-
Project ret = null;
219218
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
220219
if (env.hasProjects()) {
221220
for (Project proj : env.getProjects()) {
222-
if (name.indexOf(proj.getName()) == 0) {
223-
ret = proj;
221+
if (name.equals(proj.getName())) {
222+
return (proj);
224223
}
225224
}
226225
}
227-
return ret;
226+
return null;
228227
}
229228

230229
@Override

0 commit comments

Comments
 (0)