Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.3.1 to 4.8.4.0 #155

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<gpg.plugin.version>3.2.1</gpg.plugin.version>
<staging.plugin.version>1.6.13</staging.plugin.version>
<checkstyle.plugin.version>3.3.1</checkstyle.plugin.version>
<spotbugs.plugin.version>4.8.3.1</spotbugs.plugin.version>
<spotbugs.plugin.version>4.8.4.0</spotbugs.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
13 changes: 9 additions & 4 deletions src/main/software/amazon/event/ruler/input/DefaultParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,27 @@ public class DefaultParser implements MatchTypeParser, ByteParser {
private final SuffixParser suffixParser;
private final SuffixEqualsIgnoreCaseParser suffixEqualsIgnoreCaseParser;

DefaultParser() {
private DefaultParser() {
this(new WildcardParser(), new EqualsIgnoreCaseParser(), new SuffixParser(), new SuffixEqualsIgnoreCaseParser());
}

DefaultParser(WildcardParser wildcardParser, EqualsIgnoreCaseParser equalsIgnoreCaseParser, SuffixParser suffixParser,
SuffixEqualsIgnoreCaseParser suffixEqualsIgnoreCaseParser) {
private DefaultParser(WildcardParser wildcardParser, EqualsIgnoreCaseParser equalsIgnoreCaseParser,
SuffixParser suffixParser, SuffixEqualsIgnoreCaseParser suffixEqualsIgnoreCaseParser) {
this.wildcardParser = wildcardParser;
this.equalsIgnoreCaseParser = equalsIgnoreCaseParser;
this.suffixParser = suffixParser;
this.suffixEqualsIgnoreCaseParser = suffixEqualsIgnoreCaseParser;
}

public static DefaultParser getParser() {
public static synchronized DefaultParser getParser() {
return SINGLETON;
}

static DefaultParser getNonSingletonParserForTesting(WildcardParser wildcardParser, EqualsIgnoreCaseParser equalsIgnoreCaseParser,
SuffixParser suffixParser, SuffixEqualsIgnoreCaseParser suffixEqualsIgnoreCaseParser) {
return new DefaultParser(wildcardParser, equalsIgnoreCaseParser, suffixParser, suffixEqualsIgnoreCaseParser);
}

@Override
public InputCharacter[] parse(final MatchType type, final String value) {
if (type == WILDCARD || type == ANYTHING_BUT_WILDCARD) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/software/amazon/event/ruler/input/ParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void testParseString() {
@Test
public void testOtherMatchTypes() {
final int[] parserInvokedCount = { 0, 0, 0, 0 };
DefaultParser parser = new DefaultParser(
DefaultParser parser = DefaultParser.getNonSingletonParserForTesting(
new WildcardParser() {
@Override
public InputCharacter[] parse(String value) {
Expand Down