Skip to content

Commit

Permalink
Add an inject annotation, and the relevant dep.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 499339120
  • Loading branch information
graememorgan authored and Error Prone Team committed Jan 4, 2023
1 parent 941974e commit 819218d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@
<version>${jspecify.version}</version>
<scope>test</scope>
</dependency>
<!-- Apache 2.0 -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import java.util.Optional;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import javax.inject.Inject;

/** Checks for statement switches that can be expressed as an equivalent expression switch. */
@BugPattern(
Expand All @@ -79,6 +80,7 @@ private static enum CaseFallThru {

private final boolean enableDirectConversion;

@Inject
public StatementSwitchToExpressionSwitch(ErrorProneFlags flags) {
this.enableDirectConversion =
flags.getBoolean("StatementSwitchToExpressionSwitch:EnableDirectConversion").orElse(false);
Expand Down

0 comments on commit 819218d

Please sign in to comment.