harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r425336 [1/3] - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java: java/beans/ java/beans/beancontext/ org/apache/harmony/beans/
Date Tue, 25 Jul 2006 08:54:56 GMT
Author: mloenko
Date: Tue Jul 25 01:54:54 2006
New Revision: 425336

URL: http://svn.apache.org/viewvc?rev=425336&view=rev
Log:
fixes for HARMONY-934
[classlib][beans] fixing ecj warnings

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IntrospectionException.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLDecoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/Command.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/DefaultPersistenceDelegatesFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/Handler.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java Tue Jul 25 01:54:54 2006
@@ -64,8 +64,10 @@
                         Method setter = pd.getWriteMethod();
 
                         if (setter != null) {
-                            Object oldValue = getter.invoke(oldInstance, null);
-                            Object newValue = getter.invoke(newInstance, null);
+                            Object oldValue = getter.invoke(oldInstance,
+                                    (Object[]) null);
+                            Object newValue = getter.invoke(newInstance,
+                                    (Object[]) null);
 
                             if (oldValue != null && !oldValue.equals(newValue)
                                     || oldValue == null && newValue != null) {
@@ -78,7 +80,8 @@
                         } else {
                             // commented since the process should be
                             // continued even if no setter is found
-                            // throw new Exception("no setter for " + pd.getName() + " property.");
+                            // throw new Exception("no setter for " +
+                            // pd.getName() + " property.");
                             continue;
                         }
                     }
@@ -117,7 +120,8 @@
                             Method getter = pds[j].getReadMethod();
 
                             if (getter != null) {
-                                args[i] = getter.invoke(oldInstance, null);
+                                args[i] = getter.invoke(oldInstance,
+                                        (Object[]) null);
                                 found = true;
                                 break;
                             } else {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java Tue Jul 25 01:54:54 2006
@@ -97,8 +97,8 @@
     }
 
     void doWriteObject(Object object) {
-        PersistenceDelegate pd = (object != null) ? 
-                getPersistenceDelegate(object.getClass())
+        PersistenceDelegate pd = (object != null) ? getPersistenceDelegate(object
+                .getClass())
                 : new NullPersistenceDelegate();
 
         if (pd == null) {
@@ -159,6 +159,8 @@
                 nodes.put(oldInstance, node);
 
                 // if an expression is not a constructor
+                // FIXME prevents instance methods of Class and Method objects
+                // from being handled correctly
                 if (!(oldExp.getTarget() instanceof Class || oldExp.getTarget() instanceof Field)) {
                     ObjectNode parent = nodes.get(oldExp.getTarget());
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IntrospectionException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IntrospectionException.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IntrospectionException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IntrospectionException.java Tue Jul 25 01:54:54 2006
@@ -26,7 +26,9 @@
  */
 
 public class IntrospectionException extends Exception {
-    
+
+    static final long serialVersionUID = -3728150539969542619L;
+
     /**
      * @com.intel.drl.spec_ref
      */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java Tue Jul 25 01:54:54 2006
@@ -37,17 +37,19 @@
  */
 
 public class VetoableChangeSupport implements Serializable {
-    
+
     private static final long serialVersionUID = -5090210921595982017l;
-    
+
     private transient Object sourceBean;
+
     private transient List<VetoableChangeListener> allVetoableChangeListeners = new ArrayList<VetoableChangeListener>();
+
     private transient Map<String, List<VetoableChangeListener>> selectedVetoableChangeListeners = new HashMap<String, List<VetoableChangeListener>>();
-    
+
     // fields for serialization compatibility
     private Hashtable<String, List<VetoableChangeListener>> children;
-    private Object source;
-    private int vetoableChangeSupportSerializedDataVersion = 1; 
+
+    private int vetoableChangeSupportSerializedDataVersion = 1;
 
     /**
      * @com.intel.drl.spec_ref
@@ -62,8 +64,8 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    public void fireVetoableChange(
-            String propertyName, Object oldValue, Object newValue) throws PropertyVetoException {
+    public void fireVetoableChange(String propertyName, Object oldValue,
+            Object newValue) throws PropertyVetoException {
         PropertyChangeEvent event = createPropertyChangeEvent(propertyName,
                 oldValue, newValue);
         doFirePropertyChange(event);
@@ -72,13 +74,14 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    public synchronized void removeVetoableChangeListener(
-            String propertyName, VetoableChangeListener listener) {
-        if ( (propertyName != null) && (listener != null) ) {
-            List<VetoableChangeListener> listeners = selectedVetoableChangeListeners.get(propertyName);
-            
-            if(listeners != null) {
-                listeners.remove(listener);    
+    public synchronized void removeVetoableChangeListener(String propertyName,
+            VetoableChangeListener listener) {
+        if ((propertyName != null) && (listener != null)) {
+            List<VetoableChangeListener> listeners = selectedVetoableChangeListeners
+                    .get(propertyName);
+
+            if (listeners != null) {
+                listeners.remove(listener);
             }
         }
     }
@@ -107,37 +110,33 @@
     public synchronized VetoableChangeListener[] getVetoableChangeListeners(
             String propertyName) {
         List<VetoableChangeListener> listeners = null;
-        
+
         if (propertyName != null) {
             listeners = selectedVetoableChangeListeners.get(propertyName);
         }
-        
-        return (listeners == null) ? new VetoableChangeListener[] {} :
-            getAsVetoableChangeListenerArray(listeners);
-        
+
+        return (listeners == null) ? new VetoableChangeListener[] {}
+                : getAsVetoableChangeListenerArray(listeners);
+
     }
 
     /**
      * @com.intel.drl.spec_ref
      */
-    public void fireVetoableChange(
-            String propertyName,
-            boolean oldValue,
+    public void fireVetoableChange(String propertyName, boolean oldValue,
             boolean newValue) throws PropertyVetoException {
-        PropertyChangeEvent event = createPropertyChangeEvent(
-                propertyName, oldValue, newValue);
+        PropertyChangeEvent event = createPropertyChangeEvent(propertyName,
+                oldValue, newValue);
         doFirePropertyChange(event);
     }
 
     /**
      * @com.intel.drl.spec_ref
      */
-    public void fireVetoableChange(
-            String propertyName,
-            int oldValue,
+    public void fireVetoableChange(String propertyName, int oldValue,
             int newValue) throws PropertyVetoException {
-        PropertyChangeEvent event = createPropertyChangeEvent(
-                propertyName, oldValue, newValue);
+        PropertyChangeEvent event = createPropertyChangeEvent(propertyName,
+                oldValue, newValue);
         doFirePropertyChange(event);
     }
 
@@ -147,12 +146,13 @@
     public synchronized boolean hasListeners(String propertyName) {
         boolean result = allVetoableChangeListeners.size() > 0;
         if (!result && propertyName != null) {
-            List<VetoableChangeListener> listeners = selectedVetoableChangeListeners.get(propertyName);
+            List<VetoableChangeListener> listeners = selectedVetoableChangeListeners
+                    .get(propertyName);
             if (listeners != null) {
                 result = listeners.size() > 0;
             }
         }
-        return result;    
+        return result;
     }
 
     /**
@@ -161,7 +161,8 @@
     public synchronized void removeVetoableChangeListener(
             VetoableChangeListener listener) {
         if (listener != null) {
-            Iterator<VetoableChangeListener> iterator = allVetoableChangeListeners.iterator();
+            Iterator<VetoableChangeListener> iterator = allVetoableChangeListeners
+                    .iterator();
             while (iterator.hasNext()) {
                 VetoableChangeListener pcl = iterator.next();
                 if (pcl == listener) {
@@ -186,79 +187,85 @@
      * @com.intel.drl.spec_ref
      */
     public synchronized VetoableChangeListener[] getVetoableChangeListeners() {
-        List<VetoableChangeListener> result = new ArrayList<VetoableChangeListener>(allVetoableChangeListeners);
-        
-        Iterator<String> keysIterator =
-                selectedVetoableChangeListeners.keySet().iterator();
+        List<VetoableChangeListener> result = new ArrayList<VetoableChangeListener>(
+                allVetoableChangeListeners);
+
+        Iterator<String> keysIterator = selectedVetoableChangeListeners
+                .keySet().iterator();
         while (keysIterator.hasNext()) {
             String propertyName = keysIterator.next();
-            
-            List<VetoableChangeListener> selectedListeners = selectedVetoableChangeListeners.get(propertyName);
-            if(selectedListeners != null) {
+
+            List<VetoableChangeListener> selectedListeners = selectedVetoableChangeListeners
+                    .get(propertyName);
+            if (selectedListeners != null) {
                 for (VetoableChangeListener listener : selectedListeners) {
-                    result.add(new VetoableChangeListenerProxy(
-                            propertyName, listener));
+                    result.add(new VetoableChangeListenerProxy(propertyName,
+                            listener));
                 }
-                
+
             }
-            
+
         }
-        
+
         return getAsVetoableChangeListenerArray(result);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     private void writeObject(ObjectOutputStream oos) throws IOException {
         List<VetoableChangeListener> allSerializedVetoableChangeListeners = new ArrayList<VetoableChangeListener>();
         for (VetoableChangeListener vcl : allVetoableChangeListeners) {
-            if(vcl instanceof Serializable) {
+            if (vcl instanceof Serializable) {
                 allSerializedVetoableChangeListeners.add(vcl);
             }
         }
-        
+
         Map<String, List<VetoableChangeListener>> selectedSerializedVetoableChangeListeners = new HashMap<String, List<VetoableChangeListener>>();
         for (String propertyName : selectedVetoableChangeListeners.keySet()) {
-            List<VetoableChangeListener> keyValues = selectedVetoableChangeListeners.get(propertyName);
-            if(keyValues != null) {
+            List<VetoableChangeListener> keyValues = selectedVetoableChangeListeners
+                    .get(propertyName);
+            if (keyValues != null) {
                 List<VetoableChangeListener> serializedVetoableChangeListeners = new ArrayList<VetoableChangeListener>();
                 for (VetoableChangeListener pcl : keyValues) {
-                    if(pcl instanceof Serializable) {
+                    if (pcl instanceof Serializable) {
                         serializedVetoableChangeListeners.add(pcl);
                     }
                 }
-                
-                if(!serializedVetoableChangeListeners.isEmpty()) {
-                    selectedSerializedVetoableChangeListeners.put(
-                        propertyName, serializedVetoableChangeListeners);
+
+                if (!serializedVetoableChangeListeners.isEmpty()) {
+                    selectedSerializedVetoableChangeListeners.put(propertyName,
+                            serializedVetoableChangeListeners);
                 }
-                
+
             }
         }
-        
-        children = new Hashtable<String, List<VetoableChangeListener>>(selectedSerializedVetoableChangeListeners);
+
+        children = new Hashtable<String, List<VetoableChangeListener>>(
+                selectedSerializedVetoableChangeListeners);
         children.put("", allSerializedVetoableChangeListeners);
         oos.writeObject(children);
-        
+
         Object source = null;
-        if(sourceBean instanceof Serializable) {
+        if (sourceBean instanceof Serializable) {
             source = sourceBean;
         }
         oos.writeObject(source);
-        
+
         oos.writeInt(vetoableChangeSupportSerializedDataVersion);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     private void readObject(ObjectInputStream ois) throws IOException,
             ClassNotFoundException {
 
-        children = (Hashtable<String, List<VetoableChangeListener>>)ois.readObject();
+        children = (Hashtable<String, List<VetoableChangeListener>>) ois
+                .readObject();
 
-        selectedVetoableChangeListeners = new HashMap<String, List<VetoableChangeListener>>(children);
+        selectedVetoableChangeListeners = new HashMap<String, List<VetoableChangeListener>>(
+                children);
         allVetoableChangeListeners = selectedVetoableChangeListeners.remove("");
         if (allVetoableChangeListeners == null) {
             allVetoableChangeListeners = new ArrayList<VetoableChangeListener>();
@@ -275,86 +282,88 @@
             throws PropertyVetoException {
         doFirePropertyChange(event);
     }
-    
-    private PropertyChangeEvent createPropertyChangeEvent(
-            String propertyName, Object oldValue, Object newValue) {
+
+    private PropertyChangeEvent createPropertyChangeEvent(String propertyName,
+            Object oldValue, Object newValue) {
         return new PropertyChangeEvent(sourceBean, propertyName, oldValue,
                 newValue);
     }
-    
-    private PropertyChangeEvent createPropertyChangeEvent(
-            String propertyName, boolean oldValue, boolean newValue) {
-        return new PropertyChangeEvent(sourceBean, propertyName,
-                new Boolean(oldValue), new Boolean(newValue));
-    }
-    
-    private PropertyChangeEvent createPropertyChangeEvent(
-            String propertyName, int oldValue, int newValue) {
-        return new PropertyChangeEvent(sourceBean, propertyName,
-                new Integer(oldValue), new Integer(newValue));
+
+    private PropertyChangeEvent createPropertyChangeEvent(String propertyName,
+            boolean oldValue, boolean newValue) {
+        return new PropertyChangeEvent(sourceBean, propertyName, new Boolean(
+                oldValue), new Boolean(newValue));
+    }
+
+    private PropertyChangeEvent createPropertyChangeEvent(String propertyName,
+            int oldValue, int newValue) {
+        return new PropertyChangeEvent(sourceBean, propertyName, new Integer(
+                oldValue), new Integer(newValue));
     }
-    
+
     private void doFirePropertyChange(PropertyChangeEvent event)
-			throws PropertyVetoException {
-		String propName = event.getPropertyName();
-		Object oldValue = event.getOldValue();
-		Object newValue = event.getNewValue();
-
-		if (newValue != null && oldValue != null && newValue.equals(oldValue)) {
-			return;
-		}
-
-		/* Take note of who we are going to notify (and potentially un-notify) */
-
-		VetoableChangeListener[] listensToAll; // Listeners to all property change events
-		VetoableChangeListener[] listensToOne = null; // Listens to a given property change
-		synchronized (this) {
-			listensToAll = allVetoableChangeListeners.toArray(
-				new VetoableChangeListener[allVetoableChangeListeners.size()]);
-
-			List<VetoableChangeListener> listeners =
-				selectedVetoableChangeListeners.get(event.getPropertyName());
-			if (listeners != null) {
-				listensToOne = listeners.toArray(
-					new VetoableChangeListener[listeners.size()]);
-			}
-		}
-
-		try {
-			for (VetoableChangeListener listener : listensToAll) {
-				listener.vetoableChange(event);
-			}
-			if (listensToOne != null) {
-				for (VetoableChangeListener listener : listensToOne) {
-					listener.vetoableChange(event);
-				}
-			}
-		} catch (PropertyVetoException pve) {
-			// Tell them we have changed it back
-			PropertyChangeEvent revertEvent = createPropertyChangeEvent(
-					propName, newValue, oldValue);
-			for (VetoableChangeListener listener : listensToAll) {
-				listener.vetoableChange(revertEvent);
-			}
-			if (listensToOne != null) {
-				for (VetoableChangeListener listener : listensToOne) {
-					listener.vetoableChange(revertEvent);
-				}
-			}
-			throw pve;
-		}
-	}
+            throws PropertyVetoException {
+        String propName = event.getPropertyName();
+        Object oldValue = event.getOldValue();
+        Object newValue = event.getNewValue();
+
+        if (newValue != null && oldValue != null && newValue.equals(oldValue)) {
+            return;
+        }
+
+        /* Take note of who we are going to notify (and potentially un-notify) */
+
+        VetoableChangeListener[] listensToAll; // Listeners to all property
+                                                // change events
+        VetoableChangeListener[] listensToOne = null; // Listens to a given
+                                                        // property change
+        synchronized (this) {
+            listensToAll = allVetoableChangeListeners
+                    .toArray(new VetoableChangeListener[allVetoableChangeListeners
+                            .size()]);
+
+            List<VetoableChangeListener> listeners = selectedVetoableChangeListeners
+                    .get(event.getPropertyName());
+            if (listeners != null) {
+                listensToOne = listeners
+                        .toArray(new VetoableChangeListener[listeners.size()]);
+            }
+        }
+
+        try {
+            for (VetoableChangeListener listener : listensToAll) {
+                listener.vetoableChange(event);
+            }
+            if (listensToOne != null) {
+                for (VetoableChangeListener listener : listensToOne) {
+                    listener.vetoableChange(event);
+                }
+            }
+        } catch (PropertyVetoException pve) {
+            // Tell them we have changed it back
+            PropertyChangeEvent revertEvent = createPropertyChangeEvent(
+                    propName, newValue, oldValue);
+            for (VetoableChangeListener listener : listensToAll) {
+                listener.vetoableChange(revertEvent);
+            }
+            if (listensToOne != null) {
+                for (VetoableChangeListener listener : listensToOne) {
+                    listener.vetoableChange(revertEvent);
+                }
+            }
+            throw pve;
+        }
+    }
 
     private static VetoableChangeListener[] getAsVetoableChangeListenerArray(
             List<VetoableChangeListener> listeners) {
         Object[] objects = listeners.toArray();
-        VetoableChangeListener[] arrayResult =
-                new VetoableChangeListener[objects.length];
-        
-        for(int i = 0; i < objects.length; ++i) {
+        VetoableChangeListener[] arrayResult = new VetoableChangeListener[objects.length];
+
+        for (int i = 0; i < objects.length; ++i) {
             arrayResult[i] = (VetoableChangeListener) objects[i];
         }
-        
+
         return arrayResult;
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLDecoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLDecoder.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLDecoder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLDecoder.java Tue Jul 25 01:54:54 2006
@@ -46,9 +46,9 @@
 
     private ExceptionListener exceptionListener = null;
 
-    private Vector objects = new Vector();
+    private Vector<Object> objects = new Vector<Object>();
 
-    private Iterator iterator = null;
+    private Iterator<Object> iterator = null;
 
     /**
      * @com.intel.drl.spec_ref

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java Tue Jul 25 01:54:54 2006
@@ -41,7 +41,7 @@
 
     private Object owner;
 
-    private Vector printed = new Vector();
+    private Vector<ObjectNode> printed = new Vector<ObjectNode>();
 
     /**
      * @com.intel.drl.spec_ref
@@ -107,7 +107,7 @@
 
     private void writeAll() {
         Tag mainTag = new Tag("java");
-        Enumeration e;
+        Enumeration<Object> e;
 
         printed.clear();
         NameMaker.clear();
@@ -120,10 +120,10 @@
 
         e = roots.elements();
         while (e.hasMoreElements()) {
-            Object object = (Object) e.nextElement();
+            Object object = e.nextElement();
 
             if (object != null) {
-                ObjectNode node = (ObjectNode) nodes.get(object);
+                ObjectNode node = nodes.get(object);
 
                 printObjectTag(0, object, node);
             } else {
@@ -280,7 +280,7 @@
         Object exprValue = null;
 
         try {
-            Enumeration enumeration;
+            Enumeration<ObjectNode> enumeration;
             Tag tag;
             String objectName;
             String methodName;
@@ -292,14 +292,14 @@
             // find out, if this object is already printed
             enumeration = printed.elements();
             while (enumeration.hasMoreElements()) {
-                ObjectNode node2 = (ObjectNode) enumeration.nextElement();
+                ObjectNode node2 = enumeration.nextElement();
 
                 if (node2.getObjectValue() == exprValue) {
                     return;
                 }
             }
 
-            node = (ObjectNode) nodes.get(exprValue);
+            node = nodes.get(exprValue);
 
             // find out, if this object has no references to be printed
             // System.out.println("---- node.getReferencesNumber() = " + node.getReferencesNumber());
@@ -394,7 +394,7 @@
 
         for (int i = tag.hasAttr("index") ? 1 : 0; i < args.length; ++i) {
             if (args[i] != null) {
-                ObjectNode node = (ObjectNode) nodes.get(args[i]);
+                ObjectNode node = nodes.get(args[i]);
 
                 printObjectTag(++tabCount, args[i], node);
             } else {
@@ -471,19 +471,19 @@
 
         String name;
 
-        LinkedHashMap attrs;
+        LinkedHashMap<String, String> attrs;
 
         String characters;
 
         public Tag(String name) {
             this.name = name;
-            this.attrs = new LinkedHashMap();
+            this.attrs = new LinkedHashMap<String, String>();
             this.characters = null;
         }
 
         public Tag(String name, String characters) {
             this.name = name;
-            this.attrs = new LinkedHashMap();
+            this.attrs = new LinkedHashMap<String, String>();
             this.characters = characters;
         }
 
@@ -497,11 +497,11 @@
 
         public String toStringOnOpenUnfinished() {
             String result = "<" + name;
-            Iterator i = attrs.keySet().iterator();
+            Iterator<String> i = attrs.keySet().iterator();
 
             while (i.hasNext()) {
-                String attrName = (String) i.next();
-                String attrValue = (String) attrs.get(attrName);
+                String attrName = i.next();
+                String attrValue = attrs.get(attrName);
 
                 result += " " + attrName + "=\"" + attrValue + "\"";
             }
@@ -532,7 +532,7 @@
 
     static class NameMaker {
 
-        private static HashMap numOfExemplars = new HashMap();
+        private static HashMap<String, Integer> numOfExemplars = new HashMap<String, Integer>();
 
         public static void clear() {
             numOfExemplars.clear();
@@ -561,7 +561,7 @@
                 fullName = type.getName();
                 shortName = fullName.substring(fullName.lastIndexOf(".") + 1);
             }
-            iNum = (Integer) numOfExemplars.get(shortName);
+            iNum = numOfExemplars.get(shortName);
             if (iNum == null) {
                 numOfExemplars.put(shortName, new Integer(0));
                 result = shortName + "0";

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java Tue Jul 25 01:54:54 2006
@@ -31,6 +31,8 @@
 
 public class BeanContextMembershipEvent extends BeanContextEvent {
 
+    static final long serialVersionUID = 3499346510334590959L;
+
     /**
      * 
      */
@@ -41,11 +43,11 @@
      */
     public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
         super(bc);
-        
+
         if (changes == null) {
             throw new NullPointerException("Changes are null");
         }
-        
+
         this.children = changes;
     }
 
@@ -54,20 +56,20 @@
      */
     public BeanContextMembershipEvent(BeanContext bc, Object[] changes) {
         super(bc);
-        
+
         if (changes == null) {
             throw new NullPointerException("Changes are null");
         }
-        
+
         // Initialize collection
-        this.children = new Vector();
-        
+        this.children = new Vector<Object>();
+
         // Add all elements to it
-        for(int i = 0; i < changes.length; i++) {
+        for (int i = 0; i < changes.length; i++) {
             this.children.add(changes[i]);
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
@@ -81,7 +83,7 @@
     public Iterator iterator() {
         return this.children.iterator();
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java Tue Jul 25 01:54:54 2006
@@ -29,6 +29,8 @@
 
 public class BeanContextServiceAvailableEvent extends BeanContextEvent {
 
+    static final long serialVersionUID = -5333985775656400778L;
+
     /**
      * @serial
      */
@@ -46,8 +48,8 @@
      * @com.intel.drl.spec_ref
      */
     public Iterator getCurrentServiceSelectors() {
-        return ((BeanContextServices) super.source).
-            getCurrentServiceSelectors(serviceClass);
+        return ((BeanContextServices) super.source)
+                .getCurrentServiceSelectors(serviceClass);
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java Tue Jul 25 01:54:54 2006
@@ -27,11 +27,13 @@
 
 public class BeanContextServiceRevokedEvent extends BeanContextEvent {
 
+    static final long serialVersionUID = -1295543154724961754L;
+
     /**
      * @serial
      */
     protected Class serviceClass;
-    
+
     /**
      * @serial
      */
@@ -40,28 +42,28 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc, 
+    public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc,
             boolean invalidate) {
-                
+
         super(bcs);
         this.serviceClass = sc;
         this.invalidateRefs = invalidate;
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public Class getServiceClass() {
         return this.serviceClass;
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public BeanContextServices getSourceAsBeanContextServices() {
         return (BeanContextServices) super.propagatedFrom;
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java?rev=425336&r1=425335&r2=425336&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java Tue Jul 25 01:54:54 2006
@@ -36,18 +36,18 @@
  * @version $Revision: 1.12.4.3 $
  */
 
-public class BeanContextServicesSupport extends BeanContextSupport 
-        implements BeanContextServices {
-    
+public class BeanContextServicesSupport extends BeanContextSupport implements
+        BeanContextServices {
+
     private static final long serialVersionUID = -8494482757288719206L;
-    
+
     /**
      * Nested class
      */
     protected class BCSSChild extends BeanContextSupport.BCSChild {
-        
+
         private static final long serialVersionUID = -3263851306889194873L;
-        
+
         /**
          * 
          */
@@ -55,19 +55,18 @@
             super(child, peer);
         }
     }
-    
+
     /**
      * Nested class
      */
-    protected class BCSSProxyServiceProvider 
-            implements BeanContextServiceProvider, 
-            BeanContextServiceRevokedListener {
-           
+    protected class BCSSProxyServiceProvider implements
+            BeanContextServiceProvider, BeanContextServiceRevokedListener {
+
         /**
          * The peer of this object
          */
         private BeanContextChild child;
-               
+
         /**
          * Initialize the peer
          *
@@ -76,51 +75,52 @@
         BCSSProxyServiceProvider(BeanContextChild child) {
             this.child = child;
         }
-             
+
         /**
          *
          */
-        public Iterator getCurrentServiceSelectors(BeanContextServices bcs, 
+        public Iterator getCurrentServiceSelectors(BeanContextServices bcs,
                 Class serviceClass) {
-                    
+
             return bcs.getCurrentServiceSelectors(serviceClass);
         }
-        
+
         /**
          *
          */
         public Object getService(BeanContextServices bcs, Object requestor,
                 Class serviceClass, Object serviceSelector) {
-                            
+
             try {
-                BeanContextServiceRevokedListener l = (BeanContextServiceRevokedListener) this;    
-                return bcs.getService(this.child, requestor, serviceClass, serviceSelector, l);
-            } catch(TooManyListenersException e) {
+                BeanContextServiceRevokedListener l = this;
+                return bcs.getService(this.child, requestor, serviceClass,
+                        serviceSelector, l);
+            } catch (TooManyListenersException e) {
                 return null;
             }
         }
-        
+
         /**
          *
          */
-        public void releaseService(BeanContextServices bcs, Object requestor, 
+        public void releaseService(BeanContextServices bcs, Object requestor,
                 Object service) {
-         
+
             bcs.releaseService(this.child, requestor, service);
         }
-         
+
         /**
          *
          */
         public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) {
-            
+
             if (this.child instanceof BeanContextServices) {
-                BeanContextServices ser = (BeanContextServices) this.child;                
+                BeanContextServices ser = (BeanContextServices) this.child;
                 ser.serviceRevoked(bcsre);
             }
         }
     }
-    
+
     /**
      * Nested class
      */
@@ -132,12 +132,12 @@
          * @serial
          */
         protected BeanContextServiceProvider serviceProvider;
-        
+
         /**
          * Service class
          */
         private transient Class sc;
-        
+
         /**
          * Constructor for setting BeanContextServiceProvider in this class
          *
@@ -148,29 +148,29 @@
             this.sc = sc;
             this.serviceProvider = serviceProvider;
         }
-        
+
         /**
          *
          */
         protected BeanContextServiceProvider getServiceProvider() {
             return this.serviceProvider;
         }
-        
+
         Class getServiceClass() {
             return this.sc;
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected transient ArrayList bcsListeners;
-    
+    protected transient ArrayList<BeanContextServicesListener> bcsListeners;
+
     /**
      * @com.intel.drl.spec_ref
      */
     protected transient BCSSProxyServiceProvider proxy;
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
@@ -179,7 +179,7 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    protected transient HashMap services;
+    protected transient HashMap<Class, BCSSServiceProvider> services;
 
     /**
      * @com.intel.drl.spec_ref
@@ -187,322 +187,313 @@
     public BeanContextServicesSupport() {
         super();
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public BeanContextServicesSupport(BeanContextServices peer) {
         super(peer);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public BeanContextServicesSupport(BeanContextServices peer, Locale lcle) {
         super(peer, lcle);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, 
+    public BeanContextServicesSupport(BeanContextServices peer, Locale lcle,
             boolean dtime) {
-                
+
         super(peer, lcle, dtime);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, 
+    public BeanContextServicesSupport(BeanContextServices peer, Locale lcle,
             boolean dtime, boolean visible) {
-                
+
         super(peer, lcle, dtime, visible);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    public void addBeanContextServicesListener(
-            BeanContextServicesListener bcsl) {
-                
+    public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
+
         if (bcsl == null) {
             throw new NullPointerException("The listener is null");
         }
-        
-        synchronized(this.bcsListeners) {
+
+        synchronized (this.bcsListeners) {
             this.bcsListeners.add(bcsl);
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    public boolean addService(Class serviceClass, 
+    public boolean addService(Class serviceClass,
             BeanContextServiceProvider bcsp) {
-                
+
         return addService(serviceClass, bcsp, true);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected boolean addService(Class serviceClass, 
+    protected boolean addService(Class serviceClass,
             BeanContextServiceProvider bcsp, boolean fireEvent) {
-                
+
         if (bcsp == null) {
             throw new NullPointerException("The provider is null");
         }
-        
-        synchronized(BeanContext.globalHierarchyLock) {
-            synchronized(this.services) {            
+
+        synchronized (BeanContext.globalHierarchyLock) {
+            synchronized (this.services) {
                 if (!this.services.containsKey(serviceClass)) {
-                    this.services.put(
-                        serviceClass, 
-                        createBCSSServiceProvider(serviceClass, bcsp));  
-                        
+                    this.services.put(serviceClass, createBCSSServiceProvider(
+                            serviceClass, bcsp));
+
                     if (getChildSerializable(bcsp) != null) {
                         this.serializable++;
                     }
-                }
-                else {
+                } else {
                     fireEvent = false;
                 }
             }
-                    
+
             BeanContextServiceAvailableEvent ev = getEvent(serviceClass);
-            
+
             if (fireEvent) {
                 fireServiceAdded(ev);
             }
-            
-            for (Iterator it = iterator(); it.hasNext(); ) {
+
+            for (Iterator it = iterator(); it.hasNext();) {
                 Object child = it.next();
-                
-                if(child instanceof BeanContextServices) {
+
+                if (child instanceof BeanContextServices) {
                     ((BeanContextServices) child).serviceAvailable(ev);
                 }
             }
-                    
+
             return fireEvent;
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected synchronized void bcsPreDeserializationHook(ObjectInputStream ois) 
+    protected synchronized void bcsPreDeserializationHook(ObjectInputStream ois)
             throws IOException, ClassNotFoundException {
-                
-        synchronized(this.services) {
+
+        synchronized (this.services) {
             for (int i = 0; i < this.serializable; i++) {
-                BCSSServiceProvider provider = (BCSSServiceProvider) ois.readObject();
+                BCSSServiceProvider provider = (BCSSServiceProvider) ois
+                        .readObject();
                 this.services.put(provider.getClass(), provider);
             }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos) 
+    protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos)
             throws IOException {
-                
-        synchronized(this.services) {
-            for (Iterator it = this.services.keySet().iterator(); it.hasNext(); ) {
+
+        synchronized (this.services) {
+            for (Iterator it = this.services.keySet().iterator(); it.hasNext();) {
                 Object key = it.next();
-                
+
                 if (BeanContextSupport.getChildSerializable(key) != null) {
                     oos.writeObject(this.services.get(key));
                 }
             }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected void childJustRemovedHook(Object child, 
+    protected void childJustRemovedHook(Object child,
             BeanContextSupport.BCSChild bcsc) {
-                
+
         return;
     }
 
     /**
      * @com.intel.drl.spec_ref
      */
-    protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, 
+    protected BeanContextSupport.BCSChild createBCSChild(Object targetChild,
             Object peer) {
-                
+
         return new BCSSChild(targetChild, peer);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected BCSSServiceProvider createBCSSServiceProvider(Class sc, 
+    protected BCSSServiceProvider createBCSSServiceProvider(Class sc,
             BeanContextServiceProvider bcsp) {
-                
+
         return new BCSSServiceProvider(sc, bcsp);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     protected final void fireServiceAdded(
             BeanContextServiceAvailableEvent bcssae) {
-                
-        for (Iterator it = this.bcsListeners.iterator(); it.hasNext(); ) {
-            BeanContextServicesListener l = 
-                (BeanContextServicesListener) it.next();
-                
+
+        for (Iterator<BeanContextServicesListener> it = this.bcsListeners
+                .iterator(); it.hasNext();) {
+            BeanContextServicesListener l = it.next();
+
             l.serviceAvailable(bcssae);
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     protected final void fireServiceAdded(Class serviceClass) {
         fireServiceAdded(getEvent(serviceClass));
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     protected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre) {
-        
-        for (Iterator it = this.bcsListeners.iterator(); it.hasNext(); ) {
-            BeanContextServicesListener l = 
-                (BeanContextServicesListener) it.next();
-                
+
+        for (Iterator<BeanContextServicesListener> it = this.bcsListeners
+                .iterator(); it.hasNext();) {
+            BeanContextServicesListener l = it.next();
+
             l.serviceRevoked(bcsre);
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected final void fireServiceRevoked(Class serviceClass, 
+    protected final void fireServiceRevoked(Class serviceClass,
             boolean revokeNow) {
-                
-        fireServiceRevoked(
-            new BeanContextServiceRevokedEvent(
+
+        fireServiceRevoked(new BeanContextServiceRevokedEvent(
                 getBeanContextServicesPeer(), serviceClass, revokeNow));
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public BeanContextServices getBeanContextServicesPeer() {
         return (BeanContextServices) getBeanContextPeer();
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected static final BeanContextServicesListener 
-            getChildBeanContextServicesListener(Object child) {
-                
+    protected static final BeanContextServicesListener getChildBeanContextServicesListener(
+            Object child) {
+
         if (child instanceof BeanContextServicesListener) {
             return (BeanContextServicesListener) child;
         } else {
             return null;
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public Iterator getCurrentServiceClasses() {
-        
-        synchronized(BeanContext.globalHierarchyLock) {
-            synchronized(this.services) {
+
+        synchronized (BeanContext.globalHierarchyLock) {
+            synchronized (this.services) {
                 return this.services.keySet().iterator();
             }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public Iterator getCurrentServiceSelectors(Class serviceClass) {
-        
-        synchronized(BeanContext.globalHierarchyLock) {
-            synchronized(this.services) {
-                BCSSServiceProvider bcsp = 
-                    (BCSSServiceProvider) this.services.get(serviceClass);
-                    
+
+        synchronized (BeanContext.globalHierarchyLock) {
+            synchronized (this.services) {
+                BCSSServiceProvider bcsp = this.services.get(serviceClass);
+
                 return bcsp.getServiceProvider().getCurrentServiceSelectors(
-                    getBeanContextServicesPeer(), serviceClass);
+                        getBeanContextServicesPeer(), serviceClass);
             }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     private BeanContextServiceAvailableEvent getEvent(Class serviceClass) {
         return new BeanContextServiceAvailableEvent(
-            getBeanContextServicesPeer(), serviceClass);
+                getBeanContextServicesPeer(), serviceClass);
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    public Object getService(BeanContextChild child, Object requestor, 
-            Class serviceClass, Object serviceSelector, 
-            BeanContextServiceRevokedListener bcsrl) 
+    public Object getService(BeanContextChild child, Object requestor,
+            Class serviceClass, Object serviceSelector,
+            BeanContextServiceRevokedListener bcsrl)
             throws TooManyListenersException {
-                
+
         if (child == null) {
             throw new NullPointerException("The child is null");
         }
-        
+
         if (requestor == null) {
             throw new NullPointerException("The requestor is null");
         }
-        
+
         if (serviceClass == null) {
             throw new NullPointerException("The service class is null");
         }
-        
+
         if (serviceSelector == null) {
             throw new NullPointerException("The service selector is null");
         }
-        
+
         if (bcsrl == null) {
             throw new NullPointerException("The listener is null");
         }
-                
-        synchronized(BeanContext.globalHierarchyLock) {
+
+        synchronized (BeanContext.globalHierarchyLock) {
             Object service = null;
-            
-            synchronized(this.services) {
-                BCSSServiceProvider bcsp = 
-                    (BCSSServiceProvider) this.services.get(serviceClass);
-                    
+
+            synchronized (this.services) {
+                BCSSServiceProvider bcsp = this.services.get(serviceClass);
+
                 if (bcsp != null) {
                     service = bcsp.getServiceProvider().getService(
-                        getBeanContextServicesPeer(), 
-                        requestor, 
-                        serviceClass, 
-                        serviceSelector);
-                }  
-                    
+                            getBeanContextServicesPeer(), requestor,
+                            serviceClass, serviceSelector);
+                }
+
                 if ((service == null) && this.proxy != null) {
                     service = this.proxy.getService(
-                        getBeanContextServicesPeer(), 
-                        requestor, 
-                        serviceClass, 
-                        serviceSelector);
+                            getBeanContextServicesPeer(), requestor,
+                            serviceClass, serviceSelector);
                 }
-            }            
-             
+            }
+
             return service;
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
@@ -510,103 +501,102 @@
         if (serviceClass == null) {
             throw new NullPointerException("The service class is null");
         }
-        
-        synchronized(BeanContext.globalHierarchyLock) {
-            synchronized(this.services) {
+
+        synchronized (BeanContext.globalHierarchyLock) {
+            synchronized (this.services) {
                 return this.services.containsKey(serviceClass);
             }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public void initialize() {
         super.initialize();
-        
-        this.services = new HashMap();
-        this.bcsListeners = new ArrayList();
+
+        this.services = new HashMap<Class, BCSSServiceProvider>();
+        this.bcsListeners = new ArrayList<BeanContextServicesListener>();
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected synchronized void initializeBeanContextResources() {        
-        super.initializeBeanContextResources();        
+    protected synchronized void initializeBeanContextResources() {
+        super.initializeBeanContextResources();
         this.proxy = new BCSSProxyServiceProvider(getBeanContextServicesPeer());
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    private void readObject(ObjectInputStream ois) 
-            throws IOException, ClassNotFoundException {
-        
-        synchronized(BeanContext.globalHierarchyLock) {
-            ois.defaultReadObject();            
+    private void readObject(ObjectInputStream ois) throws IOException,
+            ClassNotFoundException {
+
+        synchronized (BeanContext.globalHierarchyLock) {
+            ois.defaultReadObject();
             initialize();
             bcsPreDeserializationHook(ois);
             this.serializable = ois.readInt();
-            
-            synchronized(this.services) {
+
+            synchronized (this.services) {
                 for (int i = 0; i < this.serializable; i++) {
-                    BCSSServiceProvider prov = 
-                        (BCSSServiceProvider) ois.readObject();                    
+                    BCSSServiceProvider prov = (BCSSServiceProvider) ois
+                            .readObject();
+
                     this.services.put(prov.getServiceClass(), prov);
                 }
             }
-            
+
             deserialize(ois, this.bcsListeners);
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
-    protected synchronized void releaseBeanContextResources() {        
-        super.releaseBeanContextResources();        
+    protected synchronized void releaseBeanContextResources() {
+        super.releaseBeanContextResources();
         this.proxy = null;
     }
 
     /**
      * @com.intel.drl.spec_ref
      */
-    public void releaseService(BeanContextChild child, Object requestor, 
+    public void releaseService(BeanContextChild child, Object requestor,
             Object service) {
-                
+
         if (child == null) {
             throw new NullPointerException("The child is null");
         }
-        
+
         if (requestor == null) {
             throw new NullPointerException("The requestor is null");
         }
-        
+
         if (service == null) {
             throw new NullPointerException("The service is null");
         }
-                
-        synchronized(BeanContext.globalHierarchyLock) {
+
+        synchronized (BeanContext.globalHierarchyLock) {
             if (this.proxy != null) {
-                this.proxy.releaseService(
-                    getBeanContextServicesPeer(), 
-                    requestor, 
-                    service);
-            }  
+                this.proxy.releaseService(getBeanContextServicesPeer(),
+                        requestor, service);
+            }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     public void removeBeanContextServicesListener(
             BeanContextServicesListener bcsl) {
-        
+
         if (bcsl == null) {
             throw new NullPointerException("The listener is null");
         }
 
-        synchronized(this.bcsListeners) {
+        synchronized (this.bcsListeners) {
             this.bcsListeners.remove(bcsl);
         }
     }
@@ -614,46 +604,44 @@
     /**
      * @com.intel.drl.spec_ref
      */
-    public void revokeService(Class serviceClass, 
+    public void revokeService(Class serviceClass,
             BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
-                
+
         if (serviceClass == null) {
             throw new NullPointerException("The service class is null");
         }
-        
+
         if (bcsp == null) {
             throw new NullPointerException("The provider is null");
         }
-        
-        synchronized(BeanContext.globalHierarchyLock) {
-            synchronized(this.services) {                     
-                Object removed = this.services.remove(serviceClass); 
-                
-                if (removed != null) {                        
+
+        synchronized (BeanContext.globalHierarchyLock) {
+            synchronized (this.services) {
+                Object removed = this.services.remove(serviceClass);
+
+                if (removed != null) {
                     if (getChildSerializable(bcsp) != null) {
                         this.serializable--;
                     }
                 }
             }
-            
-            BeanContextServiceRevokedEvent ev = 
-                new BeanContextServiceRevokedEvent(
-                    getBeanContextServicesPeer(), 
-                    serviceClass, 
+
+            BeanContextServiceRevokedEvent ev = new BeanContextServiceRevokedEvent(
+                    getBeanContextServicesPeer(), serviceClass,
                     revokeCurrentServicesNow);
-                    
+
             fireServiceRevoked(ev);
-            
-            for (Iterator it = iterator(); it.hasNext(); ) {
+
+            for (Iterator it = iterator(); it.hasNext();) {
                 Object child = it.next();
-                
-                if(child instanceof BeanContextServices) {
+
+                if (child instanceof BeanContextServices) {
                     ((BeanContextServices) child).serviceRevoked(ev);
                 }
             }
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
@@ -661,11 +649,11 @@
         if (bcssae == null) {
             throw new NullPointerException("The event is null");
         }
-        
-        for (Iterator it = this.bcsListeners.iterator(); it.hasNext(); ) {
-            BeanContextServicesListener l = 
-                (BeanContextServicesListener) it.next();
-                
+
+        for (Iterator<BeanContextServicesListener> it = this.bcsListeners
+                .iterator(); it.hasNext();) {
+            BeanContextServicesListener l = it.next();
+
             l.serviceAvailable(bcssae);
         }
     }
@@ -677,35 +665,36 @@
         if (bcssre == null) {
             throw new NullPointerException("The event is null");
         }
-        
-        for (Iterator it = this.bcsListeners.iterator(); it.hasNext(); ) {
-            BeanContextServicesListener l = 
-                (BeanContextServicesListener) it.next();
-                
+
+        for (Iterator<BeanContextServicesListener> it = this.bcsListeners
+                .iterator(); it.hasNext();) {
+            BeanContextServicesListener l = it.next();
+
             l.serviceRevoked(bcssre);
         }
     }
-    
+
     /**
      * @com.intel.drl.spec_ref
      */
     private void writeObject(ObjectOutputStream oos) throws IOException {
-        
-        synchronized(BeanContext.globalHierarchyLock) {
+
+        synchronized (BeanContext.globalHierarchyLock) {
             oos.defaultWriteObject();
-            bcsPreSerializationHook(oos);            
+            bcsPreSerializationHook(oos);
             oos.writeInt(this.serializable);
-            
-            synchronized(this.services) {
-                for (Iterator it = this.getCurrentServiceClasses(); it.hasNext(); ) {
+
+            synchronized (this.services) {
+                for (Iterator it = this.getCurrentServiceClasses(); it
+                        .hasNext();) {
                     BCSSServiceProvider prov = (BCSSServiceProvider) it.next();
-                    
+
                     if (prov.getServiceProvider() instanceof Serializable) {
                         oos.writeObject(prov);
                     }
                 }
             }
-            
+
             serialize(oos, this.bcsListeners);
         }
     }



Mime
View raw message