harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-963) java.util.Timer: purge() throws NPE on empty timer
Date Mon, 24 Jul 2006 12:20:16 GMT
java.util.Timer: purge() throws NPE on empty timer
--------------------------------------------------

                 Key: HARMONY-963
                 URL: http://issues.apache.org/jira/browse/HARMONY-963
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Windows XP professional
            Reporter: Anton Luht
            Priority: Trivial


java version "1.5.0"
pre-alpha : not complete or compatible
svn = r424964, (Jul 24 2006), Windows/ia32/msvc 1310, debug build
http://incubator.apache.org/harmony

Spec says:
    public int purge()
Removes all cancelled tasks from this timer's task queue
Returns:
   the number of tasks removed from the queue.



The following code:

import java.util.Timer;

public class Test{
  public static void main(String args[]) {
    try {
      Timer localTimer = new Timer("aaa", false);
      System.err.println("Timer.purge()= "+localTimer.purge());
      System.err.println("PASSED");
    } catch(Exception e) {
      e.printStackTrace();
      System.err.println("FAILED");
    }
    System.exit(0);
  }
}

prints

java.lang.NullPointerException
        at java.util.Timer$TimerImpl.purge(Timer.java:290)
        at java.util.Timer.purge(Timer.java:346)
        at Test.main(Test.java:7)
FAILED

on Harmony

and prints 

Timer.purge()= 0
PASSED

on RI

Please see the patch for JUnit test and classlib code attached

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message