Skip to content

Commit

Permalink
Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.3.1 to 4.8.4.0 (
Browse files Browse the repository at this point in the history
#155)

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

Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.3.1 to 4.8.4.0.
- [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.8.3.1...spotbugs-maven-plugin-4.8.4.0)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixing SING_SINGLETON_GETTER_NOT_SYNCHRONIZED error

* Fixing SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR error

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rishi Baldawa <baldawar@amazon.com>
  • Loading branch information
dependabot[bot] and baldawar authored Apr 23, 2024
1 parent ad0078a commit 48db0b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
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.4</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

0 comments on commit 48db0b0

Please sign in to comment.