geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx GBeanMBeanReference.java
Date Sun, 18 Jul 2004 22:05:11 GMT
djencks     2004/07/18 15:05:11

  Modified:    modules/kernel/src/java/org/apache/geronimo/gbean/jmx
                        GBeanMBeanReference.java
  Log:
  Remove nulls from reference patterns before trying to match
  
  Revision  Changes    Path
  1.11      +11 -2     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBeanReference.java
  
  Index: GBeanMBeanReference.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBeanReference.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- GBeanMBeanReference.java	24 Jun 2004 01:46:30 -0000	1.10
  +++ GBeanMBeanReference.java	18 Jul 2004 22:05:11 -0000	1.11
  @@ -24,6 +24,7 @@
   import java.util.HashSet;
   import java.util.Iterator;
   import java.util.Set;
  +
   import javax.management.AttributeNotFoundException;
   import javax.management.InstanceNotFoundException;
   import javax.management.MBeanServerNotification;
  @@ -130,9 +131,17 @@
           if (!gmbean.isOffline()) {
               throw new IllegalStateException("Pattern set can not be modified while online");
           }
  -        if (patterns == null) {
  +        if (patterns == null || patterns.isEmpty() || (patterns.size() == 1 &&
patterns.iterator().next() == null)) {
               this.patterns = Collections.EMPTY_SET;
           } else {
  +            patterns = new HashSet(patterns);
  +            for (Iterator iterator = this.patterns.iterator(); iterator.hasNext();) {
  +                if (iterator.next() == null) {
  +                    iterator.remove();
  +                    //there can be at most one null value in a set.
  +                    break;
  +                }
  +            }
               this.patterns = Collections.unmodifiableSet(patterns);
           }
       }
  
  
  

Mime
View raw message