geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r154728 - geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanName.java
Date Mon, 21 Feb 2005 22:08:09 GMT
Author: jboynes
Date: Mon Feb 21 14:08:07 2005
New Revision: 154728

URL: http://svn.apache.org/viewcvs?view=rev&rev=154728
Log:
Use Map to avoid synchronization

Modified:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanName.java

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanName.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanName.java?view=diff&r1=154727&r2=154728
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanName.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanName.java Mon Feb
21 14:08:07 2005
@@ -18,9 +18,9 @@
 
 import java.io.Serializable;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Properties;
 
 
 /**
@@ -42,7 +42,7 @@
      */
     private final String name;
     private final transient String domain;
-    private final transient Properties props;
+    private final transient HashMap props;
     private final transient int hashCode;
 
     /**
@@ -50,9 +50,9 @@
      * The string representation of this name is generated by combining the properties in
sorted order.
      *
      * @param domain the domain
-     * @param props the properties used to qualify this name
+     * @param props the properties used to qualify this name; a Map<String,String>
      */
-    public GBeanName(String domain, Properties props) {
+    public GBeanName(String domain, Map props) {
         if (domain == null) {
             throw new IllegalArgumentException("domain is null");
         } else if (props == null) {
@@ -61,7 +61,7 @@
             throw new IllegalArgumentException("props is empty");
         }
         this.domain = domain;
-        this.props = new Properties(props);
+        this.props = new HashMap(props);
         this.name = sortName(domain, props);
         this.hashCode = domain.hashCode() + 37 * props.hashCode();
     }
@@ -81,11 +81,11 @@
         this.hashCode = domain.hashCode() + 37 * props.hashCode();
     }
 
-    private static Properties parseName(String name) {
+    private static HashMap parseName(String name) {
         if (name.endsWith(",")) {
             throw new IllegalArgumentException("Missing last property pair");
         }
-        Properties props = new Properties();
+        HashMap props = new HashMap();
         String[] pairs = name.split(",");
         for (int i = 0; i < pairs.length; i++) {
             String pair = pairs[i];
@@ -127,10 +127,10 @@
      * always evaluate to true.
      *
      * @param domain the domain to match
-     * @param pattern the set properties to match
+     * @param pattern the set properties to match; a Map<String,String>
      * @return true if this instance matches the pattern
      */
-    public boolean matches(String domain, Properties pattern) {
+    public boolean matches(String domain, Map pattern) {
         if (domain != null) {
             if (!this.domain.equals(domain)) {
                 return false;



Mime
View raw message