--- old/src/share/classes/javax/management/ObjectName.java Thu Feb 23 16:22:34 2012 +++ new/src/share/classes/javax/management/ObjectName.java Thu Feb 23 16:22:34 2012 @@ -829,7 +829,7 @@ } // we now build the canonicalname string - _canonicalName = (new String(canonical_chars, 0, prop_index)).intern(); + _canonicalName = (new String(canonical_chars, 0, prop_index)); } /** @@ -1778,14 +1778,10 @@ // object is not an object name case if (!(object instanceof ObjectName)) return false; - // equality when canonical names are the same - // (because usage of intern()) ObjectName on = (ObjectName) object; String on_string = on._canonicalName; - if (_canonicalName == on_string) return true; // ES: OK + if(_canonicalName.compareTo(on_string) == 0) return true; - // Because we are sharing canonical form between object names, - // we have finished the comparison at this stage ==> unequal return false; }