From 45d9a2b75cbaad0715ba211756d7cd82f18292e9 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 13 Jun 2012 21:52:54 +0200 Subject: [PATCH] no Notification.toString is needed --- .../openapi/vcs/impl/GenericNotifierImpl.java | 20 +++++++------------ .../idea/svn/SvnAuthenticationNotifier.java | 6 ------ .../svn/SvnProxyAuthenticationNotifier.java | 6 ------ 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java index aa1691b5e005..1988c07b85d0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/GenericNotifierImpl.java @@ -58,9 +58,6 @@ public abstract class GenericNotifierImpl { @NotNull protected abstract String getNotificationContent(final T obj); - @NotNull - protected abstract String getToString(final T obj); - protected Collection getAllCurrentKeys() { synchronized (myLock) { return new ArrayList(myState.keySet()); @@ -109,7 +106,7 @@ public abstract class GenericNotifierImpl { if (myState.containsKey(key)) { return false; } - notification = new MyNotification(myGroupId, myTitle, getNotificationContent(obj), myType, myListener, obj, getToString(obj)); + notification = new MyNotification(myGroupId, myTitle, getNotificationContent(obj), myType, myListener, obj); myState.put(key, notification); } final boolean state = onFirstNotification(obj); @@ -180,24 +177,21 @@ public abstract class GenericNotifierImpl { protected static class MyNotification extends Notification { private final T myObj; - private final String myStringPresentation; - protected MyNotification(@NotNull String groupId, @NotNull String title, @NotNull String content, @NotNull NotificationType type, @Nullable NotificationListener listener, - @NotNull final T obj, - final String stringPresentation) { + protected MyNotification(@NotNull String groupId, + @NotNull String title, + @NotNull String content, + @NotNull NotificationType type, + @Nullable NotificationListener listener, + @NotNull final T obj) { super(groupId, title, content, type, listener); myObj = obj; - myStringPresentation = stringPresentation; } public T getObj() { return myObj; } - @Override - public String toString() { - return myStringPresentation; - } } private static void log(final String s) { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationNotifier.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationNotifier.java index 53dcac7c99c1..70fff2d294f6 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationNotifier.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationNotifier.java @@ -233,12 +233,6 @@ public class SvnAuthenticationNotifier extends GenericNotifierImplClick to fix. Not logged In to Subversion '" + obj.getRealm() + "' (" + obj.getUrl().toDecodedString() + ")"; } - @NotNull - @Override - protected String getToString(AuthenticationRequest obj) { - return "Click to fix. Not logged In to Subversion '" + obj.getRealm() + "' (" + obj.getUrl().toDecodedString() + ")"; - } - public static class AuthenticationRequest { private final Project myProject; private final String myKind; diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProxyAuthenticationNotifier.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProxyAuthenticationNotifier.java index 9c7f77018367..e949b4aae8f7 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProxyAuthenticationNotifier.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/SvnProxyAuthenticationNotifier.java @@ -43,10 +43,4 @@ public class SvnProxyAuthenticationNotifier extends GenericNotifierImpl