Skip to content

Commit d02e642

Browse files
committed
CheckStyle: Fix or suppress remaining violations
Fixing public name violations might cause incompatibility with dependents (e.g. CH extensions and plugins depending on CH). Therefore, ignoring the current violations and ensuring it does not get worse is a safe choice for now.
1 parent 333e009 commit d02e642

File tree

28 files changed

+46
-10
lines changed

28 files changed

+46
-10
lines changed

src/main/java/com/laytonsmith/PureUtilities/Common/Annotations/CheckOverrides.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ public String toString(Class<?> item) {
238238
"are %d methods which override or implement a method in a super class/super interface"
239239
+ " but don't use the @Override tag. Please tag these methods"))
240240
.append(" with @Override to continue the build process.")
241-
.append(StringUtils.nl)
242-
.append(StringUtils.Join(stringMethodsInError, StringUtils.nl));
241+
.append(StringUtils.NL)
242+
.append(StringUtils.Join(stringMethodsInError, StringUtils.NL));
243243
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, b.toString());
244244
} else {
245245
StreamUtils.GetSystemOut().println("No @Override annotations were found to be missing.");

src/main/java/com/laytonsmith/PureUtilities/Common/StringUtils.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,14 @@ public static String PluralTemplateHelper(int count, String singularTemplate, St
764764
* This is the system newline string. For instance, on windows, this would likely be \r\n, and unix systems would
765765
* likely be \n.
766766
*/
767-
public static final String nl = System.getProperty("line.separator");
767+
public static final String NL = System.getProperty("line.separator");
768+
769+
/**
770+
* @deprecated Use {@link #NL} instead.
771+
*/
772+
@SuppressWarnings("checkstyle:constantname") // Fixing this violation might break dependents.
773+
@Deprecated // Deprecated on 14-06-2018 dd-mm-yyyy.
774+
public static final String nl = NL;
768775

769776
/**
770777
* This returns the system newline string. For instance, on windows, this would likely return \r\n, and unix systems
@@ -773,7 +780,7 @@ public static String PluralTemplateHelper(int count, String singularTemplate, St
773780
* @return The system newline string.
774781
*/
775782
public static String nl() {
776-
return nl;
783+
return NL;
777784
}
778785

779786
/**

src/main/java/com/laytonsmith/PureUtilities/VirtualFS/FileSystemLayer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ protected FileSystemLayer(VirtualFile path, VirtualFileSystem fileSystem) {
6363
*/
6464
@Retention(RetentionPolicy.RUNTIME)
6565
@Target(ElementType.TYPE)
66+
@SuppressWarnings("checkstyle:typename") // Fixing this violation might break dependents.
6667
public static @interface fslayer {
6768

6869
/**

src/main/java/com/laytonsmith/PureUtilities/rParser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* written by Nossr50, with portions contributed by Reil.
1010
*
1111
*/
12+
@SuppressWarnings("checkstyle:typename") // Fixing this violation might break dependents.
1213
public final class rParser {
1314

1415
private rParser() {

src/main/java/com/laytonsmith/abstraction/enums/MCBiomeType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public abstract class MCBiomeType<Concrete> extends DynamicEnum<MCBiomeType.MCVa
1818
protected static Map<String, MCBiomeType> mappings;
1919
protected static Map<MCVanillaBiomeType, MCBiomeType> vanilla;
2020

21+
@SuppressWarnings("checkstyle:staticvariablename") // Fixing this violation might break dependents.
2122
public static MCBiomeType NULL = null;
2223

2324
public MCBiomeType(MCVanillaBiomeType mcVanillaBiomeType, Concrete concrete) {

src/main/java/com/laytonsmith/abstraction/enums/MCEntityType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public abstract class MCEntityType<Concrete> extends DynamicEnum<MCEntityType.MC
1919
protected static Map<String, MCEntityType> mappings;
2020
protected static Map<MCVanillaEntityType, MCEntityType> vanilla;
2121

22+
@SuppressWarnings("checkstyle:staticvariablename") // Fixing this violation might break dependents.
2223
public static MCEntityType NULL = null;
2324

2425
protected Class<? extends MCEntity> wrapperClass;

src/main/java/com/laytonsmith/abstraction/enums/MCSound.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public abstract class MCSound<Concrete> extends DynamicEnum<MCSound.MCVanillaSou
1818
// To be filled by the implementer
1919
protected static Map<String, MCSound> mappings;
2020

21+
@SuppressWarnings("checkstyle:staticvariablename") // Fixing this violation might break dependents.
2122
public static MCSound NULL = null;
2223

2324
public MCSound(MCVanillaSound mcVanillaSound, Concrete concrete) {

src/main/java/com/laytonsmith/annotations/abstraction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
@Retention(RetentionPolicy.RUNTIME)
1515
@Target(ElementType.TYPE)
16+
@SuppressWarnings("checkstyle:typename") // Fixing this violation might break dependents.
1617
public @interface abstraction {
1718

1819
Implementation.Type type();

src/main/java/com/laytonsmith/annotations/abstractionenum.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515
@Retention(RetentionPolicy.RUNTIME)
1616
@Target(ElementType.TYPE)
17+
@SuppressWarnings("checkstyle:typename") // Fixing this violation might break dependents.
1718
public @interface abstractionenum {
1819

1920
/**

src/main/java/com/laytonsmith/annotations/api.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
@Retention(RetentionPolicy.RUNTIME)
1919
@Target(ElementType.TYPE)
20+
@SuppressWarnings("checkstyle:typename") // Fixing this violation might break dependents.
2021
public @interface api {
2122

2223
public enum Platforms {

0 commit comments

Comments
 (0)