/[classpath]/classpath/gnu/classpath/jdwp/event/filters/ClassMatchFilter.java
ViewVC logotype

Diff of /classpath/gnu/classpath/jdwp/event/filters/ClassMatchFilter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by keiths, Fri Aug 26 21:52:28 2005 UTC revision 1.2 by mark, Sun Sep 4 19:50:03 2005 UTC
# Line 95  public class ClassMatchFilter Line 95  public class ClassMatchFilter
95      Object type = event.getParameter (ReferenceTypeId.class);      Object type = event.getParameter (ReferenceTypeId.class);
96      if (type != null)      if (type != null)
97        {        {
98          try          Class eventClass = (Class) type;
99            String name = eventClass.getName ();
100            
101            if (_pattern.startsWith ("*"))
102              return name.endsWith (_pattern.substring (1));
103            else if (_pattern.endsWith ("*"))
104            {            {
105              Class eventClass = (Class) type;              int end = _pattern.length () - 1;
106              String name = eventClass.getName ();              return name.startsWith (_pattern.substring (0, end));
   
             if (_pattern.startsWith ("*"))  
               return name.endsWith (_pattern.substring (1));  
             else if (_pattern.endsWith ("*"))  
               {  
                 int end = _pattern.length () - 1;  
                 return name.startsWith (_pattern.substring (0, end));  
               }  
             else  
               return name.matches (_pattern);  
           }  
         catch (InvalidClassException ice)  
           {  
             // the class is no longer valid  
             return false;  
107            }            }
108            else
109              return name.matches (_pattern);
110        }        }
111    
112      return false;      return false;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26