Skip to content

Commit 350de3b

Browse files
committed
Remove indices from 'name' for purposes of pseudo processing
1 parent ffe844d commit 350de3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/no/ssb/dlp/pseudo/service/pseudo/PseudoField.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public PseudoField(String name, String pattern, String pseudoFunc, EncryptedKeys
6262

6363
if (name != null) {
6464
// Regex replace such that "path[9]/thing" -> "path/thing"
65-
String nameNoIndices = name.replaceAll("\\[.*?]", "");
66-
final boolean validPattern = new FieldDescriptor(nameNoIndices).globMatches(pattern);
65+
name = name.replaceAll("\\[.*?]", "");
66+
final boolean validPattern = new FieldDescriptor(name).globMatches(pattern);
6767
if (!validPattern) {
6868
throw new IllegalArgumentException(String.format("The pattern '%s' will not match the field name '%s'. " +
6969
"Are you sure you didn't mean to use '/%s'?", pattern, name, pattern));

0 commit comments

Comments
 (0)