summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java')
-rw-r--r--libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java
index 7fad2a13161..5f86bf4af96 100644
--- a/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java
+++ b/libjava/classpath/javax/management/openmbean/OpenMBeanParameterInfoSupport.java
@@ -78,12 +78,12 @@ public class OpenMBeanParameterInfoSupport
/**
* The minimum value of the parameter (may be <code>null</code>).
*/
- private Comparable<Object> minValue;
+ private Comparable<?> minValue;
/**
* The maximum value of the parameter (may be <code>null</code>).
*/
- private Comparable<Object> maxValue;
+ private Comparable<?> maxValue;
/**
* The hash code of this instance.
@@ -190,6 +190,7 @@ public class OpenMBeanParameterInfoSupport
* the empty string.
* @throws OpenDataException if any condition in the list above is broken.
*/
+ @SuppressWarnings("unchecked")
public <T> OpenMBeanParameterInfoSupport(String name, String desc, OpenType<T> type,
T defaultValue, Comparable<T> minimumValue,
Comparable<T> maximumValue)
@@ -209,22 +210,22 @@ public class OpenMBeanParameterInfoSupport
type instanceof TabularType))
throw new OpenDataException("Default values are not applicable for " +
"array or tabular types.");
- if (minValue != null && maxValue != null
- && minValue.compareTo(maxValue) > 0)
+ if (minimumValue != null && maximumValue != null
+ && minimumValue.compareTo((T) maximumValue) > 0)
throw new OpenDataException("The minimum value is greater than the " +
"maximum.");
- if (minValue != null && defaultValue != null
- && minValue.compareTo(defaultValue) > 0)
+ if (minimumValue != null && defaultValue != null
+ && minimumValue.compareTo(defaultValue) > 0)
throw new OpenDataException("The minimum value is greater than the " +
"default.");
- if (defaultValue != null && maxValue != null
- && maxValue.compareTo(defaultValue) < 0)
+ if (defaultValue != null && maximumValue != null
+ && maximumValue.compareTo(defaultValue) < 0)
throw new OpenDataException("The default value is greater than the " +
"maximum.");
this.defaultValue = defaultValue;
- minValue = (Comparable<Object>) minimumValue;
- maxValue = (Comparable<Object>) maximumValue;
+ minValue = minimumValue;
+ maxValue = maximumValue;
}
/**
@@ -279,7 +280,7 @@ public class OpenMBeanParameterInfoSupport
"array or tabular types.");
if (legalValues != null && legalValues.length > 0)
{
- Set lv = new HashSet(legalValues.length);
+ Set<T> lv = new HashSet<T>(legalValues.length);
for (int a = 0; a < legalValues.length; ++a)
{
if (legalValues[a] != null &&
OpenPOWER on IntegriCloud