fix minor exceptions
This commit is contained in:
@@ -9,15 +9,16 @@ import java.util.Date;
|
||||
public class LicenseFileRecord implements EvalRecord {
|
||||
private final String type = "LICENSE";
|
||||
private final File file;
|
||||
private final Date expireDate;
|
||||
|
||||
private String expireDate;
|
||||
|
||||
public LicenseFileRecord(File file) {
|
||||
this.file = file;
|
||||
|
||||
try (DataInputStream dis = new DataInputStream(new FileInputStream(file))) {
|
||||
expireDate = new Date(~dis.readLong() + 2592000000L);
|
||||
expireDate = DateTime.DF_DATETIME.format(new Date(~dis.readLong() + 2592000000L));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
expireDate = "ERROR";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +35,6 @@ public class LicenseFileRecord implements EvalRecord {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return type + ": " + file.getName() + ", UNTIL: " + DateTime.DF_DATETIME.format(expireDate);
|
||||
return type + ": " + file.getName() + ", UNTIL: " + expireDate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,18 @@ import io.zhile.research.intellij.ier.helper.ResetTimeHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AppActivationListener implements ApplicationActivationListener, Disposable {
|
||||
private static AppActivationListener instance = new AppActivationListener();
|
||||
private static AppActivationListener instance;
|
||||
private static MessageBusConnection connection;
|
||||
|
||||
protected AppActivationListener() {
|
||||
|
||||
}
|
||||
|
||||
public static AppActivationListener getInstance() {
|
||||
public synchronized static AppActivationListener getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new AppActivationListener();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,18 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class AppEventListener implements AppLifecycleListener, Disposable {
|
||||
private static AppEventListener instance = new AppEventListener();
|
||||
private static AppEventListener instance;
|
||||
private static MessageBusConnection connection;
|
||||
|
||||
protected AppEventListener() {
|
||||
|
||||
}
|
||||
|
||||
public static AppEventListener getInstance() {
|
||||
public synchronized static AppEventListener getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new AppEventListener();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,18 @@ import io.zhile.research.intellij.ier.helper.BrokenPlugins;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class BrokenPluginsListener implements ApplicationActivationListener, Disposable {
|
||||
private static BrokenPluginsListener instance = new BrokenPluginsListener();
|
||||
private static BrokenPluginsListener instance;
|
||||
private static MessageBusConnection connection;
|
||||
|
||||
protected BrokenPluginsListener() {
|
||||
|
||||
}
|
||||
|
||||
public static BrokenPluginsListener getInstance() {
|
||||
public synchronized static BrokenPluginsListener getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new BrokenPluginsListener();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PluginListener implements DynamicPluginListener {
|
||||
}
|
||||
|
||||
ActionManager.getInstance().getAction(Constants.RESET_ACTION_ID);
|
||||
NotificationHelper.showInfo(null, "Plugin installed successfully! Now enjoy it~<br>For more information, visit <a href='https://zhile.io/2020/11/18/jetbrains-eval-reset.html'>here</a>.");
|
||||
NotificationHelper.showInfo(null, "Plugin installed successfully! Now enjoy it~<br>For more information, visit <a href='https://zhile.io/2020/11/18/jetbrains-eval-reset-da33a93d.html'>here</a>.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
I can reset your IDE eval information.<br>
|
||||
<em>Click "Help" menu and select "Eval Reset"</em><br><br>
|
||||
<p>
|
||||
<a href="https://zhile.io/2020/11/18/jetbrains-eval-reset.html" target="_blank">Need Help?</a>
|
||||
<a href="https://zhile.io/2020/11/18/jetbrains-eval-reset-da33a93d.html" target="_blank">Need Help?</a>
|
||||
</p>
|
||||
]]></description>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user