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 2006/09/28 18:04:13 UTC
svn commit: r450911 [1/3] - in
/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java:
java/beans/beancontext/ org/apache/harmony/beans/
org/apache/harmony/beans/editors/
Author: tellison
Date: Thu Sep 28 09:04:10 2006
New Revision: 450911
URL: http://svn.apache.org/viewvc?view=rev&rev=450911
Log:
Code tidy-up in BEANS, including fixing compiler warnings,
adding override markers, code formatting, 5.0 syntax uplifts,
comment fixes, etc. No change in functionality.
Modified:
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChild.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildComponentProxy.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextContainerProxy.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextEvent.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipListener.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextProxy.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProvider.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedListener.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServices.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesListener.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/Argument.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ArrayPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/Command.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/DefaultPersistenceDelegatesFactory.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/Handler.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/NullPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/BooleanEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/ByteEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/ColorEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/DoubleEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/FloatEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/FontEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/IntEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/LongEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/ShortEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/editors/StringEditor.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_BooleanPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_BytePersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_CharacterPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_ClassPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_DoublePersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_FloatPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_IntegerPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_LongPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_ShortPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_StringPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_reflect_FieldPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_reflect_MethodPersistenceDelegate.java
incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/java_lang_reflect_ProxyPersistenceDelegate.java
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChild.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChild.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChild.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChild.java Thu Sep 28 09:04:10 2006
@@ -14,54 +14,27 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextChild {
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void addPropertyChangeListener(String name,
- PropertyChangeListener pcl);
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void addVetoableChangeListener(String name,
- VetoableChangeListener vcl);
-
- /**
- * @com.intel.drl.spec_ref
- */
+
+ public void addPropertyChangeListener(String name,
+ PropertyChangeListener pcl);
+
+ public void addVetoableChangeListener(String name,
+ VetoableChangeListener vcl);
+
public BeanContext getBeanContext();
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void removePropertyChangeListener(String name,
- PropertyChangeListener pcl);
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void removeVetoableChangeListener(String name,
- VetoableChangeListener vcl);
-
- /**
- * @com.intel.drl.spec_ref
- */
+
+ public void removePropertyChangeListener(String name,
+ PropertyChangeListener pcl);
+
+ public void removeVetoableChangeListener(String name,
+ VetoableChangeListener vcl);
+
public void setBeanContext(BeanContext bc) throws PropertyVetoException;
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildComponentProxy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildComponentProxy.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildComponentProxy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildComponentProxy.java Thu Sep 28 09:04:10 2006
@@ -14,23 +14,11 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.awt.Component;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextChildComponentProxy {
- /**
- * @com.intel.drl.spec_ref
- */
public Component getComponent();
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextChildSupport.java Thu Sep 28 09:04:10 2006
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.7.4.3 $
- */
package java.beans.beancontext;
import java.beans.PropertyChangeEvent;
@@ -26,7 +22,6 @@
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
-
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -34,173 +29,105 @@
import org.apache.harmony.beans.internal.nls.Messages;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.7.4.3 $
- */
-
-public class BeanContextChildSupport
- implements BeanContextChild, BeanContextServicesListener, Serializable {
+public class BeanContextChildSupport implements BeanContextChild,
+ BeanContextServicesListener, Serializable {
private static final long serialVersionUID = 6328947014421475877L;
+
static final String BEAN_CONTEXT = "beanContext"; //$NON-NLS-1$
-
- /**
- *
- */
+
protected transient BeanContext beanContext;
- /**
- * @serial
- */
public BeanContextChild beanContextChildPeer;
- /**
- * @serial
- */
protected PropertyChangeSupport pcSupport;
-
- /**
- *
- */
+
protected transient boolean rejectedSetBCOnce;
- /**
- * @serial
- */
protected VetoableChangeSupport vcSupport;
-
- /**
- *
- */
+
public BeanContextChildSupport() {
-
// This class implements the JavaBean component itself
this(null);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextChildSupport(BeanContextChild bcc) {
-
- // If 'bcc' parameter is not null the JavaBean component itself
+ // If 'bcc' parameter is not null the JavaBean component itself
// implements BeanContextChild
this.beanContextChildPeer = (bcc == null ? this : bcc);
-
+
// Initialize necessary fileds for later use
pcSupport = new PropertyChangeSupport(this.beanContextChildPeer);
vcSupport = new VetoableChangeSupport(this.beanContextChildPeer);
this.rejectedSetBCOnce = false;
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void addPropertyChangeListener(String name,
+
+ public void addPropertyChangeListener(String name,
PropertyChangeListener pcl) {
-
// Do nothing if name or listener is null
if ((name == null) || (pcl == null)) {
return;
}
-
+
this.pcSupport.addPropertyChangeListener(name, pcl);
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void addVetoableChangeListener(String name,
+
+ public void addVetoableChangeListener(String name,
VetoableChangeListener vcl) {
-
// Do nothing if name or listener is null
if ((name == null) || (vcl == null)) {
return;
}
-
+
this.vcSupport.addVetoableChangeListener(name, vcl);
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void firePropertyChange(String name, Object oldValue,
- Object newValue) {
-
+
+ public void firePropertyChange(String name, Object oldValue, Object newValue) {
this.pcSupport.firePropertyChange(name, oldValue, newValue);
}
- /**
- * @com.intel.drl.spec_ref
- */
- public void fireVetoableChange(String name, Object oldValue,
- Object newValue) throws PropertyVetoException {
-
+ public void fireVetoableChange(String name, Object oldValue, Object newValue)
+ throws PropertyVetoException {
+
this.vcSupport.fireVetoableChange(name, oldValue, newValue);
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public synchronized BeanContext getBeanContext() {
return this.beanContext;
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public BeanContextChild getBeanContextChildPeer() {
return this.beanContextChildPeer;
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- protected void initializeBeanContextResources() {}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
+ protected void initializeBeanContextResources() {
+ }
+
public boolean isDelegated() {
return (!this.beanContextChildPeer.equals(this));
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- private void readObject(ObjectInputStream ois)
- throws IOException, ClassNotFoundException {
-
+
+ private void readObject(ObjectInputStream ois) throws IOException,
+ ClassNotFoundException {
+
ois.defaultReadObject();
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- protected void releaseBeanContextResources() {}
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void removePropertyChangeListener(String name,
+
+ protected void releaseBeanContextResources() {
+ }
+
+ public void removePropertyChangeListener(String name,
PropertyChangeListener pcl) {
-
+
this.pcSupport.removePropertyChangeListener(name, pcl);
}
- /**
- * @com.intel.drl.spec_ref
- */
- public void removeVetoableChangeListener(String name,
+ public void removeVetoableChangeListener(String name,
VetoableChangeListener vcl) {
-
+
this.vcSupport.removeVetoableChangeListener(name, vcl);
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public void serviceAvailable(BeanContextServiceAvailableEvent bcsae) {
if (isDelegated()) {
((BeanContextServicesListener) beanContextChildPeer)
@@ -208,73 +135,56 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) {
if (isDelegated()) {
((BeanContextServicesListener) beanContextChildPeer)
.serviceRevoked(bcsre);
}
}
-
- /**
- * @com.intel.drl.spec_ref
- */
- public synchronized void setBeanContext(BeanContext bc)
+
+ public synchronized void setBeanContext(BeanContext bc)
throws PropertyVetoException {
-
+
// Do nothing if the old and new values are uqual
if ((this.beanContext == null) && (bc == null)) {
return;
}
-
+
if ((this.beanContext != null) && this.beanContext.equals(bc)) {
return;
}
-
+
releaseBeanContextResources();
-
+
// Children are not allowed to repeatedly veto this operation.
// So, we set rejectedSetBCOnce flag to true if veto occurs
// and never veto the change again
if (!this.rejectedSetBCOnce) {
-
+
// Validate the new BeanContext value and throw
// PropertyVetoException if it was not successful
if (!validatePendingSetBeanContext(bc)) {
- this.rejectedSetBCOnce = true;
+ this.rejectedSetBCOnce = true;
fireVetoableChange(BEAN_CONTEXT, this.beanContext, bc);
-
- throw new PropertyVetoException(
- Messages.getString("beans.0F"), //$NON-NLS-1$
- new PropertyChangeEvent(this.beanContextChildPeer,
- BEAN_CONTEXT,
- this.beanContext,
- bc));
- }
- else {
- this.rejectedSetBCOnce = false;
+
+ throw new PropertyVetoException(Messages.getString("beans.0F"), //$NON-NLS-1$
+ new PropertyChangeEvent(this.beanContextChildPeer,
+ BEAN_CONTEXT, this.beanContext, bc));
}
-
+ this.rejectedSetBCOnce = false;
+
// We have to notify all listeners about "beanContext"
// property change
- firePropertyChange(BEAN_CONTEXT, this.beanContext, bc);
+ firePropertyChange(BEAN_CONTEXT, this.beanContext, bc);
this.beanContext = bc;
initializeBeanContextResources();
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean validatePendingSetBeanContext(BeanContext newValue) {
return true;
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
private void writeObject(ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextContainerProxy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextContainerProxy.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextContainerProxy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextContainerProxy.java Thu Sep 28 09:04:10 2006
@@ -14,23 +14,11 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.awt.Container;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextContainerProxy {
- /**
- * @com.intel.drl.spec_ref
- */
public Container getContainer();
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextEvent.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextEvent.java Thu Sep 28 09:04:10 2006
@@ -14,57 +14,33 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.4.4.3 $
- */
package java.beans.beancontext;
import java.util.EventObject;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.4.4.3 $
- */
-
public abstract class BeanContextEvent extends EventObject {
/**
* @serial
*/
protected BeanContext propagatedFrom;
-
- /**
- * @com.intel.drl.spec_ref
- */
- protected BeanContextEvent(BeanContext bc) {
+
+ protected BeanContextEvent(BeanContext bc) {
super(bc);
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public BeanContext getBeanContext() {
return (BeanContext) super.getSource();
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public synchronized BeanContext getPropagatedFrom() {
return this.propagatedFrom;
}
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public synchronized boolean isPropagated() {
return (this.propagatedFrom != null);
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized void setPropagatedFrom(BeanContext bc) {
this.propagatedFrom = bc;
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipEvent.java Thu Sep 28 09:04:10 2006
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.4.4.3 $
- */
package java.beans.beancontext;
import java.util.Collection;
@@ -26,23 +22,12 @@
import org.apache.harmony.beans.internal.nls.Messages;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.4.4.3 $
- */
-
public class BeanContextMembershipEvent extends BeanContextEvent {
static final long serialVersionUID = 3499346510334590959L;
- /**
- *
- */
protected Collection children;
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
super(bc);
@@ -53,9 +38,6 @@
this.children = changes;
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextMembershipEvent(BeanContext bc, Object[] changes) {
super(bc);
@@ -66,36 +48,23 @@
// Initialize collection
this.children = new Vector<Object>();
- // Add all elements to it
- for (int i = 0; i < changes.length; i++) {
- this.children.add(changes[i]);
+ for (Object element : changes) {
+ this.children.add(element);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean contains(Object child) {
return this.children.contains(child);
}
- /**
- * @com.intel.drl.spec_ref
- */
public Iterator iterator() {
return this.children.iterator();
}
- /**
- * @com.intel.drl.spec_ref
- */
public int size() {
return this.children.size();
}
- /**
- * @com.intel.drl.spec_ref
- */
public Object[] toArray() {
return this.children.toArray();
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipListener.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipListener.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextMembershipListener.java Thu Sep 28 09:04:10 2006
@@ -14,28 +14,13 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.util.EventListener;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextMembershipListener extends EventListener {
- /**
- * @com.intel.drl.spec_ref
- */
public void childrenAdded(BeanContextMembershipEvent bcme);
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public void childrenRemoved(BeanContextMembershipEvent bcme);
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextProxy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextProxy.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextProxy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextProxy.java Thu Sep 28 09:04:10 2006
@@ -14,21 +14,9 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextProxy {
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextChild getBeanContextProxy();
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceAvailableEvent.java Thu Sep 28 09:04:10 2006
@@ -14,19 +14,10 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.util.Iterator;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public class BeanContextServiceAvailableEvent extends BeanContextEvent {
static final long serialVersionUID = -5333985775656400778L;
@@ -36,32 +27,20 @@
*/
protected Class serviceClass;
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServiceAvailableEvent(BeanContextServices bcs, Class sc) {
super(bcs);
this.serviceClass = sc;
}
- /**
- * @com.intel.drl.spec_ref
- */
public Iterator getCurrentServiceSelectors() {
return ((BeanContextServices) super.source)
.getCurrentServiceSelectors(serviceClass);
}
- /**
- * @com.intel.drl.spec_ref
- */
public Class getServiceClass() {
return this.serviceClass;
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServices getSourceAsBeanContextServices() {
return (BeanContextServices) super.source;
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProvider.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProvider.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProvider.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProvider.java Thu Sep 28 09:04:10 2006
@@ -14,36 +14,18 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.util.Iterator;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextServiceProvider {
-
- /**
- * @com.intel.drl.spec_ref
- */
- public Iterator getCurrentServiceSelectors(BeanContextServices bcs,
- Class serviceClass);
- /**
- * @com.intel.drl.spec_ref
- */
- public Object getService(BeanContextServices bcs, Object requestor,
- Class serviceClass, Object serviceSelector);
+ public Iterator getCurrentServiceSelectors(BeanContextServices bcs,
+ Class serviceClass);
+
+ public Object getService(BeanContextServices bcs, Object requestor,
+ Class serviceClass, Object serviceSelector);
- /**
- * @com.intel.drl.spec_ref
- */
- public void releaseService(BeanContextServices bcs, Object requestor,
- Object service);
+ public void releaseService(BeanContextServices bcs, Object requestor,
+ Object service);
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceProviderBeanInfo.java Thu Sep 28 09:04:10 2006
@@ -14,23 +14,11 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.beans.BeanInfo;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextServiceProviderBeanInfo extends BeanInfo {
- /**
- * @com.intel.drl.spec_ref
- */
public BeanInfo[] getServicesBeanInfo();
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedEvent.java Thu Sep 28 09:04:10 2006
@@ -14,17 +14,8 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.3.4.3 $
- */
package java.beans.beancontext;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.3.4.3 $
- */
-
public class BeanContextServiceRevokedEvent extends BeanContextEvent {
static final long serialVersionUID = -1295543154724961754L;
@@ -39,9 +30,6 @@
*/
private boolean invalidateRefs;
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServiceRevokedEvent(BeanContextServices bcs, Class sc,
boolean invalidate) {
@@ -50,32 +38,20 @@
this.invalidateRefs = invalidate;
}
- /**
- * @com.intel.drl.spec_ref
- */
public Class getServiceClass() {
return this.serviceClass;
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServices getSourceAsBeanContextServices() {
return (BeanContextServices) super.propagatedFrom;
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean isCurrentServiceInvalidNow() {
return this.invalidateRefs;
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean isServiceClass(Class service) {
- if (service == null) {
+ if (service == null) {
return false;
}
return service.equals(this.serviceClass);
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedListener.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedListener.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServiceRevokedListener.java Thu Sep 28 09:04:10 2006
@@ -14,23 +14,11 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.util.EventListener;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
public interface BeanContextServiceRevokedListener extends EventListener {
- /**
- * @com.intel.drl.spec_ref
- */
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre);
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServices.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServices.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServices.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServices.java Thu Sep 28 09:04:10 2006
@@ -14,74 +14,37 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
import java.util.Iterator;
import java.util.TooManyListenersException;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
-
-public interface BeanContextServices
- extends BeanContext, BeanContextServicesListener {
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void addBeanContextServicesListener(
- BeanContextServicesListener bcsl);
-
- /**
- * @com.intel.drl.spec_ref
- */
- public boolean addService(Class serviceClass,
- BeanContextServiceProvider serviceProvider);
-
- /**
- * @com.intel.drl.spec_ref
- */
+public interface BeanContextServices extends BeanContext,
+ BeanContextServicesListener {
+
+ public void addBeanContextServicesListener(BeanContextServicesListener bcsl);
+
+ public boolean addService(Class serviceClass,
+ BeanContextServiceProvider serviceProvider);
+
public Iterator getCurrentServiceClasses();
-
- /**
- * @com.intel.drl.spec_ref
- */
+
public Iterator getCurrentServiceSelectors(Class serviceClass);
- /**
- * @com.intel.drl.spec_ref
- */
- public Object getService(BeanContextChild child, Object requestor,
- Class serviceClass, Object serviceSelector,
- BeanContextServiceRevokedListener bcsrl)
+ public Object getService(BeanContextChild child, Object requestor,
+ Class serviceClass, Object serviceSelector,
+ BeanContextServiceRevokedListener bcsrl)
throws TooManyListenersException;
- /**
- * @com.intel.drl.spec_ref
- */
public boolean hasService(Class serviceClass);
-
- /**
- * @com.intel.drl.spec_ref
- */
- public void releaseService(BeanContextChild child, Object requestor,
- Object service);
-
- /**
- * @com.intel.drl.spec_ref
- */
+
+ public void releaseService(BeanContextChild child, Object requestor,
+ Object service);
+
public void removeBeanContextServicesListener(
BeanContextServicesListener bcsl);
- /**
- * @com.intel.drl.spec_ref
- */
- public void revokeService(Class serviceClass,
- BeanContextServiceProvider serviceProvider,
- boolean revokeCurrentServicesNow);
+ public void revokeService(Class serviceClass,
+ BeanContextServiceProvider serviceProvider,
+ boolean revokeCurrentServicesNow);
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesListener.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesListener.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesListener.java Thu Sep 28 09:04:10 2006
@@ -14,22 +14,10 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
package java.beans.beancontext;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.2.4.3 $
- */
+public interface BeanContextServicesListener extends
+ BeanContextServiceRevokedListener {
-public interface BeanContextServicesListener
- extends BeanContextServiceRevokedListener {
-
- /**
- * @com.intel.drl.spec_ref
- */
public void serviceAvailable(BeanContextServiceAvailableEvent bcsae);
}
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextServicesSupport.java Thu Sep 28 09:04:10 2006
@@ -14,17 +14,12 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.12.4.3 $
- */
package java.beans.beancontext;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -33,11 +28,6 @@
import org.apache.harmony.beans.internal.nls.Messages;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.12.4.3 $
- */
-
public class BeanContextServicesSupport extends BeanContextSupport implements
BeanContextServices {
@@ -50,9 +40,6 @@
private static final long serialVersionUID = -3263851306889194873L;
- /**
- *
- */
BCSSChild(Object child, Object peer) {
super(child, peer);
}
@@ -71,25 +58,20 @@
/**
* Initialize the peer
- *
- * @param child - The peer to initialize with
+ *
+ * @param child -
+ * The peer to initialize with
*/
BCSSProxyServiceProvider(BeanContextChild child) {
this.child = child;
}
- /**
- *
- */
public Iterator getCurrentServiceSelectors(BeanContextServices bcs,
Class serviceClass) {
return bcs.getCurrentServiceSelectors(serviceClass);
}
- /**
- *
- */
public Object getService(BeanContextServices bcs, Object requestor,
Class serviceClass, Object serviceSelector) {
@@ -102,18 +84,12 @@
}
}
- /**
- *
- */
public void releaseService(BeanContextServices bcs, Object requestor,
Object service) {
bcs.releaseService(this.child, requestor, service);
}
- /**
- *
- */
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) {
if (this.child instanceof BeanContextServices) {
@@ -142,18 +118,17 @@
/**
* Constructor for setting BeanContextServiceProvider in this class
- *
- * @param sc - service class
- * @param serviceProvider - service provider
+ *
+ * @param sc -
+ * service class
+ * @param serviceProvider -
+ * service provider
*/
BCSSServiceProvider(Class sc, BeanContextServiceProvider serviceProvider) {
this.sc = sc;
this.serviceProvider = serviceProvider;
}
- /**
- *
- */
protected BeanContextServiceProvider getServiceProvider() {
return this.serviceProvider;
}
@@ -163,68 +138,38 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected transient ArrayList<BeanContextServicesListener> bcsListeners;
- /**
- * @com.intel.drl.spec_ref
- */
protected transient BCSSProxyServiceProvider proxy;
- /**
- * @com.intel.drl.spec_ref
- */
protected transient int serializable;
- /**
- * @com.intel.drl.spec_ref
- */
protected transient HashMap<Class, BCSSServiceProvider> services;
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServicesSupport() {
super();
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServicesSupport(BeanContextServices peer) {
super(peer);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle) {
super(peer, lcle);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle,
boolean dtime) {
super(peer, lcle, dtime);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle,
boolean dtime, boolean visible) {
super(peer, lcle, dtime, visible);
}
- /**
- * @com.intel.drl.spec_ref
- */
public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
if (bcsl == null) {
@@ -236,18 +181,12 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean addService(Class serviceClass,
BeanContextServiceProvider bcsp) {
return addService(serviceClass, bcsp, true);
}
- /**
- * @com.intel.drl.spec_ref
- */
protected boolean addService(Class serviceClass,
BeanContextServiceProvider bcsp, boolean fireEvent) {
@@ -287,9 +226,7 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
protected synchronized void bcsPreDeserializationHook(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
@@ -302,16 +239,12 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
protected synchronized void bcsPreSerializationHook(ObjectOutputStream oos)
throws IOException {
synchronized (this.services) {
- for (Iterator it = this.services.keySet().iterator(); it.hasNext();) {
- Object key = it.next();
-
+ for (Object key : this.services.keySet()) {
if (BeanContextSupport.getChildSerializable(key) != null) {
oos.writeObject(this.services.get(key));
}
@@ -319,70 +252,45 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
protected void childJustRemovedHook(Object child,
BeanContextSupport.BCSChild bcsc) {
return;
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
protected BeanContextSupport.BCSChild createBCSChild(Object targetChild,
Object peer) {
return new BCSSChild(targetChild, peer);
}
- /**
- * @com.intel.drl.spec_ref
- */
protected BCSSServiceProvider createBCSSServiceProvider(Class sc,
BeanContextServiceProvider bcsp) {
return new BCSSServiceProvider(sc, bcsp);
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void fireServiceAdded(
BeanContextServiceAvailableEvent bcssae) {
- for (Iterator<BeanContextServicesListener> it = this.bcsListeners
- .iterator(); it.hasNext();) {
- BeanContextServicesListener l = it.next();
-
+ for (BeanContextServicesListener l : this.bcsListeners) {
l.serviceAvailable(bcssae);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void fireServiceAdded(Class serviceClass) {
fireServiceAdded(getEvent(serviceClass));
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre) {
- for (Iterator<BeanContextServicesListener> it = this.bcsListeners
- .iterator(); it.hasNext();) {
- BeanContextServicesListener l = it.next();
-
+ for (BeanContextServicesListener l : this.bcsListeners) {
l.serviceRevoked(bcsre);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void fireServiceRevoked(Class serviceClass,
boolean revokeNow) {
@@ -390,31 +298,20 @@
getBeanContextServicesPeer(), serviceClass, revokeNow));
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextServices getBeanContextServicesPeer() {
return (BeanContextServices) getBeanContextPeer();
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final BeanContextServicesListener getChildBeanContextServicesListener(
Object child) {
if (child instanceof BeanContextServicesListener) {
return (BeanContextServicesListener) child;
- } else {
- return null;
}
+ return null;
}
- /**
- * @com.intel.drl.spec_ref
- */
public Iterator getCurrentServiceClasses() {
-
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.services) {
return this.services.keySet().iterator();
@@ -423,26 +320,25 @@
}
private class BCSIterator implements Iterator {
- private Iterator it;
- public BCSIterator(Iterator it) {
- this.it = it;
- }
-
- public boolean hasNext() {
- return it.hasNext();
- }
-
- public Object next() {
- return it.next();
- }
-
- public void remove() {
- //do nothing
- }
+ private Iterator it;
+
+ public BCSIterator(Iterator it) {
+ this.it = it;
+ }
+
+ public boolean hasNext() {
+ return it.hasNext();
+ }
+
+ public Object next() {
+ return it.next();
+ }
+
+ public void remove() {
+ // do nothing
+ }
}
- /**
- * @com.intel.drl.spec_ref
- */
+
public Iterator getCurrentServiceSelectors(Class serviceClass) {
if (serviceClass == null) {
@@ -456,23 +352,18 @@
return null;
}
- return new BCSIterator(bcsp.getServiceProvider().getCurrentServiceSelectors(
- getBeanContextServicesPeer(), serviceClass));
+ return new BCSIterator(bcsp.getServiceProvider()
+ .getCurrentServiceSelectors(
+ getBeanContextServicesPeer(), serviceClass));
}
}
}
- /**
- * @com.intel.drl.spec_ref
- */
private BeanContextServiceAvailableEvent getEvent(Class serviceClass) {
return new BeanContextServiceAvailableEvent(
getBeanContextServicesPeer(), serviceClass);
}
- /**
- * @com.intel.drl.spec_ref
- */
public Object getService(BeanContextChild child, Object requestor,
Class serviceClass, Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
@@ -521,9 +412,6 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized boolean hasService(Class serviceClass) {
if (serviceClass == null) {
throw new NullPointerException(Messages.getString("beans.19")); //$NON-NLS-1$
@@ -536,9 +424,7 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
public void initialize() {
super.initialize();
@@ -546,17 +432,12 @@
this.bcsListeners = new ArrayList<BeanContextServicesListener>();
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
protected synchronized void initializeBeanContextResources() {
super.initializeBeanContextResources();
this.proxy = new BCSSProxyServiceProvider(getBeanContextServicesPeer());
}
- /**
- * @com.intel.drl.spec_ref
- */
private void readObject(ObjectInputStream ois) throws IOException,
ClassNotFoundException {
@@ -579,17 +460,12 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
protected synchronized void releaseBeanContextResources() {
super.releaseBeanContextResources();
this.proxy = null;
}
- /**
- * @com.intel.drl.spec_ref
- */
public void releaseService(BeanContextChild child, Object requestor,
Object service) {
@@ -613,9 +489,6 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public void removeBeanContextServicesListener(
BeanContextServicesListener bcsl) {
@@ -628,9 +501,6 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public void revokeService(Class serviceClass,
BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
@@ -669,41 +539,28 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
public void serviceAvailable(BeanContextServiceAvailableEvent bcssae) {
if (bcssae == null) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
- for (Iterator<BeanContextServicesListener> it = this.bcsListeners
- .iterator(); it.hasNext();) {
- BeanContextServicesListener l = it.next();
-
+ for (BeanContextServicesListener l : this.bcsListeners) {
l.serviceAvailable(bcssae);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
+ @Override
public void serviceRevoked(BeanContextServiceRevokedEvent bcssre) {
if (bcssre == null) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
- for (Iterator<BeanContextServicesListener> it = this.bcsListeners
- .iterator(); it.hasNext();) {
- BeanContextServicesListener l = it.next();
-
+ for (BeanContextServicesListener l : this.bcsListeners) {
l.serviceRevoked(bcssre);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
private void writeObject(ObjectOutputStream oos) throws IOException {
synchronized (BeanContext.globalHierarchyLock) {
Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java?view=diff&rev=450911&r1=450910&r2=450911
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/beancontext/BeanContextSupport.java Thu Sep 28 09:04:10 2006
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.17.2.3 $
- */
package java.beans.beancontext;
import java.beans.Beans;
@@ -26,15 +22,12 @@
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;
import java.beans.Visibility;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-
import java.net.URL;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -43,11 +36,6 @@
import org.apache.harmony.beans.internal.nls.Messages;
-/**
- * @author Sergei A. Krivenko
- * @version $Revision: 1.17.2.3 $
- */
-
public class BeanContextSupport extends BeanContextChildSupport implements
BeanContext, Serializable, PropertyChangeListener,
VetoableChangeListener {
@@ -70,11 +58,13 @@
private Object proxyPeer;
/**
- * Construct an object not initially locked for editing
- * with child and its peer
- *
- * @param child - a child
- * @param proxyPeer - a peer for this child
+ * Construct an object not initially locked for editing with child and
+ * its peer
+ *
+ * @param child -
+ * a child
+ * @param proxyPeer -
+ * a peer for this child
*/
BCSChild(Object child, Object proxyPeer) {
this.child = child;
@@ -83,7 +73,7 @@
/**
* Return a child
- *
+ *
* @return a child this object was created with
*/
Object getChild() {
@@ -97,54 +87,37 @@
protected static final class BCSIterator implements Iterator {
/**
- *
+ *
*/
private Iterator it;
/**
* Construct an iterator
- *
- * @param set - a set to create iterator from
+ *
+ * @param set -
+ * a set to create iterator from
*/
BCSIterator(HashMap map) {
this.it = map.values().iterator();
}
- /**
- *
- */
public boolean hasNext() {
return it.hasNext();
}
- /**
- *
- */
public Object next() {
return it.next();
}
- /**
- *
- */
public void remove() {
it.remove();
}
}
- /**
- *
- */
private static final long serialVersionUID = -4879613978649577204L;
- /**
- *
- */
protected transient ArrayList<BeanContextMembershipListener> bcmListeners;
- /**
- *
- */
protected transient HashMap<Object, BCSChild> children;
/**
@@ -183,42 +156,27 @@
private transient VetoableChangeListener vcl;
/**
- * A flag to prevent the infinite roll backs
- * while adding and removing children
+ * A flag to prevent the infinite roll backs while adding and removing
+ * children
*/
- private boolean rollingBack = false;;
+ private boolean rollingBack = false;
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextSupport() {
this(null, null, false, true);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextSupport(BeanContext peer) {
this(peer, null, false, true);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextSupport(BeanContext peer, Locale lcle) {
this(peer, lcle, false, true);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime) {
this(peer, lcle, dtime, true);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime,
boolean visible) {
@@ -234,9 +192,6 @@
initialize();
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean add(Object targetChild) {
// We must synchronize on BeanContext.globalHierarchyLock
@@ -249,7 +204,7 @@
try {
- // If child is an instance of BeanContextChild or
+ // If child is an instance of BeanContextChild or
// BeanContextProxy,
// invoke setBeanContext() method on this child
// and register BeanContext with its child
@@ -264,11 +219,11 @@
} catch (PropertyVetoException e) {
// Throw IllegalStateException, if PropertyVetoException occurs
- throw new IllegalStateException(
- Messages.getString("beans.30", targetChild, e.getMessage())); //$NON-NLS-1$
+ throw new IllegalStateException(Messages.getString(
+ "beans.30", targetChild, e.getMessage())); //$NON-NLS-1$
}
- // If child implements Visibility,
+ // If child implements Visibility,
// set an appropriate type of ability to render GUI
Visibility vis = getChildVisibility(targetChild);
@@ -280,7 +235,7 @@
}
}
- // Check if this child implements Serializable and increase
+ // Check if this child implements Serializable and increase
// the number of serializable children of the BeanContext
if (getChildSerializable(targetChild) != null) {
this.serializable++;
@@ -293,9 +248,6 @@
return true;
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean addAll(Collection c) {
Collection<Object> col = new ArrayList<Object>();
@@ -310,7 +262,7 @@
}
} catch (Exception e) {
- // Roll back changes but first check if it's already rolling
+ // Roll back changes but first check if it's already rolling
// back to avoid infinitive action
if (!this.rollingBack) {
this.rollingBack = true;
@@ -326,9 +278,6 @@
return true;
}
- /**
- * @com.intel.drl.spec_ref
- */
public void addBeanContextMembershipListener(
BeanContextMembershipListener bcml) {
@@ -344,9 +293,10 @@
/**
* Check if we can add this child to BeanContext
- *
- * @param targetChild - a child to check
- *
+ *
+ * @param targetChild -
+ * a child to check
+ *
* @return true if we may continue
*/
private boolean addChecks(Object targetChild) {
@@ -366,13 +316,15 @@
/**
* Add child to the collection
- *
- * @param targetChild - the child to be added to the BeanContext
- * @param fire - true if BeanContextMembershipEvent should be fired
+ *
+ * @param targetChild -
+ * the child to be added to the BeanContext
+ * @param fire -
+ * true if BeanContextMembershipEvent should be fired
*/
private void addChild(Object targetChild) {
- // Add a new child using targetChild as a key and
+ // Add a new child using targetChild as a key and
// its BCSChild instance as an entry
synchronized (this.children) {
BCSChild ch = createBCSChild(targetChild, getBeanContextPeer());
@@ -384,9 +336,6 @@
fireChildrenAdded(getBCME(new Object[] { targetChild }));
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean avoidingGui() {
// Avoiding GUI means that
@@ -394,39 +343,27 @@
return (needsGui() && !this.okToUseGui);
}
- /**
- * @com.intel.drl.spec_ref
- */
protected Iterator bcsChildren() {
- // Return Iterator containing children
+ // Return Iterator containing children
// that are instances of BCSChild class
synchronized (this.children) {
return new BCSIterator(this.children);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected void bcsPreDeserializationHook(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
- // Leave it for subclasses to implement
+ // Leave it for subclasses to implement
}
- /**
- * @com.intel.drl.spec_ref
- */
protected void bcsPreSerializationHook(ObjectOutputStream oos)
throws IOException {
- // Leave it for subclasses to implement
+ // Leave it for subclasses to implement
}
- /**
- * @com.intel.drl.spec_ref
- */
protected void childDeserializedHook(Object child,
BeanContextSupport.BCSChild bcsc) {
@@ -435,71 +372,40 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected void childJustAddedHook(Object child,
BeanContextSupport.BCSChild bcsc) {
- // Leave it for subclasses to implement
+ // Leave it for subclasses to implement
}
- /**
- * @com.intel.drl.spec_ref
- */
protected void childJustRemovedHook(Object child,
BeanContextSupport.BCSChild bcsc) {
- // Leave it for subclasses to implement
+ // Leave it for subclasses to implement
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final boolean classEquals(Class first, Class second) {
-
// Either classes themselves or their names should be equal
return (first.equals(second) ? true : (first.getName().equals(
second.getName()) ? true : false));
}
- /**
- * @com.intel.drl.spec_ref
- */
public void clear() {
throw new UnsupportedOperationException();
-
/*
- synchronized(BeanContext.globalHierarchyLock) {
- Collection col = new ArrayList();
-
- // Remove all children from BeanContext that are in the collection
- // one by one. This operation is successful if all the
- // removals succeeded
- for (Iterator i = iterator(); i.hasNext(); ) {
- try {
- Object next = i.next();
-
- if (remove(next)) {
- col.add(next);
- }
- } catch(Exception e) {
-
- // Roll back changes
- this.rollingBack = true;
- addAll(col);
- return;
- }
- }
- }*/
+ * synchronized(BeanContext.globalHierarchyLock) { Collection col = new
+ * ArrayList(); // Remove all children from BeanContext that are in the
+ * collection // one by one. This operation is successful if all the //
+ * removals succeeded for (Iterator i = iterator(); i.hasNext(); ) { try {
+ * Object next = i.next();
+ *
+ * if (remove(next)) { col.add(next); } } catch(Exception e) { // Roll
+ * back changes this.rollingBack = true; addAll(col); return; } } }
+ */
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean contains(Object o) {
-
- // See if a given object can be found among
+ // See if a given object can be found among
// the children's collection values
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
@@ -508,12 +414,9 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean containsAll(Collection c) {
- // Iterate through the collection provided and find matches
+ // Iterate through the collection provided and find matches
// in the current BeanContext. If not found return false.
for (Iterator i = c.iterator(); i.hasNext();) {
Object next = i.next();
@@ -528,12 +431,8 @@
return true;
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean containsKey(Object o) {
-
- // See if a given object can be found among
+ // See if a given object can be found among
// the children's collection keys
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
@@ -542,32 +441,20 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final Object[] copyChildren() {
-
// Make a copy of all children
synchronized (this.children) {
return this.children.entrySet().toArray();
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected BCSChild createBCSChild(Object targetChild, Object peer) {
-
// Create a child object with a reference to its peer
return new BCSChild(targetChild, peer);
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void deserialize(ObjectInputStream ois, Collection coll)
throws IOException, ClassNotFoundException {
-
// Read objects from output stream until "EOS" (the end of stream)
// mark is found. Place all the objects into collection provided
while (true) {
@@ -581,11 +468,7 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized void dontUseGui() {
-
// Command this BeanContext and its children not to use GUI
this.okToUseGui = false;
@@ -599,55 +482,34 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void fireChildrenAdded(BeanContextMembershipEvent bcme) {
-
- // Notify all registered listenes about the change made
- for (Iterator<BeanContextMembershipListener> i = bcmListeners
- .iterator(); i.hasNext();) {
- BeanContextMembershipListener cur = i.next();
-
+ for (BeanContextMembershipListener cur : bcmListeners) {
cur.childrenAdded(bcme);
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme) {
-
- // Notify all registered listenes about the change made
- for (Iterator<BeanContextMembershipListener> i = bcmListeners
- .iterator(); i.hasNext();) {
- BeanContextMembershipListener cur = i.next();
-
+ for (BeanContextMembershipListener cur : bcmListeners) {
cur.childrenRemoved(bcme);
}
}
/**
* Get BeanContextMembershipEvent class instance
- *
- * @param changes - an array of changes that has been made
- *
+ *
+ * @param changes -
+ * an array of changes that has been made
+ *
* @return BeanContextMembershipEvent object
*/
private BeanContextMembershipEvent getBCME(Object[] changes) {
return new BeanContextMembershipEvent(getBeanContextPeer(), changes);
}
- /**
- * @com.intel.drl.spec_ref
- */
public BeanContext getBeanContextPeer() {
return (BeanContext) getBeanContextChildPeer();
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final BeanContextChild getChildBeanContextChild(
Object child) {
@@ -656,12 +518,14 @@
return null;
}
- if (child instanceof BeanContextChild && child instanceof BeanContextProxy) {
- // beans.49=Child cannot implement both BeanContextChild and BeanContextProxy
+ if (child instanceof BeanContextChild
+ && child instanceof BeanContextProxy) {
+ // beans.49=Child cannot implement both BeanContextChild and
+ // BeanContextProxy
throw new IllegalArgumentException(Messages.getString("beans.49")); //$NON-NLS-1$
- }
+ }
- // See if the child implements BeanContextChild or BeanContextProxy.
+ // See if the child implements BeanContextChild or BeanContextProxy.
// Cast it to appropriate class or simply return null
if (child instanceof BeanContextChild) {
return (BeanContextChild) child;
@@ -672,14 +536,10 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final BeanContextMembershipListener getChildBeanContextMembershipListener(
Object child) {
-
- // See if child implements BeanContextMembershipListener.
- // Cast it to BeanContextMembershipListener if it does
+ // See if child implements BeanContextMembershipListener.
+ // Cast it to BeanContextMembershipListener if it does
// or return null otherwise
if ((child != null) && child instanceof BeanContextMembershipListener) {
return (BeanContextMembershipListener) child;
@@ -688,90 +548,67 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final PropertyChangeListener getChildPropertyChangeListener(
Object child) {
-
- // See if child implements PropertyChangeListener.
+ // See if child implements PropertyChangeListener.
// Cast it to PropertyChangeListener if it does
// or return null otherwise
if ((child != null) && child instanceof PropertyChangeListener) {
return (PropertyChangeListener) child;
- } else {
- return null;
}
+ return null;
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final Serializable getChildSerializable(Object child) {
-
- // See if child implements Serializable.
+ // See if child implements Serializable.
// Cast it to Serializable if it does
// or return null otherwise
if ((child != null) && child instanceof Serializable) {
return (Serializable) child;
- } else {
- return null;
}
+ return null;
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final VetoableChangeListener getChildVetoableChangeListener(
Object child) {
-
- // See if child implements VetoableChangeListener.
+ // See if child implements VetoableChangeListener.
// Cast it to VetoableChangeListener if it does
// or return null otherwise
if ((child != null) && child instanceof VetoableChangeListener) {
return (VetoableChangeListener) child;
- } else {
- return null;
}
+ return null;
}
- /**
- * @com.intel.drl.spec_ref
- */
protected static final Visibility getChildVisibility(Object child) {
-
- // See if child implements Visibility.
+ // See if child implements Visibility.
// Cast it to Visibility if it does
// or return null otherwise
if ((child != null) && child instanceof Visibility) {
return (Visibility) child;
- } else {
- return null;
}
+ return null;
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized Locale getLocale() {
return this.locale;
}
/**
* Construct PropertyChangeEvent object and return
- *
- * @param prop - property name
- * @param o - the old value
- * @param n - the new value
+ *
+ * @param prop -
+ * property name
+ * @param o -
+ * the old value
+ * @param n -
+ * the new value
*
* @return PropertyChangeEvent object
*/
- // private PropertyChangeEvent getPCE(String prop, Object o, Object n) {
- // return new PropertyChangeEvent(getBeanContextPeer(), prop, o, n);
- // }
- /**
- * @com.intel.drl.spec_ref
- */
+ // private PropertyChangeEvent getPCE(String prop, Object o, Object n) {
+ // return new PropertyChangeEvent(getBeanContextPeer(), prop, o, n);
+ // }
public URL getResource(String name, BeanContextChild bcc) {
// The resource name should not be null
@@ -799,14 +636,12 @@
} catch (Exception ex) {
// We tried our best but still failed
- throw new IllegalArgumentException(Messages.getString("beans.2D")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages
+ .getString("beans.2D")); //$NON-NLS-1$
}
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public InputStream getResourceAsStream(String name, BeanContextChild bcc) {
// The resource name should not be null
@@ -823,7 +658,8 @@
throw new IllegalArgumentException(Messages.getString("beans.46")); //$NON-NLS-1$
}
- // Load resource using the same ClassLoader as BeanContextChild specified
+ // Load resource using the same ClassLoader as BeanContextChild
+ // specified
// If NullPointerException occurs try to load it as system resource
try {
return bcc.getClass().getClassLoader().getResourceAsStream(name);
@@ -833,14 +669,12 @@
} catch (Exception ex) {
// No success at all
- throw new IllegalArgumentException(Messages.getString("beans.2D")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages
+ .getString("beans.2D")); //$NON-NLS-1$
}
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected synchronized void initialize() {
// Initialize some fields
@@ -869,9 +703,6 @@
};
}
- /**
- * @com.intel.drl.spec_ref
- */
public Object instantiateChild(String beanName) throws IOException,
ClassNotFoundException {
@@ -880,18 +711,11 @@
.getClassLoader(), beanName, getBeanContextPeer());
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized boolean isDesignTime() {
return this.designTime;
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean isEmpty() {
-
// See if there are any children in this BeanContext
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
@@ -900,18 +724,11 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean isSerializing() {
return this.serializing;
}
- /**
- * @com.intel.drl.spec_ref
- */
public Iterator iterator() {
-
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
return this.children.keySet().iterator();
@@ -919,11 +736,7 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized boolean needsGui() {
-
// BeanContext needs GUI if at least one its children needs it.
// We may check it by trying to cast each child to Visibility
// and see it needs GUI.
@@ -946,11 +759,7 @@
return false;
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized void okToUseGui() {
-
// Notify this BeanContext and its children that it's OK now to use GUI
this.okToUseGui = true;
@@ -964,9 +773,6 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public void propertyChange(PropertyChangeEvent pce) {
if (!pce.getPropertyName().equals(BEAN_CONTEXT)) {
@@ -985,12 +791,8 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public final void readChildren(ObjectInputStream ois) throws IOException,
ClassNotFoundException {
-
// Deserialize children
for (int i = 0; i < this.serializable; i++) {
BCSChild bChild = (BCSChild) ois.readObject();
@@ -998,9 +800,6 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
private void readObject(ObjectInputStream ois) throws IOException,
ClassNotFoundException {
@@ -1021,16 +820,10 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean remove(Object targetChild) {
return remove(targetChild, true);
}
- /**
- * @com.intel.drl.spec_ref
- */
protected boolean remove(Object targetChild, boolean callChildSetBC) {
synchronized (BeanContext.globalHierarchyLock) {
@@ -1043,15 +836,13 @@
Object removed = null;
if (containsKey(targetChild)) {
-
- // Remove the reference to the BeanContext from the child
+ // Remove the reference to the BeanContext from the child
// if ordered to do so
if (callChildSetBC) {
removeFromContext(targetChild);
}
synchronized (this.children) {
-
// Just before removing save a reference to it for later use
// in childJustRemovedHook() method
BCSChild ch = this.children.get(targetChild);
@@ -1062,7 +853,7 @@
// Fire the event
fireChildrenRemoved(getBCME(new Object[] { targetChild }));
- // Check if this child implements Serializable and decrease
+ // Check if this child implements Serializable and decrease
// the number of serializable children of BeanContext
if (getChildSerializable(targetChild) != null) {
this.serializable--;
@@ -1073,47 +864,26 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean removeAll(Collection c) {
throw new UnsupportedOperationException();
/*
- synchronized(BeanContext.globalHierarchyLock) {
- Collection col = new ArrayList();
-
- // Remove all children from BeanContext that are in the collection
- // one by one. This operation is successful if all the
- // removals succeeded
- for (Iterator i = c.iterator(); i.hasNext(); ) {
- try {
- Object next = i.next();
-
- if (remove(next)) {
- col.add(next);
- }
- } catch(Exception e) {
-
- // Roll back changes but first check if it's already rolling
- // back to avoid infinitive action
- if (!this.rollingBack) {
- this.rollingBack = true;
- addAll(col);
- } else {
- this.rollingBack = false;
- }
-
- return false;
- }
- }
- }
-
- return true;*/
+ * synchronized(BeanContext.globalHierarchyLock) { Collection col = new
+ * ArrayList(); // Remove all children from BeanContext that are in the
+ * collection // one by one. This operation is successful if all the //
+ * removals succeeded for (Iterator i = c.iterator(); i.hasNext(); ) {
+ * try { Object next = i.next();
+ *
+ * if (remove(next)) { col.add(next); } } catch(Exception e) { // Roll
+ * back changes but first check if it's already rolling // back to avoid
+ * infinitive action if (!this.rollingBack) { this.rollingBack = true;
+ * addAll(col); } else { this.rollingBack = false; }
+ *
+ * return false; } } }
+ *
+ * return true;
+ */
}
- /**
- * @com.intel.drl.spec_ref
- */
public void removeBeanContextMembershipListener(
BeanContextMembershipListener bcml) {
@@ -1128,14 +898,14 @@
}
/**
- * Separate BeanContext and its child that had just been removed
- * by removing all references to each other
- *
- * @param targetChild - a BeanContext child that was removed
+ * Separate BeanContext and its child that had just been removed by removing
+ * all references to each other
+ *
+ * @param targetChild -
+ * a BeanContext child that was removed
*/
private void removeFromContext(Object targetChild) {
try {
-
// If child is an instance of BeanContextChild or BeanContextProxy,
// invoke setBeanContext() method on this child
// with null parameter
@@ -1147,55 +917,33 @@
ch.removeVetoableChangeListener(BEAN_CONTEXT, this.vcl);
}
} catch (PropertyVetoException e) {
-
// Required by spec
- throw new IllegalStateException(
- Messages.getString("beans.2E", targetChild, e.getMessage())); //$NON-NLS-1$
+ throw new IllegalStateException(Messages.getString(
+ "beans.2E", targetChild, e.getMessage())); //$NON-NLS-1$
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public boolean retainAll(Collection c) {
throw new UnsupportedOperationException();
/*
- synchronized(BeanContext.globalHierarchyLock) {
- synchronized(this.children) {
-
- Collection col = new ArrayList();
-
- // Remove all children from BeanContext that are not in the
- // collection
- // This operation is successful if all the removals succeeded
- for (Iterator i = iterator(); i.hasNext(); ) {
- Object nextKey = i.next();
- Object nextValue = this.children.get(nextKey);
-
- if (!c.contains(nextKey) && !c.contains(nextValue)) {
- try {
- if (remove(nextKey)) {
- col.add(nextKey);
- }
- } catch(Exception e) {
-
- // Roll back changes
- this.rollingBack = true;
- addAll(col);
- return false;
- }
- }
- }
- }
- }
-
- return true;*/
+ * synchronized(BeanContext.globalHierarchyLock) {
+ * synchronized(this.children) {
+ *
+ * Collection col = new ArrayList(); // Remove all children from
+ * BeanContext that are not in the // collection // This operation is
+ * successful if all the removals succeeded for (Iterator i =
+ * iterator(); i.hasNext(); ) { Object nextKey = i.next(); Object
+ * nextValue = this.children.get(nextKey);
+ *
+ * if (!c.contains(nextKey) && !c.contains(nextValue)) { try { if
+ * (remove(nextKey)) { col.add(nextKey); } } catch(Exception e) { //
+ * Roll back changes this.rollingBack = true; addAll(col); return false; } } } } }
+ *
+ * return true;
+ */
}
- /**
- * @com.intel.drl.spec_ref
- */
protected final void serialize(ObjectOutputStream oos, Collection coll)
throws IOException {
@@ -1212,9 +960,6 @@
oos.writeObject("EOS"); //$NON-NLS-1$
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized void setDesignTime(boolean dTime) {
boolean old = this.designTime;
@@ -1224,13 +969,10 @@
firePropertyChange("designTime", new Boolean(old), new Boolean(dTime)); //$NON-NLS-1$
}
- /**
- * @com.intel.drl.spec_ref
- */
public synchronized void setLocale(Locale newLocale)
throws PropertyVetoException {
- // Use default locale if a new value is null
+ // Use default locale if a new value is null
newLocale = (newLocale == null ? Locale.getDefault() : newLocale);
// Notify BeanContext about this change
@@ -1239,11 +981,7 @@
firePropertyChange("locale", old, newLocale); //$NON-NLS-1$
}
- /**
- * @com.intel.drl.spec_ref
- */
public int size() {
-
// Return the number of children of this BeanContext
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
@@ -1252,11 +990,7 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public Object[] toArray() {
-
// Convert the collection of children to array
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
@@ -1265,11 +999,7 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
public Object[] toArray(Object[] arry) {
-
// Convert the collection of children to array
synchronized (BeanContext.globalHierarchyLock) {
synchronized (this.children) {
@@ -1278,19 +1008,11 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
protected boolean validatePendingAdd(Object targetChild) {
-
return true;
}
- /**
- * @com.intel.drl.spec_ref
- */
protected boolean validatePendingRemove(Object targetChild) {
-
if (targetChild == null) {
throw new IllegalArgumentException(Messages.getString("beans.2F")); //$NON-NLS-1$
}
@@ -1298,23 +1020,15 @@
return true;
}
- /**
- * @com.intel.drl.spec_ref
- */
public void vetoableChange(PropertyChangeEvent pce)
throws PropertyVetoException {
if (pce == null) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
-
}
- /**
- * @com.intel.drl.spec_ref
- */
public final void writeChildren(ObjectOutputStream oos) throws IOException {
-
// Write serializable children to ObjectOutputStream
synchronized (this.children) {
for (Iterator it = iterator(); it.hasNext();) {
@@ -1327,9 +1041,6 @@
}
}
- /**
- * @com.intel.drl.spec_ref
- */
private void writeObject(ObjectOutputStream oos) throws IOException,
ClassNotFoundException {