Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip modifier transforming for enum constants
added simple test added changelog fixed #290
- Loading branch information
1 parent
1d55f45
commit 35620e4
Showing
9 changed files
with
115 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...test/java/de/plushnikov/intellij/plugin/inspection/FieldDefaultsOnEnumInspectionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
package de.plushnikov.intellij.plugin.inspection; | |||
|
|||
import com.intellij.codeInspection.InspectionProfileEntry; | |||
|
|||
public class FieldDefaultsOnEnumInspectionTest extends LombokInspectionTest { | |||
|
|||
@Override | |||
protected String getTestDataPath() { | |||
return TEST_DATA_INSPECTION_DIRECTORY + "/fielddefaults"; | |||
} | |||
|
|||
@Override | |||
protected InspectionProfileEntry getInspection() { | |||
return null; | |||
} | |||
|
|||
public void testEnumClass() throws Exception { | |||
doTest(); | |||
} | |||
} |
42 changes: 42 additions & 0 deletions
42
src/test/java/de/plushnikov/intellij/plugin/inspection/FieldMayBeFinalInspectionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,42 @@ | |||
package de.plushnikov.intellij.plugin.inspection; | |||
|
|||
import com.intellij.codeInspection.InspectionProfileEntry; | |||
import com.siyeh.ig.style.FieldMayBeFinalInspection; | |||
|
|||
public class FieldMayBeFinalInspectionTest extends LombokInspectionTest { | |||
|
|||
@Override | |||
protected String getTestDataPath() { | |||
return TEST_DATA_INSPECTION_DIRECTORY + "/canBeFinalInspection"; | |||
} | |||
|
|||
@Override | |||
protected InspectionProfileEntry getInspection() { | |||
return new FieldMayBeFinalInspection(); | |||
} | |||
|
|||
public void testClassNormal() throws Exception { | |||
doTest(); | |||
} | |||
|
|||
public void testClassWithData() throws Exception { | |||
doTest(); | |||
} | |||
|
|||
public void testClassWithFieldSetter() throws Exception { | |||
doTest(); | |||
} | |||
|
|||
public void testClassWithGetter() throws Exception { | |||
doTest(); | |||
} | |||
|
|||
public void testClassWithSetter() throws Exception { | |||
doTest(); | |||
} | |||
|
|||
public void testClassWithValue() throws Exception { | |||
doTest(); | |||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
test-manual/src/main/java/de/plushnikov/fielddefault/issue290/EnumClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
package de.plushnikov.fielddefault.issue290; | |||
|
|||
import lombok.AccessLevel; | |||
import lombok.Getter; | |||
import lombok.experimental.FieldDefaults; | |||
|
|||
@Getter | |||
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true) | |||
public enum EnumClass { | |||
ENUM1, ENUM2 | |||
} |
7 changes: 7 additions & 0 deletions
7
test-manual/src/main/java/de/plushnikov/fielddefault/issue290/OtherClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
package de.plushnikov.fielddefault.issue290; | |||
|
|||
public class OtherClass { | |||
public static void main(String[] args) { | |||
System.out.println(EnumClass.ENUM1.name()); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
import lombok.AccessLevel; | |||
import lombok.Getter; | |||
import lombok.experimental.FieldDefaults; | |||
|
|||
@Getter | |||
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true) | |||
public enum EnumClass { | |||
ENUM1, ENUM2 | |||
} | |||
|
|||
class SomeOtherClass { | |||
public static void main(String[] args) { | |||
System.out.println(EnumClass.ENUM1.name()); | |||
} | |||
} |