diff options
Diffstat (limited to 'libjava/classpath/javax/management/openmbean')
24 files changed, 469 insertions, 477 deletions
diff --git a/libjava/classpath/javax/management/openmbean/ArrayType.java b/libjava/classpath/javax/management/openmbean/ArrayType.java index 1a23f66..fc18870 100644 --- a/libjava/classpath/javax/management/openmbean/ArrayType.java +++ b/libjava/classpath/javax/management/openmbean/ArrayType.java @@ -44,14 +44,14 @@ import java.util.Map; /** * The open type descriptor for arrays of open data values. - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ public class ArrayType<T> extends OpenType<T> { - + /** * Compatible with JDK 1.5 */ @@ -108,8 +108,8 @@ public class ArrayType<T> * a loadable class. */ private static final String getArrayClassName(OpenType<?> elementType, - int dim, - boolean primitive) + int dim, + boolean primitive) throws OpenDataException { Class<?> type; @@ -117,22 +117,22 @@ public class ArrayType<T> type = getPrimitiveTypeClass((SimpleType<?>) elementType); else { - String className = elementType.getClassName(); - try - { - type = Class.forName(className); - } - catch (ClassNotFoundException e) - { - throw new OpenDataException("The class name, " + className + - ", is unavailable."); - } + String className = elementType.getClassName(); + try + { + type = Class.forName(className); + } + catch (ClassNotFoundException e) + { + throw new OpenDataException("The class name, " + className + + ", is unavailable."); + } } while (type.isArray()) type = type.getComponentType(); return Array.newInstance(type, - new int[getDimensions(elementType, dim)]).getClass().getName(); + new int[getDimensions(elementType, dim)]).getClass().getName(); } /** @@ -146,11 +146,11 @@ public class ArrayType<T> * @throws IllegalArgumentException if <code>dim</code> is less than 1. */ private static final int getDimensions(OpenType<?> elementType, - int dim) + int dim) { if (dim < 1) throw new IllegalArgumentException("Dimensions must be greater " + - "than or equal to 1."); + "than or equal to 1."); if (elementType instanceof ArrayType) return dim + ((ArrayType<?>) elementType).getDimension(); return dim; @@ -184,7 +184,7 @@ public class ArrayType<T> if (type.equals(Long.TYPE)) return SimpleType.LONG; if (type.equals(Short.TYPE)) - return SimpleType.SHORT; + return SimpleType.SHORT; if (type.equals(Void.TYPE)) return SimpleType.VOID; throw new OpenDataException(type + " is not a primitive type."); @@ -218,7 +218,7 @@ public class ArrayType<T> if (type.equals(SimpleType.LONG)) return Long.TYPE; if (type.equals(SimpleType.SHORT)) - return Short.TYPE; + return Short.TYPE; if (type.equals(SimpleType.VOID)) return Void.TYPE; throw new OpenDataException(type + " is not a primitive type."); @@ -257,7 +257,7 @@ public class ArrayType<T> { OpenType<?> trueElemType = getElementType(elemType); if (elemType instanceof ArrayType && - ((ArrayType<?>) elemType).isPrimitiveArray()) + ((ArrayType<?>) elemType).isPrimitiveArray()) return getPrimitiveTypeClass((SimpleType<?>) trueElemType).getName(); return trueElemType.getClassName(); } @@ -309,21 +309,21 @@ public class ArrayType<T> public ArrayType(int dim, OpenType<?> elementType) throws OpenDataException { - super(getArrayClassName(elementType, dim, false), - getArrayClassName(elementType, dim, false), - getDimensions(elementType, dim) + "-dimension array of " - + getElementTypeName(elementType)); + super(getArrayClassName(elementType, dim, false), + getArrayClassName(elementType, dim, false), + getDimensions(elementType, dim) + "-dimension array of " + + getElementTypeName(elementType)); if (!(elementType instanceof SimpleType || - elementType instanceof CompositeType || - elementType instanceof TabularType || - elementType instanceof ArrayType)) + elementType instanceof CompositeType || + elementType instanceof TabularType || + elementType instanceof ArrayType)) throw new OpenDataException("The element type must be a simple " + - "type, an array type, a composite type " + - "or a tabular type."); + "type, an array type, a composite type " + + "or a tabular type."); dimension = getDimensions(elementType, dim); this.elementType = getElementType(elementType); primitiveArray = (elementType instanceof ArrayType && - ((ArrayType<?>) elementType).isPrimitiveArray()); + ((ArrayType<?>) elementType).isPrimitiveArray()); } /** @@ -377,10 +377,10 @@ public class ArrayType<T> throws OpenDataException { super(getArrayClassName(elementType, 1, primitiveArray), - getArrayClassName(elementType, 1, primitiveArray), - "1-dimension array of " + - (primitiveArray ? getPrimitiveTypeClass(elementType).getName() - : elementType.getClassName())); + getArrayClassName(elementType, 1, primitiveArray), + "1-dimension array of " + + (primitiveArray ? getPrimitiveTypeClass(elementType).getName() + : elementType.getClassName())); dimension = 1; this.elementType = elementType; this.primitiveArray = primitiveArray; @@ -400,7 +400,7 @@ public class ArrayType<T> * <li>The primitive array flag is set the same in both * instances.</li> * </ul> - * + * * @param obj the object to compare with. * @return true if the conditions above hold. */ @@ -410,8 +410,8 @@ public class ArrayType<T> return false; ArrayType<?> atype = (ArrayType<?>) obj; return (atype.getDimension() == dimension && - atype.getElementOpenType().equals(elementType) && - atype.isPrimitiveArray() == primitiveArray); + atype.getElementOpenType().equals(elementType) && + atype.isPrimitiveArray() == primitiveArray); } /** @@ -438,7 +438,7 @@ public class ArrayType<T> * @throws OpenDataException if the class name of {@code elementType} * is not in {@link OpenType#ALLOWED_CLASSNAMES_LIST}. * @since 1.6 - */ + */ @SuppressWarnings("unchecked") public static <E> ArrayType<E[]> getArrayType(OpenType<E> elementType) throws OpenDataException @@ -484,7 +484,7 @@ public class ArrayType<T> * @throws IllegalArgumentException if the type is not a primitive * array. * @since 1.6 - */ + */ @SuppressWarnings("unchecked") public static <T> ArrayType<T> getPrimitiveArrayType(Class<T> type) { @@ -495,32 +495,32 @@ public class ArrayType<T> int dim = 0; do { - comType = comType.getComponentType(); - ++dim; - if (comType == null) - throw new IllegalArgumentException("The given class is " + - "not an array."); + comType = comType.getComponentType(); + ++dim; + if (comType == null) + throw new IllegalArgumentException("The given class is " + + "not an array."); } while (comType.isArray()); try { - arr = new ArrayType<T>(getPrimitiveType(comType), true); + arr = new ArrayType<T>(getPrimitiveType(comType), true); } catch (OpenDataException e) { - throw new IllegalArgumentException("The array is not of a primitive " + - "type", e); + throw new IllegalArgumentException("The array is not of a primitive " + + "type", e); } while (dim > 1) try - { - arr = new ArrayType<T>(1, arr); - --dim; - } + { + arr = new ArrayType<T>(1, arr); + --dim; + } catch (OpenDataException e) - { - throw (Error) - new InternalError("Couldn't generate extra dimensions").initCause(e); - } + { + throw (Error) + new InternalError("Couldn't generate extra dimensions").initCause(e); + } primCache.put(type, arr); return arr; } @@ -570,8 +570,8 @@ public class ArrayType<T> { if (hashCode == null) hashCode = Integer.valueOf(dimension + - elementType.hashCode() + - Boolean.valueOf(primitiveArray).hashCode()); + elementType.hashCode() + + Boolean.valueOf(primitiveArray).hashCode()); return hashCode.intValue(); } @@ -619,21 +619,21 @@ public class ArrayType<T> Class<?> elementClass = null; try { - elementClass = Class.forName(getClassName()); + elementClass = Class.forName(getClassName()); } catch (ClassNotFoundException e) { - throw new IllegalStateException("The array type's element " + - "class could not be found.", e); + throw new IllegalStateException("The array type's element " + + "class could not be found.", e); } if (!(elementClass.isAssignableFrom(objClass))) return false; for (int a = 0; a < Array.getLength(obj); ++a) { - Object elem = Array.get(obj, a); - if (elem != null && - (!(elementType.isValue(elem)))) - return false; + Object elem = Array.get(obj, a); + if (elem != null && + (!(elementType.isValue(elem)))) + return false; } return true; } @@ -661,11 +661,11 @@ public class ArrayType<T> { if (string == null) string = getClass().getName() - + "[name=" + getTypeName() - + ", dimension=" + dimension - + ", elementType=" + elementType - + ", primitiveArray=" + primitiveArray - + "]"; + + "[name=" + getTypeName() + + ", dimension=" + dimension + + ", elementType=" + elementType + + ", primitiveArray=" + primitiveArray + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/CompositeData.java b/libjava/classpath/javax/management/openmbean/CompositeData.java index 3134bc4..c3d2b2d 100644 --- a/libjava/classpath/javax/management/openmbean/CompositeData.java +++ b/libjava/classpath/javax/management/openmbean/CompositeData.java @@ -151,4 +151,3 @@ public interface CompositeData Collection<?> values(); } - diff --git a/libjava/classpath/javax/management/openmbean/CompositeDataInvocationHandler.java b/libjava/classpath/javax/management/openmbean/CompositeDataInvocationHandler.java index 170ec32..4f10f6e 100644 --- a/libjava/classpath/javax/management/openmbean/CompositeDataInvocationHandler.java +++ b/libjava/classpath/javax/management/openmbean/CompositeDataInvocationHandler.java @@ -49,7 +49,7 @@ import java.lang.reflect.Proxy; * {@link CompositeData} object. An instance of {@link CompositeData} * consists of a series of key-value mappings. This handler assumes * these keys to be the names of attributes, and thus provides - * accessor methods by returning the associated value. + * accessor methods by returning the associated value. * </p> * <p> * As an example, consider the following interface: @@ -110,7 +110,7 @@ public class CompositeDataInvocationHandler { if (data == null) throw new IllegalArgumentException("The CompositeData instance " + - "must be non-null."); + "must be non-null."); this.data = data; } @@ -149,18 +149,18 @@ public class CompositeDataInvocationHandler String mName = method.getName(); if (mName.equals("equals")) { - if (args[0] instanceof Proxy) - { - InvocationHandler h = Proxy.getInvocationHandler(args[0]); - if (h instanceof CompositeDataInvocationHandler) - return data.equals(((CompositeDataInvocationHandler) - h).getCompositeData()); - } - return false; + if (args[0] instanceof Proxy) + { + InvocationHandler h = Proxy.getInvocationHandler(args[0]); + if (h instanceof CompositeDataInvocationHandler) + return data.equals(((CompositeDataInvocationHandler) + h).getCompositeData()); + } + return false; } if (mName.equals("hashCode")) { - return data.hashCode(); + return data.hashCode(); } String attrib = null; if (mName.startsWith("get")) @@ -171,18 +171,18 @@ public class CompositeDataInvocationHandler throw new NoSuchMethodException(mName + " is not an accessor."); if (!data.containsKey(attrib)) { - if (Character.isLowerCase(attrib.charAt(0))) - throw new NoSuchMethodException("The attribute " + - attrib + " is not available " + - "in the given CompositeData " + - "object"); - attrib = Character.toLowerCase(attrib.charAt(0)) - + attrib.substring(1); - if (!data.containsKey(attrib)) - throw new NoSuchMethodException("The attribute " + - attrib + " is not available " + - "in the given CompositeData " + - "object"); + if (Character.isLowerCase(attrib.charAt(0))) + throw new NoSuchMethodException("The attribute " + + attrib + " is not available " + + "in the given CompositeData " + + "object"); + attrib = Character.toLowerCase(attrib.charAt(0)) + + attrib.substring(1); + if (!data.containsKey(attrib)) + throw new NoSuchMethodException("The attribute " + + attrib + " is not available " + + "in the given CompositeData " + + "object"); } return data.get(attrib); } diff --git a/libjava/classpath/javax/management/openmbean/CompositeDataSupport.java b/libjava/classpath/javax/management/openmbean/CompositeDataSupport.java index 6bce267..2cc6f40 100644 --- a/libjava/classpath/javax/management/openmbean/CompositeDataSupport.java +++ b/libjava/classpath/javax/management/openmbean/CompositeDataSupport.java @@ -109,9 +109,9 @@ public class CompositeDataSupport public CompositeDataSupport(CompositeType type, Map<String, ?> items) throws OpenDataException { - this(type, - items.keySet().toArray(new String[items.size()]), - items.values().toArray()); + this(type, + items.keySet().toArray(new String[items.size()]), + items.values().toArray()); } /** @@ -157,26 +157,26 @@ public class CompositeDataSupport Set<String> typeKeys = type.keySet(); if (typeKeys.size() != names.length) throw new OpenDataException("The number of field names does not match " + - "the type description."); + "the type description."); contents = new TreeMap<String, Object>(); for (int a = 0; a < names.length; ++a) { - if (names[a] == null) - throw new IllegalArgumentException("Element " + a + " of the names " + - "array is null."); - if (names[a].length() == 0) - throw new IllegalArgumentException("Element " + a + " of the names " + - "array is an empty string."); - if (values[a] == null) - throw new IllegalArgumentException("Element " + a + " of the values " + - "array is null."); - if (!(typeKeys.contains(names[a]))) - throw new OpenDataException("The name, " + names[a] + ", is not a " + - "field in the given type description."); - if (!(type.getType(names[a]).isValue(values[a]))) - throw new OpenDataException("The value, " + values[a] + ", is not a " + - "valid value for the " + names[a] + " field."); - contents.put(names[a], values[a]); + if (names[a] == null) + throw new IllegalArgumentException("Element " + a + " of the names " + + "array is null."); + if (names[a].length() == 0) + throw new IllegalArgumentException("Element " + a + " of the names " + + "array is an empty string."); + if (values[a] == null) + throw new IllegalArgumentException("Element " + a + " of the values " + + "array is null."); + if (!(typeKeys.contains(names[a]))) + throw new OpenDataException("The name, " + names[a] + ", is not a " + + "field in the given type description."); + if (!(type.getType(names[a]).isValue(values[a]))) + throw new OpenDataException("The value, " + values[a] + ", is not a " + + "valid value for the " + names[a] + " field."); + contents.put(names[a], values[a]); } } @@ -229,10 +229,10 @@ public class CompositeDataSupport return false; for (String key : contents.keySet()) { - if (!(data.containsKey(key))) - return false; - if (!(data.get(key).equals(contents.get(key)))) - return false; + if (!(data.containsKey(key))) + return false; + if (!(data.get(key).equals(contents.get(key)))) + return false; } return true; } @@ -343,4 +343,3 @@ public class CompositeDataSupport } } - diff --git a/libjava/classpath/javax/management/openmbean/CompositeType.java b/libjava/classpath/javax/management/openmbean/CompositeType.java index 3244c64..e36fed1 100644 --- a/libjava/classpath/javax/management/openmbean/CompositeType.java +++ b/libjava/classpath/javax/management/openmbean/CompositeType.java @@ -46,7 +46,7 @@ import java.util.TreeMap; /** * The open type descriptor for instances of the * {@link CompositeData} class. - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ @@ -109,34 +109,34 @@ public class CompositeType * before comparison. */ public CompositeType(String name, String desc, String[] names, - String[] descs, OpenType<?>[] types) + String[] descs, OpenType<?>[] types) throws OpenDataException { super(CompositeData.class.getName(), name, desc); - if (names.length == 0 - || names.length != descs.length - || names.length != types.length) + if (names.length == 0 + || names.length != descs.length + || names.length != types.length) throw new IllegalArgumentException("Arrays must be non-empty " + - "and of equal size."); + "and of equal size."); nameToDescription = new TreeMap<String,String>(); for (int a = 0; a < names.length; ++a) { - if (names[a] == null) - throw new IllegalArgumentException("Name " + a + " is null."); - if (descs[a] == null) - throw new IllegalArgumentException("Description " + a + - " is null."); - String fieldName = names[a].trim(); - if (fieldName.length() == 0) - throw new IllegalArgumentException("Name " + a + " is " + - "the empty string."); - if (descs[a].length() == 0) - throw new IllegalArgumentException("Description " + a + " is " + - "the empty string."); - if (nameToDescription.containsKey(fieldName)) - throw new OpenDataException(fieldName + " appears more " + - "than once."); - nameToDescription.put(fieldName, descs[a]); + if (names[a] == null) + throw new IllegalArgumentException("Name " + a + " is null."); + if (descs[a] == null) + throw new IllegalArgumentException("Description " + a + + " is null."); + String fieldName = names[a].trim(); + if (fieldName.length() == 0) + throw new IllegalArgumentException("Name " + a + " is " + + "the empty string."); + if (descs[a].length() == 0) + throw new IllegalArgumentException("Description " + a + " is " + + "the empty string."); + if (nameToDescription.containsKey(fieldName)) + throw new OpenDataException(fieldName + " appears more " + + "than once."); + nameToDescription.put(fieldName, descs[a]); } nameToType = new TreeMap<String,OpenType<?>>(); for (int a = 0; a < names.length; ++a) @@ -167,7 +167,7 @@ public class CompositeType * <li>The type names are equal.</li> * <li>The fields and their types match.</li> * </ul> - * + * * @param obj the object to compare with. * @return true if the conditions above hold. */ @@ -184,7 +184,7 @@ public class CompositeType for (String key : keys) { if (!(ctype.getType(key).equals(getType(key)))) - return false; + return false; } return true; } @@ -222,7 +222,7 @@ public class CompositeType /** * <p> * Returns the hash code of the composite data type. - * This is computed as the sum of the hash codes of + * This is computed as the sum of the hash codes of * each field name and its type, together with the hash * code of the type name. These are the same elements * of the type that are compared as part of the @@ -242,18 +242,18 @@ public class CompositeType { if (hashCode == null) { - int elementTotal = 0; - for (Map.Entry<String,OpenType<?>> entry : nameToType.entrySet()) - { - elementTotal += (entry.getKey().hashCode() + - entry.getValue().hashCode()); - } - hashCode = Integer.valueOf(elementTotal - + getTypeName().hashCode()); + int elementTotal = 0; + for (Map.Entry<String,OpenType<?>> entry : nameToType.entrySet()) + { + elementTotal += (entry.getKey().hashCode() + + entry.getValue().hashCode()); + } + hashCode = Integer.valueOf(elementTotal + + getTypeName().hashCode()); } return hashCode.intValue(); } - + /** * Returns true if the specified object is a member of this * composite type. The object is judged to be so if it is @@ -268,15 +268,15 @@ public class CompositeType { if (obj instanceof CompositeData) { - CompositeData data = (CompositeData) obj; - return equals(data.getCompositeType()); + CompositeData data = (CompositeData) obj; + return equals(data.getCompositeType()); } return false; } /** * Returns an unmodifiable {@link java.util.Set}-based - * view of the field names that form part of this + * view of the field names that form part of this * {@link CompositeType} instance. The names are stored * in ascending alphanumeric order. * @@ -311,9 +311,9 @@ public class CompositeType { if (string == null) string = getClass().getName() - + "[name=" + getTypeName() - + ", fields=" + nameToType - + "]"; + + "[name=" + getTypeName() + + ", fields=" + nameToType + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/InvalidKeyException.java b/libjava/classpath/javax/management/openmbean/InvalidKeyException.java index 5f0cf76..e9458ba 100644 --- a/libjava/classpath/javax/management/openmbean/InvalidKeyException.java +++ b/libjava/classpath/javax/management/openmbean/InvalidKeyException.java @@ -74,4 +74,3 @@ public class InvalidKeyException } } - diff --git a/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java b/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java index 9c9ff8c..b4f49ba 100644 --- a/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java +++ b/libjava/classpath/javax/management/openmbean/InvalidOpenTypeException.java @@ -73,4 +73,3 @@ public class InvalidOpenTypeException } } - diff --git a/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java b/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java index cc6bba6..69b22c4 100644 --- a/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java +++ b/libjava/classpath/javax/management/openmbean/KeyAlreadyExistsException.java @@ -74,4 +74,3 @@ public class KeyAlreadyExistsException } } - diff --git a/libjava/classpath/javax/management/openmbean/OpenDataException.java b/libjava/classpath/javax/management/openmbean/OpenDataException.java index a476cc1..5e2a0b7 100644 --- a/libjava/classpath/javax/management/openmbean/OpenDataException.java +++ b/libjava/classpath/javax/management/openmbean/OpenDataException.java @@ -76,4 +76,3 @@ public class OpenDataException } } - diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java index 1b276fd..d521306 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfo.java @@ -59,7 +59,7 @@ public interface OpenMBeanAttributeInfo * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * <code>openType.equals(object.getOpenType())</code>, * <code>defaultValue.equals(object.getDefaultValue())</code>, diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java index 6da2e95..098f72e 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java @@ -44,7 +44,7 @@ import java.util.Set; import javax.management.MBeanAttributeInfo; /** - * Describes an attribute of an open management bean. + * Describes an attribute of an open management bean. * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 @@ -113,11 +113,11 @@ public class OpenMBeanAttributeInfoSupport * the empty string. */ public OpenMBeanAttributeInfoSupport(String name, String desc, OpenType<?> type, - boolean isReadable, boolean isWritable, - boolean isIs) + boolean isReadable, boolean isWritable, + boolean isIs) { super(name, type == null ? null : type.getClassName(), desc, isReadable, - isWritable, isIs); + isWritable, isIs); if (name == null) throw new IllegalArgumentException("The name may not be null."); if (desc == null) @@ -128,7 +128,7 @@ public class OpenMBeanAttributeInfoSupport throw new IllegalArgumentException("The name may not be the empty string."); if (desc.length() == 0) throw new IllegalArgumentException("The description may not be the " + - "empty string."); + "empty string."); } /** @@ -158,8 +158,8 @@ public class OpenMBeanAttributeInfoSupport * of {@link ArrayType} or {@link TabularType}. */ public <T> OpenMBeanAttributeInfoSupport(String name, String desc, OpenType<T> type, - boolean isReadable, boolean isWritable, - boolean isIs, T defaultValue) + boolean isReadable, boolean isWritable, + boolean isIs, T defaultValue) throws OpenDataException { this(name, desc, type, isReadable, isWritable, isIs, defaultValue, null); @@ -168,7 +168,7 @@ public class OpenMBeanAttributeInfoSupport /** * <p> * Constructs a new {@link OpenMBeanAttributeInfo} using the - * specified name, description, open type, access properties, + * specified name, description, open type, access properties, * default, maximum and minimum values. The name, description * and open type cannot be <code>null</code> and the name and * description may not be equal to the empty string. The @@ -187,7 +187,7 @@ public class OpenMBeanAttributeInfoSupport * <li>The default value must be smaller than or equal to the maximum value * (literally, <code>defaultValue.compareTo(maxValue) <= 0</code>.</li> * </ul> - * + * * @param name the name of the attribute. * @param desc a description of the attribute. * @param type the open type of the attribute. @@ -205,39 +205,39 @@ public class OpenMBeanAttributeInfoSupport */ @SuppressWarnings("unchecked") public <T> OpenMBeanAttributeInfoSupport(String name, String desc, OpenType<T> type, - boolean isReadable, boolean isWritable, - boolean isIs, T defaultValue, - Comparable<T> minimumValue, - Comparable<T> maximumValue) + boolean isReadable, boolean isWritable, + boolean isIs, T defaultValue, + Comparable<T> minimumValue, + Comparable<T> maximumValue) throws OpenDataException { this(name, desc, type, isReadable, isWritable, isIs); if (defaultValue != null && !(type.isValue(defaultValue))) throw new OpenDataException("The default value is not a member of the " + - "open type given."); + "open type given."); if (minimumValue != null && !(type.isValue(minimumValue))) throw new OpenDataException("The minimum value is not a member of the " + - "open type given."); + "open type given."); if (maximumValue != null && !(type.isValue(maximumValue))) throw new OpenDataException("The maximum value is not a member of the " + - "open type given."); - if (defaultValue != null && (type instanceof ArrayType || - type instanceof TabularType)) + "open type given."); + if (defaultValue != null && (type instanceof ArrayType || + type instanceof TabularType)) throw new OpenDataException("Default values are not applicable for " + - "array or tabular types."); - if (minimumValue != null && maximumValue != null - && minimumValue.compareTo((T) maximumValue) > 0) + "array or tabular types."); + if (minimumValue != null && maximumValue != null + && minimumValue.compareTo((T) maximumValue) > 0) throw new OpenDataException("The minimum value is greater than the " + - "maximum."); - if (minimumValue != null && defaultValue != null - && minimumValue.compareTo(defaultValue) > 0) + "maximum."); + if (minimumValue != null && defaultValue != null + && minimumValue.compareTo(defaultValue) > 0) throw new OpenDataException("The minimum value is greater than the " + - "default."); + "default."); if (defaultValue != null && maximumValue != null - && maximumValue.compareTo(defaultValue) < 0) + && maximumValue.compareTo(defaultValue) < 0) throw new OpenDataException("The default value is greater than the " + - "maximum."); - + "maximum."); + openType = type; this.defaultValue = defaultValue; minValue = minimumValue; @@ -282,40 +282,40 @@ public class OpenMBeanAttributeInfoSupport * @throws OpenDataException if any condition in the list above is broken. */ public <T> OpenMBeanAttributeInfoSupport(String name, String desc, OpenType<T> type, - boolean isReadable, boolean isWritable, - boolean isIs, T defaultValue, - T[] legalValues) + boolean isReadable, boolean isWritable, + boolean isIs, T defaultValue, + T[] legalValues) throws OpenDataException { this(name, desc, type, isReadable, isWritable, isIs); if (defaultValue != null && !(type.isValue(defaultValue))) throw new OpenDataException("The default value is not a member of the " + - "open type given."); - if (defaultValue != null && (type instanceof ArrayType || - type instanceof TabularType)) + "open type given."); + if (defaultValue != null && (type instanceof ArrayType || + type instanceof TabularType)) throw new OpenDataException("Default values are not applicable for " + - "array or tabular types."); - if (legalValues != null && (type instanceof ArrayType || - type instanceof TabularType)) + "array or tabular types."); + if (legalValues != null && (type instanceof ArrayType || + type instanceof TabularType)) throw new OpenDataException("Legal values are not applicable for " + - "array or tabular types."); + "array or tabular types."); if (legalValues != null && legalValues.length > 0) { - Set<T> lv = new HashSet<T>(legalValues.length); - for (int a = 0; a < legalValues.length; ++a) - { - if (legalValues[a] != null && - !(type.isValue(legalValues[a]))) - throw new OpenDataException("The legal value, " - + legalValues[a] + - "is not a member of the " + - "open type given."); - lv.add(legalValues[a]); - } - if (defaultValue != null && !(lv.contains(defaultValue))) - throw new OpenDataException("The default value is not in the set " + - "of legal values."); - this.legalValues = Collections.unmodifiableSet(lv); + Set<T> lv = new HashSet<T>(legalValues.length); + for (int a = 0; a < legalValues.length; ++a) + { + if (legalValues[a] != null && + !(type.isValue(legalValues[a]))) + throw new OpenDataException("The legal value, " + + legalValues[a] + + "is not a member of the " + + "open type given."); + lv.add(legalValues[a]); + } + if (defaultValue != null && !(lv.contains(defaultValue))) + throw new OpenDataException("The default value is not in the set " + + "of legal values."); + this.legalValues = Collections.unmodifiableSet(lv); } openType = type; this.defaultValue = defaultValue; @@ -329,7 +329,7 @@ public class OpenMBeanAttributeInfoSupport * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanAttributeInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * <code>openType.equals(object.getOpenType())</code>, * <code>isRead == object.isReadable()</code>, @@ -446,20 +446,20 @@ public class OpenMBeanAttributeInfoSupport public int hashCode() { if (hashCode == null) - hashCode = Integer.valueOf(getName().hashCode() + - openType.hashCode() + - Boolean.valueOf(isReadable()).hashCode() + - (2 * - Boolean.valueOf(isWritable()).hashCode()) + - (4 * Boolean.valueOf(isIs()).hashCode()) + - (defaultValue == null ? 0 : - defaultValue.hashCode()) + - (minValue == null ? 0 : - minValue.hashCode()) + - (maxValue == null ? 0 : - maxValue.hashCode()) + - (legalValues == null ? 0 : - legalValues.hashCode())); + hashCode = Integer.valueOf(getName().hashCode() + + openType.hashCode() + + Boolean.valueOf(isReadable()).hashCode() + + (2 * + Boolean.valueOf(isWritable()).hashCode()) + + (4 * Boolean.valueOf(isIs()).hashCode()) + + (defaultValue == null ? 0 : + defaultValue.hashCode()) + + (minValue == null ? 0 : + minValue.hashCode()) + + (maxValue == null ? 0 : + maxValue.hashCode()) + + (legalValues == null ? 0 : + legalValues.hashCode())); return hashCode.intValue(); } @@ -531,16 +531,16 @@ public class OpenMBeanAttributeInfoSupport { if (string == null) string = getClass().getName() - + "[name=" + getName() - + ",openType=" + openType - + ",isReadable=" + isReadable() - + ",isWritable=" + isWritable() - + ",isIs=" + isIs() - + ",defaultValue=" + defaultValue - + ",minValue=" + minValue - + ",maxValue=" + maxValue - + ",legalValues=" + legalValues - + "]"; + + "[name=" + getName() + + ",openType=" + openType + + ",isReadable=" + isReadable() + + ",isWritable=" + isWritable() + + ",isIs=" + isIs() + + ",defaultValue=" + defaultValue + + ",minValue=" + minValue + + ",maxValue=" + maxValue + + ",legalValues=" + legalValues + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java index 34cef13..5bccdb6 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfo.java @@ -59,7 +59,7 @@ public interface OpenMBeanConstructorInfo * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * and <code>signature.equals(object.getSignature())</code>. */ diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java index 9dac01a..c187d5d 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java @@ -43,7 +43,7 @@ import javax.management.MBeanConstructorInfo; import javax.management.MBeanParameterInfo; /** - * Describes a constructor for an open management bean. + * Describes a constructor for an open management bean. * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 @@ -89,7 +89,7 @@ public class OpenMBeanConstructorInfoSupport * {@link javax.management.MBeanParameterInfo} */ public OpenMBeanConstructorInfoSupport(String name, String desc, - OpenMBeanParameterInfo[] sig) + OpenMBeanParameterInfo[] sig) { super(name, desc, (MBeanParameterInfo[]) sig); if (name == null) @@ -100,7 +100,7 @@ public class OpenMBeanConstructorInfoSupport throw new IllegalArgumentException("The name may not be the empty string."); if (desc.length() == 0) throw new IllegalArgumentException("The description may not be the " + - "empty string."); + "empty string."); } /** @@ -110,7 +110,7 @@ public class OpenMBeanConstructorInfoSupport * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * and <code>signature.equals(object.getSignature())</code>. */ @@ -140,8 +140,8 @@ public class OpenMBeanConstructorInfoSupport public int hashCode() { if (hashCode == null) - hashCode = Integer.valueOf(getName().hashCode() + - Arrays.asList(getSignature()).hashCode()); + hashCode = Integer.valueOf(getName().hashCode() + + Arrays.asList(getSignature()).hashCode()); return hashCode.intValue(); } @@ -165,9 +165,9 @@ public class OpenMBeanConstructorInfoSupport { if (string == null) string = getClass().getName() - + "[name=" + getName() - + ",signature=" + Arrays.toString(getSignature()) - + "]"; + + "[name=" + getName() + + ",signature=" + Arrays.toString(getSignature()) + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java index 5aa4df4..98da260 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanInfo.java @@ -66,7 +66,7 @@ public interface OpenMBeanInfo * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanInfo} - * instance, + * instance, * <code>className.equals(object.getClassName())</code> * and each info class has an equal in the other object. */ diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java index d67ff76..c335d75 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanInfoSupport.java @@ -47,7 +47,7 @@ import javax.management.MBeanNotificationInfo; import javax.management.MBeanOperationInfo; /** - * Describes an open management bean. + * Describes an open management bean. * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 @@ -97,16 +97,16 @@ public class OpenMBeanInfoSupport * is not assignable to the equivalent * <code>MBeanXXXInfo</code> class. */ - public OpenMBeanInfoSupport(String name, String desc, - OpenMBeanAttributeInfo[] attribs, - OpenMBeanConstructorInfo[] cons, - OpenMBeanOperationInfo[] ops, - MBeanNotificationInfo[] notifs) + public OpenMBeanInfoSupport(String name, String desc, + OpenMBeanAttributeInfo[] attribs, + OpenMBeanConstructorInfo[] cons, + OpenMBeanOperationInfo[] ops, + MBeanNotificationInfo[] notifs) { super(name, desc, (MBeanAttributeInfo[]) attribs, - (MBeanConstructorInfo[]) cons, - (MBeanOperationInfo[]) ops, - notifs); + (MBeanConstructorInfo[]) cons, + (MBeanOperationInfo[]) ops, + notifs); } /** @@ -116,7 +116,7 @@ public class OpenMBeanInfoSupport * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanInfo} - * instance, + * instance, * <code>className.equals(object.getClassName())</code> * and each info class has an equal in the other object. */ @@ -149,12 +149,12 @@ public class OpenMBeanInfoSupport public int hashCode() { if (hashCode == null) - hashCode = - Integer.valueOf(getClassName().hashCode() + - new HashSet<MBeanAttributeInfo>(Arrays.asList(getAttributes())).hashCode() + - new HashSet<MBeanConstructorInfo>(Arrays.asList(getConstructors())).hashCode() + - new HashSet<MBeanNotificationInfo>(Arrays.asList(getNotifications())).hashCode() + - new HashSet<MBeanOperationInfo>(Arrays.asList(getOperations())).hashCode()); + hashCode = + Integer.valueOf(getClassName().hashCode() + + new HashSet<MBeanAttributeInfo>(Arrays.asList(getAttributes())).hashCode() + + new HashSet<MBeanConstructorInfo>(Arrays.asList(getConstructors())).hashCode() + + new HashSet<MBeanNotificationInfo>(Arrays.asList(getNotifications())).hashCode() + + new HashSet<MBeanOperationInfo>(Arrays.asList(getOperations())).hashCode()); return hashCode.intValue(); } @@ -179,12 +179,12 @@ public class OpenMBeanInfoSupport { if (string == null) string = getClass().getName() - + "[className=" + getClassName() - + ",attributes=" + Arrays.toString(getAttributes()) - + ",constructors=" + Arrays.toString(getConstructors()) - + ",notifications=" + Arrays.toString(getNotifications()) - + ",operations=" + Arrays.toString(getOperations()) - + "]"; + + "[className=" + getClassName() + + ",attributes=" + Arrays.toString(getAttributes()) + + ",constructors=" + Arrays.toString(getConstructors()) + + ",notifications=" + Arrays.toString(getNotifications()) + + ",operations=" + Arrays.toString(getOperations()) + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java index e835b8d..3b5bf92 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfo.java @@ -59,7 +59,7 @@ public interface OpenMBeanOperationInfo * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * <code>signature.equals(object.getSignature())</code>, * <code>returnOpenType.equals(object.getReturnOpenType())</code>, diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java index c01433d..992df34 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanOperationInfoSupport.java @@ -43,7 +43,7 @@ import javax.management.MBeanOperationInfo; import javax.management.MBeanParameterInfo; /** - * Describes a operation for an open management bean. + * Describes a operation for an open management bean. * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 @@ -82,7 +82,7 @@ public class OpenMBeanOperationInfoSupport * description may not be equal to the empty string, and neither * the name, description nor the open return type may be * <code>null</code>. The value of <code>impact</code> must be - * one of the four valid values + * one of the four valid values * ({@link javax.management.MBeanOperationInfo#INFO}, * {@link javax.management.MBeanOperationInfo#ACTION}, * {@link javax.management.MBeanOperationInfo#ACTION_INFO} and @@ -107,11 +107,11 @@ public class OpenMBeanOperationInfoSupport * {@link javax.management.MBeanParameterInfo} */ public OpenMBeanOperationInfoSupport(String name, String desc, - OpenMBeanParameterInfo[] sig, - OpenType<?> type, int impact) + OpenMBeanParameterInfo[] sig, + OpenType<?> type, int impact) { super(name, desc, (MBeanParameterInfo[]) sig, - type == null ? null : type.getClassName(), impact); + type == null ? null : type.getClassName(), impact); if (name == null) throw new IllegalArgumentException("The name may not be null."); if (desc == null) @@ -122,9 +122,9 @@ public class OpenMBeanOperationInfoSupport throw new IllegalArgumentException("The name may not be the empty string."); if (desc.length() == 0) throw new IllegalArgumentException("The description may not be the " + - "empty string."); - if (impact != ACTION && impact != INFO && - impact != ACTION_INFO && impact != UNKNOWN) + "empty string."); + if (impact != ACTION && impact != INFO && + impact != ACTION_INFO && impact != UNKNOWN) throw new IllegalArgumentException("The impact factor is an invalid value."); returnOpenType = type; } @@ -136,7 +136,7 @@ public class OpenMBeanOperationInfoSupport * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * <code>signature.equals(object.getSignature())</code>, * <code>returnOpenType.equals(object.getReturnOpenType())</code>, @@ -182,10 +182,10 @@ public class OpenMBeanOperationInfoSupport public int hashCode() { if (hashCode == null) - hashCode = Integer.valueOf(getName().hashCode() + - returnOpenType.hashCode() + - Integer.valueOf(getImpact()).hashCode() + - Arrays.asList(getSignature()).hashCode()); + hashCode = Integer.valueOf(getName().hashCode() + + returnOpenType.hashCode() + + Integer.valueOf(getImpact()).hashCode() + + Arrays.asList(getSignature()).hashCode()); return hashCode.intValue(); } @@ -209,30 +209,30 @@ public class OpenMBeanOperationInfoSupport { if (string == null) { - String impactString; - switch (getImpact()) - { - case INFO: - impactString = "INFO"; - break; - case ACTION: - impactString = "ACTION"; - break; - case ACTION_INFO: - impactString = "ACTION_INFO"; - break; - case UNKNOWN: - impactString = "UNKNOWN"; - break; - default: - impactString = "ERRONEOUS VALUE"; - } - string = getClass().getName() - + "[name=" + getName() - + ",signature=" + Arrays.toString(getSignature()) - + ",returnOpenType=" + returnOpenType - + ",impact=" + impactString - + "]"; + String impactString; + switch (getImpact()) + { + case INFO: + impactString = "INFO"; + break; + case ACTION: + impactString = "ACTION"; + break; + case ACTION_INFO: + impactString = "ACTION_INFO"; + break; + case UNKNOWN: + impactString = "UNKNOWN"; + break; + default: + impactString = "ERRONEOUS VALUE"; + } + string = getClass().getName() + + "[name=" + getName() + + ",signature=" + Arrays.toString(getSignature()) + + ",returnOpenType=" + returnOpenType + + ",impact=" + impactString + + "]"; } return string; } diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java index 75d1baf..0869a68 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfo.java @@ -59,7 +59,7 @@ public interface OpenMBeanParameterInfo * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * <code>openType.equals(object.getOpenType())</code>, * <code>defaultValue.equals(object.getDefaultValue())</code>, diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java index 5f86bf4..78ad1c5 100644 --- a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java +++ b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java @@ -45,7 +45,7 @@ import javax.management.MBeanParameterInfo; /** * Describes the parameters of a constructor or operation associated - * with an open management bean. + * with an open management bean. * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 @@ -122,7 +122,7 @@ public class OpenMBeanParameterInfoSupport throw new IllegalArgumentException("The name may not be the empty string."); if (desc.length() == 0) throw new IllegalArgumentException("The description may not be the " + - "empty string."); + "empty string."); openType = type; } @@ -150,7 +150,7 @@ public class OpenMBeanParameterInfoSupport * of {@link ArrayType} or {@link TabularType}. */ public <T> OpenMBeanParameterInfoSupport(String name, String desc, OpenType<T> type, - T defaultValue) + T defaultValue) throws OpenDataException { this(name, desc, type, defaultValue, null); @@ -177,7 +177,7 @@ public class OpenMBeanParameterInfoSupport * <li>The default value must be smaller than or equal to the maximum value * (literally, <code>defaultValue.compareTo(maxValue) <= 0</code>.</li> * </ul> - * + * * @param name the name of the parameter. * @param desc a description of the parameter. * @param type the open type of the parameter. @@ -192,37 +192,37 @@ public class OpenMBeanParameterInfoSupport */ @SuppressWarnings("unchecked") public <T> OpenMBeanParameterInfoSupport(String name, String desc, OpenType<T> type, - T defaultValue, Comparable<T> minimumValue, - Comparable<T> maximumValue) + T defaultValue, Comparable<T> minimumValue, + Comparable<T> maximumValue) throws OpenDataException { this(name, desc, type); if (defaultValue != null && !(type.isValue(defaultValue))) throw new OpenDataException("The default value is not a member of the " + - "open type given."); + "open type given."); if (minimumValue != null && !(type.isValue(minimumValue))) throw new OpenDataException("The minimum value is not a member of the " + - "open type given."); + "open type given."); if (maximumValue != null && !(type.isValue(maximumValue))) throw new OpenDataException("The maximum value is not a member of the " + - "open type given."); - if (defaultValue != null && (type instanceof ArrayType || - type instanceof TabularType)) + "open type given."); + if (defaultValue != null && (type instanceof ArrayType || + type instanceof TabularType)) throw new OpenDataException("Default values are not applicable for " + - "array or tabular types."); - if (minimumValue != null && maximumValue != null - && minimumValue.compareTo((T) maximumValue) > 0) + "array or tabular types."); + if (minimumValue != null && maximumValue != null + && minimumValue.compareTo((T) maximumValue) > 0) throw new OpenDataException("The minimum value is greater than the " + - "maximum."); - if (minimumValue != null && defaultValue != null - && minimumValue.compareTo(defaultValue) > 0) + "maximum."); + if (minimumValue != null && defaultValue != null + && minimumValue.compareTo(defaultValue) > 0) throw new OpenDataException("The minimum value is greater than the " + - "default."); + "default."); if (defaultValue != null && maximumValue != null - && maximumValue.compareTo(defaultValue) < 0) + && maximumValue.compareTo(defaultValue) < 0) throw new OpenDataException("The default value is greater than the " + - "maximum."); - + "maximum."); + this.defaultValue = defaultValue; minValue = minimumValue; maxValue = maximumValue; @@ -263,38 +263,38 @@ public class OpenMBeanParameterInfoSupport * @throws OpenDataException if any condition in the list above is broken. */ public <T> OpenMBeanParameterInfoSupport(String name, String desc, OpenType<T> type, - T defaultValue, T[] legalValues) + T defaultValue, T[] legalValues) throws OpenDataException { this(name, desc, type); if (defaultValue != null && !(type.isValue(defaultValue))) throw new OpenDataException("The default value is not a member of the " + - "open type given."); - if (defaultValue != null && (type instanceof ArrayType || - type instanceof TabularType)) + "open type given."); + if (defaultValue != null && (type instanceof ArrayType || + type instanceof TabularType)) throw new OpenDataException("Default values are not applicable for " + - "array or tabular types."); - if (legalValues != null && (type instanceof ArrayType || - type instanceof TabularType)) + "array or tabular types."); + if (legalValues != null && (type instanceof ArrayType || + type instanceof TabularType)) throw new OpenDataException("Legal values are not applicable for " + - "array or tabular types."); + "array or tabular types."); if (legalValues != null && legalValues.length > 0) { - Set<T> lv = new HashSet<T>(legalValues.length); - for (int a = 0; a < legalValues.length; ++a) - { - if (legalValues[a] != null && - !(type.isValue(legalValues[a]))) - throw new OpenDataException("The legal value, " - + legalValues[a] + - "is not a member of the " + - "open type given."); - lv.add(legalValues[a]); - } - if (defaultValue != null && !(lv.contains(defaultValue))) - throw new OpenDataException("The default value is not in the set " + - "of legal values."); - this.legalValues = Collections.unmodifiableSet(lv); + Set<T> lv = new HashSet<T>(legalValues.length); + for (int a = 0; a < legalValues.length; ++a) + { + if (legalValues[a] != null && + !(type.isValue(legalValues[a]))) + throw new OpenDataException("The legal value, " + + legalValues[a] + + "is not a member of the " + + "open type given."); + lv.add(legalValues[a]); + } + if (defaultValue != null && !(lv.contains(defaultValue))) + throw new OpenDataException("The default value is not in the set " + + "of legal values."); + this.legalValues = Collections.unmodifiableSet(lv); } this.defaultValue = defaultValue; } @@ -307,7 +307,7 @@ public class OpenMBeanParameterInfoSupport * * @param obj the object to compare. * @return true if the object is a {@link OpenMBeanParameterInfo} - * instance, + * instance, * <code>name.equals(object.getName())</code>, * <code>openType.equals(object.getOpenType())</code>, * <code>defaultValue.equals(object.getDefaultValue())</code>, @@ -418,16 +418,16 @@ public class OpenMBeanParameterInfoSupport public int hashCode() { if (hashCode == null) - hashCode = Integer.valueOf(getName().hashCode() + - openType.hashCode() + - (defaultValue == null ? 0 : - defaultValue.hashCode()) + - (minValue == null ? 0 : - minValue.hashCode()) + - (maxValue == null ? 0 : - maxValue.hashCode()) + - (legalValues == null ? 0 : - legalValues.hashCode())); + hashCode = Integer.valueOf(getName().hashCode() + + openType.hashCode() + + (defaultValue == null ? 0 : + defaultValue.hashCode()) + + (minValue == null ? 0 : + minValue.hashCode()) + + (maxValue == null ? 0 : + maxValue.hashCode()) + + (legalValues == null ? 0 : + legalValues.hashCode())); return hashCode.intValue(); } @@ -499,13 +499,13 @@ public class OpenMBeanParameterInfoSupport { if (string == null) string = getClass().getName() - + "[name=" + getName() - + ",openType=" + openType - + ",defaultValue=" + defaultValue - + ",minValue=" + minValue - + ",maxValue=" + maxValue - + ",legalValues=" + legalValues - + "]"; + + "[name=" + getName() + + ",openType=" + openType + + ",defaultValue=" + defaultValue + + ",minValue=" + minValue + + ",maxValue=" + maxValue + + ",legalValues=" + legalValues + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/OpenType.java b/libjava/classpath/javax/management/openmbean/OpenType.java index f3a97fe..d8abc7c 100644 --- a/libjava/classpath/javax/management/openmbean/OpenType.java +++ b/libjava/classpath/javax/management/openmbean/OpenType.java @@ -47,7 +47,7 @@ import java.util.List; * applicable data values for open MBeans. An open type * is defined by its name and description, and the name * of the Java class it maps to. - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ @@ -99,7 +99,7 @@ public abstract class OpenType<T> "java.util.Date", "javax.management.ObjectName", CompositeData.class.getName(), - TabularData.class.getName() + TabularData.class.getName() }; /** @@ -107,8 +107,8 @@ public abstract class OpenType<T> * used as open types. Note that each type is also available * in array form, possibly with multiple dimensions. */ - public static final List<String> ALLOWED_CLASSNAMES_LIST = - Arrays.asList(ALLOWED_CLASSNAMES); + public static final List<String> ALLOWED_CLASSNAMES_LIST = + Arrays.asList(ALLOWED_CLASSNAMES); /** * Constructs a new {@link OpenType} for the specified class @@ -136,25 +136,25 @@ public abstract class OpenType<T> { if (name == null || name.equals("")) throw new IllegalArgumentException("The name can not be null " + - "or the empty string."); + "or the empty string."); if (desc == null || desc.equals("")) throw new IllegalArgumentException("The description can not " + - "be null or the empty string."); + "be null or the empty string."); Class<?> type; try { - type = Class.forName(className); + type = Class.forName(className); } catch (ClassNotFoundException e) { - throw (OpenDataException) new OpenDataException("The class name, " + className + - ", is unavailable.").initCause(e); + throw (OpenDataException) new OpenDataException("The class name, " + className + + ", is unavailable.").initCause(e); } while (type.isArray()) type = type.getComponentType(); if (!(type.isPrimitive() || ALLOWED_CLASSNAMES_LIST.contains(type.getName()))) - throw new OpenDataException("The class name, " + className + - ", does not specify a valid open type."); + throw new OpenDataException("The class name, " + className + + ", does not specify a valid open type."); this.className = className; typeName = name; description = desc; @@ -172,7 +172,7 @@ public abstract class OpenType<T> /** * Returns the name of the Java class this type represents. This must * be one of the {@link ALLOWED_CLASSNAMES} or an array of one of them. - * The specification of arrays follows the standard set by + * The specification of arrays follows the standard set by * {@link java.lang.Class#getName()} i.e. the name is the class name * preceded by n instances of '[' and an 'L', where n is number of * dimensions used by the array. diff --git a/libjava/classpath/javax/management/openmbean/SimpleType.java b/libjava/classpath/javax/management/openmbean/SimpleType.java index ef05e9d..81b991b 100644 --- a/libjava/classpath/javax/management/openmbean/SimpleType.java +++ b/libjava/classpath/javax/management/openmbean/SimpleType.java @@ -56,7 +56,7 @@ import javax.management.ObjectName; * basic Java types. As a result, the valid instances of this * class are predefined, and no constructor is given for creating * new instances. - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ @@ -80,7 +80,7 @@ public final class SimpleType<T> * The {@link SimpleType} representation of * <code>java.lang.Boolean</code>. */ - public static final SimpleType<Boolean> BOOLEAN; + public static final SimpleType<Boolean> BOOLEAN; /** * The {@link SimpleType} representation of @@ -98,7 +98,7 @@ public final class SimpleType<T> * The {@link SimpleType} representation of * <code>java.util.Date</code>. */ - public static final SimpleType<Date> DATE; + public static final SimpleType<Date> DATE; /** * The {@link SimpleType} representation of @@ -171,28 +171,28 @@ public final class SimpleType<T> { try { - BIGDECIMAL = new SimpleType<BigDecimal>("java.math.BigDecimal"); - BIGINTEGER = new SimpleType<BigInteger>("java.math.BigInteger"); - BOOLEAN = new SimpleType<Boolean>("java.lang.Boolean"); - BYTE = new SimpleType<Byte>("java.lang.Byte"); - CHARACTER = new SimpleType<Character>("java.lang.Character"); - DATE = new SimpleType<Date>("java.util.Date"); - DOUBLE = new SimpleType<Double>("java.lang.Double"); - FLOAT = new SimpleType<Float>("java.lang.Float"); - INTEGER = new SimpleType<Integer>("java.lang.Integer"); - LONG = new SimpleType<Long>("java.lang.Long"); - OBJECTNAME = - new SimpleType<ObjectName>("javax.management.ObjectName"); - SHORT = new SimpleType<Short>("java.lang.Short"); - STRING = new SimpleType<String>("java.lang.String"); - VOID = new SimpleType<Void>("java.lang.Void"); + BIGDECIMAL = new SimpleType<BigDecimal>("java.math.BigDecimal"); + BIGINTEGER = new SimpleType<BigInteger>("java.math.BigInteger"); + BOOLEAN = new SimpleType<Boolean>("java.lang.Boolean"); + BYTE = new SimpleType<Byte>("java.lang.Byte"); + CHARACTER = new SimpleType<Character>("java.lang.Character"); + DATE = new SimpleType<Date>("java.util.Date"); + DOUBLE = new SimpleType<Double>("java.lang.Double"); + FLOAT = new SimpleType<Float>("java.lang.Float"); + INTEGER = new SimpleType<Integer>("java.lang.Integer"); + LONG = new SimpleType<Long>("java.lang.Long"); + OBJECTNAME = + new SimpleType<ObjectName>("javax.management.ObjectName"); + SHORT = new SimpleType<Short>("java.lang.Short"); + STRING = new SimpleType<String>("java.lang.String"); + VOID = new SimpleType<Void>("java.lang.Void"); } catch (OpenDataException e) { - /* In normal circumstances, this shouldn't be possible. */ - throw new IllegalStateException("A invalid class name " + - "was passed to the SimpleType " + - "constructor.", e); + /* In normal circumstances, this shouldn't be possible. */ + throw new IllegalStateException("A invalid class name " + + "was passed to the SimpleType " + + "constructor.", e); } } @@ -200,12 +200,12 @@ public final class SimpleType<T> * Constructs a new {@link SimpleType} instance for the given * class name. The class name is also used as the type name * and description of the {@link OpenType} instance. - * + * * @param name the name of the class this instance should * represent. * @throws OpenDataException if somehow the constructor of the * superclass is passed an invalid - * class name. + * class name. */ private SimpleType(String name) throws OpenDataException @@ -224,7 +224,7 @@ public final class SimpleType<T> * {@link SimpleType}.</li> * <li>The class names are equal.</li> * </ul> - * + * * @param obj the object to compare with. * @return true if the conditions above hold. */ @@ -319,7 +319,7 @@ public final class SimpleType<T> if (equals(VOID)) return VOID; throw new InvalidObjectException("Invalid simple type instance " + - "deserialized."); + "deserialized."); } /** @@ -342,8 +342,8 @@ public final class SimpleType<T> { if (string == null) string = getClass().getName() - + "[name=" + getClassName() - + "]"; + + "[name=" + getClassName() + + "]"; return string; } diff --git a/libjava/classpath/javax/management/openmbean/TabularData.java b/libjava/classpath/javax/management/openmbean/TabularData.java index 75ab00b..8bceae8 100644 --- a/libjava/classpath/javax/management/openmbean/TabularData.java +++ b/libjava/classpath/javax/management/openmbean/TabularData.java @@ -63,7 +63,7 @@ public interface TabularData * this instance's tabular type. The returned indices are the * values of the fields in the supplied {@link CompositeData} * instance that match the names given in the {@link TabularType}. - * + * * @param val the {@link CompositeData} value whose index should * be calculated. * @return the index the value would take on, if it were to be added. @@ -154,14 +154,14 @@ public interface TabularData /** * Returns true if this {@link TabularData} instance * contains no {@link CompositeData} values. - * + * * @return true if the instance is devoid of rows. */ boolean isEmpty(); /** * Returns a {@link java.util.Set} view of the keys or - * indices of this {@link TabularData} instance. + * indices of this {@link TabularData} instance. * * @return a set containing the keys of this instance. */ @@ -174,7 +174,7 @@ public interface TabularData * the same index as an existing value. The index is * calculated using the index names of the * {@link TabularType} for this instance. - * + * * @param val the {@link CompositeData} value to add. * @throws NullPointerException if <code>val</code> is * <code>null</code>. @@ -198,7 +198,7 @@ public interface TabularData * value can not be added, then none of the values should * be. If the array is <code>null</code> or empty, the * method simply returns. - * + * * @param vals the {@link CompositeData} values to add. * @throws NullPointerException if a value from the array is * <code>null</code>. @@ -247,7 +247,7 @@ public interface TabularData * object. */ String toString(); - + /** * Returns the values associated with this instance. * @@ -256,4 +256,3 @@ public interface TabularData Collection<?> values(); } - diff --git a/libjava/classpath/javax/management/openmbean/TabularDataSupport.java b/libjava/classpath/javax/management/openmbean/TabularDataSupport.java index 8557f5f..e2da1b4 100644 --- a/libjava/classpath/javax/management/openmbean/TabularDataSupport.java +++ b/libjava/classpath/javax/management/openmbean/TabularDataSupport.java @@ -115,7 +115,7 @@ public class TabularDataSupport tabularType = type; dataMap = new HashMap<Object,Object>(cap, lf); } - + /** * Calculates the index the specified {@link CompositeData} value * would have, if it was to be added to this {@link TabularData} @@ -127,7 +127,7 @@ public class TabularDataSupport * this instance's tabular type. The returned indices are the * values of the fields in the supplied {@link CompositeData} * instance that match the names given in the {@link TabularType}. - * + * * @param val the {@link CompositeData} value whose index should * be calculated. * @return the index the value would take on, if it were to be added. @@ -139,8 +139,8 @@ public class TabularDataSupport { if (!(val.getCompositeType().equals(tabularType.getRowType()))) throw new InvalidOpenTypeException("The type of the given value " + - "does not match the row type " + - "of this instance."); + "does not match the row type " + + "of this instance."); List<String> indexNames = tabularType.getIndexNames(); List<String> matchingIndicies = new ArrayList<String>(indexNames.size()); for (String name : indexNames) @@ -169,12 +169,12 @@ public class TabularDataSupport TabularDataSupport clone = null; try { - clone = (TabularDataSupport) super.clone(); - clone.setMap((HashMap<Object,Object>) dataMap.clone()); + clone = (TabularDataSupport) super.clone(); + clone.setMap((HashMap<Object,Object>) dataMap.clone()); } catch (CloneNotSupportedException e) { - /* This won't happen as we implement Cloneable */ + /* This won't happen as we implement Cloneable */ } return clone; } @@ -336,7 +336,7 @@ public class TabularDataSupport { if (!(isKeyValid(key))) throw new InvalidKeyException("The key does not match the " + - "tabular type of this instance."); + "tabular type of this instance."); return (CompositeData) dataMap.get(key); } @@ -369,7 +369,7 @@ public class TabularDataSupport /** * Returns true if this {@link TabularData} instance * contains no {@link CompositeData} values. - * + * * @return true if the instance is devoid of rows. */ public boolean isEmpty() @@ -391,9 +391,9 @@ public class TabularDataSupport CompositeType rowType = tabularType.getRowType(); for (int a = 0; it.hasNext(); ++a) { - OpenType<?> type = rowType.getType(it.next()); - if (!(type.isValue(key[a]))) - return false; + OpenType<?> type = rowType.getType(it.next()); + if (!(type.isValue(key[a]))) + return false; } return true; } @@ -422,7 +422,7 @@ public class TabularDataSupport * the same index as an existing value. The index is * calculated using the index names of the * {@link TabularType} for this instance. - * + * * @param val the {@link CompositeData} value to add. * @throws NullPointerException if <code>val</code> is * <code>null</code>. @@ -438,7 +438,7 @@ public class TabularDataSupport Object[] key = calculateIndex(val); if (dataMap.containsKey(key)) throw new KeyAlreadyExistsException("A value with this index " + - "already exists."); + "already exists."); dataMap.put(key, val); } @@ -476,7 +476,7 @@ public class TabularDataSupport * value can not be added, then none of the values should * be. If the array is <code>null</code> or empty, the * method simply returns. - * + * * @param vals the {@link CompositeData} values to add. * @throws NullPointerException if a value from the array is * <code>null</code>. @@ -496,12 +496,12 @@ public class TabularDataSupport Map<Object,Object> mapToAdd = new HashMap<Object,Object>(vals.length); for (int a = 0; a < vals.length; ++a) { - Object[] key = calculateIndex(vals[a]); - if (dataMap.containsKey(key)) - throw new KeyAlreadyExistsException("Element " + a + ": A " + - "value with this index " + - "already exists."); - mapToAdd.put(key, vals[a]); + Object[] key = calculateIndex(vals[a]); + if (dataMap.containsKey(key)) + throw new KeyAlreadyExistsException("Element " + a + ": A " + + "value with this index " + + "already exists."); + mapToAdd.put(key, vals[a]); } dataMap.putAll(mapToAdd); } @@ -541,7 +541,7 @@ public class TabularDataSupport Iterator<?> it = vals.iterator(); for (int a = 0; it.hasNext(); ++a) { - data[a] = (CompositeData) it.next(); + data[a] = (CompositeData) it.next(); } putAll(data); } @@ -583,7 +583,7 @@ public class TabularDataSupport { if (!(isKeyValid(key))) throw new InvalidKeyException("The key does not match the " + - "tabular type of this instance."); + "tabular type of this instance."); return (CompositeData) dataMap.remove(key); } @@ -622,11 +622,11 @@ public class TabularDataSupport public String toString() { return getClass().getName() - + "[tabularType=" + tabularType + + "[tabularType=" + tabularType + ",dataMap=" + dataMap + "]"; } - + /** * Returns a collection (or bag) view of the values in this Map. The * collection is backed by the map, so that changes in one show up in @@ -646,4 +646,3 @@ public class TabularDataSupport } } - diff --git a/libjava/classpath/javax/management/openmbean/TabularType.java b/libjava/classpath/javax/management/openmbean/TabularType.java index 5a861d0..5ea220701 100644 --- a/libjava/classpath/javax/management/openmbean/TabularType.java +++ b/libjava/classpath/javax/management/openmbean/TabularType.java @@ -45,7 +45,7 @@ import java.util.List; /** * The open type descriptor for instances of the * {@link TabularData} class. - * + * * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @since 1.5 */ @@ -92,7 +92,7 @@ public class TabularType * The result of <code>TabularData.class.getName()</code> is adopted * as the class name (see {@link OpenType}). The ordering of the array * elements is relevant in determining the indicies of the values in the - * table, and thus in the use of the + * table, and thus in the use of the * {@link TabularData#get(java.lang.Object[])} and * {@link TabularData#remove(java.lang.Object[])} methods of the * {@link TabularData} class. @@ -108,7 +108,7 @@ public class TabularType * name in the given row type. */ public TabularType(String name, String desc, CompositeType rowType, - String[] indexNames) + String[] indexNames) throws OpenDataException { super(TabularData.class.getName(), name, desc); @@ -116,16 +116,16 @@ public class TabularType throw new IllegalArgumentException("A null row type was given."); for (int a = 0; a < indexNames.length; ++a) { - if (indexNames[a] == null) - throw new IllegalArgumentException("Name " + a + - " is null."); - if (indexNames[a].length() == 0) - throw new IllegalArgumentException("Name " + a + - " is the empty string."); - if (!(rowType.containsKey(indexNames[a]))) - throw new OpenDataException("No matching key for " + - indexNames[a] + " was found in " + - "the supplied row type."); + if (indexNames[a] == null) + throw new IllegalArgumentException("Name " + a + + " is null."); + if (indexNames[a].length() == 0) + throw new IllegalArgumentException("Name " + a + + " is the empty string."); + if (!(rowType.containsKey(indexNames[a]))) + throw new OpenDataException("No matching key for " + + indexNames[a] + " was found in " + + "the supplied row type."); } this.rowType = rowType; this.indexNames = Collections.unmodifiableList(Arrays.asList(indexNames)); @@ -144,7 +144,7 @@ public class TabularType * <li>The row types are equal.</li> * <li>The index names are equal and in the same order.</li> * </ul> - * + * * @param obj the object to compare with. * @return true if the conditions above hold. */ @@ -154,8 +154,8 @@ public class TabularType return false; TabularType ttype = (TabularType) obj; return (ttype.getTypeName().equals(getTypeName()) - && (ttype.getRowType().equals(getRowType())) - && (ttype.getIndexNames().equals(getIndexNames()))); + && (ttype.getRowType().equals(getRowType())) + && (ttype.getIndexNames().equals(getIndexNames()))); } /** @@ -205,16 +205,16 @@ public class TabularType { if (hashCode == null) { - int elementTotal = 0; - for (String s : indexNames) - elementTotal += s.hashCode(); - hashCode = Integer.valueOf(elementTotal - + getTypeName().hashCode() - + rowType.hashCode()); + int elementTotal = 0; + for (String s : indexNames) + elementTotal += s.hashCode(); + hashCode = Integer.valueOf(elementTotal + + getTypeName().hashCode() + + rowType.hashCode()); } return hashCode.intValue(); } - + /** * Returns true if the specified object is a member of this * tabular type. The object is judged to be so if it is @@ -229,8 +229,8 @@ public class TabularType { if (obj instanceof TabularData) { - TabularData data = (TabularData) obj; - return equals(data.getTabularType()); + TabularData data = (TabularData) obj; + return equals(data.getTabularType()); } return false; } @@ -258,10 +258,10 @@ public class TabularType { if (string == null) string = getClass().getName() - + "[name=" + getTypeName() - + ", rowType=" + rowType - + ", indexNames=" + indexNames - + "]"; + + "[name=" + getTypeName() + + ", rowType=" + rowType + + ", indexNames=" + indexNames + + "]"; return string; } |