--- old/src/share/classes/java/beans/EventHandler.java 2014-06-02 16:44:58.000000000 -0700
+++ new/src/share/classes/java/beans/EventHandler.java 2014-06-02 16:44:57.000000000 -0700
@@ -446,7 +446,7 @@
}
if (listenerMethodName == null || listenerMethodName.equals(methodName)) {
- Class[] argTypes = null;
+ Class>[] argTypes = null;
Object[] newArgs = null;
if (eventPropertyName == null) { // Nullary method.
--- old/src/share/classes/java/beans/EventSetDescriptor.java 2014-06-02 16:44:58.000000000 -0700
+++ new/src/share/classes/java/beans/EventSetDescriptor.java 2014-06-02 16:44:58.000000000 -0700
@@ -81,7 +81,7 @@
String eventName = NameGenerator.capitalize(eventSetName) + "Event";
Method[] listenerMethods = getListenerMethods();
if (listenerMethods.length > 0) {
- Class[] args = getParameterTypes(getClass0(), listenerMethods[0]);
+ Class>[] args = getParameterTypes(getClass0(), listenerMethods[0]);
// Check for EventSet compliance. Special case for vetoableChange. See 4529996
if (!"vetoableChange".equals(eventSetName) && !args[0].getName().endsWith(eventName)) {
throw new IntrospectionException("Method \"" + listenerMethodName +
--- old/src/share/classes/java/beans/IndexedPropertyDescriptor.java 2014-06-02 16:44:59.000000000 -0700
+++ new/src/share/classes/java/beans/IndexedPropertyDescriptor.java 2014-06-02 16:44:59.000000000 -0700
@@ -353,7 +353,7 @@
Class> indexedPropertyType = null;
if (indexedReadMethod != null) {
- Class params[] = getParameterTypes(getClass0(), indexedReadMethod);
+ Class>[] params = getParameterTypes(getClass0(), indexedReadMethod);
if (params.length != 1) {
throw new IntrospectionException("bad indexed read method arg count");
}
@@ -366,7 +366,7 @@
}
}
if (indexedWriteMethod != null) {
- Class params[] = getParameterTypes(getClass0(), indexedWriteMethod);
+ Class>[] params = getParameterTypes(getClass0(), indexedWriteMethod);
if (params.length != 2) {
throw new IntrospectionException("bad indexed write method arg count");
}
--- old/src/share/classes/java/beans/Introspector.java 2014-06-02 16:45:00.000000000 -0700
+++ new/src/share/classes/java/beans/Introspector.java 2014-06-02 16:44:59.000000000 -0700
@@ -1384,7 +1384,7 @@
* parameter list on a given class.
*/
private static Method internalFindMethod(Class> start, String methodName,
- int argCount, Class args[]) {
+ int argCount, Class> args[]) {
// For overriden methods we need to find the most derived version.
// So we start with the given class and walk up the superclass chain.
@@ -1426,7 +1426,7 @@
// Now check any inherited interfaces. This is necessary both when
// the argument class is itself an interface, and when the argument
// class is an abstract class.
- Class ifcs[] = start.getInterfaces();
+ Class>[] ifcs = start.getInterfaces();
for (int i = 0 ; i < ifcs.length; i++) {
// Note: The original implementation had both methods calling
// the 3 arg method. This is preserved but perhaps it should
@@ -1459,7 +1459,7 @@
* @return the method or null if not found
*/
static Method findMethod(Class> cls, String methodName, int argCount,
- Class args[]) {
+ Class>[] args) {
if (methodName == null) {
return null;
}
@@ -1502,7 +1502,7 @@
* Return true iff the given method throws the given exception.
*/
private boolean throwsException(Method method, Class> exception) {
- Class exs[] = method.getExceptionTypes();
+ Class>[] exs = method.getExceptionTypes();
for (int i = 0; i < exs.length; i++) {
if (exs[i] == exception) {
return true;
--- old/src/share/classes/java/beans/MetaData.java 2014-06-02 16:45:00.000000000 -0700
+++ new/src/share/classes/java/beans/MetaData.java 2014-06-02 16:45:00.000000000 -0700
@@ -1401,7 +1401,7 @@
}
private static boolean isValid(Constructor> constructor, String[] names) {
- Class[] parameters = constructor.getParameterTypes();
+ Class>[] parameters = constructor.getParameterTypes();
if (names.length != parameters.length) {
return false;
}
--- old/src/share/classes/java/beans/PropertyDescriptor.java 2014-06-02 16:45:01.000000000 -0700
+++ new/src/share/classes/java/beans/PropertyDescriptor.java 2014-06-02 16:45:01.000000000 -0700
@@ -112,7 +112,7 @@
// If this class or one of its base classes allow PropertyChangeListener,
// then we assume that any properties we discover are "bound".
// See Introspector.getTargetPropertyInfo() method.
- Class[] args = { PropertyChangeListener.class };
+ Class>[] args = { PropertyChangeListener.class };
this.bound = null != Introspector.findMethod(beanClass, "addPropertyChangeListener", args.length, args);
}
--- old/src/share/classes/java/beans/beancontext/BeanContextServiceAvailableEvent.java 2014-06-02 16:45:01.000000000 -0700
+++ new/src/share/classes/java/beans/beancontext/BeanContextServiceAvailableEvent.java 2014-06-02 16:45:01.000000000 -0700
@@ -47,7 +47,7 @@
* @param bcs The context in which the service has become available
* @param sc A Class reference to the newly available service
*/
- public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
+ public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class> sc) {
super((BeanContext)bcs);
serviceClass = sc;
@@ -65,13 +65,13 @@
* Gets the service class that is the subject of this notification.
* @return A Class reference to the newly available service
*/
- public Class getServiceClass() { return serviceClass; }
+ public Class> getServiceClass() { return serviceClass; }
/**
* Gets the list of service dependent selectors.
* @return the current selectors available from the service
*/
- public Iterator getCurrentServiceSelectors() {
+ public Iterator> getCurrentServiceSelectors() {
return ((BeanContextServices)getSource()).getCurrentServiceSelectors(serviceClass);
}
@@ -82,5 +82,5 @@
/**
* A Class reference to the newly available service
*/
- protected Class serviceClass;
+ protected Class> serviceClass;
}
--- old/src/share/classes/java/beans/beancontext/BeanContextServiceProvider.java 2014-06-02 16:45:02.000000000 -0700
+++ new/src/share/classes/java/beans/beancontext/BeanContextServiceProvider.java 2014-06-02 16:45:02.000000000 -0700
@@ -70,7 +70,7 @@
*
* @return a reference to the requested service
*/
- Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector);
+ Object getService(BeanContextServices bcs, Object requestor, Class> serviceClass, Object serviceSelector);
/**
* Invoked by BeanContextServices,
@@ -100,5 +100,5 @@
* @param serviceClass the specified service
* @return the current service selectors for the specified serviceClass
*/
- Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass);
+ Iterator> getCurrentServiceSelectors(BeanContextServices bcs, Class> serviceClass);
}
--- old/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedEvent.java 2014-06-02 16:45:03.000000000 -0700
+++ new/src/share/classes/java/beans/beancontext/BeanContextServiceRevokedEvent.java 2014-06-02 16:45:02.000000000 -0700
@@ -46,7 +46,7 @@
* @param sc the service that is being revoked
* @param invalidate true for immediate revocation
*/
- public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc, boolean invalidate) {
+ public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class> sc, boolean invalidate) {
super((BeanContext)bcs);
serviceClass = sc;
@@ -67,7 +67,7 @@
* @return A Class reference to the
* service that is being revoked
*/
- public Class getServiceClass() { return serviceClass; }
+ public Class> getServiceClass() { return serviceClass; }
/**
* Checks this event to determine whether or not
@@ -76,7 +76,7 @@
* @return true if the service being revoked is of the
* same class as the specified service
*/
- public boolean isServiceClass(Class service) {
+ public boolean isServiceClass(Class> service) {
return serviceClass.equals(service);
}
@@ -94,6 +94,6 @@
/**
* A Class reference to the service that is being revoked.
*/
- protected Class serviceClass;
+ protected Class> serviceClass;
private boolean invalidateRefs;
}
--- old/src/share/classes/java/beans/beancontext/BeanContextServices.java 2014-06-02 16:45:03.000000000 -0700
+++ new/src/share/classes/java/beans/beancontext/BeanContextServices.java 2014-06-02 16:45:03.000000000 -0700
@@ -62,7 +62,7 @@
* associated with the service
* @return true if the service was successful added, false otherwise
*/
- boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider);
+ boolean addService(Class> serviceClass, BeanContextServiceProvider serviceProvider);
/**
* BeanContextServiceProviders wishing to remove
@@ -83,7 +83,7 @@
* terminate service to all currently outstanding references
* to the specified service.
*/
- void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow);
+ void revokeService(Class> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow);
/**
* Reports whether or not a given service is
@@ -91,7 +91,7 @@
* @param serviceClass the service in question
* @return true if the service is available
*/
- boolean hasService(Class serviceClass);
+ boolean hasService(Class> serviceClass);
/**
* A BeanContextChild, or any arbitrary object
@@ -113,7 +113,7 @@
* @return a reference to this context's named
* Service as requested or null
*/
- Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException;
+ Object getService(BeanContextChild child, Object requestor, Class> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException;
/**
* Releases a BeanContextChild's
@@ -131,7 +131,7 @@
* @return an Iterator consisting of the
* currently available services
*/
- Iterator getCurrentServiceClasses();
+ Iterator> getCurrentServiceClasses();
/**
* Gets the list of service dependent service parameters
@@ -142,7 +142,7 @@
* @return the currently available service selectors
* for the named serviceClass
*/
- Iterator getCurrentServiceSelectors(Class serviceClass);
+ Iterator> getCurrentServiceSelectors(Class> serviceClass);
/**
* Adds a BeanContextServicesListener to this BeanContext
--- old/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java 2014-06-02 16:45:04.000000000 -0700
+++ new/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java 2014-06-02 16:45:03.000000000 -0700
@@ -129,9 +129,8 @@
public void initialize() {
super.initialize();
-
- services = new HashMap(serializable + 1);
- bcsListeners = new ArrayList(1);
+ services = new HashMap<>(serializable + 1);
+ bcsListeners = new ArrayList<>(1);
}
/**
@@ -169,7 +168,7 @@
// create an instance of a service ref
- BCSSCServiceClassRef(Class sc, BeanContextServiceProvider bcsp, boolean delegated) {
+ BCSSCServiceClassRef(Class> sc, BeanContextServiceProvider bcsp, boolean delegated) {
super();
serviceClass = sc;
@@ -183,7 +182,7 @@
// add a requestor and assoc listener
void addRequestor(Object requestor, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
- BeanContextServiceRevokedListener cbcsrl = (BeanContextServiceRevokedListener)requestors.get(requestor);
+ BeanContextServiceRevokedListener cbcsrl = requestors.get(requestor);
if (cbcsrl != null && !cbcsrl.equals(bcsrl))
throw new TooManyListenersException();
@@ -200,7 +199,7 @@
// check a requestors listener
void verifyRequestor(Object requestor, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException {
- BeanContextServiceRevokedListener cbcsrl = (BeanContextServiceRevokedListener)requestors.get(requestor);
+ BeanContextServiceRevokedListener cbcsrl = requestors.get(requestor);
if (cbcsrl != null && !cbcsrl.equals(bcsrl))
throw new TooManyListenersException();
@@ -230,15 +229,18 @@
}
- Iterator cloneOfEntries() {
- return ((HashMap)requestors.clone()).entrySet().iterator();
+ @SuppressWarnings("unchecked") // Cast from clone
+ Iterator> cloneOfEntries() {
+ return ((HashMap