xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@locus.apache.org
Subject cvs commit: xml-stylebook/src/org/apache/stylebook BasicEntry.java Entry.java Project.java ResourceEntry.java
Date Wed, 01 Dec 1999 18:39:14 GMT
pier        99/12/01 10:39:14

  Modified:    src/org/apache/stylebook BasicEntry.java Entry.java
                        Project.java ResourceEntry.java
  Log:
  Added equity check to entries in project file.
  
  Revision  Changes    Path
  1.3       +5 -1      xml-stylebook/src/org/apache/stylebook/BasicEntry.java
  
  Index: BasicEntry.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/BasicEntry.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicEntry.java	1999/11/30 12:28:51	1.2
  +++ BasicEntry.java	1999/12/01 18:39:13	1.3
  @@ -23,7 +23,7 @@
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
    *         Software Foundation</a>. All rights reserved.
  - * @version CVS $Revision: 1.2 $ $Date: 1999/11/30 12:28:51 $
  + * @version CVS $Revision: 1.3 $ $Date: 1999/12/01 18:39:13 $
    */
   public class BasicEntry extends BasicContext implements Entry {
       private Producer producer=null;
  @@ -77,5 +77,9 @@
               this.processor=proc;
               this.parameters=param;
           }
  +    }
  +    
  +    public boolean equals(Entry e) {
  +        return(false);
       }
   }
  
  
  
  1.2       +3 -1      xml-stylebook/src/org/apache/stylebook/Entry.java
  
  Index: Entry.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/Entry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Entry.java	1999/11/15 22:05:48	1.1
  +++ Entry.java	1999/12/01 18:39:13	1.2
  @@ -16,9 +16,11 @@
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
    *         Software Foundation</a>. All rights reserved.
  - * @version CVS $Revision: 1.1 $ $Date: 1999/11/15 22:05:48 $
  + * @version CVS $Revision: 1.2 $ $Date: 1999/12/01 18:39:13 $
    */
   public interface Entry {
       public void create(OutputStream out)
       throws IOException, CreationException;
  +    
  +    public boolean equals(Entry e);
   }
  
  
  
  1.3       +5 -3      xml-stylebook/src/org/apache/stylebook/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/Project.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Project.java	1999/11/30 12:28:51	1.2
  +++ Project.java	1999/12/01 18:39:13	1.3
  @@ -23,7 +23,7 @@
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
    *         Software Foundation</a>. All rights reserved.
  - * @version CVS $Revision: 1.2 $ $Date: 1999/11/30 12:28:51 $
  + * @version CVS $Revision: 1.3 $ $Date: 1999/12/01 18:39:13 $
    */
   public class Project {
       private Hashtable entries=new Hashtable();
  @@ -73,7 +73,8 @@
           URL source=new URL(urlbase,e.getAttribute("source"));
           String target=e.getAttribute("target");
           Entry entry=new BasicEntry(this.engine,source,target,e,parambase);
  -        if(this.entries.put(target,entry)!=null)
  +        Entry old=(Entry)this.entries.put(target,entry);
  +        if(old!=null) if(!old.equals(entry))
               throw new LoadingException("Duplicate Entry \""+target+"\"");
       }
   
  @@ -82,7 +83,8 @@
           URL source=new URL(urlbase,e.getAttribute("source"));
           String target=e.getAttribute("target");
           Entry entry=new ResourceEntry(this.engine,source,target);
  -        if(this.entries.put(target,entry)!=null)
  +        Entry old=(Entry)this.entries.put(target,entry);
  +        if(old!=null) if(!old.equals(entry))
               throw new LoadingException("Duplicate Entry \""+target+"\"");
       }
       
  
  
  
  1.3       +11 -1     xml-stylebook/src/org/apache/stylebook/ResourceEntry.java
  
  Index: ResourceEntry.java
  ===================================================================
  RCS file: /home/cvs/xml-stylebook/src/org/apache/stylebook/ResourceEntry.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ResourceEntry.java	1999/11/30 12:28:52	1.2
  +++ ResourceEntry.java	1999/12/01 18:39:14	1.3
  @@ -21,7 +21,7 @@
    * @author <a href="mailto:pier@apache.org">Pierpaolo Fumagalli</a>
    * @author Copyright 1999 &copy; <a href="http://www.apache.org">The Apache
    *         Software Foundation</a>. All rights reserved.
  - * @version CVS $Revision: 1.2 $ $Date: 1999/11/30 12:28:52 $
  + * @version CVS $Revision: 1.3 $ $Date: 1999/12/01 18:39:14 $
    */
   public class ResourceEntry implements Entry {
       private URL src=null;
  @@ -39,5 +39,15 @@
           while((data=in.read())!=-1) out.write(data);
           in.close();
           out.flush();
  +    }
  +    
  +    public boolean equals(Entry e) {
  +        try {
  +            ResourceEntry r=(ResourceEntry)e;
  +            if(r.src.equals(this.src)) return(true);
  +            return(false);
  +        } catch (Exception x) {
  +            return(false);
  +        }
       }
   }
  
  
  

Mime
View raw message