File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
lib/src/main/java/com/diffplug/spotless/generic
plugin-maven/src/main/java/com/diffplug/spotless/maven/java
testlib/src/test/java/com/diffplug/spotless/java Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 2020import com .diffplug .spotless .FormatterStep ;
2121
2222public final class ReplaceObsoletesStep implements FormatterStep {
23-
24-
25- private ReplaceObsoletesStep () {
26- }
23+ private ReplaceObsoletesStep () {}
2724
2825 public static FormatterStep forJava () {
2926 return new ReplaceObsoletesStep ();
@@ -36,11 +33,25 @@ public String getName() {
3633
3734 @ Override
3835 public String format (String rawUnix , File file ) throws Exception {
39- return "" ;
36+ String result = rawUnix ;
37+ // Replace System.getProperty("line.separator") with System.lineSeparator()
38+ result = result .replace (
39+ "System.getProperty(\" line.separator\" )" ,
40+ "System.lineSeparator()" );
41+
42+ // Remove = false from boolean fields
43+ result = result .replaceAll (
44+ "(public\\ s+boolean\\ s+\\ w+)\\ s*=\\ s*false" ,
45+ "$1" );
46+
47+ // Remove = null from reference fields
48+ result = result .replaceAll (
49+ "(public\\ s+(?:String|\\ w+)\\ s+\\ w+)\\ s*=\\ s*null" ,
50+ "$1" );
51+
52+ return result ;
4053 }
4154
4255 @ Override
43- public void close () throws Exception {
44-
45- }
56+ public void close () throws Exception {}
4657}
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments