Going through the suggar section
authorJaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:59:23 +0200
changeset 179b94c14f52c31
parent 178 f3f2f73686d8
child 180 131332825eab
Going through the suggar section
samples/visitor/21-clientprovider/src-test/org/apidesign/test/visitor/PrintTest.java
     1.1 --- a/samples/visitor/21-clientprovider/src-test/org/apidesign/test/visitor/PrintTest.java	Sat Jun 14 09:59:21 2008 +0200
     1.2 +++ b/samples/visitor/21-clientprovider/src-test/org/apidesign/test/visitor/PrintTest.java	Sat Jun 14 09:59:23 2008 +0200
     1.3 @@ -39,12 +39,14 @@
     1.4          };
     1.5      }
     1.6  
     1.7 +    // BEGIN: visitor.clientprovider.print
     1.8      public static class PrintVisitor implements Visitor.Version1_0 {
     1.9          StringBuffer sb = new StringBuffer();
    1.10          
    1.11          final Visitor dispatch = Visitor.create(this);
    1.12          
    1.13          public void visitPlus(Plus s) {
    1.14 +            // s.getFirst().visit(this); // does not compile, we need:
    1.15              s.getFirst().visit(dispatch);
    1.16              sb.append(" + ");
    1.17              s.getSecond().visit(dispatch);
    1.18 @@ -59,6 +61,7 @@
    1.19              return true;
    1.20          }
    1.21      }
    1.22 +    // END: visitor.clientprovider.print
    1.23      
    1.24      @Test public void printOnePlusOne() {
    1.25          Number one = newNumber(1);