From 65a18434e7345784418a4d4826e5c7933fe27f45 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Wed, 2 Apr 2014 12:17:25 +0400 Subject: [PATCH 1/2] 8038333: TEST_BUG: java/lang/ref/EarlyTimeout.java fails with a non-adequate message Reviewed-by: mchung --- jdk/test/java/lang/ref/EarlyTimeout.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/lang/ref/EarlyTimeout.java b/jdk/test/java/lang/ref/EarlyTimeout.java index d33b46bbb48..cbbc269ad90 100644 --- a/jdk/test/java/lang/ref/EarlyTimeout.java +++ b/jdk/test/java/lang/ref/EarlyTimeout.java @@ -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"); } } From a5adc0deb1c9bf4ef573eeeee5c0c021001ac490 Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Wed, 2 Apr 2014 15:59:00 +0400 Subject: [PATCH 2/2] 8038488: Tidy warnings cleanup for java.beans Reviewed-by: malenkov, alexsch --- jdk/src/share/classes/java/beans/SimpleBeanInfo.java | 2 +- .../classes/java/beans/beancontext/BeanContextChildSupport.java | 2 +- jdk/src/share/classes/java/beans/package.html | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/java/beans/SimpleBeanInfo.java b/jdk/src/share/classes/java/beans/SimpleBeanInfo.java index 2775b7eb8af..29fd9cc4b5a 100644 --- a/jdk/src/share/classes/java/beans/SimpleBeanInfo.java +++ b/jdk/src/share/classes/java/beans/SimpleBeanInfo.java @@ -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. - *

+ * * @param resourceName A pathname relative to the directory * holding the class file of the current class. For example, * "wombat.gif". diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java index 3b6edade049..af95e03e284 100644 --- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java +++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java @@ -262,7 +262,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer * the PropertyVetoException.

* * No event is fired if old and new are equal and non-null. - *

+ * * @param name The programmatic name of the property that is about to * change * diff --git a/jdk/src/share/classes/java/beans/package.html b/jdk/src/share/classes/java/beans/package.html index 9f8234673e7..2b68012cee5 100644 --- a/jdk/src/share/classes/java/beans/package.html +++ b/jdk/src/share/classes/java/beans/package.html @@ -150,7 +150,6 @@ For overview, architecture, and tutorial documentation, please see:

  • JavaBeans, a trail in The Java Tutorial.
  • Long-Term Persistence, an article in The Swing Connection. -