Skip to content

Commit 16dc9e7

Browse files
author
Vladimir Kotal
committed
move usernameCnPattern initialization and definition
1 parent d2cdd3f commit 16dc9e7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

plugins/LdapPlugin/src/opengrok/auth/plugin/LdapUserPlugin.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class LdapUserPlugin extends AbstractLdapPlugin {
4747
protected static final String OBJECT_CLASS = "objectclass";
4848

4949
private String objectClass;
50+
private Pattern usernameCnPattern = Pattern.compile("(cn=[a-zA-Z_]+)");
5051

5152
private boolean isAlphanumeric(String str) {
5253
for (int i = 0; i < str.length(); i++) {
@@ -59,8 +60,6 @@ private boolean isAlphanumeric(String str) {
5960
return true;
6061
}
6162

62-
private Pattern usernameCnPattern = null;
63-
6463
@Override
6564
public void load(Map<String, Object> parameters) {
6665
super.load(parameters);
@@ -75,8 +74,6 @@ public void load(Map<String, Object> parameters) {
7574
"' contains non-alphanumeric characters");
7675
}
7776

78-
usernameCnPattern = Pattern.compile("(cn=[a-zA-Z_]+)");
79-
8077
LOGGER.log(Level.FINE, "LdapUser plugin loaded with objectclass={0}",
8178
objectClass);
8279
}

0 commit comments

Comments
 (0)