jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From md...@apache.org
Subject cvs commit: jakarta-bcel/src/java/org/apache/bcel/util ClassQueue.java
Date Mon, 04 Feb 2002 08:43:22 GMT
mdahm       02/02/04 00:43:22

  Modified:    src/java/org/apache/bcel/util ClassQueue.java
  Log:
  Bug fix: Class queue uses now ArrayList, different semantics not regarded
  
  Revision  Changes    Path
  1.2       +12 -7     jakarta-bcel/src/java/org/apache/bcel/util/ClassQueue.java
  
  Index: ClassQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-bcel/src/java/org/apache/bcel/util/ClassQueue.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClassQueue.java	29 Oct 2001 20:00:29 -0000	1.1
  +++ ClassQueue.java	4 Feb 2002 08:43:22 -0000	1.2
  @@ -60,19 +60,24 @@
    * Utility class implementing a (typesafe) queue of JavaClass
    * objects.
    *
  - * @version $Id: ClassQueue.java,v 1.1 2001/10/29 20:00:29 jvanzyl Exp $
  + * @version $Id: ClassQueue.java,v 1.2 2002/02/04 08:43:22 mdahm Exp $
    * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> 
    * @see ClassVector
   */
   public class ClassQueue {
  -  protected int       left = 0;
  -  private   ArrayList vec  = new ArrayList();
  +  protected ArrayList vec  = new ArrayList();
  +
  +  public void enqueue(JavaClass clazz) { vec.add(clazz); }
   
  -  public void      enqueue(JavaClass clazz) { vec.add(clazz); }
     public JavaClass dequeue()                {
  -    JavaClass clazz = (JavaClass)vec.get(left);
  -    vec.remove(left++);
  +    JavaClass clazz = (JavaClass)vec.get(0);
  +    vec.remove(0);
       return clazz;
     }
  -  public boolean   empty()                  { return vec.size() <= left; }
  +
  +  public boolean empty() { return vec.size() == 0; }
  +
  +  public String toString() {
  +    return vec.toString();
  +  }
   }  
  
  
  

--
To unsubscribe, e-mail:   <mailto:bcel-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-dev-help@jakarta.apache.org>


Mime
View raw message