You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2007/08/02 23:27:58 UTC
svn commit: r562262 [2/6] - in /harmony/enhanced/classlib/branches/java6: ./
depends/build/platform/ modules/accessibility/ modules/annotation/
modules/applet/ modules/archive/ modules/auth/ modules/awt/
modules/awt/src/main/java/unix/org/apache/harmon...
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoImpl.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/BeanInfoImpl.java Thu Aug 2 14:27:53 2007
@@ -250,13 +250,18 @@
// in event set descriptor pattern
}
- listenerCoreName = Introspector
- .decapitalize(listenerCoreName);
- EventSetDescriptor esd = new EventSetDescriptor(
- listenerCoreName, listenerType,
- listenerMethods, addListenerMethod,
- removeListenerMethod, getListenerMethod);
- result.put(listenerCoreName, esd);
+ 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$
+ }
} // if length of parameters list equals to 1
} // if no descriptors for given listener name yet
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Beans.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Beans.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Beans.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Beans.java Thu Aug 2 14:27:53 2007
@@ -161,34 +161,38 @@
ClassLoader loader = null;
- String beanResourceName = getBeanResourceName(beanName);
+ // First try to load it from a serialization file.
+ String beanResourceName = getBeanResourceName(beanName);
InputStream is = (cls == null) ? ClassLoader
.getSystemResourceAsStream(beanResourceName) : cls
.getResourceAsStream(beanResourceName);
- if (is != null) {
- ObjectInputStream ois = (cls == null) ? new ObjectInputStream(is)
- : new CustomizedObjectInputStream(is, cls);
- result = ois.readObject();
+ IOException serializationException = null;
+ if (is != null) {
+ try{
+ ObjectInputStream ois = (cls == null) ? new ObjectInputStream(is)
+ : new CustomizedObjectInputStream(is, cls);
+ result = ois.readObject();
+ }catch(IOException exception){
+ //Not loadable - remember this as we may throw it later.
+ serializationException = exception;
+ }
}
- if (result == null) {
+ //If that did not work, try to instantiate it from the given classloader.
+ if (result == null) {
deserialized = false;
try {
loader = cls == null ? ClassLoader.getSystemClassLoader() : cls;
Class<?> c = Class.forName(beanName, true, loader);
-
- try {
- result = c.newInstance();
-
- } catch (IllegalAccessException iae) {
- throw new ClassNotFoundException(iae.getClass() + ": " //$NON-NLS-1$
- + iae.getMessage());
- }
- } catch (InstantiationException ie) {
- throw new ClassNotFoundException(ie.getClass() + ": " //$NON-NLS-1$
- + ie.getMessage());
+ result = c.newInstance();
+ } catch (Exception e) {
+ if (serializationException != null) {
+ throw serializationException;
+ }
+ throw new ClassNotFoundException(e.getClass() + ": " //$NON-NLS-1$
+ + e.getMessage());
}
}
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ClassPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ClassPersistenceDelegate.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ClassPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ClassPersistenceDelegate.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,92 @@
+/*
+ * 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.Field;
+
+class ClassPersistenceDelegate extends PersistenceDelegate {
+ @Override
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ Class<?> value = (Class) oldInstance;
+ Field fld = null;
+ final String TYPE = "TYPE"; //$NON-NLS-1$
+ Expression result;
+ /*
+ * Special treatment to String.class to prevent endless loop of
+ * instantiation.
+ */
+ if (value == String.class) {
+ return new Expression(value, "", "getClass", null); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ try {
+ if (value.equals(Integer.TYPE)) {
+ fld = Integer.class.getField(TYPE);
+ } else if (value.equals(Short.TYPE)) {
+ fld = Short.class.getField(TYPE);
+ } else if (value.equals(Long.TYPE)) {
+ fld = Long.class.getField(TYPE);
+ } else if (value.equals(Float.TYPE)) {
+ fld = Float.class.getField(TYPE);
+ } else if (value.equals(Double.TYPE)) {
+ fld = Double.class.getField(TYPE);
+ } else if (value.equals(Byte.TYPE)) {
+ fld = Byte.class.getField(TYPE);
+ } else if (value.equals(Character.TYPE)) {
+ fld = Character.class.getField(TYPE);
+ } else if (value.equals(Boolean.TYPE)) {
+ fld = Boolean.class.getField(TYPE);
+ }
+ } catch (NoSuchFieldException e) {
+ // impossible situation for valid java.lang classes
+ // implementation with version >= 1.1
+ throw new AssertionError(e);
+ }
+ if (fld != null) {
+ // we have primitive type
+ result = new Expression(oldInstance, fld,
+ "get", new Object[] { null }); //$NON-NLS-1$
+ } else {
+ result = new Expression(oldInstance, String.class, "forName", //$NON-NLS-1$
+ new Object[] { value.getName() });
+ }
+ return result;
+ }
+
+ @Override
+ /*
+ * It's unnecessary to do anything for initialization, because two mutatable
+ * class objects are actually the same.
+ */
+ protected void initialize(Class<?> type, Object oldInstance,
+ Object newInstance, Encoder out) {
+ // do nothing
+ }
+
+ @Override
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ if (oldInstance instanceof Class && newInstance instanceof Class) {
+ Class<?> c1 = (Class) oldInstance;
+ Class<?> c2 = (Class) newInstance;
+ if (c1.getName().equals(c2.getName())) {
+ return true;
+ }
+ return false;
+ }
+ return super.mutatesTo(oldInstance, newInstance);
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ClassPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/Encoder.java Thu Aug 2 14:27:53 2007
@@ -55,7 +55,7 @@
private static final ArrayPersistenceDelegate arrayPD = new ArrayPersistenceDelegate();
- private static final java_lang_reflect_ProxyPersistenceDelegate proxyPD = new java_lang_reflect_ProxyPersistenceDelegate();
+ private static final ProxyPersistenceDelegate proxyPD = new ProxyPersistenceDelegate();
private static final NullPersistenceDelegate nullPD = new NullPersistenceDelegate();
@@ -81,11 +81,11 @@
delegates.put(Long.class, ppd);
delegates.put(Short.class, ppd);
- delegates.put(Class.class, new java_lang_ClassPersistenceDelegate());
- delegates.put(Field.class, new java_lang_reflect_FieldPersistenceDelegate());
- delegates.put(Method.class, new java_lang_reflect_MethodPersistenceDelegate());
- delegates.put(String.class, new java_lang_StringPersistenceDelegate());
- delegates.put(Proxy.class, new java_lang_reflect_ProxyPersistenceDelegate());
+ delegates.put(Class.class, new ClassPersistenceDelegate());
+ delegates.put(Field.class, new FieldPersistenceDelegate());
+ delegates.put(Method.class, new MethodPersistenceDelegate());
+ delegates.put(String.class, new StringPersistenceDelegate());
+ delegates.put(Proxy.class, new ProxyPersistenceDelegate());
delegates.put(Choice.class, new AwtChoicePersistenceDelegate());
delegates.put(Color.class, new AwtColorPersistenceDelegate());
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java Thu Aug 2 14:27:53 2007
@@ -131,14 +131,16 @@
public EventSetDescriptor(String eventSetName, Class<?> listenerType,
Method[] listenerMethods, Method addListenerMethod,
- Method removeListenerMethod) {
+ Method removeListenerMethod) throws IntrospectionException {
+
this(eventSetName, listenerType, listenerMethods, addListenerMethod,
removeListenerMethod, null);
}
public EventSetDescriptor(String eventSetName, Class<?> listenerType,
Method[] listenerMethods, Method addListenerMethod,
- Method removeListenerMethod, Method getListenerMethod) {
+ Method removeListenerMethod, Method getListenerMethod)
+ throws IntrospectionException {
setName(eventSetName);
this.listenerType = listenerType;
@@ -165,7 +167,9 @@
public EventSetDescriptor(String eventSetName, Class<?> listenerType,
MethodDescriptor[] listenerMethodDescriptors,
- Method addListenerMethod, Method removeListenerMethod) {
+ Method addListenerMethod, Method removeListenerMethod)
+ throws IntrospectionException {
+
this(eventSetName, listenerType, null, addListenerMethod,
removeListenerMethod, null);
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/FieldPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/FieldPersistenceDelegate.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/FieldPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/FieldPersistenceDelegate.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,53 @@
+/*
+ * 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.Field;
+
+/**
+ * This is a persistence delegate for the {@link java.lang.reflect.Field} class.
+ */
+class FieldPersistenceDelegate extends PersistenceDelegate {
+ @Override
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ // should not be null or have a type other than Field
+ assert oldInstance instanceof Field : oldInstance;
+ Field oldField = (Field) oldInstance;
+ Class<?> declClass = oldField.getDeclaringClass();
+ return new Expression(oldField, declClass, "getField", //$NON-NLS-1$
+ new Object[] { oldField.getName() });
+ }
+
+ @Override
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ // check for consistency
+ assert oldInstance instanceof Field : oldInstance;
+ assert newInstance instanceof Field : newInstance;
+ assert newInstance.equals(oldInstance);
+ }
+
+ @Override
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ assert oldInstance instanceof Field : oldInstance;
+ if (!(newInstance instanceof Field)) {
+ // if null or not a Field
+ return false;
+ }
+ return oldInstance.equals(newInstance);
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/FieldPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/MethodPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/MethodPersistenceDelegate.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/MethodPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/MethodPersistenceDelegate.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,53 @@
+/*
+ * 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.Method;
+
+/**
+ * Persistence delegate for {@link java.lang.reflect.Method} class.
+ */
+class MethodPersistenceDelegate extends PersistenceDelegate {
+ @Override
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ // should not be null or have a type other than Method
+ assert oldInstance instanceof Method : oldInstance;
+ Method oldMethod = (Method) oldInstance;
+ Class<?> declClass = oldMethod.getDeclaringClass();
+ return new Expression(oldMethod, declClass, "getMethod", //$NON-NLS-1$
+ new Object[] { oldMethod.getName(), oldMethod.getParameterTypes() });
+ }
+
+ @Override
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ // check for consistency
+ assert oldInstance instanceof Method : oldInstance;
+ assert newInstance instanceof Method : newInstance;
+ assert newInstance.equals(oldInstance);
+ }
+
+ @Override
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ assert oldInstance instanceof Method : oldInstance;
+ if (!(newInstance instanceof Method)) {
+ // if null or not a Method
+ return false;
+ }
+ return oldInstance.equals(newInstance);
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/MethodPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/PrimitiveWrapperPersistenceDelegate.java Thu Aug 2 14:27:53 2007
@@ -24,7 +24,7 @@
* primitive types like int.
*
*/
-public class PrimitiveWrapperPersistenceDelegate extends PersistenceDelegate {
+class PrimitiveWrapperPersistenceDelegate extends PersistenceDelegate {
/*
* It's unnecessary to do anything for initialization, because two mutatable
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ProxyPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ProxyPersistenceDelegate.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ProxyPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ProxyPersistenceDelegate.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,48 @@
+/*
+ * 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.InvocationHandler;
+import java.lang.reflect.Proxy;
+
+class ProxyPersistenceDelegate extends DefaultPersistenceDelegate {
+ @Override
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ assert oldInstance instanceof Proxy : oldInstance;
+ Class[] interfaces = oldInstance.getClass().getInterfaces();
+ InvocationHandler handler = Proxy.getInvocationHandler(oldInstance);
+ return new Expression(oldInstance, Proxy.class, "newProxyInstance", //$NON-NLS-1$
+ new Object[] { oldInstance.getClass().getClassLoader(), interfaces, handler });
+ }
+
+ @Override
+ protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
+ // check for consistency
+ assert oldInstance instanceof Proxy : oldInstance;
+ assert newInstance instanceof Proxy : newInstance;
+ assert newInstance == oldInstance;
+ super.initialize(type, oldInstance, newInstance, out);
+ }
+
+ @Override
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ assert oldInstance instanceof Proxy : oldInstance;
+ assert oldInstance == newInstance;
+ return super.mutatesTo(oldInstance, newInstance);
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/ProxyPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StandardBeanInfo.java Thu Aug 2 14:27:53 2007
@@ -823,7 +823,7 @@
* @throws IntrospectionException
*/
@SuppressWarnings("unchecked")
- private EventSetDescriptor[] introspectEvents() {
+ private EventSetDescriptor[] introspectEvents() throws IntrospectionException {
// Get descriptors for the public methods
// FIXME: performance
MethodDescriptor[] theMethods = introspectMethods();
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StringPersistenceDelegate.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StringPersistenceDelegate.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StringPersistenceDelegate.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StringPersistenceDelegate.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,45 @@
+/*
+ * 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 StringPersistenceDelegate extends PersistenceDelegate {
+ @Override
+ protected Expression instantiate(Object oldInstance, Encoder out) {
+ String value = (String) oldInstance;
+ return new Expression(oldInstance, String.class,
+ "new", new Object[] { value }); //$NON-NLS-1$
+ }
+
+ @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
+ protected boolean mutatesTo(Object oldInstance, Object newInstance) {
+ if (oldInstance instanceof String && newInstance instanceof String) {
+ return newInstance.equals(oldInstance);
+ }
+ return super.mutatesTo(oldInstance, newInstance);
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/StringPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java Thu Aug 2 14:27:53 2007
@@ -837,11 +837,17 @@
}
/**
- * Releases a service without checking the memebership of the child.
+ * Releases a service without checking the membership of the child.
*/
private void releaseServiceWithoutCheck(BeanContextChild child,
BCSSChild bcssChild, Object requestor, Object service,
boolean callRevokedListener) {
+
+ if (bcssChild.serviceRecords == null
+ || bcssChild.serviceRecords.isEmpty()) {
+ return;
+ }
+
synchronized (child) {
// scan record
for (Iterator iter = bcssChild.serviceRecords.iterator(); iter
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/ColorEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/ColorEditor.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/ColorEditor.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/ColorEditor.java Thu Aug 2 14:27:53 2007
@@ -20,30 +20,43 @@
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
+import java.awt.Panel;
import java.awt.Rectangle;
-import java.beans.PropertyEditorSupport;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyEditor;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
-public class ColorEditor extends PropertyEditorSupport {
+@SuppressWarnings("serial")
+public class ColorEditor extends Panel implements PropertyEditor {
+List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
+
+ private Color value;
+
+ private Object source;
+
public ColorEditor(Object source) {
- super(source);
+ if(null == source) {
+ throw new NullPointerException();
+ }
+ this.source = source;
}
public ColorEditor() {
super();
}
- @Override
public Component getCustomEditor() {
- return null;
+ return this;
}
- @Override
public boolean supportsCustomEditor() {
return true;
}
- @Override
public String getJavaInitializationString() {
String result = null;
Color color = (Color) getValue();
@@ -51,23 +64,31 @@
int red = color.getRed();
int green = color.getGreen();
int blue = color.getBlue();
- result = "new Color(" + red + "," + green + "," + blue + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ result = "new java.awt.Color(" + red + "," + green + "," + blue + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
return result;
}
- @Override
public String[] getTags() {
return null;
}
- @Override
public void setValue(Object value) {
- if (value instanceof Color) {
- super.setValue(value);
+ if( null == value) {
+ return;
+ }
+ Object oldValue = this.value;
+ this.value = (Color) value;
+ PropertyChangeEvent changeAllEvent = new PropertyChangeEvent(this,
+ "value", oldValue, value); //$NON-NLS-1$
+ PropertyChangeListener[] copy = new PropertyChangeListener[listeners.size()];
+ listeners.toArray(copy);
+ for (PropertyChangeListener listener : copy) {
+ listener.propertyChange(changeAllEvent);
}
}
+ @SuppressWarnings("nls")
public String getAsText(){
Color c = (Color)getValue();
StringBuilder sb = new StringBuilder(14);
@@ -79,7 +100,7 @@
return sb.toString();
}
- @Override
+ @SuppressWarnings("nls")
public void setAsText(String text) {
if (null == text) {
throw new NullPointerException();
@@ -88,33 +109,69 @@
int r = 0;
int g = 0;
int b = 0;
-
+ String aText = text;
try {
int index = text.indexOf(",");
r = Integer.parseInt(text.substring(0, index));
- text = text.substring(index + 1);
- index = text.indexOf(",");
- g = Integer.parseInt(text.substring(0, index));
- text = text.substring(index + 1);
- b = Integer.parseInt(text);
+ aText = text.substring(index + 1);
+ index = aText.indexOf(",");
+ g = Integer.parseInt(aText.substring(0, index));
+ aText = aText.substring(index + 1);
+ b = Integer.parseInt(aText);
setValue(new Color(r, g, b));
} catch (Exception e) {
- throw new IllegalArgumentException(text);
+ throw new IllegalArgumentException(aText);
}
}
- @Override
public boolean isPaintable() {
return true;
}
- @Override
public void paintValue(Graphics gfx, Rectangle box) {
Color color = (Color) getValue();
if (color != null) {
gfx.setColor(color);
gfx.drawRect(box.x, box.y, box.x + box.width, box.y + box.height);
+ }
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ @Override
+ public synchronized void removePropertyChangeListener(
+ PropertyChangeListener listener) {
+ if (listeners != null) {
+ listeners.remove(listener);
+ }
+ }
+
+ @Override
+ public synchronized void addPropertyChangeListener(
+ PropertyChangeListener listener) {
+ listeners.add(listener);
+ }
+
+ public void firePropertyChange() {
+ if (listeners.isEmpty()) {
+ return;
+ }
+
+ List<PropertyChangeListener> copy = new ArrayList<PropertyChangeListener>(
+ listeners.size());
+ synchronized (listeners) {
+ copy.addAll(listeners);
+ }
+
+ PropertyChangeEvent changeAllEvent = new PropertyChangeEvent(source,
+ null, null, null);
+ for (Iterator<PropertyChangeListener> listenersItr = copy.iterator(); listenersItr
+ .hasNext();) {
+ PropertyChangeListener listna = listenersItr.next();
+ listna.propertyChange(changeAllEvent);
}
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java Thu Aug 2 14:27:53 2007
@@ -42,7 +42,7 @@
if(source== null){
throw new NullPointerException();
}
- this.source = (Font)source;
+ this.source = source;
}
public FontEditor() {
@@ -73,13 +73,10 @@
}
public void setValue(Object newValue) {
- if(newValue == null){
- throw new NullPointerException();
- }
Object oldValue = value;
value = (Font)newValue;
PropertyChangeEvent changeAllEvent = new PropertyChangeEvent(this,
- "value", oldValue, value);
+ "value", oldValue, value); //$NON-NLS-1$
PropertyChangeListener[] copy = new PropertyChangeListener[listeners.size()];
listeners.toArray(copy);
for (PropertyChangeListener listener : copy) {
@@ -112,6 +109,7 @@
throw new IllegalArgumentException(text==null?text:value.toString());
}
+ @Override
public synchronized void removePropertyChangeListener(
PropertyChangeListener listener) {
if (listeners != null) {
@@ -119,6 +117,7 @@
}
}
+ @Override
public synchronized void addPropertyChangeListener(
PropertyChangeListener listener) {
listeners.add(listener);
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/ClassPersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/ClassPersistenceDelegateTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/ClassPersistenceDelegateTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/ClassPersistenceDelegateTest.java Thu Aug 2 14:27:53 2007
@@ -19,7 +19,7 @@
import java.beans.Encoder;
import java.beans.Expression;
-import java.beans.java_lang_ClassPersistenceDelegate;
+import java.beans.ClassPersistenceDelegate;
import junit.framework.TestCase;
@@ -28,12 +28,12 @@
*/
public class ClassPersistenceDelegateTest extends TestCase {
- private java_lang_ClassPersistenceDelegate pd = null;
+ private ClassPersistenceDelegate pd = null;
@Override
protected void setUp() throws Exception {
super.setUp();
- pd = new java_lang_ClassPersistenceDelegate();
+ pd = new ClassPersistenceDelegate();
}
public void testMutates() {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/StringPersistenceDelegateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/StringPersistenceDelegateTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/StringPersistenceDelegateTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/StringPersistenceDelegateTest.java Thu Aug 2 14:27:53 2007
@@ -19,7 +19,7 @@
import java.beans.Encoder;
import java.beans.Expression;
-import java.beans.java_lang_StringPersistenceDelegate;
+import java.beans.StringPersistenceDelegate;
import junit.framework.TestCase;
@@ -28,12 +28,12 @@
*/
public class StringPersistenceDelegateTest extends TestCase {
- private java_lang_StringPersistenceDelegate pd = null;
+ private StringPersistenceDelegate pd = null;
@Override
protected void setUp() throws Exception {
super.setUp();
- pd = new java_lang_StringPersistenceDelegate();
+ pd = new StringPersistenceDelegate();
}
public void testMutates() {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeansTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeansTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeansTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/BeansTest.java Thu Aug 2 14:27:53 2007
@@ -39,8 +39,10 @@
import junit.textui.TestRunner;
import org.apache.harmony.beans.tests.support.SampleBean;
+import org.apache.harmony.beans.tests.support.mock.CorruptedSerBean;
import org.apache.harmony.beans.tests.support.mock.MockAppletInitializer;
import org.apache.harmony.beans.tests.support.mock.MockJavaBean;
+import org.apache.harmony.beans.tests.support.mock.WrongSerBean;
/**
* Unit test for java.beans.Beans
@@ -345,7 +347,7 @@
try {
Beans.setDesignTime(true);
assertTrue(Beans.isDesignTime());
-
+
Beans.setDesignTime(false);
assertFalse(Beans.isDesignTime());
} finally {
@@ -358,16 +360,16 @@
try {
Beans.setGuiAvailable(true);
assertTrue(Beans.isGuiAvailable());
-
+
Beans.setGuiAvailable(false);
assertFalse(Beans.isGuiAvailable());
} finally {
Beans.setGuiAvailable(value);
}
}
-
+
public void testIsGuiAvailableDefault() {
- assertTrue("GUI is available by default", Beans.isGuiAvailable());
+ assertTrue("GUI is available by default", Beans.isGuiAvailable());
}
/**
@@ -427,42 +429,89 @@
targetType = null;
assertFalse(Beans.isInstanceOf(bean, targetType));
}
-
- public void test_instantiate_with_corrupted_serialization_file()
- throws Exception {
- final String BEANS_NAME = "TestBean";
- // create a corrupted serialization file with name TestBean.ser
- File file = new File(BEANS_NAME + ".ser");
- file.deleteOnExit();
- FileOutputStream fout = new FileOutputStream(file);
- fout.close();
+ public void test_instantiate_with_empty_serialization_file()
+ throws Exception {
+ final String BEANS_NAME = "org/apache/harmony/beans/tests/support/mock/EmptySerBean.ser";
try {
Beans.instantiate(null, BEANS_NAME);
- fail("should throw IOException.");
- } catch (IOException e) {
+ fail("should throw ClassNotFoundException.");
+ } catch (ClassNotFoundException e) {
// expected
}
}
-
- //Regression for HARMONY-3777
- public void test_instantiate_with_applet() throws Exception{
- Applet applet = (Applet) Beans.instantiate(null, "java.applet.Applet");
- assertNotNull(applet.getAppletContext());
- assertTrue(applet.isActive());
- }
- /**
- *
+ // Regression for HARMONY-3777
+ public void test_instantiate_with_applet() throws Exception {
+ Applet applet = (Applet) Beans.instantiate(null, "java.applet.Applet");
+ assertNotNull(applet.getAppletContext());
+ assertTrue(applet.isActive());
+ }
+
+ /*
+ * Test instantiate a bean with corrupted .ser file. First failed to create
+ * an instance by deserialize from a corrupted .ser file, then successfully
+ * load the class and create an instance of it.
+ */
+ public void test_instantiate_withCorruptedSer() throws IOException,
+ ClassNotFoundException {
+ Object bean = Beans.instantiate(null,
+ "org.apache.harmony.beans.tests.support.mock.CorruptedSerBean");
+ assertTrue(bean instanceof CorruptedSerBean);
+ }
+
+ /*
+ * Test instantiate a bean with wrong .ser file, which means the definition
+ * of the class changes after .ser file is created. First failed to create
+ * an instance by deserialize from a corrupted .ser file, which will cause a
+ * InvalidClassException, then successfully load the class and create an
+ * instance of it.
+ */
+ public void test_instantiate_withWrongSer() throws IOException,
+ ClassNotFoundException {
+ Object bean = Beans.instantiate(null,
+ "org.apache.harmony.beans.tests.support.mock.WrongSerBean");
+ assertTrue(bean instanceof WrongSerBean);
+ }
+
+ /*
+ * Test instantiate a bean with wrong but not corrupted .ser file First
+ * failed to create an instance by deserialize from a wrong .ser file, which
+ * will cause a ClassNotFoundException.
+ */
+ public void test_instantiate_ClassNotFoundExceptionThrowing()
+ throws IOException {
+ ClassLoader loader = new WrongSerClassLoader();
+ try {
+ Beans
+ .instantiate(loader,
+ "org.apache.harmony.beans.tests.support.mock.WrongSerBean2");
+ fail("Should throw a ClassNotFoundException");
+ } catch (ClassNotFoundException ex) {
+ // expected
+ }
+ }
+
+ /*
+ * Test instantiate bean with corrupted .ser file and wrong class name. This
+ * will cause an IOException.
*/
+ public void test_instantiate_IOExceptionThrowing()
+ throws ClassNotFoundException {
+ ClassLoader loader = new CorruptedSerClassLoader();
+ try {
+ Beans.instantiate(loader, "NotExistBean2");
+ fail("Should throw a IOException");
+ } catch (IOException ex) {
+ // expected
+ }
+ }
+
public static Test suite() {
return new TestSuite(BeansTest.class);
}
- /**
- *
- */
public static void main(String[] args) {
TestRunner.run(suite());
}
@@ -529,4 +578,26 @@
return getResource(MOCK_JAVA_BEAN2_SFILE);
}
}
+
+ /*
+ * A classloader for loading NotExistBean.ser, of which coresponding
+ * NotExistBean.java file is deleted.
+ */
+ private class WrongSerClassLoader extends ClassLoader {
+ @Override
+ protected URL findResource(String name) {
+ return getResource("org/apache/harmony/beans/tests/support/mock/NotExistBean.ser");
+ }
+ }
+
+ /*
+ * A classloader for loading corrupted .ser file.
+ */
+ private class CorruptedSerClassLoader extends ClassLoader {
+ @Override
+ protected URL findResource(String name) {
+ return getResource("org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.ser");
+ }
+ }
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PropertyEditorManagerTest.java Thu Aug 2 14:27:53 2007
@@ -21,7 +21,9 @@
import java.awt.Component;
import java.awt.Font;
import java.awt.Graphics;
+import java.awt.Panel;
import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyEditor;
import java.beans.PropertyEditorManager;
@@ -735,10 +737,39 @@
assertNull(e2.getTags());
assertSame(font, e2.getValue());
assertTrue(e2.isPaintable());
- Component c = (Component) e2.getCustomEditor();
+ Component c = e2.getCustomEditor();
assertSame(c, e2);
+ e2.addPropertyChangeListener(new ExceptionPropertyChangeListener());
+
+ try {
+ e2.setValue(null);
+ fail("Should throw an error");
+ } catch (MockError e) {
+ // expected
+ assertNull(e2.getValue());
+ }
+
+ try {
+ e2.setValue(new Font("Arial", Font.BOLD, 10));
+ fail("Should throw an error");
+ } catch (MockError e) {
+ // expected
+ }
}
+ @SuppressWarnings("serial")
+ public static class MockError extends Error {
+ public MockError(String msg) {
+ super(msg);
+ }
+ }
+ public static class ExceptionPropertyChangeListener implements PropertyChangeListener {
+
+ public void propertyChange(PropertyChangeEvent event) {
+ throw new MockError("property changed");
+ }
+
+ }
public void testColorEditor() throws Exception{
PropertyEditor e2 = PropertyEditorManager.findEditor(Color.class);
e2.setValue(Color.RED);
@@ -747,6 +778,47 @@
assertNotSame(Color.RED, e2.getValue());
assertEquals(Color.RED, e2.getValue());
assertTrue(e2.isPaintable());
+ assertTrue(e2 instanceof Panel);
+ assertTrue(e2 instanceof PropertyEditor);
+ assertTrue(e2.supportsCustomEditor());
+ assertSame(e2, e2.getCustomEditor());
+ assertEquals("new java.awt.Color(255,0,0)", e2
+ .getJavaInitializationString());
+ assertNull(e2.getTags());
+
+ ExceptionPropertyChangeListener listener = new ExceptionPropertyChangeListener();
+ e2.addPropertyChangeListener(listener);
+
+ e2.setValue(null);
+ assertEquals(Color.RED.getRed(), ((Color) e2.getValue()).getRed());
+
+ try {
+ e2.setValue(Color.yellow);
+ fail("Should throw an error");
+ } catch (MockError e) {
+ // expected
+ }
+
+ assertEquals("255,255,0", e2.getAsText());
+
+ try {
+ e2.setAsText(null);
+ fail("Should throw NPE");
+ } catch (NullPointerException e) {
+ // expected
+ }
+
+ try {
+ e2.setAsText("text");
+ fail("Should throw IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+
+ e2.removePropertyChangeListener(listener);
+ e2.setAsText("255,255,255");
+ assertEquals("java.awt.Color[r=255,g=255,b=255]", ((Color) e2
+ .getValue()).toString());
}
public void testGetSetEditorPath() throws Exception{
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,72 @@
+/*
+ * 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 org.apache.harmony.beans.tests.java.beans.beancontext;
+
+import java.beans.beancontext.BeanContextServiceProvider;
+import java.beans.beancontext.BeanContextServices;
+import java.beans.beancontext.BeanContextServicesSupport;
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+/*
+ * Regression test for HARMONY-1369
+ */
+public class BeanContextServicesSupport2Test extends TestCase {
+
+ public void test() {
+ BeanContextServiceProvider bcsp = new BCSP();
+ BCSS serviceSupport = new BCSS(new BeanContextServicesSupport());
+ assertTrue("Expected first addService to return true", serviceSupport
+ .addService(Boolean.TYPE, bcsp, false));
+ assertFalse("Expected second addService to return false", serviceSupport
+ .addService(Boolean.TYPE, bcsp, false));
+ }
+
+ class BCSP implements BeanContextServiceProvider {
+ public Iterator getCurrentServiceSelectors(BeanContextServices p0,
+ Class p1) {
+ return null;
+ }
+
+ public void releaseService(BeanContextServices p0, Object p1, Object p2) {
+ return;
+ }
+
+ public Object getService(BeanContextServices p0, Object p1, Class p2,
+ Object p3) {
+ return null;
+ }
+ }
+
+ class BCSS extends BeanContextServicesSupport {
+ public BCSS() {
+ super();
+ }
+
+ public BCSS(BeanContextServicesSupport peer) {
+ super(peer);
+ }
+
+ public boolean addService(Class serviceClass,
+ BeanContextServiceProvider bcsp, boolean firevent) {
+ return super.addService(serviceClass, bcsp, firevent);
+ }
+ }
+
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupport2Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextServicesSupportTest.java Thu Aug 2 14:27:53 2007
@@ -1037,6 +1037,17 @@
provider.records.assertEndOfRecords();
assertNull(l.lastEvent);
}
+
+ /*
+ * regression test for HARMONY-4272
+ */
+ public void testReleaseService_WithNullServiceRecords()
+ throws TooManyListenersException {
+ MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
+ MockBeanContextChild child = new MockBeanContextChild();
+ support.add(child);
+ support.releaseService(child, child, new Object());
+ }
public void testReleaseService() throws TooManyListenersException,
PropertyVetoException {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java Thu Aug 2 14:27:53 2007
@@ -1,85 +1,85 @@
-/*
- * 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 org.apache.harmony.beans.tests.java.beans.beancontext;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.beancontext.BeanContextSupport;
-import java.beans.beancontext.BeanContextMembershipListener;
-import java.beans.beancontext.BeanContextMembershipEvent;
-import java.beans.beancontext.BeanContextChildSupport;
-import java.util.Locale;
-
-import junit.framework.TestCase;
-
-public class BeanContextSupport2Test extends TestCase {
-
- //Regression for HARMONY-3774.
- public void test_setLocale_null() throws Exception
- {
- Locale locale = Locale.FRANCE;
- BeanContextSupport beanContextSupport = new BeanContextSupport(null, locale);
- assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
- MyPropertyChangeListener myPropertyChangeListener = new MyPropertyChangeListener();
- beanContextSupport.addPropertyChangeListener("locale", myPropertyChangeListener);
- beanContextSupport.setLocale(null);
- assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
- assertFalse(myPropertyChangeListener.changed);
- }
-
- /**
- * Regression test for HARMONY-4011
- */
- public void test4011() {
- BeanContextSupport context = new BeanContextSupport();
- final int[] k = { 0 };
- BeanContextMembershipListener listener =
- new BeanContextMembershipListener() {
-
- public void childrenAdded(BeanContextMembershipEvent bcme) {
- k[0]++;
- }
-
- public void childrenRemoved(BeanContextMembershipEvent bcme) {}
- };
-
- // add listener
- context.addBeanContextMembershipListener(listener);
- context.add(new BeanContextChildSupport());
- assertEquals(1, k[0]);
-
- // add the same listener onse again
- context.addBeanContextMembershipListener(listener);
- context.add(new BeanContextChildSupport());
- assertEquals(2, k[0]);
- }
-
- private class MyPropertyChangeListener implements PropertyChangeListener {
- public boolean changed = false;
-
- public void propertyChange(PropertyChangeEvent event) {
- changed = true;
- }
-
- public void reset() {
- changed = false;
- }
-
- }
-
-}
+/*
+ * 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 org.apache.harmony.beans.tests.java.beans.beancontext;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.beancontext.BeanContextSupport;
+import java.beans.beancontext.BeanContextMembershipListener;
+import java.beans.beancontext.BeanContextMembershipEvent;
+import java.beans.beancontext.BeanContextChildSupport;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+public class BeanContextSupport2Test extends TestCase {
+
+ //Regression for HARMONY-3774.
+ public void test_setLocale_null() throws Exception
+ {
+ Locale locale = Locale.FRANCE;
+ BeanContextSupport beanContextSupport = new BeanContextSupport(null, locale);
+ assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
+ MyPropertyChangeListener myPropertyChangeListener = new MyPropertyChangeListener();
+ beanContextSupport.addPropertyChangeListener("locale", myPropertyChangeListener);
+ beanContextSupport.setLocale(null);
+ assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
+ assertFalse(myPropertyChangeListener.changed);
+ }
+
+ /**
+ * Regression test for HARMONY-4011
+ */
+ public void test4011() {
+ BeanContextSupport context = new BeanContextSupport();
+ final int[] k = { 0 };
+ BeanContextMembershipListener listener =
+ new BeanContextMembershipListener() {
+
+ public void childrenAdded(BeanContextMembershipEvent bcme) {
+ k[0]++;
+ }
+
+ public void childrenRemoved(BeanContextMembershipEvent bcme) {}
+ };
+
+ // add listener
+ context.addBeanContextMembershipListener(listener);
+ context.add(new BeanContextChildSupport());
+ assertEquals(1, k[0]);
+
+ // add the same listener onse again
+ context.addBeanContextMembershipListener(listener);
+ context.add(new BeanContextChildSupport());
+ assertEquals(2, k[0]);
+ }
+
+ private class MyPropertyChangeListener implements PropertyChangeListener {
+ public boolean changed = false;
+
+ public void propertyChange(PropertyChangeEvent event) {
+ changed = true;
+ }
+
+ public void reset() {
+ changed = false;
+ }
+
+ }
+
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,22 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
+
+public class CorruptedSerBean {
+
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.ser?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.ser (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/CorruptedSerBean.ser Thu Aug 2 14:27:53 2007
@@ -0,0 +1 @@
+bad data.
\ No newline at end of file
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/EmptySerBean.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/EmptySerBean.ser?view=auto&rev=562262
==============================================================================
(empty)
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClass.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClass.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClass.java Thu Aug 2 14:27:53 2007
@@ -1,3 +1,20 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
public class MockNullSubClass extends MockNullSuperClass{
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClassBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClassBeanInfo.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClassBeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSubClassBeanInfo.java Thu Aug 2 14:27:53 2007
@@ -1,3 +1,20 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
import java.beans.EventSetDescriptor;
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClass.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClass.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClass.java Thu Aug 2 14:27:53 2007
@@ -1,3 +1,20 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
public class MockNullSuperClass {
Modified: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClassBeanInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClassBeanInfo.java?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClassBeanInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockNullSuperClassBeanInfo.java Thu Aug 2 14:27:53 2007
@@ -1,3 +1,20 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
import java.beans.EventSetDescriptor;
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/NotExistBean.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/NotExistBean.ser?view=auto&rev=562262
==============================================================================
Binary file - no diff available.
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/NotExistBean.ser
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,58 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
+
+import java.io.Serializable;
+
+/**
+ * A bean class which .ser file is wrong.
+ * Used for BeansTest.test_instantiate_withWrongSer()
+ */
+public class WrongSerBean implements Serializable{
+ private int intField;
+ private char charField;
+ private String str;
+
+ public WrongSerBean(){
+ super();
+ }
+
+ public WrongSerBean(int intField, char charField){
+ this.intField = intField;
+ this.charField = charField;
+ this.str = "test";
+ }
+
+ public char getCharField() {
+ return charField;
+ }
+
+ public void setCharField(char charField) {
+ this.charField = charField;
+ }
+
+ public int getIntField() {
+ return intField;
+ }
+
+ public void setIntField(int intField) {
+ this.intField = intField;
+ }
+
+
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.ser?view=auto&rev=562262
==============================================================================
Binary file - no diff available.
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean.ser
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean2.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean2.java?view=auto&rev=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean2.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean2.java Thu Aug 2 14:27:53 2007
@@ -0,0 +1,22 @@
+/*
+ * 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 org.apache.harmony.beans.tests.support.mock;
+
+public class WrongSerBean2 {
+
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/WrongSerBean2.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/build.xml Thu Aug 2 14:27:53 2007
@@ -68,8 +68,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.concurrent.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.concurrent.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/build.xml Thu Aug 2 14:27:53 2007
@@ -62,8 +62,8 @@
<delete file="${hy.jdk}/jre/lib/boot/${hy.crypto.packaging.jarname}-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.crypto.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/imageio/build.xml Thu Aug 2 14:27:53 2007
@@ -65,8 +65,8 @@
<delete file="${hy.jdk}/jre/lib/boot/imageio-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.imageio.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="clean-native">
Modified: harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/instrument/build.xml Thu Aug 2 14:27:53 2007
@@ -98,8 +98,8 @@
<delete file="${hy.jdk}/jre/lib/boot/instrument-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.instrument.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml?view=diff&rev=562262&r1=562261&r2=562262
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/build.xml Thu Aug 2 14:27:53 2007
@@ -60,8 +60,8 @@
<delete file="${hy.jdk}/jre/lib/boot/jndi-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
- <fileset dir="${hy.jndi.bin.test}" />
</delete>
+ <delete failonerror="false" dir="bin"/>
</target>
<target name="compile-java">