# HG changeset patch # User mchung # Date 1347641234 25200 # Node ID 889df16bef60dae7fdeabd41c116cb3e0c68ddaa # Parent 7e765d50416fabc3fbc6a8a25a407db4fab90f22 7193302: Remove ConstructorProperties annotation from java.lang.management.LockInfo Reviewed-by: alanb, sla, egahlin diff -r 7e765d50416f -r 889df16bef60 jdk/src/share/classes/java/lang/management/LockInfo.java --- a/jdk/src/share/classes/java/lang/management/LockInfo.java Fri Sep 14 10:30:38 2012 -0400 +++ b/jdk/src/share/classes/java/lang/management/LockInfo.java Fri Sep 14 09:47:14 2012 -0700 @@ -27,7 +27,7 @@ import javax.management.openmbean.CompositeData; import java.util.concurrent.locks.*; -import java.beans.ConstructorProperties; +import sun.management.LockInfoCompositeData; /** * Information about a lock. A lock can be a built-in object monitor, @@ -44,8 +44,7 @@ * *
+ *+ * + * @param cd {@code CompositeData} representing a {@code LockInfo} + * + * @throws IllegalArgumentException if {@code cd} does not + * represent a {@code LockInfo} with the attributes described + * above. + * @return a {@code LockInfo} object represented + * by {@code cd} if {@code cd} is not {@code null}; + * {@code null} otherwise. + * + * @since 1.8 + */ + public static LockInfo from(CompositeData cd) { + if (cd == null) { + return null; + } + + if (cd instanceof LockInfoCompositeData) { + return ((LockInfoCompositeData) cd).getLockInfo(); + } else { + return LockInfoCompositeData.toLockInfo(cd); + } + } + + /** * Returns a string representation of a lock. The returned * string representation consists of the name of the class of the * lock object, the at-sign character `@', and the unsigned diff -r 7e765d50416f -r 889df16bef60 jdk/src/share/classes/java/lang/management/ThreadInfo.java --- a/jdk/src/share/classes/java/lang/management/ThreadInfo.java Fri Sep 14 10:30:38 2012 -0400 +++ b/jdk/src/share/classes/java/lang/management/ThreadInfo.java Fri Sep 14 09:47:14 2012 -0700 @@ -696,9 +696,7 @@ *+ *
+ *+ * + *Attribute Name + *Type + *+ * + *className + *java.lang.String + *+ * + *identityHashCode + *java.lang.Integer + *
* If cd does not contain this attribute, * the LockInfo object will be constructed from @@ -766,10 +764,7 @@ *
* If cd does not contain this attribute, * this attribute will be set to an empty array.