[jboss-cvs] jbosstest/src/main/org/jboss/test/classloader/interrupt ...

Scott Stark scott.stark at jboss.com
Thu Jul 20 22:57:30 EDT 2006


  User: starksm 
  Date: 06/07/20 22:57:30

  Modified:    src/main/org/jboss/test/classloader/interrupt 
                        TestThread.java
  Log:
  Just check that the thread was interrupted going into the class loading call to avoid logging side-effect clearing the interrupt flag.
  
  Revision  Changes    Path
  1.5       +4 -2      jbosstest/src/main/org/jboss/test/classloader/interrupt/TestThread.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TestThread.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/classloader/interrupt/TestThread.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- TestThread.java	29 Oct 2005 23:41:21 -0000	1.4
  +++ TestThread.java	21 Jul 2006 02:57:30 -0000	1.5
  @@ -26,7 +26,7 @@
   /** A thread subclass that loads a class while its interrupted flag is set.
    *
    * @author Scott.Stark at jboss.org
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class TestThread extends Thread
   {
  @@ -50,9 +50,11 @@
         {
            // An explict reference to TestClass will invoke loadClassInternal
            log.debug("Creating TestClass");
  +         this.interrupt();
  +         boolean wasInterrupted = this.isInterrupted();
            TestClass tc = new TestClass();
            log.debug("TestClass instance = "+tc);
  -         if( this.isInterrupted() == false )
  +         if( wasInterrupted == false )
               ex = new IllegalStateException("Interrupted state not restore after loadClassInternal");
         }
         catch(Throwable e)
  
  
  



More information about the jboss-cvs-commits mailing list