mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-16 21:35:25 +00:00
Merge
This commit is contained in:
commit
03ece18beb
@ -108,7 +108,7 @@ public class SimpleBeanInfo implements BeanInfo {
|
||||
* It takes the name of a resource file associated with the
|
||||
* current object's class file and loads an image object
|
||||
* from that file. Typically images will be GIFs.
|
||||
* <p>
|
||||
*
|
||||
* @param resourceName A pathname relative to the directory
|
||||
* holding the class file of the current class. For example,
|
||||
* "wombat.gif".
|
||||
|
||||
@ -262,7 +262,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer
|
||||
* the PropertyVetoException. <P>
|
||||
*
|
||||
* No event is fired if old and new are equal and non-null.
|
||||
* <P>
|
||||
*
|
||||
* @param name The programmatic name of the property that is about to
|
||||
* change
|
||||
*
|
||||
|
||||
@ -150,7 +150,6 @@ For overview, architecture, and tutorial documentation, please see:
|
||||
<li><a href="http://java.sun.com/docs/books/tutorial/javabeans/">JavaBeans</a>, a trail in <em>The Java Tutorial</em>.
|
||||
<li><a href="http://java.sun.com/products/jfc/tsc/articles/persistence2/">Long-Term Persistence</a>, an article in <em>The Swing Connection</em>.
|
||||
</ul>
|
||||
<p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -37,7 +37,7 @@ import java.util.concurrent.CountDownLatch;
|
||||
/**
|
||||
* In order to demonstrate the issue we make several threads (two appears to be sufficient)
|
||||
* to block in ReferenceQueue#remove(timeout) at the same time.
|
||||
* Then, we force a reference to be enqueued by setting its referent to null and calling System.gs().
|
||||
* Then, we force a reference to be enqueued by setting its referent to null and calling System.gc().
|
||||
* One of the threads gets the reference returned from the remove().
|
||||
* The other threads get null:
|
||||
* 1) with bug: this may happen before the specified timeout is elapsed,
|
||||
@ -63,7 +63,10 @@ public class EarlyTimeout extends Thread {
|
||||
threads[i] = new EarlyTimeout();
|
||||
threads[i].start();
|
||||
}
|
||||
// The main thread waits until the threads has started and give it a chance
|
||||
// for the threads to block on the queue.remove(TIMEOUT) call
|
||||
startedSignal.await();
|
||||
Thread.sleep(TIMEOUT / 2);
|
||||
referent = null;
|
||||
System.gc();
|
||||
for (EarlyTimeout thread : threads) {
|
||||
@ -82,7 +85,7 @@ public class EarlyTimeout extends Thread {
|
||||
nonNullRefCount++;
|
||||
}
|
||||
}
|
||||
if (nonNullRefCount != 1) {
|
||||
if (nonNullRefCount > 1) {
|
||||
throw new RuntimeException("more than one references were removed from queue");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user