cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/environment/commandline LinkSamplingEnvironment.java
Date Mon, 25 Sep 2000 14:59:44 GMT
stefano     00/09/25 07:59:43

  Modified:    src/org/apache/cocoon/environment/commandline Tag:
                        xml-cocoon2 LinkSamplingEnvironment.java
  Log:
  new link view parsing
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +19 -9     xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/LinkSamplingEnvironment.java
  
  Index: LinkSamplingEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/LinkSamplingEnvironment.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- LinkSamplingEnvironment.java	2000/09/03 17:45:46	1.1.2.2
  +++ LinkSamplingEnvironment.java	2000/09/25 14:59:39	1.1.2.3
  @@ -71,22 +71,32 @@
        */
       class LineLister extends ByteArrayOutputStream {
   
  -        private List links = Collections.synchronizedList(new ArrayList());
  +        private boolean linkable = false;
           
  +        private List links = new ArrayList();
  +        
           public void write(int c) {
  -            super.write(c);
  +            if (!linkable && (c == '+')) {
  +                linkable = true;
  +                return;
  +            }
  +            if (linkable && (c == ' ')) {
  +                return;
  +            }
               if (c == '\n') {
  -                synchronized (links) {
  -                    links.add(this.toString());
  -                    this.reset();
  -                }
  +                if (linkable) links.add(this.toString());
  +                reset();
               }
  +            super.write(c);
           }
           
           public Collection list() {
  -            synchronized (links) {
  -                return links;
  -            }
  +            return links;
  +        }
  +        
  +        public void reset() {
  +            super.reset();
  +            linkable = false;
           }
       }
   }
  
  
  

Mime
View raw message