ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r709341 - in /ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder: PropertyBuilder.java Tag.java
Date Fri, 31 Oct 2008 04:15:11 GMT
Author: bodewig
Date: Thu Oct 30 21:15:10 2008
New Revision: 709341

URL: http://svn.apache.org/viewvc?rev=709341&view=rev
Log:
This is what I wanted to write.

Modified:
    ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/PropertyBuilder.java
    ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/Tag.java

Modified: ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/PropertyBuilder.java
URL: http://svn.apache.org/viewvc/ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/PropertyBuilder.java?rev=709341&r1=709340&r2=709341&view=diff
==============================================================================
--- ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/PropertyBuilder.java (original)
+++ ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/PropertyBuilder.java Thu
Oct 30 21:15:10 2008
@@ -20,7 +20,7 @@
 import org.apache.tools.ant.Project;
 
 public class PropertyBuilder extends Tag<PropertyBuilder> {
-    public PropertyBuilder(Project p) {
+    PropertyBuilder(Project p) {
         super(p, "property");
     }
 

Modified: ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/Tag.java
URL: http://svn.apache.org/viewvc/ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/Tag.java?rev=709341&r1=709340&r2=709341&view=diff
==============================================================================
--- ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/Tag.java (original)
+++ ant/sandbox/javafront/src/main/org/apache/ant/javafront/builder/Tag.java Thu Oct 30 21:15:10
2008
@@ -24,6 +24,7 @@
 
 public class Tag<T extends Tag<T>> {
 
+    private final T self = (T) this;
     private final UnknownElement ue;
     private final RuntimeConfigurable rc;
 
@@ -35,20 +36,20 @@
         rc = new RuntimeConfigurable(ue, name);
     }
 
-    public Tag<T> withAttribute(String name, String value) {
+    public T withAttribute(String name, String value) {
         rc.setAttribute(name, value);
-        return this;
+        return self;
     }
 
-    public Tag<T> withChild(Tag<?> child) {
+    public T withChild(Tag<?> child) {
         ue.addChild(child.ue);
         rc.addChild(child.rc);
-        return this;
+        return self;
     }
 
-    public Tag<T> withNestedText(String text) {
+    public T withNestedText(String text) {
         rc.addText(text);
-        return this;
+        return self;
     }
 
     public Object build() {



Mime
View raw message