You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ke...@apache.org on 2005/01/25 23:32:30 UTC
svn commit: r126435 - /incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java /incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java
Author: kentam
Date: Tue Jan 25 14:32:29 2005
New Revision: 126435
URL: http://svn.apache.org/viewcvs?view=rev&rev=126435
Log:
Fix BEEHIVE-187: default control threading is MULTI_THREADED i/o SINGLE_THREADED
Added additional compile time checking for duplicate property names.
Tests: all DRTs
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java?view=diff&rev=126435&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java&r1=126434&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java&r2=126435
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java Tue Jan 25 14:32:29 2005
@@ -164,6 +164,8 @@
Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
if ( thr != null )
_threadingPolicy = thr.value();
+ else
+ _threadingPolicy = ThreadingPolicy.SINGLE_THREADED; // default to single-threaded
ensureThreadingBehaviour();
}
@@ -956,7 +958,8 @@
/**
* The threading policy associated with the control implementation wrapped by this
- * ControlBean.
+ * ControlBean. Initialized to null in order to avoid prematurely assuming single-threadedness
+ * during bean hookup.
*/
transient private ThreadingPolicy _threadingPolicy = null;
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java?view=diff&rev=126435&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java&r1=126434&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java&r2=126435
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java Tue Jan 25 14:32:29 2005
@@ -326,7 +326,11 @@
//
// Detect the presence of locally declared bound or constrained properties
+ // Enforce property name (including prefix) uniqueness across all propertysets on this interface.
//
+
+ Set<String> propertyNames = new HashSet<String>();
+
for (AptPropertySet propSet : propSets)
{
for (AptProperty prop : propSet.getProperties())
@@ -336,6 +340,19 @@
if (prop.isConstrained())
_hasConstrainedProperties = true;
+
+ String propName = prop.getAccessorName();
+
+ if ( propertyNames.contains( propName ) )
+ {
+ _env.getMessager().printError(_intfDecl.getPosition(),
+ "Duplicate property name " + propName + " found on property set '" + propSet.getShortName() +
+ "'. Consider using the PropertySet 'prefix' attribute to disambiguate.");
+ }
+ else
+ {
+ propertyNames.add( propName );
+ }
}
}