aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang/management
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/management')
-rw-r--r--libjava/classpath/java/lang/management/ClassLoadingMXBean.java3
-rw-r--r--libjava/classpath/java/lang/management/CompilationMXBean.java2
-rw-r--r--libjava/classpath/java/lang/management/GarbageCollectorMXBean.java2
-rw-r--r--libjava/classpath/java/lang/management/ManagementFactory.java494
-rw-r--r--libjava/classpath/java/lang/management/ManagementPermission.java5
-rw-r--r--libjava/classpath/java/lang/management/MemoryMXBean.java6
-rw-r--r--libjava/classpath/java/lang/management/MemoryManagerMXBean.java4
-rw-r--r--libjava/classpath/java/lang/management/MemoryNotificationInfo.java13
-rw-r--r--libjava/classpath/java/lang/management/MemoryPoolMXBean.java6
-rw-r--r--libjava/classpath/java/lang/management/MemoryType.java1
-rw-r--r--libjava/classpath/java/lang/management/MemoryUsage.java35
-rw-r--r--libjava/classpath/java/lang/management/MonitorInfo.java26
-rw-r--r--libjava/classpath/java/lang/management/OperatingSystemMXBean.java2
-rw-r--r--libjava/classpath/java/lang/management/RuntimeMXBean.java24
-rw-r--r--libjava/classpath/java/lang/management/ThreadInfo.java268
-rw-r--r--libjava/classpath/java/lang/management/ThreadMXBean.java44
16 files changed, 465 insertions, 470 deletions
diff --git a/libjava/classpath/java/lang/management/ClassLoadingMXBean.java b/libjava/classpath/java/lang/management/ClassLoadingMXBean.java
index 2a8651b..491af24 100644
--- a/libjava/classpath/java/lang/management/ClassLoadingMXBean.java
+++ b/libjava/classpath/java/lang/management/ClassLoadingMXBean.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.lang.management;
/**
- * Provides access to information about the class loading
+ * Provides access to information about the class loading
* behaviour of the current invocation of the virtual
* machine. An instance of this bean is obtained by calling
* {@link ManagementFactory#getClassLoadingMXBean()}.
@@ -100,4 +100,3 @@ public interface ClassLoadingMXBean
void setVerbose(boolean verbose);
}
-
diff --git a/libjava/classpath/java/lang/management/CompilationMXBean.java b/libjava/classpath/java/lang/management/CompilationMXBean.java
index 7f666f2..36f69c4 100644
--- a/libjava/classpath/java/lang/management/CompilationMXBean.java
+++ b/libjava/classpath/java/lang/management/CompilationMXBean.java
@@ -50,7 +50,7 @@ package java.lang.management;
*/
public interface CompilationMXBean
{
-
+
/**
* Returns the name of the Just-In-Time (JIT) compiler.
*
diff --git a/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java b/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java
index 5bb0a18..f3da004 100644
--- a/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java
+++ b/libjava/classpath/java/lang/management/GarbageCollectorMXBean.java
@@ -70,7 +70,7 @@ public interface GarbageCollectorMXBean
* Note that the accumulated time may not change, even when the
* collection count increases, if the time taken is sufficiently
* short; this depends on the resolution of the timer used.
- *
+ *
* @return the accumulated number of milliseconds spent collecting,
* or -1 if this is undefined.
*/
diff --git a/libjava/classpath/java/lang/management/ManagementFactory.java b/libjava/classpath/java/lang/management/ManagementFactory.java
index 977b399..c054f5d 100644
--- a/libjava/classpath/java/lang/management/ManagementFactory.java
+++ b/libjava/classpath/java/lang/management/ManagementFactory.java
@@ -82,7 +82,7 @@ import javax.management.openmbean.TabularData;
/**
* <p>
* Provides access to the system's management beans via a series
- * of static methods.
+ * of static methods.
* </p>
* <p>
* An instance of a system management bean can be obtained by
@@ -251,16 +251,16 @@ public class ManagementFactory
public static OperatingSystemMXBean getOperatingSystemMXBean()
{
if (osBean == null)
- try
- {
- osBean = new OperatingSystemMXBeanImpl();
- }
+ try
+ {
+ osBean = new OperatingSystemMXBeanImpl();
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "operating system bean is not a " +
- "compliant management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "operating system bean is not a " +
+ "compliant management bean.");
+ }
return osBean;
}
@@ -275,15 +275,15 @@ public class ManagementFactory
{
if (runtimeBean == null)
try
- {
- runtimeBean = new RuntimeMXBeanImpl();
- }
+ {
+ runtimeBean = new RuntimeMXBeanImpl();
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "runtime bean is not a compliant " +
- "management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "runtime bean is not a compliant " +
+ "management bean.");
+ }
return runtimeBean;
}
@@ -298,15 +298,15 @@ public class ManagementFactory
{
if (classLoadingBean == null)
try
- {
- classLoadingBean = new ClassLoadingMXBeanImpl();
- }
+ {
+ classLoadingBean = new ClassLoadingMXBeanImpl();
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "class loading bean is not a " +
- "compliant management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "class loading bean is not a " +
+ "compliant management bean.");
+ }
return classLoadingBean;
}
@@ -321,15 +321,15 @@ public class ManagementFactory
{
if (threadBean == null)
try
- {
- threadBean = new ThreadMXBeanImpl();
- }
+ {
+ threadBean = new ThreadMXBeanImpl();
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "thread bean is not a compliant " +
- "management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "thread bean is not a compliant " +
+ "management bean.");
+ }
return threadBean;
}
@@ -344,15 +344,15 @@ public class ManagementFactory
{
if (memoryBean == null)
try
- {
- memoryBean = new MemoryMXBeanImpl();
- }
+ {
+ memoryBean = new MemoryMXBeanImpl();
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "memory bean is not a compliant " +
- "management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "memory bean is not a compliant " +
+ "management bean.");
+ }
return memoryBean;
}
@@ -369,17 +369,17 @@ public class ManagementFactory
public static CompilationMXBean getCompilationMXBean()
{
if (compilationBean == null &&
- SystemProperties.getProperty("gnu.java.compiler.name") != null)
+ SystemProperties.getProperty("gnu.java.compiler.name") != null)
try
- {
- compilationBean = new CompilationMXBeanImpl();
- }
+ {
+ compilationBean = new CompilationMXBeanImpl();
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "compilation bean is not a compliant " +
- "management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "compilation bean is not a compliant " +
+ "management bean.");
+ }
return compilationBean;
}
@@ -397,15 +397,15 @@ public class ManagementFactory
String[] names = VMManagementFactory.getMemoryPoolNames();
for (int a = 0; a < names.length; ++a)
try
- {
- poolBeans.add(new MemoryPoolMXBeanImpl(names[a]));
- }
+ {
+ poolBeans.add(new MemoryPoolMXBeanImpl(names[a]));
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "memory pool bean, " + a + ", is " +
- "not a compliant management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "memory pool bean, " + a + ", is " +
+ "not a compliant management bean.");
+ }
return poolBeans;
}
@@ -423,15 +423,15 @@ public class ManagementFactory
String[] names = VMManagementFactory.getMemoryManagerNames();
for (int a = 0; a < names.length; ++a)
try
- {
- managerBeans.add(new MemoryManagerMXBeanImpl(names[a]));
- }
+ {
+ managerBeans.add(new MemoryManagerMXBeanImpl(names[a]));
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "memory manager bean, " + a + ", is " +
- "not a compliant management bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "memory manager bean, " + a + ", is " +
+ "not a compliant management bean.");
+ }
managerBeans.addAll(getGarbageCollectorMXBeans());
return managerBeans;
}
@@ -450,16 +450,16 @@ public class ManagementFactory
String[] names = VMManagementFactory.getGarbageCollectorNames();
for (int a = 0; a < names.length; ++a)
try
- {
- gcBeans.add(new GarbageCollectorMXBeanImpl(names[a]));
- }
+ {
+ gcBeans.add(new GarbageCollectorMXBeanImpl(names[a]));
+ }
catch (NotCompliantMBeanException e)
- {
- throw new InternalError("The GNU implementation of the " +
- "garbage collector bean, " + a +
- ", is not a compliant management " +
- "bean.");
- }
+ {
+ throw new InternalError("The GNU implementation of the " +
+ "garbage collector bean, " + a +
+ ", is not a compliant management " +
+ "bean.");
+ }
return gcBeans;
}
@@ -490,77 +490,77 @@ public class ManagementFactory
{
if (platformServer == null)
{
- platformServer = MBeanServerFactory.createMBeanServer();
- try
- {
- platformServer.registerMBean(getOperatingSystemMXBean(),
- new ObjectName(OPERATING_SYSTEM_MXBEAN_NAME));
- platformServer.registerMBean(getRuntimeMXBean(),
- new ObjectName(RUNTIME_MXBEAN_NAME));
- platformServer.registerMBean(getClassLoadingMXBean(),
- new ObjectName(CLASS_LOADING_MXBEAN_NAME));
- platformServer.registerMBean(getThreadMXBean(),
- new ObjectName(THREAD_MXBEAN_NAME));
- platformServer.registerMBean(getMemoryMXBean(),
- new ObjectName(MEMORY_MXBEAN_NAME));
- CompilationMXBean compBean = getCompilationMXBean();
- if (compBean != null)
- platformServer.registerMBean(compBean,
- new ObjectName(COMPILATION_MXBEAN_NAME));
- Iterator beans = getMemoryPoolMXBeans().iterator();
- while (beans.hasNext())
- {
- MemoryPoolMXBean bean = (MemoryPoolMXBean) beans.next();
- platformServer.registerMBean(bean,
- new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE +
- ",name=" +
- bean.getName()));
- }
- beans = getMemoryManagerMXBeans().iterator();
- while (beans.hasNext())
- {
- MemoryManagerMXBean bean = (MemoryManagerMXBean) beans.next();
- platformServer.registerMBean(bean,
- new ObjectName(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE +
- ",name=" +
- bean.getName()));
- }
- beans = getGarbageCollectorMXBeans().iterator();
- while (beans.hasNext())
- {
- GarbageCollectorMXBean bean = (GarbageCollectorMXBean) beans.next();
- platformServer.registerMBean(bean,
- new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
- ",name=" +
- bean.getName()));
- }
- platformServer.registerMBean(LogManager.getLoggingMXBean(),
- new ObjectName(LogManager.LOGGING_MXBEAN_NAME));
- }
- catch (InstanceAlreadyExistsException e)
- {
- throw (Error)
- (new InternalError("One of the management beans is " +
- "already registered.").initCause(e));
- }
- catch (MBeanRegistrationException e)
- {
- throw (Error)
- (new InternalError("One of the management beans' preRegister " +
- "methods threw an exception.").initCause(e));
- }
- catch (NotCompliantMBeanException e)
- {
- throw (Error)
- (new InternalError("One of the management beans is " +
- "not compliant.").initCause(e));
- }
- catch (MalformedObjectNameException e)
- {
- throw (Error)
- (new InternalError("The object name of a management bean is " +
- "not compliant.").initCause(e));
- }
+ platformServer = MBeanServerFactory.createMBeanServer();
+ try
+ {
+ platformServer.registerMBean(getOperatingSystemMXBean(),
+ new ObjectName(OPERATING_SYSTEM_MXBEAN_NAME));
+ platformServer.registerMBean(getRuntimeMXBean(),
+ new ObjectName(RUNTIME_MXBEAN_NAME));
+ platformServer.registerMBean(getClassLoadingMXBean(),
+ new ObjectName(CLASS_LOADING_MXBEAN_NAME));
+ platformServer.registerMBean(getThreadMXBean(),
+ new ObjectName(THREAD_MXBEAN_NAME));
+ platformServer.registerMBean(getMemoryMXBean(),
+ new ObjectName(MEMORY_MXBEAN_NAME));
+ CompilationMXBean compBean = getCompilationMXBean();
+ if (compBean != null)
+ platformServer.registerMBean(compBean,
+ new ObjectName(COMPILATION_MXBEAN_NAME));
+ Iterator beans = getMemoryPoolMXBeans().iterator();
+ while (beans.hasNext())
+ {
+ MemoryPoolMXBean bean = (MemoryPoolMXBean) beans.next();
+ platformServer.registerMBean(bean,
+ new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE +
+ ",name=" +
+ bean.getName()));
+ }
+ beans = getMemoryManagerMXBeans().iterator();
+ while (beans.hasNext())
+ {
+ MemoryManagerMXBean bean = (MemoryManagerMXBean) beans.next();
+ platformServer.registerMBean(bean,
+ new ObjectName(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE +
+ ",name=" +
+ bean.getName()));
+ }
+ beans = getGarbageCollectorMXBeans().iterator();
+ while (beans.hasNext())
+ {
+ GarbageCollectorMXBean bean = (GarbageCollectorMXBean) beans.next();
+ platformServer.registerMBean(bean,
+ new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
+ ",name=" +
+ bean.getName()));
+ }
+ platformServer.registerMBean(LogManager.getLoggingMXBean(),
+ new ObjectName(LogManager.LOGGING_MXBEAN_NAME));
+ }
+ catch (InstanceAlreadyExistsException e)
+ {
+ throw (Error)
+ (new InternalError("One of the management beans is " +
+ "already registered.").initCause(e));
+ }
+ catch (MBeanRegistrationException e)
+ {
+ throw (Error)
+ (new InternalError("One of the management beans' preRegister " +
+ "methods threw an exception.").initCause(e));
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw (Error)
+ (new InternalError("One of the management beans is " +
+ "not compliant.").initCause(e));
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw (Error)
+ (new InternalError("The object name of a management bean is " +
+ "not compliant.").initCause(e));
+ }
}
return platformServer;
}
@@ -600,51 +600,51 @@ public class ManagementFactory
* @throws IOException if the connection throws one.
*/
public static <T> T newPlatformMXBeanProxy(MBeanServerConnection connection,
- String mxbeanName,
- Class<T> mxbeanInterface)
+ String mxbeanName,
+ Class<T> mxbeanInterface)
throws IOException
{
if (!(mxbeanName.equals(CLASS_LOADING_MXBEAN_NAME) ||
- mxbeanName.equals(COMPILATION_MXBEAN_NAME) ||
- mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) ||
- mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) ||
- mxbeanName.equals(MEMORY_MXBEAN_NAME) ||
- mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) ||
- mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) ||
- mxbeanName.equals(RUNTIME_MXBEAN_NAME) ||
- mxbeanName.equals(THREAD_MXBEAN_NAME)))
+ mxbeanName.equals(COMPILATION_MXBEAN_NAME) ||
+ mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) ||
+ mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) ||
+ mxbeanName.equals(MEMORY_MXBEAN_NAME) ||
+ mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) ||
+ mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) ||
+ mxbeanName.equals(RUNTIME_MXBEAN_NAME) ||
+ mxbeanName.equals(THREAD_MXBEAN_NAME)))
{
- throw new IllegalArgumentException("The named bean, " + mxbeanName +
- ", is not a platform name.");
+ throw new IllegalArgumentException("The named bean, " + mxbeanName +
+ ", is not a platform name.");
}
if ((mxbeanName.equals(CLASS_LOADING_MXBEAN_NAME) &&
- mxbeanInterface != ClassLoadingMXBean.class) ||
- (mxbeanName.equals(COMPILATION_MXBEAN_NAME) &&
- mxbeanInterface != CompilationMXBean.class) ||
- (mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) &&
- mxbeanInterface != GarbageCollectorMXBean.class) ||
- (mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) &&
- mxbeanInterface != MemoryManagerMXBean.class) ||
- (mxbeanName.equals(MEMORY_MXBEAN_NAME) &&
- mxbeanInterface != MemoryMXBean.class) ||
- (mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) &&
- mxbeanInterface != MemoryPoolMXBean.class) ||
- (mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) &&
- mxbeanInterface != OperatingSystemMXBean.class) ||
- (mxbeanName.equals(RUNTIME_MXBEAN_NAME) &&
- mxbeanInterface != RuntimeMXBean.class) ||
- (mxbeanName.equals(THREAD_MXBEAN_NAME) &&
- mxbeanInterface != ThreadMXBean.class))
+ mxbeanInterface != ClassLoadingMXBean.class) ||
+ (mxbeanName.equals(COMPILATION_MXBEAN_NAME) &&
+ mxbeanInterface != CompilationMXBean.class) ||
+ (mxbeanName.startsWith(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE) &&
+ mxbeanInterface != GarbageCollectorMXBean.class) ||
+ (mxbeanName.startsWith(MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE) &&
+ mxbeanInterface != MemoryManagerMXBean.class) ||
+ (mxbeanName.equals(MEMORY_MXBEAN_NAME) &&
+ mxbeanInterface != MemoryMXBean.class) ||
+ (mxbeanName.startsWith(MEMORY_POOL_MXBEAN_DOMAIN_TYPE) &&
+ mxbeanInterface != MemoryPoolMXBean.class) ||
+ (mxbeanName.equals(OPERATING_SYSTEM_MXBEAN_NAME) &&
+ mxbeanInterface != OperatingSystemMXBean.class) ||
+ (mxbeanName.equals(RUNTIME_MXBEAN_NAME) &&
+ mxbeanInterface != RuntimeMXBean.class) ||
+ (mxbeanName.equals(THREAD_MXBEAN_NAME) &&
+ mxbeanInterface != ThreadMXBean.class))
throw new IllegalArgumentException("The interface, " + mxbeanInterface +
- ", does not match the bean, " + mxbeanName);
+ ", does not match the bean, " + mxbeanName);
ObjectName bean;
try
{
- bean = new ObjectName(mxbeanName);
+ bean = new ObjectName(mxbeanName);
}
catch (MalformedObjectNameException e)
{
- throw new IllegalArgumentException("The named bean is invalid.");
+ throw new IllegalArgumentException("The named bean is invalid.");
}
if (!(connection.isRegistered(bean)))
throw new IllegalArgumentException("The bean is not registered on this connection.");
@@ -654,8 +654,8 @@ public class ManagementFactory
else
interfaces = new Class[] { mxbeanInterface };
return (T) Proxy.newProxyInstance(mxbeanInterface.getClassLoader(),
- interfaces,
- new ManagementInvocationHandler(connection, bean));
+ interfaces,
+ new ManagementInvocationHandler(connection, bean));
}
/**
@@ -688,7 +688,7 @@ public class ManagementFactory
* @param bean the bean to proxy.
*/
public ManagementInvocationHandler(MBeanServerConnection conn,
- ObjectName bean)
+ ObjectName bean)
throws IOException
{
this.conn = conn;
@@ -715,46 +715,46 @@ public class ManagementFactory
{
String name = method.getName();
if (name.equals("toString"))
- return "Proxy for " + bean + " using " + conn;
+ return "Proxy for " + bean + " using " + conn;
if (name.equals("addNotificationListener"))
- {
- conn.addNotificationListener(bean,
- (NotificationListener) args[0],
- (NotificationFilter) args[1],
- args[2]);
- return null;
- }
+ {
+ conn.addNotificationListener(bean,
+ (NotificationListener) args[0],
+ (NotificationFilter) args[1],
+ args[2]);
+ return null;
+ }
if (name.equals("getNotificationInfo"))
- return conn.getMBeanInfo(bean).getNotifications();
+ return conn.getMBeanInfo(bean).getNotifications();
if (name.equals("removeNotificationListener"))
- {
- if (args.length == 1)
- conn.removeNotificationListener(bean,
- (NotificationListener)
- args[0]);
- else
- conn.removeNotificationListener(bean,
- (NotificationListener)
- args[0],
- (NotificationFilter)
- args[1], args[2]);
- return null;
- }
+ {
+ if (args.length == 1)
+ conn.removeNotificationListener(bean,
+ (NotificationListener)
+ args[0]);
+ else
+ conn.removeNotificationListener(bean,
+ (NotificationListener)
+ args[0],
+ (NotificationFilter)
+ args[1], args[2]);
+ return null;
+ }
String attrib = null;
if (name.startsWith("get"))
- attrib = name.substring(3);
+ attrib = name.substring(3);
else if (name.startsWith("is"))
- attrib = name.substring(2);
+ attrib = name.substring(2);
if (attrib != null)
- return translate(conn.getAttribute(bean, attrib), method);
+ return translate(conn.getAttribute(bean, attrib), method);
else if (name.startsWith("set"))
- {
- conn.setAttribute(bean, new Attribute(name.substring(3),
- args[0]));
- return null;
- }
+ {
+ conn.setAttribute(bean, new Attribute(name.substring(3),
+ args[0]));
+ return null;
+ }
else
- return translate(conn.invoke(bean, name, args, null), method);
+ return translate(conn.invoke(bean, name, args, null), method);
}
/**
@@ -772,44 +772,44 @@ public class ManagementFactory
{
Class<?> returnType = method.getReturnType();
if (returnType.isEnum())
- {
- String ename = (String) otype;
- Enum[] constants = (Enum[]) returnType.getEnumConstants();
- for (Enum c : constants)
- if (c.name().equals(ename))
- return c;
- }
+ {
+ String ename = (String) otype;
+ Enum[] constants = (Enum[]) returnType.getEnumConstants();
+ for (Enum c : constants)
+ if (c.name().equals(ename))
+ return c;
+ }
if (List.class.isAssignableFrom(returnType))
- {
- Object[] elems = (Object[]) otype;
- List l = new ArrayList(elems.length);
- for (Object elem : elems)
- l.add(elem);
- return l;
- }
+ {
+ Object[] elems = (Object[]) otype;
+ List l = new ArrayList(elems.length);
+ for (Object elem : elems)
+ l.add(elem);
+ return l;
+ }
if (Map.class.isAssignableFrom(returnType))
- {
- TabularData data = (TabularData) otype;
- Map m = new HashMap(data.size());
- for (Object val : data.values())
- {
- CompositeData vals = (CompositeData) val;
- m.put(vals.get("key"), vals.get("value"));
- }
- return m;
- }
+ {
+ TabularData data = (TabularData) otype;
+ Map m = new HashMap(data.size());
+ for (Object val : data.values())
+ {
+ CompositeData vals = (CompositeData) val;
+ m.put(vals.get("key"), vals.get("value"));
+ }
+ return m;
+ }
try
- {
- Method m = returnType.getMethod("from",
- new Class[]
- { CompositeData.class });
- return m.invoke(null, (CompositeData) otype);
- }
+ {
+ Method m = returnType.getMethod("from",
+ new Class[]
+ { CompositeData.class });
+ return m.invoke(null, (CompositeData) otype);
+ }
catch (NoSuchMethodException e)
- {
- /* Ignored; we expect this if this
- isn't a from(CompositeData) class */
- }
+ {
+ /* Ignored; we expect this if this
+ isn't a from(CompositeData) class */
+ }
return otype;
}
diff --git a/libjava/classpath/java/lang/management/ManagementPermission.java b/libjava/classpath/java/lang/management/ManagementPermission.java
index 0e6bd06..7379457 100644
--- a/libjava/classpath/java/lang/management/ManagementPermission.java
+++ b/libjava/classpath/java/lang/management/ManagementPermission.java
@@ -71,7 +71,7 @@ import java.security.BasicPermission;
* usage limits changed. Malicious code could use
* this to alter the behaviour of the system.</li>
* </ul>
- *
+ *
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.5
*/
@@ -127,6 +127,5 @@ public final class ManagementPermission
if (!(actions == null || actions.equals("")))
throw new IllegalArgumentException("Invalid actions.");
}
-
-}
+}
diff --git a/libjava/classpath/java/lang/management/MemoryMXBean.java b/libjava/classpath/java/lang/management/MemoryMXBean.java
index 4d9e5ff..acf0e67 100644
--- a/libjava/classpath/java/lang/management/MemoryMXBean.java
+++ b/libjava/classpath/java/lang/management/MemoryMXBean.java
@@ -39,7 +39,7 @@ package java.lang.management;
/**
* <p>
- * Provides access to information about the memory used
+ * Provides access to information about the memory used
* by the virtual machine. An instance of this bean is
* obtained by calling
* {@link ManagementFactory#getMemoryMXBean()}.
@@ -104,7 +104,7 @@ package java.lang.management;
*/
public interface MemoryMXBean
{
-
+
/**
* Instigates a garbage collection cycle. The virtual
* machine's garbage collector should make the best
@@ -135,7 +135,7 @@ public interface MemoryMXBean
* memory.
*/
MemoryUsage getNonHeapMemoryUsage();
-
+
/**
* Returns the number of objects which are waiting to
* be garbage collected (finalized). An object is
diff --git a/libjava/classpath/java/lang/management/MemoryManagerMXBean.java b/libjava/classpath/java/lang/management/MemoryManagerMXBean.java
index 9210705..1b10e99 100644
--- a/libjava/classpath/java/lang/management/MemoryManagerMXBean.java
+++ b/libjava/classpath/java/lang/management/MemoryManagerMXBean.java
@@ -49,10 +49,10 @@ package java.lang.management;
public interface MemoryManagerMXBean
{
- /**
+ /**
* Returns an array containing the names of the memory pools
* this memory manager manages.
- *
+ *
* @return an array containing the name of each memory pool
* this manager is responsible for.
*/
diff --git a/libjava/classpath/java/lang/management/MemoryNotificationInfo.java b/libjava/classpath/java/lang/management/MemoryNotificationInfo.java
index adb38b0..85856e0 100644
--- a/libjava/classpath/java/lang/management/MemoryNotificationInfo.java
+++ b/libjava/classpath/java/lang/management/MemoryNotificationInfo.java
@@ -74,7 +74,7 @@ import javax.management.openmbean.SimpleType;
* {@link #from(javax.management.openmbean.CompositeData)} method may be
* used to unwrap the value and obtain an instance of this class.
* </p>
- *
+ *
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.5
*/
@@ -87,7 +87,7 @@ public class MemoryNotificationInfo
* threshold again before another notification is emitted. The value is
* <code>java.management.memory.threshold.exceeded</code>.
*/
- public static final String MEMORY_THRESHOLD_EXCEEDED =
+ public static final String MEMORY_THRESHOLD_EXCEEDED =
"java.management.memory.threshold.exceeded";
/**
@@ -153,9 +153,9 @@ public class MemoryNotificationInfo
* <tr><td>committed</td><td>java.lang.Long</td></tr>
* <tr><td>max</td><td>java.lang.Long</td></tr>
* </table>
- *
+ *
* @param data the composite data structure to take values from.
- * @return a new instance containing the values from the
+ * @return a new instance containing the values from the
* composite data structure, or <code>null</code>
* if the data structure was also <code>null</code>.
* @throws IllegalArgumentException if the composite data structure
@@ -172,8 +172,8 @@ public class MemoryNotificationInfo
ThreadInfo.checkAttribute(type, "count", SimpleType.LONG);
MemoryUsage usage = MemoryUsage.from((CompositeData) data.get("usage"));
return new MemoryNotificationInfo(((String) data.get("poolName")),
- usage,
- ((Long) data.get("count")).longValue());
+ usage,
+ ((Long) data.get("count")).longValue());
}
/**
@@ -212,4 +212,3 @@ public class MemoryNotificationInfo
}
}
-
diff --git a/libjava/classpath/java/lang/management/MemoryPoolMXBean.java b/libjava/classpath/java/lang/management/MemoryPoolMXBean.java
index 36a8236..9729093 100644
--- a/libjava/classpath/java/lang/management/MemoryPoolMXBean.java
+++ b/libjava/classpath/java/lang/management/MemoryPoolMXBean.java
@@ -209,7 +209,7 @@ public interface MemoryPoolMXBean
long getUsageThresholdCount();
/**
- * Returns true if the collection usage level is equal to
+ * Returns true if the collection usage level is equal to
* or greater than the collection usage threshold.
*
* @return true if the collection usage threshold has been
@@ -236,7 +236,7 @@ public interface MemoryPoolMXBean
boolean isCollectionUsageThresholdSupported();
/**
- * Returns true if the usage level is equal to
+ * Returns true if the usage level is equal to
* or greater than the usage threshold.
*
* @return true if the usage threshold has been
@@ -260,7 +260,7 @@ public interface MemoryPoolMXBean
* @see #setUsageThreshold(long)
*/
boolean isUsageThresholdSupported();
-
+
/**
* Returns true if this memory pool is still valid. A memory pool
* becomes invalid when it is removed by the virtual machine and
diff --git a/libjava/classpath/java/lang/management/MemoryType.java b/libjava/classpath/java/lang/management/MemoryType.java
index 4422b32..c864d54 100644
--- a/libjava/classpath/java/lang/management/MemoryType.java
+++ b/libjava/classpath/java/lang/management/MemoryType.java
@@ -48,4 +48,3 @@ public enum MemoryType
{
HEAP, NON_HEAP;
}
-
diff --git a/libjava/classpath/java/lang/management/MemoryUsage.java b/libjava/classpath/java/lang/management/MemoryUsage.java
index d851da9..42aef3c 100644
--- a/libjava/classpath/java/lang/management/MemoryUsage.java
+++ b/libjava/classpath/java/lang/management/MemoryUsage.java
@@ -119,29 +119,29 @@ public class MemoryUsage
* above.
*/
public MemoryUsage(long init, long used, long committed,
- long maximum)
+ long maximum)
{
if (init < -1)
throw new IllegalArgumentException("Initial value of "
- + init + " is too small.");
+ + init + " is too small.");
if (used < 0)
throw new IllegalArgumentException("Used value of "
- + used + " is too small.");
+ + used + " is too small.");
if (committed < 0)
throw new IllegalArgumentException("Committed value of "
- + committed + " is too small.");
+ + committed + " is too small.");
if (committed < used)
throw new IllegalArgumentException("Committed value of "
- + committed + " is below "
- + used + ", the amount used.");
+ + committed + " is below "
+ + used + ", the amount used.");
if (maximum < -1)
throw new IllegalArgumentException("Maximum value of "
- + maximum + " is too small.");
+ + maximum + " is too small.");
if (maximum != -1 && maximum < committed)
- throw new IllegalArgumentException("Maximum value of "
- + maximum + " is below "
- + committed + ", the amount "
- + "committed.");
+ throw new IllegalArgumentException("Maximum value of "
+ + maximum + " is below "
+ + committed + ", the amount "
+ + "committed.");
this.init = init;
this.used = used;
this.committed = committed;
@@ -165,9 +165,9 @@ public class MemoryUsage
* <p>
* All should have the type, <code>java.lang.Long</code>.
* </p>
- *
+ *
* @param data the composite data structure to take values from.
- * @return a new instance containing the values from the
+ * @return a new instance containing the values from the
* composite data structure, or <code>null</code>
* if the data structure was also <code>null</code>.
* @throws IllegalArgumentException if the composite data structure
@@ -185,9 +185,9 @@ public class MemoryUsage
ThreadInfo.checkAttribute(type, "Committed", SimpleType.LONG);
ThreadInfo.checkAttribute(type, "Max", SimpleType.LONG);
return new MemoryUsage(((Long) data.get("Init")).longValue(),
- ((Long) data.get("Used")).longValue(),
- ((Long) data.get("Committed")).longValue(),
- ((Long) data.get("Max")).longValue());
+ ((Long) data.get("Used")).longValue(),
+ ((Long) data.get("Committed")).longValue(),
+ ((Long) data.get("Max")).longValue());
}
/**
@@ -217,7 +217,7 @@ public class MemoryUsage
/**
* Returns the maximum amount of memory available for this
- * pool (in bytes). This amount is not guaranteed to
+ * pool (in bytes). This amount is not guaranteed to
* actually be usable. This method may return -1, if the
* value is undefined.
*
@@ -262,4 +262,3 @@ public class MemoryUsage
}
}
-
diff --git a/libjava/classpath/java/lang/management/MonitorInfo.java b/libjava/classpath/java/lang/management/MonitorInfo.java
index cba73a8..fd72337 100644
--- a/libjava/classpath/java/lang/management/MonitorInfo.java
+++ b/libjava/classpath/java/lang/management/MonitorInfo.java
@@ -82,16 +82,16 @@ public class MonitorInfo
* &lt; 0.
*/
public MonitorInfo(String className, int identityHashCode, int stackDepth,
- StackTraceElement stackFrame)
+ StackTraceElement stackFrame)
{
super(className, identityHashCode);
if (stackFrame == null && stackDepth >= 0)
throw new IllegalArgumentException("The stack frame is null, but the " +
- "stack depth is greater than or equal " +
- "to zero.");
+ "stack depth is greater than or equal " +
+ "to zero.");
if (stackFrame != null && stackDepth < 0)
throw new IllegalArgumentException("The stack frame is not null, but the " +
- "stack depth is less than zero.");
+ "stack depth is less than zero.");
this.stackDepth = stackDepth;
this.stackFrame = stackFrame;
}
@@ -123,9 +123,9 @@ public class MonitorInfo
* <tr><td>lineNumber</td><td>java.lang.Integer</td></tr>
* <tr><td>nativeMethod</td><td>java.lang.Boolean</td></tr>
* </table>
- *
+ *
* @param data the composite data structure to take values from.
- * @return a new instance containing the values from the
+ * @return a new instance containing the values from the
* composite data structure, or <code>null</code>
* if the data structure was also <code>null</code>.
* @throws IllegalArgumentException if the composite data structure
@@ -141,15 +141,15 @@ public class MonitorInfo
ThreadInfo.checkAttribute(type, "IdentityHashCode", SimpleType.INTEGER);
ThreadInfo.checkAttribute(type, "LockedStackDepth", SimpleType.INTEGER);
ThreadInfo.checkAttribute(type, "LockedStackFrame",
- ThreadInfo.getStackTraceType());
+ ThreadInfo.getStackTraceType());
CompositeData frame = (CompositeData) data.get("LockedStackFrame");
return new MonitorInfo((String) data.get("ClassName"),
- (Integer) data.get("IdentityHashCode"),
- (Integer) data.get("LockedStackDepth"),
- new StackTraceElement((String) frame.get("ClassName"),
- (String) frame.get("MethodName"),
- (String) frame.get("FileName"),
- (Integer) frame.get("LineNumber")));
+ (Integer) data.get("IdentityHashCode"),
+ (Integer) data.get("LockedStackDepth"),
+ new StackTraceElement((String) frame.get("ClassName"),
+ (String) frame.get("MethodName"),
+ (String) frame.get("FileName"),
+ (Integer) frame.get("LineNumber")));
}
/**
diff --git a/libjava/classpath/java/lang/management/OperatingSystemMXBean.java b/libjava/classpath/java/lang/management/OperatingSystemMXBean.java
index ed38285..dcc963e 100644
--- a/libjava/classpath/java/lang/management/OperatingSystemMXBean.java
+++ b/libjava/classpath/java/lang/management/OperatingSystemMXBean.java
@@ -89,7 +89,7 @@ public interface OperatingSystemMXBean
/**
* Returns the system load average for the last minute, or -1
* if this is unavailable. The availability and calculation
- * of the load average is system-dependent, but is usually
+ * of the load average is system-dependent, but is usually
* a damped time-dependent average obtained by monitoring the
* number of queued and running processes. It is expected
* that this method will be called frequently to monitor the
diff --git a/libjava/classpath/java/lang/management/RuntimeMXBean.java b/libjava/classpath/java/lang/management/RuntimeMXBean.java
index a2931d1..1e2aa01 100644
--- a/libjava/classpath/java/lang/management/RuntimeMXBean.java
+++ b/libjava/classpath/java/lang/management/RuntimeMXBean.java
@@ -56,7 +56,7 @@ public interface RuntimeMXBean
* Returns the boot classpath used by the virtual machine. This
* value follows the standard path syntax used by the underlying
* operating system (e.g. directories separated by ':' on UNIX
- * or ';' on Windows).
+ * or ';' on Windows).
* </p>
* <p>
* Supplying this value is optional. Users should check the
@@ -81,7 +81,7 @@ public interface RuntimeMXBean
* property via {@link System#getProperty(String)}. This value
* follows the standard path syntax used by the underlying operating
* system (e.g. directories separated by ':' on UNIX or ';' on
- * Windows).
+ * Windows).
*
* @return the classpath used by the system class loader.
* @throws SecurityException if a security manager exists which
@@ -114,7 +114,7 @@ public interface RuntimeMXBean
* {@link System#getProperty(String)}. This value follows the
* standard path syntax used by the underlying operating
* system (e.g. directories separated by ':' on UNIX or ';' on
- * Windows).
+ * Windows).
*
* @return the library path.
* @throws SecurityException if a security manager exists which
@@ -142,7 +142,7 @@ public interface RuntimeMXBean
* same virtual machine (for example, it might include
* the process identifier or the host name of the machine
* on which it is running). The intention is that this
- * name refers to the precise entity that the other data
+ * name refers to the precise entity that the other data
* supplied by this bean refers to, rather than the VM
* in general.
*
@@ -154,7 +154,7 @@ public interface RuntimeMXBean
* Returns the specification name of the virtual machine.
* This is equivalent to obtaining the
* <code>java.vm.specification.name</code> property via
- * {@link System#getProperty(String)}.
+ * {@link System#getProperty(String)}.
*
* @return the specification name of the VM.
* @throws SecurityException if a security manager exists which
@@ -169,7 +169,7 @@ public interface RuntimeMXBean
* Returns the specification vendor of the virtual machine.
* This is equivalent to obtaining the
* <code>java.vm.specification.vendor</code> property via
- * {@link System#getProperty(String)}.
+ * {@link System#getProperty(String)}.
*
* @return the specification vendor of the VM.
* @throws SecurityException if a security manager exists which
@@ -184,7 +184,7 @@ public interface RuntimeMXBean
* Returns the specification version of the virtual machine.
* This is equivalent to obtaining the
* <code>java.vm.specification.version</code> property via
- * {@link System#getProperty(String)}.
+ * {@link System#getProperty(String)}.
*
* @return the specification version of the VM.
* @throws SecurityException if a security manager exists which
@@ -198,7 +198,7 @@ public interface RuntimeMXBean
/**
* Returns the approximate start time of the virtual machine
* in milliseconds.
- *
+ *
* @return the start time of the virtual machine.
*/
long getStartTime();
@@ -216,7 +216,7 @@ public interface RuntimeMXBean
/**
* Returns the uptime of the virtual machine in milliseconds.
- *
+ *
* @return the uptime of the virtual machine.
*/
long getUptime();
@@ -225,7 +225,7 @@ public interface RuntimeMXBean
* Returns the implementation name of the virtual machine.
* This is equivalent to obtaining the
* <code>java.vm.name</code> property via
- * {@link System#getProperty(String)}.
+ * {@link System#getProperty(String)}.
*
* @return the implementation name of the VM.
* @throws SecurityException if a security manager exists which
@@ -240,7 +240,7 @@ public interface RuntimeMXBean
* Returns the implementation vendor of the virtual machine.
* This is equivalent to obtaining the
* <code>java.vm.vendor</code> property via
- * {@link System#getProperty(String)}.
+ * {@link System#getProperty(String)}.
*
* @return the implementation vendor of the VM.
* @throws SecurityException if a security manager exists which
@@ -255,7 +255,7 @@ public interface RuntimeMXBean
* Returns the implementation version of the virtual machine.
* This is equivalent to obtaining the
* <code>java.vm.version</code> property via
- * {@link System#getProperty(String)}.
+ * {@link System#getProperty(String)}.
*
* @return the implementation version of the VM.
* @throws SecurityException if a security manager exists which
diff --git a/libjava/classpath/java/lang/management/ThreadInfo.java b/libjava/classpath/java/lang/management/ThreadInfo.java
index 5b8856d..a4ecc76 100644
--- a/libjava/classpath/java/lang/management/ThreadInfo.java
+++ b/libjava/classpath/java/lang/management/ThreadInfo.java
@@ -211,7 +211,7 @@ public class ThreadInfo
* lock, or <code>-1</code> if it doesn't have an owner
* (only used if blocked)
* @param lockOwnerName the name of the thread which owns the monitor
- * lock, or <code>null</code> if it doesn't have an
+ * lock, or <code>null</code> if it doesn't have an
* owner (only used if blocked)
* @param waitedCount the number of times the thread has been in a
* waiting state.
@@ -227,16 +227,16 @@ public class ThreadInfo
* by the thread.
* @param lockedSynchronizers an array of {@link LockInfo} objects
* representing locks held on ownable
- * synchronizers by the thread.
+ * synchronizers by the thread.
*
* @since 1.6
*/
private ThreadInfo(long threadId, String threadName, Thread.State threadState,
- long blockedCount, long blockedTime, String lockName,
- long lockOwnerId, String lockOwnerName, long waitedCount,
- long waitedTime, boolean isInNative, boolean isSuspended,
- StackTraceElement[] trace, MonitorInfo[] lockedMonitors,
- LockInfo[] lockedSynchronizers)
+ long blockedCount, long blockedTime, String lockName,
+ long lockOwnerId, String lockOwnerName, long waitedCount,
+ long waitedTime, boolean isInNative, boolean isSuspended,
+ StackTraceElement[] trace, MonitorInfo[] lockedMonitors,
+ LockInfo[] lockedSynchronizers)
{
this.threadId = threadId;
this.threadName = threadName;
@@ -266,16 +266,16 @@ public class ThreadInfo
* or of the wrong type.
*/
static void checkAttribute(CompositeType ctype, String name,
- OpenType type)
+ OpenType type)
throws IllegalArgumentException
{
OpenType foundType = ctype.getType(name);
if (foundType == null)
throw new IllegalArgumentException("Could not find a field named " +
- name);
+ name);
if (!(foundType.equals(type)))
throw new IllegalArgumentException("Field " + name + " is not of " +
- "type " + type.getClassName());
+ "type " + type.getClassName());
}
/**
@@ -288,31 +288,31 @@ public class ThreadInfo
{
if (seType == null)
try
- {
- seType = new CompositeType(StackTraceElement.class.getName(),
- "An element of a stack trace",
- new String[] { "className", "methodName",
- "fileName", "lineNumber",
- "nativeMethod"
- },
- new String[] { "Name of the class",
- "Name of the method",
- "Name of the source code file",
- "Line number",
- "True if this is a native method"
- },
- new OpenType[] {
- SimpleType.STRING, SimpleType.STRING,
- SimpleType.STRING, SimpleType.INTEGER,
- SimpleType.BOOLEAN
- });
- }
+ {
+ seType = new CompositeType(StackTraceElement.class.getName(),
+ "An element of a stack trace",
+ new String[] { "className", "methodName",
+ "fileName", "lineNumber",
+ "nativeMethod"
+ },
+ new String[] { "Name of the class",
+ "Name of the method",
+ "Name of the source code file",
+ "Line number",
+ "True if this is a native method"
+ },
+ new OpenType[] {
+ SimpleType.STRING, SimpleType.STRING,
+ SimpleType.STRING, SimpleType.INTEGER,
+ SimpleType.BOOLEAN
+ });
+ }
catch (OpenDataException e)
- {
- throw new IllegalStateException("Something went wrong in creating " +
- "the composite data type for the " +
- "stack trace element.", e);
- }
+ {
+ throw new IllegalStateException("Something went wrong in creating " +
+ "the composite data type for the " +
+ "stack trace element.", e);
+ }
return seType;
}
@@ -352,9 +352,9 @@ public class ThreadInfo
* <tr><td>lineNumber</td><td>java.lang.Integer</td></tr>
* <tr><td>nativeMethod</td><td>java.lang.Boolean</td></tr>
* </table>
- *
+ *
* @param data the composite data structure to take values from.
- * @return a new instance containing the values from the
+ * @return a new instance containing the values from the
* composite data structure, or <code>null</code>
* if the data structure was also <code>null</code>.
* @throws IllegalArgumentException if the composite data structure
@@ -380,119 +380,119 @@ public class ThreadInfo
checkAttribute(type, "LockOwnerName", SimpleType.STRING);
try
{
- checkAttribute(type, "StackTrace",
- new ArrayType(1, getStackTraceType()));
+ checkAttribute(type, "StackTrace",
+ new ArrayType(1, getStackTraceType()));
}
catch (OpenDataException e)
{
- throw new IllegalStateException("Something went wrong in creating " +
- "the array for the stack trace element.",
- e);
+ throw new IllegalStateException("Something went wrong in creating " +
+ "the array for the stack trace element.",
+ e);
}
OpenType foundType = type.getType("LockedMonitors");
if (foundType != null)
try
- {
- CompositeType mType = new CompositeType(MonitorInfo.class.getName(),
- "Information on a object monitor lock",
- new String[] { "ClassName",
- "IdentityHashCode",
- "LockedStackDepth",
- "LockedStackFrame"
- },
- new String[] { "Name of the class",
- "Identity hash code " +
- "of the class",
- "Stack depth at time " +
- "of lock",
- "Stack frame at time " +
- "of lock",
- },
- new OpenType[] {
- SimpleType.STRING, SimpleType.INTEGER,
- SimpleType.INTEGER, getStackTraceType()
- });
- if (!(foundType.equals(new ArrayType(1, mType))))
- throw new IllegalArgumentException("Field LockedMonitors is not of " +
- "type " + mType.getClassName());
- }
+ {
+ CompositeType mType = new CompositeType(MonitorInfo.class.getName(),
+ "Information on a object monitor lock",
+ new String[] { "ClassName",
+ "IdentityHashCode",
+ "LockedStackDepth",
+ "LockedStackFrame"
+ },
+ new String[] { "Name of the class",
+ "Identity hash code " +
+ "of the class",
+ "Stack depth at time " +
+ "of lock",
+ "Stack frame at time " +
+ "of lock",
+ },
+ new OpenType[] {
+ SimpleType.STRING, SimpleType.INTEGER,
+ SimpleType.INTEGER, getStackTraceType()
+ });
+ if (!(foundType.equals(new ArrayType(1, mType))))
+ throw new IllegalArgumentException("Field LockedMonitors is not of " +
+ "type " + mType.getClassName());
+ }
catch (OpenDataException e)
{
- throw new IllegalStateException("Something went wrong in creating " +
- "the composite data type for the " +
- "object monitor information array.", e);
+ throw new IllegalStateException("Something went wrong in creating " +
+ "the composite data type for the " +
+ "object monitor information array.", e);
}
foundType = type.getType("LockedSynchronizers");
if (foundType != null)
try
- {
- CompositeType lType = new CompositeType(LockInfo.class.getName(),
- "Information on a lock",
- new String[] { "ClassName",
- "IdentityHashCode"
- },
- new String[] { "Name of the class",
- "Identity hash code " +
- "of the class"
- },
- new OpenType[] {
- SimpleType.STRING, SimpleType.INTEGER
- });
- if (!(foundType.equals(new ArrayType(1, lType))))
- throw new IllegalArgumentException("Field LockedSynchronizers is not of " +
- "type " + lType.getClassName());
- }
+ {
+ CompositeType lType = new CompositeType(LockInfo.class.getName(),
+ "Information on a lock",
+ new String[] { "ClassName",
+ "IdentityHashCode"
+ },
+ new String[] { "Name of the class",
+ "Identity hash code " +
+ "of the class"
+ },
+ new OpenType[] {
+ SimpleType.STRING, SimpleType.INTEGER
+ });
+ if (!(foundType.equals(new ArrayType(1, lType))))
+ throw new IllegalArgumentException("Field LockedSynchronizers is not of " +
+ "type " + lType.getClassName());
+ }
catch (OpenDataException e)
{
- throw new IllegalStateException("Something went wrong in creating " +
- "the composite data type for the " +
- "ownable synchronizerinformation array.", e);
+ throw new IllegalStateException("Something went wrong in creating " +
+ "the composite data type for the " +
+ "ownable synchronizerinformation array.", e);
}
CompositeData[] dTraces = (CompositeData[]) data.get("StackTrace");
StackTraceElement[] traces = new StackTraceElement[dTraces.length];
for (int a = 0; a < dTraces.length; ++a)
- /* FIXME: We can't use the boolean as there is no available
- constructor. */
- traces[a] =
- new StackTraceElement((String) dTraces[a].get("ClassName"),
- (String) dTraces[a].get("MethodName"),
- (String) dTraces[a].get("FileName"),
- ((Integer)
- dTraces[a].get("LineNumber")).intValue());
+ /* FIXME: We can't use the boolean as there is no available
+ constructor. */
+ traces[a] =
+ new StackTraceElement((String) dTraces[a].get("ClassName"),
+ (String) dTraces[a].get("MethodName"),
+ (String) dTraces[a].get("FileName"),
+ ((Integer)
+ dTraces[a].get("LineNumber")).intValue());
MonitorInfo[] mInfo;
if (data.containsKey("LockedMonitors"))
{
- CompositeData[] dmInfos = (CompositeData[]) data.get("LockedMonitors");
- mInfo = new MonitorInfo[dmInfos.length];
- for (int a = 0; a < dmInfos.length; ++a)
- mInfo[a] = MonitorInfo.from(dmInfos[a]);
+ CompositeData[] dmInfos = (CompositeData[]) data.get("LockedMonitors");
+ mInfo = new MonitorInfo[dmInfos.length];
+ for (int a = 0; a < dmInfos.length; ++a)
+ mInfo[a] = MonitorInfo.from(dmInfos[a]);
}
else
mInfo = new MonitorInfo[]{};
LockInfo[] lInfo;
if (data.containsKey("LockedSynchronizers"))
{
- CompositeData[] dlInfos = (CompositeData[]) data.get("LockedSynchronizers");
- lInfo = new LockInfo[dlInfos.length];
- for (int a = 0; a < dlInfos.length; ++a)
- lInfo[a] = new LockInfo((String) dlInfos[a].get("ClassName"),
- (Integer) dlInfos[a].get("IdentityHashCode"));
+ CompositeData[] dlInfos = (CompositeData[]) data.get("LockedSynchronizers");
+ lInfo = new LockInfo[dlInfos.length];
+ for (int a = 0; a < dlInfos.length; ++a)
+ lInfo[a] = new LockInfo((String) dlInfos[a].get("ClassName"),
+ (Integer) dlInfos[a].get("IdentityHashCode"));
}
else
lInfo = new LockInfo[]{};
return new ThreadInfo(((Long) data.get("ThreadId")).longValue(),
- (String) data.get("ThreadName"),
- Thread.State.valueOf((String) data.get("ThreadState")),
- ((Long) data.get("BlockedCount")).longValue(),
- ((Long) data.get("BlockedTime")).longValue(),
- (String) data.get("LockName"),
- ((Long) data.get("LockOwnerId")).longValue(),
- (String) data.get("LockOwnerName"),
- ((Long) data.get("WaitedCount")).longValue(),
- ((Long) data.get("WaitedTime")).longValue(),
- ((Boolean) data.get("InNative")).booleanValue(),
- ((Boolean) data.get("Suspended")).booleanValue(),
- traces, mInfo, lInfo);
+ (String) data.get("ThreadName"),
+ Thread.State.valueOf((String) data.get("ThreadState")),
+ ((Long) data.get("BlockedCount")).longValue(),
+ ((Long) data.get("BlockedTime")).longValue(),
+ (String) data.get("LockName"),
+ ((Long) data.get("LockOwnerId")).longValue(),
+ (String) data.get("LockOwnerName"),
+ ((Long) data.get("WaitedCount")).longValue(),
+ ((Long) data.get("WaitedTime")).longValue(),
+ ((Boolean) data.get("InNative")).booleanValue(),
+ ((Boolean) data.get("Suspended")).booleanValue(),
+ traces, mInfo, lInfo);
}
/**
@@ -528,7 +528,7 @@ public class ThreadInfo
* for thread contention monitoring and for this support
* to be enabled.
* </p>
- *
+ *
* @return the accumulated time (in milliseconds) that this
* thread has spent in the blocked state, since
* thread contention monitoring was enabled, or -1
@@ -601,7 +601,7 @@ public class ThreadInfo
* The lock is the return value of
* {@link java.util.concurrent.locks.LockSupport#getBlocker()}.</li>
* </ol>
- *
+ *
* @return a {@link LockInfo} object representing the lock on
* which the thread is blocked, or <code>null</code> if
* the thread isn't blocked.
@@ -613,7 +613,7 @@ public class ThreadInfo
String lockName = getLockName();
int at = lockName.indexOf('@');
return new LockInfo(lockName.substring(0, at),
- Integer.decode(lockName.substring(at + 1)));
+ Integer.decode(lockName.substring(at + 1)));
}
/**
@@ -655,7 +655,7 @@ public class ThreadInfo
* monitor lock this thread is waiting for. -1 is returned
* if either this thread is not blocked, or the lock is
* not held by any other thread.
- *
+ *
* @return the thread identifier of thread holding the lock
* this thread is waiting for, or -1 if the thread
* is not blocked or the lock is not held by another
@@ -673,7 +673,7 @@ public class ThreadInfo
* monitor lock this thread is waiting for. <code>null</code>
* is returned if either this thread is not blocked,
* or the lock is not held by any other thread.
- *
+ *
* @return the thread identifier of thread holding the lock
* this thread is waiting for, or <code>null</code>
* if the thread is not blocked or the lock is not
@@ -701,7 +701,7 @@ public class ThreadInfo
* stack trace information for a thread. In these
* cases, an empty array will also be returned.
* </p>
- *
+ *
* @return an array of {@link java.lang.StackTraceElement}s
* representing the trace of this thread.
*/
@@ -742,16 +742,16 @@ public class ThreadInfo
{
return threadState;
}
-
+
/**
* Returns the number of times this thread has been
- * in the {@link java.lang.Thread.State#WAITING}
+ * in the {@link java.lang.Thread.State#WAITING}
* or {@link java.lang.Thread.State#TIMED_WAITING} state.
* A thread enters one of these states when it is waiting
* due to a call to {@link java.lang.Object.wait()},
* {@link java.lang.Object.join()} or
* {@link java.lang.concurrent.locks.LockSupport.park()},
- * either with an infinite or timed delay, respectively.
+ * either with an infinite or timed delay, respectively.
*
* @return the number of times this thread has been waiting.
*/
@@ -771,14 +771,14 @@ public class ThreadInfo
* due to a call to {@link java.lang.Object.wait()},
* {@link java.lang.Object.join()} or
* {@link java.lang.concurrent.locks.LockSupport.park()},
- * either with an infinite or timed delay, respectively.
+ * either with an infinite or timed delay, respectively.
* </p>
* <p>
* Use of this method requires virtual machine support
* for thread contention monitoring and for this support
* to be enabled.
* </p>
- *
+ *
* @return the accumulated time (in milliseconds) that this
* thread has spent in one of the waiting states, since
* thread contention monitoring was enabled, or -1
@@ -849,14 +849,14 @@ public class ThreadInfo
public String toString()
{
return getClass().getName() +
- "[id=" + threadId +
+ "[id=" + threadId +
", name=" + threadName +
", state=" + threadState +
", blockedCount=" + blockedCount +
", waitedCount=" + waitedCount +
- ", isInNative=" + isInNative +
+ ", isInNative=" + isInNative +
", isSuspended=" + isSuspended +
- (isThreadBlocked() ?
+ (isThreadBlocked() ?
", lockOwnerId=" + lockOwnerId +
", lockOwnerName=" + lockOwnerName : "") +
", lockedMonitors=" + Arrays.toString(lockedMonitors) +
@@ -888,8 +888,8 @@ public class ThreadInfo
private boolean isThreadBlocked()
{
return (threadState == Thread.State.BLOCKED ||
- threadState == Thread.State.WAITING ||
- threadState == Thread.State.TIMED_WAITING);
+ threadState == Thread.State.WAITING ||
+ threadState == Thread.State.TIMED_WAITING);
}
-
+
}
diff --git a/libjava/classpath/java/lang/management/ThreadMXBean.java b/libjava/classpath/java/lang/management/ThreadMXBean.java
index f73075d..551c532 100644
--- a/libjava/classpath/java/lang/management/ThreadMXBean.java
+++ b/libjava/classpath/java/lang/management/ThreadMXBean.java
@@ -39,7 +39,7 @@ package java.lang.management;
/**
* <p>
- * Provides access to information about the threads
+ * Provides access to information about the threads
* of the virtual machine. An instance of this bean is
* obtained by calling
* {@link ManagementFactory#getThreadMXBean()}.
@@ -122,8 +122,8 @@ public interface ThreadMXBean
* @see #isSynchronizerUsageSupported()
*/
ThreadInfo[] dumpAllThreads(boolean lockedMonitors,
- boolean lockedSynchronizers);
-
+ boolean lockedSynchronizers);
+
/**
* <p>
* This method obtains a list of threads which are deadlocked
@@ -140,7 +140,7 @@ public interface ThreadMXBean
* then {@link #findMonitorDeadlockedThreads()} should be used in
* preference to this method.
* </p>
- *
+ *
* @return an array of thread identifiers, corresponding to threads
* which are currently in a deadlocked situation, or
* <code>null</code> if there are no deadlocks.
@@ -161,7 +161,7 @@ public interface ThreadMXBean
* waiting to obtain monitor ownership. On entering a synchronized
* method of an object, or re-entering it after returning from an
* {@link java.lang.Object#wait()} call, a thread obtains ownership
- * of the object's monitor.
+ * of the object's monitor.
* </p>
* <p>
* Deadlocks can occur in this situation if one or more threads end up
@@ -174,7 +174,7 @@ public interface ThreadMXBean
* of a different object. While in that method, it then wants to
* call the original synchronized method, R, called by A. Doing so
* requires ownership of P, which is still held by A. Hence, it
- * becomes blocked.
+ * becomes blocked.
* </p>
* <p>
* A then finishes its sleep, becomes runnable, and is then allowed
@@ -193,7 +193,7 @@ public interface ThreadMXBean
* to include deadlocks involving ownable synchronizers,
* {@link #findDeadlockedThreads()} should be used instead.
* </p>
- *
+ *
* @return an array of thread identifiers, corresponding to threads
* which are currently in a deadlocked situation, or
* <code>null</code> if there are no deadlocks.
@@ -221,7 +221,7 @@ public interface ThreadMXBean
* Returns the total number of nanoseconds of CPU time
* the current thread has used. This is equivalent to calling
* <code>{@link #getThreadCpuTime()}(Thread.currentThread.getId())</code>.
- * </p>
+ * </p>
* <p>
* Note that the value is only nanosecond-precise, and not accurate; there
* is no guarantee that the difference between two values is really a
@@ -248,7 +248,7 @@ public interface ThreadMXBean
* the current thread has executed in user mode. This is
* equivalent to calling
* <code>{@link #getThreadUserTime()}(Thread.currentThread.getId())</code>.
- * </p>
+ * </p>
* <p>
* Note that the value is only nanosecond-precise, and not accurate; there
* is no guarantee that the difference between two values is really a
@@ -298,8 +298,8 @@ public interface ThreadMXBean
/**
* <p>
* Returns the total number of nanoseconds of CPU time
- * the specified thread has used.
- * </p>
+ * the specified thread has used.
+ * </p>
* <p>
* Note that the value is only nanosecond-precise, and not accurate; there
* is no guarantee that the difference between two values is really a
@@ -329,7 +329,7 @@ public interface ThreadMXBean
* <code>{@link #getThreadInfo}(id, 0)</code>. If the
* identifier specifies a thread which is either non-existant
* or not alive, then the method returns <code>null</code>.
- *
+ *
* @param id the identifier of the thread to return information
* on.
* @return a {@link ThreadInfo} object pertaining to the specified
@@ -348,11 +348,11 @@ public interface ThreadMXBean
* identifier specifies a thread which is either non-existant
* or not alive, then the corresponding element in the returned
* array is <code>null</code>.
- *
+ *
* @param ids an array of thread identifiers to return information
* on.
* @return an array of {@link ThreadInfo} objects matching the
- * specified threads. The corresponding element is
+ * specified threads. The corresponding element is
* <code>null</code> if the identifier specifies
* a thread that doesn't exist or is not alive.
* @throws IllegalArgumentException if an identifier in the array is
@@ -379,15 +379,15 @@ public interface ThreadMXBean
* If an identifier specifies a thread which is either non-existant
* or not alive, then the corresponding element in the returned
* array is <code>null</code>.
- *
+ *
* @param ids an array of thread identifiers to return information
* on.
* @param lockedMonitors true if information on locked monitors
* should be included.
* @param lockedSynchronizers true if information on locked
- * ownable synchronizers should be included.
+ * ownable synchronizers should be included.
* @return an array of {@link ThreadInfo} objects matching the
- * specified threads. The corresponding element is
+ * specified threads. The corresponding element is
* <code>null</code> if the identifier specifies
* a thread that doesn't exist or is not alive.
* @throws IllegalArgumentException if an identifier in the array is
@@ -407,7 +407,7 @@ public interface ThreadMXBean
* @see #isSynchronizerUsageSupported()
*/
ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors,
- boolean lockedSynchronizers);
+ boolean lockedSynchronizers);
/**
* Returns information on the specified thread with
@@ -444,7 +444,7 @@ public interface ThreadMXBean
* to an empty stack trace (an empty array is returned by the
* appropriate {@link ThreadInfo} method). A maximum depth of
* <code>Integer.MAX_VALUE</code> returns the full stack trace.
- *
+ *
* @param ids an array of thread identifiers to return information
* on.
* @param maxDepth the maximum depth of the stack trace.
@@ -452,7 +452,7 @@ public interface ThreadMXBean
* correspond to an empty and full stack trace
* respectively.
* @return an array of {@link ThreadInfo} objects matching the
- * specified threads. The corresponding element is
+ * specified threads. The corresponding element is
* <code>null</code> if the identifier specifies
* a thread that doesn't exist or is not alive.
* @throws IllegalArgumentException if an identifier in the array is
@@ -466,8 +466,8 @@ public interface ThreadMXBean
/**
* <p>
* Returns the total number of nanoseconds of CPU time
- * the specified thread has executed in user mode.
- * </p>
+ * the specified thread has executed in user mode.
+ * </p>
* <p>
* Note that the value is only nanosecond-precise, and not accurate; there
* is no guarantee that the difference between two values is really a