harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r558953 [1/2] - in /harmony/enhanced/classlib/trunk/modules/beans/src: main/java/java/beans/ main/java/org/apache/harmony/beans/ test/java-internal/java/beans/ test/java-internal/org/
Date Tue, 24 Jul 2007 07:58:40 GMT
Author: tonywu
Date: Tue Jul 24 00:58:36 2007
New Revision: 558953

URL: http://svn.apache.org/viewvc?view=rev&rev=558953
Log:
Apply patch Harmony-4504 ([classlib][beans] Move primitive persistence delegates from o.a.h.beans package to java.beans package, combine them into one, and do some code tidy up)

Added:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/java_lang_ClassPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/java_lang_StringPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/java_lang_reflect_FieldPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/java_lang_reflect_MethodPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/java_lang_reflect_ProxyPersistenceDelegate.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java-internal/java/beans/AllTests.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java-internal/java/beans/ArrayPersistenceDelegateTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java-internal/java/beans/ClassPersistenceDelegateTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java-internal/java/beans/StringPersistenceDelegateTest.java   (with props)
Removed:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ArrayPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/DefaultPersistenceDelegatesFactory.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/NullPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/PrimitiveWrapperPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_BooleanPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_BytePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_CharacterPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_ClassPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_DoublePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_FloatPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_IntegerPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_LongPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_ShortPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_StringPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_reflect_FieldPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_reflect_MethodPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_reflect_ProxyPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/test/java-internal/org/
Modified:
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtChoicePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtColorPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtComponentPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtContainerPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtCursorPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtDimensionPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtFontPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtInsetsPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtListPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuBarPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuShortcutPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtPointPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtRectanglePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtScrollPanePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanDescriptor.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/CustomizedObjectInputStream.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ParameterDescriptor.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Statement.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/StaticFieldPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingAbstractButtonPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingBoxPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingDefaultComboBoxModelPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingJFramePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingJTabbedPanePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SwingToolTipManagerPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/UtilCollectionPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/UtilDatePersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/UtilListPersistenceDelegate.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/VetoableChangeSupport.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLDecoder.java
    harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java

Added: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java?view=auto&rev=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -0,0 +1,95 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package java.beans;
+
+import java.lang.reflect.Array;
+
+class ArrayPersistenceDelegate extends PersistenceDelegate {
+
+    private static PersistenceDelegate pd = null;
+
+    public static PersistenceDelegate getInstance() {
+        if (pd == null) {
+            pd = new ArrayPersistenceDelegate();
+        }
+        return pd;
+    }
+
+    @Override
+    protected Expression instantiate(Object oldInstance, Encoder out) {
+        assert oldInstance != null && oldInstance.getClass().isArray() : oldInstance;
+
+        int length = Array.getLength(oldInstance);
+        Class<?> componentType = oldInstance.getClass().getComponentType();
+
+        return new Expression(oldInstance, Array.class, "newInstance", //$NON-NLS-1$
+                new Object[] { componentType, new Integer(length) });
+    }
+
+    @Override
+    protected void initialize(Class<?> type, Object oldInstance,
+            Object newInstance, Encoder out) {
+
+        assert oldInstance != null && oldInstance.getClass().isArray() : oldInstance;
+        assert newInstance != null && newInstance.getClass().isArray() : newInstance;
+
+        int length = Array.getLength(oldInstance);
+        Class<?> componentType = type.getComponentType();
+        Object nullValue = Array.get(Array.newInstance(componentType, 1), 0);
+
+        for (int i = 0; i < length; ++i) {
+
+            Object oldValue = Array.get(oldInstance, i);
+            Object newValue = Array.get(newInstance, i);
+
+            if (oldValue != null && !oldValue.equals(newValue)
+                    || oldValue == null && newValue != null) {
+                if (nullValue == null || !nullValue.equals(oldValue)) {
+                    Statement s = new Statement(oldInstance, "set", //$NON-NLS-1$
+                            new Object[] { new Integer(i), oldValue });
+
+                    out.writeStatement(s);
+                }
+            }
+        }
+    }
+
+    @Override
+    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+        assert oldInstance != null && oldInstance.getClass().isArray() : oldInstance;
+
+        if (newInstance != null) {
+            Class<? extends Object> newCl = newInstance.getClass();
+
+            if (!newCl.isArray()) {
+                return false;
+            }
+            // both are arrays
+            int l1 = Array.getLength(oldInstance);
+            int l2 = Array.getLength(newInstance);
+            Class<?> cType1 = oldInstance.getClass().getComponentType();
+            Class<?> cType2 = newCl.getComponentType();
+
+            if (l1 == l2 && cType1.equals(cType2)) {
+                return true;
+            }
+            return false;
+        }
+        return false;
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ArrayPersistenceDelegate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtChoicePersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtChoicePersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtChoicePersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtChoicePersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.Choice;
 
 class AwtChoicePersistenceDelegate extends DefaultPersistenceDelegate {
-	protected void initialize(Class<?> type, Object oldInstance,
+    @Override
+	@SuppressWarnings({ "nls", "boxing" })
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		super.initialize(type, oldInstance, newInstance, enc);
 		if (type != oldInstance.getClass()) {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtColorPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtColorPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtColorPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtColorPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.Color;
 
 class AwtColorPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+    @Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Color color = (Color) oldInstance;
 		return new Expression(oldInstance, oldInstance.getClass(),
                 Statement.CONSTRUCTOR_NAME, new Object[] { color.getRed(),

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtComponentPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtComponentPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtComponentPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtComponentPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -19,7 +19,9 @@
 
 class AwtComponentPersistenceDelegate extends DefaultPersistenceDelegate {
 
-	protected void initialize(Class<?> type, Object oldInstance,
+    @Override
+	@SuppressWarnings("nls")
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		// Call the initialization of the super type
 		super.initialize(type, oldInstance, newInstance, enc);
@@ -41,7 +43,8 @@
 
 	}
 
-	static void writeProperty(Object oldInstance, Object newInstance,
+	@SuppressWarnings("nls")
+    static void writeProperty(Object oldInstance, Object newInstance,
 			Encoder enc, String property) {
 		StringBuilder builder = new StringBuilder();
 		Expression getterExp = new Expression(oldInstance, builder

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtContainerPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtContainerPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtContainerPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtContainerPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.Container;
 
 class AwtContainerPersistenceDelegate extends AwtComponentPersistenceDelegate {
-	protected void initialize(Class<?> type, Object oldInstance,
+    @Override
+	@SuppressWarnings({ "nls", "boxing" })
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		// Call the initialization of the super type
 		super.initialize(type, oldInstance, newInstance, enc);

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtCursorPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtCursorPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtCursorPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtCursorPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.Cursor;
 
 class AwtCursorPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+    @Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Cursor cursor = (Cursor) oldInstance;
 		return new Expression(oldInstance, oldInstance.getClass(),
                 Statement.CONSTRUCTOR_NAME, new Object[] { cursor.getType() });

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtDimensionPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtDimensionPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtDimensionPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtDimensionPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -21,7 +21,9 @@
 
 class AwtDimensionPersistenceDelegate extends DefaultPersistenceDelegate {
 	
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+    @Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Dimension dimesion = (Dimension) oldInstance;
 
         return new Expression(dimesion, dimesion.getClass(), Statement.CONSTRUCTOR_NAME,

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtFontPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtFontPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtFontPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtFontPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.Font;
 
 class AwtFontPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+    @Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Font font = (Font) oldInstance;
 		return new Expression(oldInstance, oldInstance.getClass(),
                 Statement.CONSTRUCTOR_NAME, new Object[] { font.getFontName(),

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtInsetsPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtInsetsPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtInsetsPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtInsetsPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.Insets;
 
 class AwtInsetsPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+    @Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Insets inset = (Insets) oldInstance;
 		return new Expression(oldInstance, oldInstance.getClass(),
 				Statement.CONSTRUCTOR_NAME, new Object[] { inset.top, inset.left, inset.bottom,

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtListPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtListPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtListPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtListPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 import java.awt.List;
 
 class AwtListPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected void initialize(Class<?> type, Object oldInstance,
+    @Override
+	@SuppressWarnings({ "nls", "boxing" })
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		super.initialize(type, oldInstance, newInstance, enc);
 

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuBarPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuBarPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuBarPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuBarPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -21,7 +21,9 @@
 import java.awt.MenuBar;
 
 class AwtMenuBarPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected void initialize(Class<?> type, Object oldInstance,
+    @Override
+	@SuppressWarnings({ "nls", "boxing" })
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		super.initialize(type, oldInstance, newInstance, enc);
 		if (type != oldInstance.getClass()) {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -21,7 +21,9 @@
 import java.awt.MenuItem;
 
 class AwtMenuPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected void initialize(Class<?> type, Object oldInstance,
+    @Override
+	@SuppressWarnings({ "nls", "boxing" })
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		super.initialize(type, oldInstance, newInstance, enc);
 		if (type != oldInstance.getClass()) {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuShortcutPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuShortcutPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuShortcutPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtMenuShortcutPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -21,7 +21,8 @@
 
 class AwtMenuShortcutPersistenceDelegate extends PersistenceDelegate {
 
-	@Override
+    @Override
+	@SuppressWarnings("boxing")
 	protected Expression instantiate(Object oldInstance, Encoder enc) {
 		MenuShortcut shortcut = (MenuShortcut) oldInstance;
 		int keyCode = shortcut.getKey();

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtPointPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtPointPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtPointPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtPointPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -19,7 +19,9 @@
 import java.awt.Point;
 
 class AwtPointPersistenceDelegate extends DefaultPersistenceDelegate {
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+    @Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Point point = (Point) oldInstance;
 		return new Expression(oldInstance, oldInstance.getClass(),
 				Statement.CONSTRUCTOR_NAME, new Object[] { point.x, point.y });

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtRectanglePersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtRectanglePersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtRectanglePersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtRectanglePersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -21,16 +21,20 @@
 
 class AwtRectanglePersistenceDelegate extends DefaultPersistenceDelegate {
 
-	protected boolean mutatesTo(Object o1, Object o2) {
+	@Override
+    protected boolean mutatesTo(Object o1, Object o2) {
 		return o1.equals(o2);
 	}
 
-	protected void initialize(Class<?> type, Object oldInstance,
+	@Override
+    protected void initialize(Class<?> type, Object oldInstance,
 			Object newInstance, Encoder enc) {
 		return;
 	}
 	
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+	@Override
+	@SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		Rectangle rect = (Rectangle) oldInstance;
 
         return new Expression(rect, rect.getClass(), Statement.CONSTRUCTOR_NAME,

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtScrollPanePersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtScrollPanePersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtScrollPanePersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/AwtScrollPanePersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,9 @@
 
 class AwtScrollPanePersistenceDelegate extends
 		DefaultPersistenceDelegate {
-	protected Expression instantiate(Object oldInstance, Encoder enc) {
+	@Override
+    @SuppressWarnings("boxing")
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
 		return new Expression(oldInstance, oldInstance.getClass(),
 				Statement.CONSTRUCTOR_NAME,
 				new Object[] { ((ScrollPane) oldInstance)

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanDescriptor.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanDescriptor.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanDescriptor.java Tue Jul 24 00:58:36 2007
@@ -95,15 +95,15 @@
      * Utility method for getting the unqualified name of a {@link Class}.
      * </p>
      * 
-     * @param beanClass
+     * @param leguminaClass
      *            The Class to get the name from.
      * @return A String instance or <code>null</code>.
      */
-    private String getShortClassName(Class<?> beanClass) {
+    private String getShortClassName(Class<?> leguminaClass) {
         String result = null;
 
-        if (beanClass != null) {
-            String beanClassName = beanClass.getName();
+        if (leguminaClass != null) {
+            String beanClassName = leguminaClass.getName();
             int idx = beanClassName.lastIndexOf("."); //$NON-NLS-1$
 
             result = (idx == -1) ? beanClassName : beanClassName

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoImpl.java Tue Jul 24 00:58:36 2007
@@ -97,6 +97,7 @@
                     addPropertyDescriptorsFromMethods(result, setters,
                             MT_SETTER);
                 } catch (Exception e) {
+                    // empty
                 }
 
                 values = result.values().toArray();
@@ -249,18 +250,13 @@
                                 // in event set descriptor pattern
                             }
 
-                            try {
-                                listenerCoreName = Introspector
-                                        .decapitalize(listenerCoreName);
-                                EventSetDescriptor esd = new EventSetDescriptor(
-                                        listenerCoreName, listenerType,
-                                        listenerMethods, addListenerMethod,
-                                        removeListenerMethod, getListenerMethod);
-                                result.put(listenerCoreName, esd);
-                            } catch (IntrospectionException ie) {
-                                System.out.println(Messages.getString(
-                                        "beans.39", listenerCoreName)); //$NON-NLS-1$
-                            }
+                            listenerCoreName = Introspector
+                                    .decapitalize(listenerCoreName);
+                            EventSetDescriptor esd = new EventSetDescriptor(
+                                    listenerCoreName, listenerType,
+                                    listenerMethods, addListenerMethod,
+                                    removeListenerMethod, getListenerMethod);
+                            result.put(listenerCoreName, esd);
 
                         } // if length of parameters list equals to 1
                     } // if no descriptors for given listener name yet
@@ -351,7 +347,7 @@
         String result = null;
 
         if (methodName.startsWith("set") //$NON-NLS-1$ 
-                || methodName.startsWith("get")) { //$NON-NLS-2$
+                || methodName.startsWith("get")) {  //$NON-NLS-1$
             result = methodName.substring(3);
             result = Introspector.decapitalize(result);
         } else if (methodName.startsWith("is")) { //$NON-NLS-1$

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/BeanInfoWrapper.java Tue Jul 24 00:58:36 2007
@@ -20,7 +20,6 @@
 import java.awt.Image;
 import java.lang.reflect.Method;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -191,7 +190,6 @@
                 EventSetDescriptor[] parentResult = parentBeanInfoWrapper
                         .getEventSetDescriptors();
                 Map<String, FeatureDescriptor> hm;
-                Collection<FeatureDescriptor> values;
 
                 if (defaultEventName == null) {
                 	int parentDefaultIdx = parentBeanInfoWrapper.getDefaultEventIndex();
@@ -417,6 +415,7 @@
         return null;
     }
 
+    @SuppressWarnings("null")
     private static MethodDescriptor[] concatArraysToOneArray(
             MethodDescriptor[] childs, MethodDescriptor[] parents) {
 
@@ -552,7 +551,7 @@
     }
     
     private static void copy(PropertyDescriptor target, 
-            PropertyDescriptor source) throws IntrospectionException {
+            PropertyDescriptor source) {
         target.setBound(source.isBound());
         target.setConstrained(source.isConstrained());
         target.setDisplayName(source.getDisplayName());

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Beans.java Tue Jul 24 00:58:36 2007
@@ -52,6 +52,7 @@
      * Constructs a Beans instance.
      */
     public Beans() {
+        // expected
     }
 
     /**
@@ -218,7 +219,8 @@
      *            the specified view type.
      * @return a type view of the given bean.
      */
-    public static Object getInstanceOf(Object bean, Class<?> targetType) {
+    public static Object getInstanceOf(Object bean, @SuppressWarnings("unused")
+    Class<?> targetType) {
         return bean;
     }
 
@@ -344,7 +346,7 @@
         // If we can't get to the applet itself, the codebase and doc base are
         // left as null.
         if (objectUrl == null) {
-            applet.setStub(getAppletStub(applet, getStubAppletContext(applet),
+            applet.setStub(getAppletStub(getStubAppletContext(applet),
                     null, null));
             return;
         }
@@ -360,13 +362,12 @@
         int docURLlength = urlString.lastIndexOf('/');
         URL docBase = safeURL(urlString.substring(0, docURLlength + 1));
 
-        applet.setStub(getAppletStub(applet, getStubAppletContext(applet),
+        applet.setStub(getAppletStub(getStubAppletContext(applet),
                 codeBase, docBase));
     }
     
     
-    private static AppletStub getAppletStub(final Applet target,
-            final AppletContext context, final URL codeBase, final URL docBase) {
+    private static AppletStub getAppletStub(final AppletContext context, final URL codeBase, final URL docBase) {
 
         return new AppletStub() {
             public boolean isActive() {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/CustomizedObjectInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/CustomizedObjectInputStream.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/CustomizedObjectInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/CustomizedObjectInputStream.java Tue Jul 24 00:58:36 2007
@@ -73,7 +73,7 @@
             } else if (postfix.equals("S")) { //$NON-NLS-1$
                 componentType = short.class;
             } else if (postfix.equals("V")) { //$NON-NLS-1$
-                componentType = null;
+                // expected, componentType is already null
             } else if (postfix.startsWith("L")) { //$NON-NLS-1$
                 componentType = cls.loadClass(postfix.substring(1, postfix
                         .length() - 1));

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/DefaultPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -94,6 +94,7 @@
      * @param enc
      *            the encoder to write the outputs to
      */
+    @Override
     protected void initialize(Class<?> type, Object oldInstance,
             Object newInstance, Encoder enc) {
         // Call the initialization of the super type
@@ -169,12 +170,11 @@
     /*
      * Get the field value of an object using privileged code.
      */
-    @SuppressWarnings("unchecked")
     private Object getFieldValue(Object oldInstance, String fieldName)
             throws NoSuchFieldException, IllegalAccessException {
-        Class c = oldInstance.getClass();
+        Class<? extends Object> c = oldInstance.getClass();
         final Field f = c.getDeclaredField(fieldName);
-        AccessController.doPrivileged(new PrivilegedAction() {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 f.setAccessible(true);
                 return null;
@@ -186,12 +186,12 @@
     /*
      * Get the value for the specified property of the given bean instance.
      */
-    private Object getPropertyValue(HashMap proDscMap, Object oldInstance,
+    private Object getPropertyValue(HashMap<String, PropertyDescriptor> proDscMap, Object oldInstance,
             String propName) throws Exception {
         // Try to get the read method for the property
         Method getter = null;
         if (null != proDscMap) {
-            PropertyDescriptor pd = (PropertyDescriptor) proDscMap
+            PropertyDescriptor pd = proDscMap
                     .get(Introspector.decapitalize(propName));
             if (null != pd) {
                 getter = pd.getReadMethod();
@@ -227,6 +227,7 @@
      * @return an expression for instantiating an object of the same type as the
      *         old instance
      */
+    @Override
     protected Expression instantiate(Object oldInstance, Encoder enc) {
         Object[] args = null;
 
@@ -234,7 +235,7 @@
         if (this.propertyNames.length > 0) {
             // Prepare the property descriptors for finding getter method later
             BeanInfo info = null;
-            HashMap proDscMap = null;
+            HashMap<String, PropertyDescriptor> proDscMap = null;
             try {
                 info = Introspector.getBeanInfo(oldInstance.getClass(),
                         Introspector.IGNORE_ALL_BEANINFO);
@@ -291,11 +292,12 @@
      * @return true if second object mutates to the first object, otherwise
      *         false
      */
+    @Override
     protected boolean mutatesTo(Object o1, Object o2) {
         if (null == o1 || null == o2) {
             return false;
         }
-        Class c = o1.getClass();
+        Class<? extends Object> c = o1.getClass();
         if (this.propertyNames.length > 0) {
             // Check the "equals" method has been declared
             Method equalMethod = null;

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Encoder.java Tue Jul 24 00:58:36 2007
@@ -29,7 +29,6 @@
 
 import javax.swing.*;
 
-import org.apache.harmony.beans.*;
 
 /**
  * The <code>Encoder</code>, together with <code>PersistenceDelegate</code>
@@ -66,7 +65,7 @@
 
 		public void exceptionThrown(Exception exception) {
 			System.err.println("Exception during encoding:" + exception); //$NON-NLS-1$
-			System.err.println("Continue...");
+			System.err.println("Continue..."); //$NON-NLS-1$
 		}
 
 	}
@@ -261,7 +260,8 @@
 	 */
 	public void setExceptionListener(ExceptionListener listener) {
 		if (listener == null) {
-			listener = defaultExListener;
+			this.listener = defaultExListener;
+            return;
 		}
 		this.listener = listener;
 	}

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventHandler.java Tue Jul 24 00:58:36 2007
@@ -37,7 +37,7 @@
 
     public EventHandler(Object target, String action, String eventPropertyName,
             String listenerMethodName) {
-        if(target == null || action  == null){
+        if (target == null || action == null) {
             throw new NullPointerException();
         }
         this.target = target;
@@ -50,9 +50,10 @@
         Class<?> proxyClass;
         Object result = null;
 
+        Object[] theArguments = arguments;
         // XXX
         if (arguments == null) {
-            arguments = new Object[0];
+            theArguments = new Object[0];
         }
 
         proxyClass = proxy.getClass();
@@ -66,24 +67,24 @@
                 // if the method from the Object class is called
                 if (method.getDeclaringClass().equals(Object.class)) {
                     if (method.getName().equals("hashCode") && //$NON-NLS-1$
-                            arguments.length == 0) {
+                            theArguments.length == 0) {
                         result = Integer.valueOf(hashCode());
                     } else if (method.getName().equals("equals") && //$NON-NLS-1$
-                            arguments.length == 1 && arguments[0] != null) {
-                        result = Boolean.valueOf(proxy == arguments[0]);
+                            theArguments.length == 1 && theArguments[0] != null) {
+                        result = Boolean.valueOf(proxy == theArguments[0]);
                     } else if (method.getName().equals("toString") && //$NON-NLS-1$
-                            arguments.length == 0) {
+                            theArguments.length == 0) {
                         result = proxy.getClass().getSimpleName()
                                 + toString().substring(
                                         getClass().getName().length());
                     }
-                } else if (isValidInvocation(method, arguments)) {
+                } else if (isValidInvocation(method, theArguments)) {
                     // if listener method
                     try {
                         // extract value from event property name
-                        Object[] args = getArgs(arguments);
+                        Object[] args = getArgs(theArguments);
                         // extract method to be invoked on target
-                        Method m = getMethod(proxy, method, arguments, args);
+                        Method m = getMethod(proxy, method, theArguments, args);
 
                         // we have a valid listener method at this point
                         result = m.invoke(target, args);
@@ -96,16 +97,15 @@
                 } else {
                     // in order to be compatible with RI
                     if (listenerMethodName.equals(method.getName())) {
-                        throw new IllegalArgumentException(Messages.getString(
-                                "beans.4D"));
+                        throw new IllegalArgumentException(Messages
+                                .getString("beans.4D")); //$NON-NLS-1$
                     }
                 }
             }
         } else {
-            //HARMONY-2495
+            // HARMONY-2495
             if (null == method) {
-                throw new NullPointerException(Messages.getString(
-                        "beans.55")); //$NON-NLS-1$
+                throw new NullPointerException(Messages.getString("beans.55")); //$NON-NLS-1$
             }
         }
 
@@ -131,7 +131,7 @@
     @SuppressWarnings("unchecked")
     public static <T> T create(Class<T> listenerInterface, Object target,
             String action, String eventPropertyName, String listenerMethodName) {
-        if(action == null || target == null || listenerInterface == null){
+        if (action == null || target == null || listenerInterface == null) {
             throw new NullPointerException();
         }
         return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(),
@@ -142,7 +142,8 @@
     @SuppressWarnings("unchecked")
     public static <T> T create(Class<T> listenerInterface, Object target,
             String action, String eventPropertyName) {
-        return create(listenerInterface, target, action, eventPropertyName, null);
+        return create(listenerInterface, target, action, eventPropertyName,
+                null);
     }
 
     @SuppressWarnings("unchecked")
@@ -162,7 +163,7 @@
             if (eventPropertyName == null
                     && (arguments == null || arguments.length == 0)) {
                 result = true;
-            // one-argument call is also valid
+                // one-argument call is also valid
             } else if (arguments != null && arguments.length == 1) {
                 result = true;
             } else {
@@ -179,7 +180,7 @@
         if (eventPropertyName == null) {
             return new Object[] {};
         } else if ((arguments == null) || (arguments.length == 0)) {
-//                || (arguments[0] == null)) {
+            // || (arguments[0] == null)) {
             return arguments;
         } else {
             Object arg = arguments[0];
@@ -188,7 +189,7 @@
             while (st.hasMoreTokens()) {
                 String propertyName = st.nextToken();
                 PropertyDescriptor pd = findPropertyDescriptor(arg.getClass(),
-                        propertyName);;
+                        propertyName);
 
                 if (pd != null) {
                     Method getter = pd.getReadMethod();
@@ -269,15 +270,14 @@
                                 "beans.13", action)); //$NON-NLS-1$
                     }
                 } else {
-                    throw new IndexOutOfBoundsException(
-                            Messages.getString("beans.14")); //$NON-NLS-1$
+                    throw new IndexOutOfBoundsException(Messages
+                            .getString("beans.14")); //$NON-NLS-1$
                 }
             } else {
                 return result;
             }
         } catch (IntrospectionException ie) {
-            throw new IndexOutOfBoundsException(
-                    Messages.getString("beans.14")); //$NON-NLS-1$
+            throw new IndexOutOfBoundsException(Messages.getString("beans.14")); //$NON-NLS-1$
         }
 
         return result;
@@ -298,8 +298,7 @@
         return result;
     }
 
-    private Method findStaticGetter(Class<?> theClass, String propertyName)
-            throws IntrospectionException {
+    private Method findStaticGetter(Class<?> theClass, String propertyName) {
         Method result = null;
         Method[] methods = theClass.getMethods();
 

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/EventSetDescriptor.java Tue Jul 24 00:58:36 2007
@@ -115,7 +115,7 @@
             if (listenerMethodName.equals(m.getName())) {
                 Class[] paramTypes = m.getParameterTypes();
                 if (paramTypes.length == 1
-                        && paramTypes[0].getName().endsWith("Event")) {
+                        && paramTypes[0].getName().endsWith("Event")) { //$NON-NLS-1$
                     method = m;
                     break;
                 }
@@ -131,15 +131,14 @@
 
     public EventSetDescriptor(String eventSetName, Class<?> listenerType,
             Method[] listenerMethods, Method addListenerMethod,
-            Method removeListenerMethod) throws IntrospectionException {
+            Method removeListenerMethod) {
         this(eventSetName, listenerType, listenerMethods, addListenerMethod,
                 removeListenerMethod, null);
     }
 
     public EventSetDescriptor(String eventSetName, Class<?> listenerType,
             Method[] listenerMethods, Method addListenerMethod,
-            Method removeListenerMethod, Method getListenerMethod)
-            throws IntrospectionException {
+            Method removeListenerMethod, Method getListenerMethod) {
 
         setName(eventSetName);
         this.listenerType = listenerType;
@@ -166,8 +165,7 @@
 
     public EventSetDescriptor(String eventSetName, Class<?> listenerType,
             MethodDescriptor[] listenerMethodDescriptors,
-            Method addListenerMethod, Method removeListenerMethod)
-            throws IntrospectionException {
+            Method addListenerMethod, Method removeListenerMethod) {
         this(eventSetName, listenerType, null, addListenerMethod,
                 removeListenerMethod, null);
 
@@ -182,15 +180,16 @@
     }
 
     // ensures that there is no nulls
+    @SuppressWarnings("nls")
     private void checkNotNull(Object sourceClass, Object eventSetName,
-            Object listenerType, Object listenerMethodName) {
+            Object alistenerType, Object listenerMethodName) {
         if (sourceClass == null) {
             throw new NullPointerException(Messages.getString("beans.0C"));
         }
         if (eventSetName == null) {
             throw new NullPointerException(Messages.getString("beans.53"));
         }
-        if (listenerType == null) {
+        if (alistenerType == null) {
             throw new NullPointerException(Messages.getString("beans.54"));
         }
         if (listenerMethodName == null) {
@@ -316,7 +315,7 @@
             return sourceClass.getMethod(methodName, listenerType);
         } catch (NoSuchMethodException e) {
             return findAddRemoveListnerMethodWithLessCheck(sourceClass,
-                    methodName, listenerType);
+                    methodName);
         } catch (Exception e) {
             throw new IntrospectionException(Messages.getString("beans.31", //$NON-NLS-1$
                     methodName, listenerType.getName()));
@@ -324,28 +323,19 @@
     }
 
     private Method findAddRemoveListnerMethodWithLessCheck(
-            Class<?> sourceClass, String methodName, Class listenerTYpe)
+            Class<?> sourceClass, String methodName)
             throws IntrospectionException {
         String expectedListenerTypeName = listenerType.getName();
         expectedListenerTypeName = expectedListenerTypeName
-                .substring(expectedListenerTypeName.lastIndexOf(".") + 1);
+                .substring(expectedListenerTypeName.lastIndexOf(".") + 1); //$NON-NLS-1$
         Method method = null;
         Method[] methods = sourceClass.getMethods();
         for (Method m : methods) {
             if (m.getName().equals(methodName)) {
                 Class[] paramTypes = m.getParameterTypes();
                 if (paramTypes.length == 1) {
-                    // String paramTypeName = paramTypes[0].getName();
-                    // paramTypeName = paramTypeName.substring(paramTypeName
-                    // .lastIndexOf(".") + 1);
-                    // if (paramTypeName.endsWith("Listener")) {
-                    // paramTypeName = paramTypeName.substring(0,
-                    // paramTypeName.length() - "Listener".length());
-                    // if (expectedListenerTypeName.startsWith(paramTypeName)) {
                     method = m;
                     break;
-                    // }
-                    // }
                 }
             }
         }

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/IndexedPropertyDescriptor.java Tue Jul 24 00:58:36 2007
@@ -24,7 +24,7 @@
 
 public class IndexedPropertyDescriptor extends PropertyDescriptor {
 
-    private Class indexedPropertyType;
+    private Class<?> indexedPropertyType;
 
     private Method indexedGetter;
 
@@ -54,18 +54,19 @@
         setIndexedByName(beanClass, indexedGetterName, indexedSetterName);
     }
 
-    private void setIndexedByName(Class beanClass, String indexedGetterName,
+    private void setIndexedByName(Class<?> beanClass, String indexedGetterName,
             String indexedSetterName) throws IntrospectionException {
 
-        if (indexedGetterName == null) {
+        String theIndexedGetterName = indexedGetterName;
+        if (theIndexedGetterName == null) {
             if (indexedSetterName != null) {
                 setIndexedWriteMethod(beanClass, indexedSetterName);
             }
         } else {
-            if (indexedGetterName.length() == 0) {
-                indexedGetterName = "get" + name;
+            if (theIndexedGetterName.length() == 0) {
+                theIndexedGetterName = "get" + name; //$NON-NLS-1$
             }
-            setIndexedReadMethod(beanClass, indexedGetterName);
+            setIndexedReadMethod(beanClass, theIndexedGetterName);
             if (indexedSetterName != null) {
                 setIndexedWriteMethod(beanClass, indexedSetterName,
                         indexedPropertyType);
@@ -79,12 +80,12 @@
     }
 
     private boolean isCompatible() {
-        Class propertyType = getPropertyType();
+        Class<?> propertyType = getPropertyType();
 
         if (propertyType == null) {
             return true;
         }
-        Class componentTypeOfProperty = propertyType.getComponentType();
+        Class<?> componentTypeOfProperty = propertyType.getComponentType();
         if (componentTypeOfProperty == null) {
             return false;
         }
@@ -233,7 +234,7 @@
         return indexedPropertyType;
     }
 
-    private void setIndexedReadMethod(Class beanClass, String indexedGetterName)
+    private void setIndexedReadMethod(Class<?> beanClass, String indexedGetterName)
             throws IntrospectionException {
         Method getter;
         try {
@@ -249,15 +250,15 @@
         internalSetIndexedReadMethod(getter);
     }
 
-    private void internalSetIndexedReadMethod(Method indexedGetter)
+    private void internalSetIndexedReadMethod(Method indexGetter)
             throws IntrospectionException {
         // Clearing the indexed read method.
-        if (indexedGetter == null) {
+        if (indexGetter == null) {
             if (indexedSetter == null) {
                 if (getPropertyType() != null) {
                     // beans.5A=Indexed method is not compatible with non indexed method
                     throw new IntrospectionException(Messages
-                            .getString("beans.5A"));
+                            .getString("beans.5A")); //$NON-NLS-1$
                 }
                 indexedPropertyType = null;
             }
@@ -265,17 +266,17 @@
             return;
         }
         // Validate the indexed getter.
-        if ((indexedGetter.getParameterTypes().length != 1)
-                || (indexedGetter.getParameterTypes()[0] != Integer.TYPE)) {
+        if ((indexGetter.getParameterTypes().length != 1)
+                || (indexGetter.getParameterTypes()[0] != Integer.TYPE)) {
             // beans.5B=Indexed read method must take a single int argument
             throw new IntrospectionException(Messages.getString("beans.5B")); //$NON-NLS-1$
         }
-        Class indexedReadType = indexedGetter.getReturnType();
+        Class<?> indexedReadType = indexGetter.getReturnType();
         if (indexedReadType == Void.TYPE) {
             // beans.5B=Indexed read method must take a single int argument
             throw new IntrospectionException(Messages.getString("beans.5B")); //$NON-NLS-1$
         } else if (indexedSetter != null
-                && indexedGetter.getReturnType() != indexedSetter
+                && indexGetter.getReturnType() != indexedSetter
                         .getParameterTypes()[1]) {
             // beans.5A=Indexed read method is not compatible with indexed write method
             throw new IntrospectionException(Messages.getString("beans.5A")); //$NON-NLS-1$
@@ -293,10 +294,10 @@
         }
 
         // Set the indexed getter
-        this.indexedGetter = indexedGetter;
+        this.indexedGetter = indexGetter;
     }
 
-    private void setIndexedWriteMethod(Class beanClass, String indexedSetterName)
+    private void setIndexedWriteMethod(Class<?> beanClass, String indexedSetterName)
             throws IntrospectionException {
         Method setter = null;
         try {
@@ -312,8 +313,8 @@
         internalSetIndexedWriteMethod(setter, true);
     }
 
-    private void setIndexedWriteMethod(Class beanClass,
-            String indexedSetterName, Class argType)
+    private void setIndexedWriteMethod(Class<?> beanClass,
+            String indexedSetterName, Class<?> argType)
             throws IntrospectionException {
         try {
             Method setter = beanClass.getMethod(indexedSetterName, new Class[] {
@@ -328,15 +329,15 @@
         }
     }
 
-    private void internalSetIndexedWriteMethod(Method indexedSetter,
+    private void internalSetIndexedWriteMethod(Method indexSetter,
             boolean initialize) throws IntrospectionException {
         // Clearing the indexed write method.
-        if (indexedSetter == null) {
+        if (indexSetter == null) {
             if (indexedGetter == null) {
                 if (getPropertyType() != null) {
                     // beans.5E=Indexed method is not compatible with non indexed method
                     throw new IntrospectionException(Messages
-                            .getString("beans.5E"));
+                            .getString("beans.5E")); //$NON-NLS-1$
                 }
                 indexedPropertyType = null;
             }
@@ -345,7 +346,7 @@
         }
 
         // Validate the indexed write method.
-        Class[] indexedSetterArgs = indexedSetter.getParameterTypes();
+        Class[] indexedSetterArgs = indexSetter.getParameterTypes();
         if (indexedSetterArgs.length != 2) {
             // beans.5F=Indexed write method must take two arguments
             throw new IntrospectionException(Messages.getString("beans.5F")); //$NON-NLS-1$
@@ -357,7 +358,7 @@
 
         // Set the indexed property type if not already set, confirm validity if
         // it is.
-        Class indexedWriteType = indexedSetterArgs[1];
+        Class<?> indexedWriteType = indexedSetterArgs[1];
         if (initialize && indexedGetter == null) {
             indexedPropertyType = indexedWriteType;
         } else {
@@ -368,7 +369,7 @@
         }
 
         // Set the indexed write method.
-        this.indexedSetter = indexedSetter;
+        this.indexedSetter = indexSetter;
     }
 
     private static String initialUpperCase(String string) {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/Introspector.java Tue Jul 24 00:58:36 2007
@@ -83,7 +83,7 @@
     // The cache to store Bean Info objects that have been found or created
     private static final int DEFAULT_CAPACITY = 128;
 
-    private static Map<Class, StandardBeanInfo> theCache = Collections.synchronizedMap(new WeakHashMap<Class, StandardBeanInfo>(DEFAULT_CAPACITY));
+    private static Map<Class<?>, StandardBeanInfo> theCache = Collections.synchronizedMap(new WeakHashMap<Class<?>, StandardBeanInfo>(DEFAULT_CAPACITY));
 
     private Introspector() {
         super();
@@ -253,7 +253,7 @@
         searchPath = path;
     }
 
-    private static StandardBeanInfo getBeanInfoImpl(Class beanClass, Class stopClass,
+    private static StandardBeanInfo getBeanInfoImpl(Class<?> beanClass, Class<?> stopClass,
             int flags) throws IntrospectionException {
         BeanInfo explicitInfo = null;
         if (flags == USE_ALL_BEANINFO) {
@@ -269,11 +269,11 @@
         }
         
         // recursive get beaninfo for super classes
-        Class beanSuperClass = beanClass.getSuperclass();
+        Class<?> beanSuperClass = beanClass.getSuperclass();
         if (beanSuperClass != stopClass) {
             if (beanSuperClass == null)
                 throw new IntrospectionException(
-                        "Stop class is not super class of bean class");
+                        "Stop class is not super class of bean class"); //$NON-NLS-1$
             int superflags = flags == IGNORE_IMMEDIATE_BEANINFO ? USE_ALL_BEANINFO
                     : flags;
             BeanInfo superBeanInfo = getBeanInfoImpl(beanSuperClass, stopClass,
@@ -285,7 +285,7 @@
         return beanInfo;
     }
 
-    private static BeanInfo getExplicitBeanInfo(Class beanClass) {
+    private static BeanInfo getExplicitBeanInfo(Class<?> beanClass) {
         BeanInfo theBeanInfo = null;
         String beanInfoClassName = beanClass.getName() + "BeanInfo"; //$NON-NLS-1$
         try{
@@ -297,7 +297,7 @@
         int index = beanInfoClassName.lastIndexOf('.');
         String beanInfoName = index>=0? beanInfoClassName.substring(index+1):beanInfoClassName;
         for (int i = 0; i < searchPath.length; i++) {
-            beanInfoClassName = searchPath[i] + "." + beanInfoName;
+            beanInfoClassName = searchPath[i] + "." + beanInfoName; //$NON-NLS-1$
             try{
                 theBeanInfo = loadBeanInfo(beanInfoClassName, beanClass);
                 break;
@@ -322,7 +322,7 @@
      *         are problems instantiating the instance
      */
     private static BeanInfo loadBeanInfo(String beanInfoClassName,
-        Class beanClass) throws Exception{
+        Class<?> beanClass) throws Exception{
         try {
             ClassLoader cl = beanClass.getClassLoader();
             if(cl != null){
@@ -342,8 +342,8 @@
                 Thread.currentThread().getContextClassLoader()).newInstance();
     }
 
-    private static StandardBeanInfo getBeanInfoImplAndInit(Class beanClass,
-            Class stopClass, int flag) throws IntrospectionException {
+    private static StandardBeanInfo getBeanInfoImplAndInit(Class<?> beanClass,
+            Class<?> stopClass, int flag) throws IntrospectionException {
         StandardBeanInfo standardBeanInfo = getBeanInfoImpl(beanClass,
                 stopClass, flag);
         standardBeanInfo.init();

Added: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java?view=auto&rev=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package java.beans;
+
+class NullPersistenceDelegate extends PersistenceDelegate {
+    @Override
+    protected Expression instantiate(Object oldInstance, Encoder out) {
+        assert oldInstance == null;
+        return new Expression(null, null, null, null);
+    }
+
+    @Override
+    /*
+     * It's unnecessary to do anything for initialization, because two mutatable
+     * strings are actually equivalent already.
+     */
+    protected void initialize(Class<?> type, Object oldInstance,
+            Object newInstance, Encoder out) {
+        // do nothing
+    }
+
+    @Override
+    public void writeObject(Object oldInstance, Encoder out) {
+        assert oldInstance == null;
+        out.writeExpression(instantiate(null, out));
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ParameterDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ParameterDescriptor.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ParameterDescriptor.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/ParameterDescriptor.java Tue Jul 24 00:58:36 2007
@@ -20,5 +20,6 @@
 public class ParameterDescriptor extends FeatureDescriptor {
 
     public ParameterDescriptor() {
+        // do nothing
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PersistenceDelegate.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -54,7 +54,7 @@
      */
     protected void initialize(Class<?> type, Object oldInstance,
             Object newInstance, Encoder enc) {
-        Class c = type.getSuperclass();
+        Class<?> c = type.getSuperclass();
         if (null != c) {
             PersistenceDelegate pd = enc.getPersistenceDelegate(c);
             pd.initialize(c, oldInstance, newInstance, enc);

Added: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java?view=auto&rev=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java Tue Jul 24 00:58:36 2007
@@ -0,0 +1,66 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+
+package java.beans;
+
+
+/**
+ * A special internal <code>PersistenceDelegate</code> for wrapper classes of
+ * primitive types like int.
+ * 
+ */
+public class PrimitiveWrapperPersistenceDelegate extends PersistenceDelegate {
+
+    /*
+     * It's unnecessary to do anything for initialization, because two mutatable
+     * wrapper objects are actually equivalent already.
+     */
+    @Override
+    protected void initialize(Class<?> type, Object oldInstance,
+            Object newInstance, Encoder enc) {
+        // do nothing
+    }
+
+    /*
+     * Instantiates a wrapper object using the constructor taking one String
+     * parameter except for Character.
+     */
+    @Override
+    protected Expression instantiate(Object oldInstance, Encoder enc) {
+        if (oldInstance instanceof Character) {
+            return new Expression(oldInstance, oldInstance.toString(),
+                    "charAt", new Object[] { new Integer(0) }); //$NON-NLS-1$
+        }
+        return new Expression(oldInstance, oldInstance.getClass(),
+                "new", new Object[] { oldInstance //$NON-NLS-1$
+                        .toString() });
+    }
+
+    /*
+     * Two wrapper objects are regarded mutatable if they are equal.
+     */
+    @Override
+    protected boolean mutatesTo(Object o1, Object o2) {
+        if (null == o2) {
+            return false;
+        }
+        return o1.equals(o2);
+    }
+
+}
+

Propchange: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyChangeSupport.java Tue Jul 24 00:58:36 2007
@@ -184,7 +184,7 @@
         ArrayList<PropertyChangeListener> result = new ArrayList<PropertyChangeListener>(
                 globalListeners);
         for (String propertyName : children.keySet()) {
-            PropertyChangeSupport namedListener = (PropertyChangeSupport) children
+            PropertyChangeSupport namedListener = children
                     .get(propertyName);
             PropertyChangeListener[] listeners = namedListener
                     .getPropertyChangeListeners();
@@ -198,7 +198,7 @@
 
     private void writeObject(ObjectOutputStream oos) throws IOException {
         oos.defaultWriteObject();
-        PropertyChangeListener[] gListeners = (PropertyChangeListener[]) globalListeners
+        PropertyChangeListener[] gListeners = globalListeners
                 .toArray(new PropertyChangeListener[0]);
         for (int i = 0; i < gListeners.length; i++) {
             if (gListeners[i] instanceof Serializable) {
@@ -236,11 +236,13 @@
         return new PropertyChangeEvent(source, propertyName, oldValue, newValue);
     }
 
+    @SuppressWarnings("boxing")
     private PropertyChangeEvent createPropertyChangeEvent(String propertyName,
             boolean oldValue, boolean newValue) {
         return new PropertyChangeEvent(source, propertyName, oldValue, newValue);
     }
 
+    @SuppressWarnings("boxing")
     private PropertyChangeEvent createPropertyChangeEvent(String propertyName,
             int oldValue, int newValue) {
         return new PropertyChangeEvent(source, propertyName, oldValue, newValue);
@@ -254,7 +256,7 @@
         }
 
         // Collect up the global listeners
-        PropertyChangeListener[] gListeners = (PropertyChangeListener[]) globalListeners
+        PropertyChangeListener[] gListeners = globalListeners
                 .toArray(new PropertyChangeListener[0]);
         // Fire the events for global listeners
         for (int i = 0; i < gListeners.length; i++) {
@@ -263,7 +265,7 @@
 
         // Fire the events for the property specific listeners if any
         if (event.getPropertyName() != null) {
-            PropertyChangeSupport namedListener = (PropertyChangeSupport) children
+            PropertyChangeSupport namedListener = children
                     .get(event.getPropertyName());
             if (namedListener != null) {
                 namedListener.firePropertyChange(event);

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorManager.java Tue Jul 24 00:58:36 2007
@@ -27,6 +27,7 @@
     private static final Map<Class<?>, Class<?>> registeredEditors = new HashMap<Class<?>, Class<?>>();
 
     public PropertyEditorManager() {
+        // expected
     }
 
     public static void registerEditor(Class<?> targetType, Class<?> editorClass) {
@@ -58,6 +59,7 @@
             try {
                 editor = (PropertyEditor) editorClass.newInstance();
             } catch (Exception e) {
+                // expected
             }
         }
         
@@ -91,9 +93,11 @@
                         editorClass.asSubclass(PropertyEditorSupport.class);
                         break;
                     } catch (Exception e) {
+                        // expected
                     }
                 }
             } catch (Exception e) {
+                // expected
             }
             if(editorClass != null){
                 try {
@@ -101,6 +105,7 @@
 //                    registeredEditors.put(targetType, editorClass);
                     editor = (PropertyEditor) editorClass.newInstance();
                 } catch (Exception e) {
+                    // expected
                 }    
             }
         }
@@ -112,11 +117,8 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        if(apath == null){
-            apath = new String[0];
-        }
         synchronized(PropertyEditorManager.class){
-            path = apath;
+            path = (apath == null)? new String[0] : apath;
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorSupport.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorSupport.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/PropertyEditorSupport.java Tue Jul 24 00:58:36 2007
@@ -47,6 +47,7 @@
     }
 
     public void paintValue(Graphics gfx, Rectangle box) {
+        // expected
     }
 
     public void setAsText(String text) throws IllegalArgumentException {

Modified: harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java?view=diff&rev=558953&r1=558952&r2=558953
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/SimpleBeanInfo.java Tue Jul 24 00:58:36 2007
@@ -23,7 +23,9 @@
 
 public class SimpleBeanInfo implements BeanInfo {
 
-    public SimpleBeanInfo() {}
+    public SimpleBeanInfo() {
+        // expected
+    }
 
     public Image loadImage(String resourceName) {
         if (null == resourceName) {
@@ -34,9 +36,8 @@
         
         if (file != null) {
             return Toolkit.getDefaultToolkit().createImage(file);
-        } else {
-            return null;
         }
+        return null;
     }
 
     public PropertyDescriptor[] getPropertyDescriptors() {



Mime
View raw message