Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8761a95
commit 9c3c4fd
Showing
14 changed files
with
168 additions
and
17 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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/de/plushnikov/intellij/plugin/action/delombok/DelombokUtilityClassAction.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package de.plushnikov.intellij.plugin.action.delombok; | ||
|
||
import de.plushnikov.intellij.plugin.processor.clazz.UtilityClassProcessor; | ||
import de.plushnikov.intellij.plugin.util.ExtensionsUtil; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class DelombokUtilityClassAction extends AbstractDelombokAction { | ||
@NotNull | ||
protected DelombokHandler createHandler() { | ||
return new DelombokHandler(true, ExtensionsUtil.findExtension(UtilityClassProcessor.class)); | ||
} | ||
} |
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
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
24 changes: 24 additions & 0 deletions
24
...st/java/de/plushnikov/intellij/plugin/action/delombok/DelombokUtilityClassActionTest.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.plushnikov.intellij.plugin.action.delombok; | ||
|
||
import com.intellij.openapi.actionSystem.AnAction; | ||
import de.plushnikov.intellij.plugin.action.LombokLightActionTestCase; | ||
|
||
public class DelombokUtilityClassActionTest extends LombokLightActionTestCase { | ||
|
||
protected AnAction getAction() { | ||
return new DelombokUtilityClassAction(); | ||
} | ||
|
||
@Override | ||
protected String getBasePath() { | ||
return super.getBasePath() + "/action/delombok/utilityclass"; | ||
} | ||
|
||
public void testUtilityClass() throws Exception { | ||
doTest(); | ||
} | ||
|
||
public void testUtilityInner() throws Exception { | ||
doTest(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
testData/action/delombok/utilityclass/afterUtilityClass.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
final class UtilityClass { | ||
private static long someField = System.currentTimeMillis(); | ||
|
||
private UtilityClass() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
|
||
static void someMethod() { | ||
System.out.println(); | ||
} | ||
|
||
protected static class InnerClass { | ||
|
||
private String innerInnerMember; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
testData/action/delombok/utilityclass/afterUtilityInner.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class UtilityInner { | ||
|
||
static class InnerInner { | ||
static final class InnerInnerInner { | ||
static int member; | ||
|
||
private InnerInnerInner() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
} | ||
} | ||
enum UtilityInsideEnum { | ||
FOO, BAR; | ||
static final class InsideEnum { | ||
static int member; | ||
|
||
private InsideEnum() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
} | ||
} | ||
interface UtilityInsideInterface { | ||
final class InsideInterface { | ||
static int member; | ||
|
||
private InsideInterface() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
testData/action/delombok/utilityclass/beforeUtilityClass.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@lombok.experimental.UtilityClass | ||
class UtilityClass { | ||
private long someField = System.currentTimeMillis(); | ||
|
||
void someMethod() { | ||
System.out.println(); | ||
} | ||
|
||
protected class InnerClass { | ||
private String innerInnerMember; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
testData/action/delombok/utilityclass/beforeUtilityInner.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class UtilityInner { | ||
static class InnerInner { | ||
@lombok.experimental.UtilityClass | ||
class InnerInnerInner { | ||
int member; | ||
} | ||
} | ||
|
||
enum UtilityInsideEnum { | ||
FOO, BAR; | ||
|
||
@lombok.experimental.UtilityClass | ||
class InsideEnum { | ||
int member; | ||
} | ||
} | ||
|
||
interface UtilityInsideInterface { | ||
@lombok.experimental.UtilityClass | ||
class InsideInterface { | ||
int member; | ||
} | ||
} | ||
} |