Tokenizer is immutable and thread safe, so reuse it.
This commit is contained in:
parent
225edf5ea8
commit
4c42c70a51
|
@ -45,10 +45,10 @@ final class DistinguishedNameParser {
|
||||||
private static final Tokenizer.Delimiter EQUAL_OR_COMMA_OR_PLUS = Tokenizer.delimiters('=', ',', '+');
|
private static final Tokenizer.Delimiter EQUAL_OR_COMMA_OR_PLUS = Tokenizer.delimiters('=', ',', '+');
|
||||||
private static final Tokenizer.Delimiter COMMA_OR_PLUS = Tokenizer.delimiters(',', '+');
|
private static final Tokenizer.Delimiter COMMA_OR_PLUS = Tokenizer.delimiters(',', '+');
|
||||||
|
|
||||||
private final Tokenizer tokenParser;
|
private final Tokenizer tokenParser = new InternalTokenParser();
|
||||||
|
|
||||||
DistinguishedNameParser() {
|
private DistinguishedNameParser() {
|
||||||
this.tokenParser = new InternalTokenParser();
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
private String parseToken(final CharArrayBuffer buf, final Tokenizer.Cursor cursor, final Tokenizer.Delimiter delimiters) {
|
private String parseToken(final CharArrayBuffer buf, final Tokenizer.Cursor cursor, final Tokenizer.Delimiter delimiters) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class TestDistinguishedNameParser {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
impl = new DistinguishedNameParser();
|
impl = DistinguishedNameParser.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue