beehive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ky...@apache.org
Subject svn commit: rev 37344 - in incubator/beehive/trunk/controls/src: api/org/apache/beehive/controls/api/properties runtime/org/apache/beehive/controls/runtime/generator/apt
Date Wed, 01 Sep 2004 18:21:58 GMT
Author: kylem
Date: Wed Sep  1 11:21:57 2004
New Revision: 37344

Modified:
   incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java
   incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptMethodHelper.java
Log:
Minor fixes, including:
- Fix to argument name generation code in AptMethodHelper
- Tighten the @Target annotation for Control PropertySet annotations.  Since PropertySets
are
  themselves always annotation types, the @Target decl should reflect this.  Doesn't change
any
  existing use cases or code, just provides tighter validation of use.


Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java
==============================================================================
--- incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java
(original)
+++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java
Wed Sep  1 11:21:57 2004
@@ -49,7 +49,7 @@
  */
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE})
+@Target({ElementType.ANNOTATION_TYPE})
 public @interface PropertySet
 {
     /**

Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptMethodHelper.java
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptMethodHelper.java
(original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptMethodHelper.java
Wed Sep  1 11:21:57 2004
@@ -76,17 +76,17 @@
     public String getArgDecl()
     {
         StringBuffer sb = new StringBuffer();
-        int i = 0;
 
         if ( _methodDecl.getParameters() == null )
             return "";
         
+        int i = 0;
         for (ParameterDeclaration paramDecl : _methodDecl.getParameters())
         {
             if ( paramDecl.getType() == null )
                 return "";
                 
-            if (i++ != 0)
+            if (i != 0)
                 sb.append(", ");
             
             sb.append(paramDecl.getType().toString());
@@ -99,6 +99,8 @@
                 sb.append("arg" + i);
             else
                 sb.append(argName);
+
+            i++;
         }
         return sb.toString();
     }
@@ -116,7 +118,7 @@
         
         for (ParameterDeclaration paramDecl : _methodDecl.getParameters())
         {
-            if (i++ != 0)
+            if (i != 0)
                 sb.append(", ");
 
             // BUGBUG: when the MethodDeclaration is derived from Reflection, this seems
@@ -126,6 +128,8 @@
                 sb.append("arg" + i);
             else
                 sb.append(argName);
+
+            i++;
         }
         return sb.toString();
     }
@@ -144,7 +148,7 @@
         
         for (ParameterDeclaration paramDecl : _methodDecl.getParameters())
         {
-            if (i++ != 0)
+            if (i != 0)
                 sb.append(",");
 
             // BUGBUG: when the MethodDeclaration is derived from Reflection, this seems
@@ -167,6 +171,8 @@
             }
             else
                 sb.append(argName);
+
+            i++;
         }
         return sb.toString();
     }

Mime
View raw message