/[classpath]/classpath/vm/reference/gnu/classpath/jdwp/VMIdManager.java
ViewVC logotype

Diff of /classpath/vm/reference/gnu/classpath/jdwp/VMIdManager.java

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

revision 1.2 by mark, Thu Aug 25 00:47:49 2005 UTC revision 1.3 by mark, Sun Sep 4 19:50:03 2005 UTC
# Line 170  public class VMIdManager Line 170  public class VMIdManager
170       * Returns a new reference type id for the given class       * Returns a new reference type id for the given class
171       *       *
172       * @param clazz  the <code>Class</code> for which an id is desired       * @param clazz  the <code>Class</code> for which an id is desired
173       * @returns a suitable reference type id or <code>null</code>       * @returns a suitable reference type id or null when the
174         * reference is cleared.
175       */       */
176      public static ReferenceTypeId newReferenceTypeId (SoftReference ref)      public static ReferenceTypeId newReferenceTypeId (SoftReference ref)
177      {      {
178        ReferenceTypeId id = null;        ReferenceTypeId id;
179        Class clazz = (Class) ref.get ();        Class clazz = (Class) ref.get ();
180          if (clazz == null)
181            return null;
182    
183        try        if (clazz.isArray ())
184            id = new ArrayReferenceTypeId ();
185          else if (clazz.isInterface ())
186            id = new InterfaceReferenceTypeId ();
187          else
188            id = new ClassReferenceTypeId ();
189          synchronized (_ridLock)
190          {          {
191            if (clazz.isArray ())            id.setId (++_lastRid);
             id = new ArrayReferenceTypeId ();  
           else if (clazz.isInterface ())  
             id = new InterfaceReferenceTypeId ();  
           else  
             id = new ClassReferenceTypeId ();  
           synchronized (_ridLock)  
             {  
               id.setId (++_lastRid);  
             }  
           return id;  
         }  
       catch (InstantiationException ie)  
         {  
           return null;  
         }  
       catch (IllegalAccessException iae)  
         {  
           return null;  
192          }          }
193          return id;
194      }      }
195    }    }
196    

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

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