jdk/src/share/classes/sun/management/snmp/jvminstr/NotificationTargetImpl.java
changeset 24685 215fa91e1b4c
parent 5506 202f599c92aa
--- a/jdk/src/share/classes/sun/management/snmp/jvminstr/NotificationTargetImpl.java	Wed Jul 05 19:43:07 2017 +0200
+++ b/jdk/src/share/classes/sun/management/snmp/jvminstr/NotificationTargetImpl.java	Fri May 30 15:46:12 2014 -0400
@@ -70,8 +70,8 @@
 
         String addrStr;
         if (target.startsWith("[")) {
-            final int index = target.indexOf("]");
-            final int index2 = target.lastIndexOf(":");
+            final int index = target.indexOf(']');
+            final int index2 = target.lastIndexOf(':');
             if(index == -1)
                 throw new IllegalArgumentException("Host starts with [ but " +
                                                    "does not end with ]");
@@ -85,8 +85,8 @@
             if (addrStr.startsWith("["))
                 throw new IllegalArgumentException("More than one [[...]]");
         } else {
-            final int index = target.indexOf(":");
-            final int index2 = target.lastIndexOf(":");
+            final int index = target.indexOf(':');
+            final int index2 = target.lastIndexOf(':');
             if(index == -1) throw new
                 IllegalArgumentException("Missing port separator \":\"");
             addrStr = target.substring(0, index);
@@ -98,7 +98,7 @@
         address = InetAddress.getByName(addrStr);
 
         //THE CHECK SHOULD BE STRONGER!!!
-        final int index = target.lastIndexOf(":");
+        final int index = target.lastIndexOf(':');
 
         community = target.substring(index + 1, target.length());