From f8d7bfc7273640fc874ab086854c9321fff139af Mon Sep 17 00:00:00 2001 From: pengzhile Date: Wed, 1 Jul 2020 10:37:24 +0800 Subject: [PATCH] fix Signed-off-by: pengzhile --- .../research/intellij/action/ResetAction.java | 2 +- src/test/java/MyInterface.java | 3 +++ src/test/java/Tsss.java | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/test/java/MyInterface.java create mode 100644 src/test/java/Tsss.java diff --git a/src/main/java/io/zhile/research/intellij/action/ResetAction.java b/src/main/java/io/zhile/research/intellij/action/ResetAction.java index 980862d..77dcb29 100644 --- a/src/main/java/io/zhile/research/intellij/action/ResetAction.java +++ b/src/main/java/io/zhile/research/intellij/action/ResetAction.java @@ -83,7 +83,7 @@ public class ResetAction extends AnAction { File dir = Paths.get(appData, "JetBrains", fileName).toFile(); - return dir.delete(); + return !dir.exists() || dir.delete(); } protected File getEvalFile() { diff --git a/src/test/java/MyInterface.java b/src/test/java/MyInterface.java new file mode 100644 index 0000000..7426e1e --- /dev/null +++ b/src/test/java/MyInterface.java @@ -0,0 +1,3 @@ +public interface MyInterface { + public void test(); +} diff --git a/src/test/java/Tsss.java b/src/test/java/Tsss.java new file mode 100644 index 0000000..5d117c8 --- /dev/null +++ b/src/test/java/Tsss.java @@ -0,0 +1,20 @@ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Tsss { + List list = Arrays.asList(); + + public static void main(String[] args) { + new Tsss().add(new MyInterface() { + @Override + public void test() { + + } + }); + } + + public void add(MyInterface obj) { + list.add(obj); + } +}