ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit AggregateTransformer.java
Date Fri, 05 Apr 2002 03:20:55 GMT
conor       02/04/04 19:20:55

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        AggregateTransformer.java
  Log:
  Tedious workaround for JDK 1.1 compilation issues
  
  Revision  Changes    Path
  1.12      +19 -2     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
  
  Index: AggregateTransformer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -w -u -r1.11 -r1.12
  --- AggregateTransformer.java	26 Jan 2002 20:41:45 -0000	1.11
  +++ AggregateTransformer.java	5 Apr 2002 03:20:55 -0000	1.12
  @@ -117,12 +117,29 @@
       protected String format;
   
       /** XML Parser factory */
  -    protected final static DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
  +    private static DocumentBuilderFactory privateDBFactory;
  +    
  +    /** XML Parser factory accessible to subclasses */
  +    protected static DocumentBuilderFactory dbfactory;
  +    
  +    static {
  +       privateDBFactory = DocumentBuilderFactory.newInstance();
  +       dbfactory = privateDBFactory;
  +    }
   
       public AggregateTransformer(Task task){
           this.task = task;
       }
   
  +    /**
  +     * Get the Document Builder Factory
  +     *
  +     * @return the DocumentBuilderFactory instance in use
  +     */
  +    protected static DocumentBuilderFactory getDocumentBuilderFactory() {
  +        return privateDBFactory;
  +    }
  +    
       public void setFormat(Format format){
           this.format = format.getValue();
       }
  @@ -138,7 +155,7 @@
        */
       protected void setXmlfile(File xmlfile) throws BuildException {
           try {
  -            DocumentBuilder builder = dbfactory.newDocumentBuilder();
  +            DocumentBuilder builder = privateDBFactory.newDocumentBuilder();
               InputStream in = new FileInputStream(xmlfile);
               try {
                   Document doc = builder.parse(in);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message