User: squirest Date: 02/01/16 15:38:22 Modified: src/main/javax/management ObjectName.java Log: cleanup canonical and string representation of property patterns pattern tests now fail against RI so failure message make that clearly expected Revision Changes Path 1.5 +16 -18 jmx/src/main/javax/management/ObjectName.java Index: ObjectName.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/javax/management/ObjectName.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ObjectName.java 2001/12/21 20:56:38 1.4 +++ ObjectName.java 2002/01/16 23:38:22 1.5 @@ -19,7 +19,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>. * @author <a href="mailto:[EMAIL PROTECTED]">Trevor Squires</a>. - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * */ public class ObjectName implements java.io.Serializable @@ -231,16 +231,7 @@ } initProperties(ptable); - - // if it's not a propertyPattern then preserve the original string - if (!this.hasPropertyPattern) - { - this.keyProperties = properties; - } - else - { - this.keyProperties = canonicalKeyProperties; - } + this.keyProperties = properties; } /** @@ -302,14 +293,21 @@ } } + if (this.hasPropertyPattern) + { + if (properties.size() > 0) + { + strBuffer.append(",*"); + } + else + { + strBuffer.append("*"); + } + } + this.propertiesHash = properties; this.canonicalKeyProperties = strBuffer.toString(); - - // now precompute the hashcode - // just need it to be unique - strBuffer.append(':').append(this.domain).append(':'); - strBuffer.append(isPattern()).append(isPropertyPattern()); - this.precompHashCode = strBuffer.toString().hashCode(); + this.precompHashCode = getCanonicalName().hashCode(); } /** @@ -341,7 +339,7 @@ } /** - * returns true if the key or value string is zero length or contains illegal characters + * returns true if the domain contains illegal characters */ private boolean isIllegalDomain(String dom) {
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development