Skip to content

Commit a16cf32

Browse files
committed
Make SameNameButDifferent an error
In PalantirJavaFormatSettings `State` named both IntelliJ's @State annotation and the settings' own State class. The annotation is now written out in full, which leaves the name to the class.
1 parent ffa9b7f commit a16cf32

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎buildSrc/src/main/groovy/open-java-format.error-prone-conventions.gradle‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ tasks.withType(JavaCompile).configureEach {
5555
// Checks whose findings have been fixed, build-breaking so that new ones are fixed too rather than read past.
5656
tasks.withType(JavaCompile).configureEach {
5757
options.errorprone {
58+
error('SameNameButDifferent')
5859
error('UnusedVariable')
5960
}
6061
}

‎open-java-format-idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirJavaFormatSettings.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.intellij.formatting.service.FormattingService;
2020
import com.intellij.openapi.components.PersistentStateComponent;
21-
import com.intellij.openapi.components.State;
2221
import com.intellij.openapi.components.Storage;
2322
import com.intellij.openapi.extensions.PluginDescriptor;
2423
import com.intellij.openapi.project.Project;
@@ -37,7 +36,7 @@
3736

3837
import static java.util.Optional.ofNullable;
3938

40-
@State(
39+
@com.intellij.openapi.components.State(
4140
name = "PalantirJavaFormatSettings",
4241
storages = {@Storage("open-java-format.xml")})
4342
public class PalantirJavaFormatSettings implements PersistentStateComponent<PalantirJavaFormatSettings.State> {

0 commit comments

Comments
 (0)