ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional XMLValidateTask.java
Date Tue, 08 Jan 2002 19:55:36 GMT
sbailliez    02/01/08 11:55:36

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional
                        XMLValidateTask.java
  Log:
  Fix bad coding style.
  then/else parts of if statement and loop body must always been enclosed
  in a block statement.
  
  Revision  Changes    Path
  1.10      +16 -9     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java
  
  Index: XMLValidateTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/XMLValidateTask.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLValidateTask.java	23 Nov 2001 19:37:38 -0000	1.9
  +++ XMLValidateTask.java	8 Jan 2002 19:55:36 -0000	1.10
  @@ -256,10 +256,11 @@
               }
               else {
                   String errorMsg = "File " + file + " cannot be read";
  -                if (failOnError)
  +                if (failOnError) {
                       throw new BuildException(errorMsg);
  -                else
  +                } else {
                       log(errorMsg, Project.MSG_ERR);
  +                }
               }
           }
   
  @@ -295,8 +296,9 @@
   //                loader.addSystemPackageRoot("org.xml"); // needed to avoid conflict
                   readerClass = loader.loadClass(readerClassName);
                   AntClassLoader.initializeClass(readerClass);
  -            } else
  +            } else {
                   readerClass = Class.forName(readerClassName);
  +            }
   
               // then check it implements XMLReader
               if (XMLReader.class.isAssignableFrom(readerClass)) {
  @@ -357,17 +359,19 @@
               xmlReader.setFeature(feature,value);
               toReturn = true;
           } catch (SAXNotRecognizedException e) {
  -            if (warn)
  +            if (warn) {
                   log("Could not set feature '"
                       + feature
                       + "' because the parser doesn't recognize it",
                       Project.MSG_WARN);
  +            }
           } catch (SAXNotSupportedException  e) {
  -            if (warn)
  +            if (warn) {
                   log("Could not set feature '"
                       + feature
                       + "' because the parser doesn't support it",
                       Project.MSG_WARN);
  +            }
           }
           return toReturn;
       }
  @@ -387,17 +391,19 @@
               is.setSystemId(uri);
               xmlReader.parse(is);
           } catch (SAXException ex) {
  -            if (failOnError)
  +            if (failOnError) {
                   throw new BuildException("Could not validate document " + afile);
  +            }
           } catch (IOException ex) {
               throw new BuildException("Could not validate document " + afile, ex);
           }
   
           if (errorHandler.getFailure()) {
  -            if (failOnError)
  +            if (failOnError) {
                   throw new BuildException(afile + " is not a valid XML document.");
  -            else
  +            } else {
                   log(afile + " is not a valid XML document",Project.MSG_ERR);
  +            }
           }
       }
   
  @@ -438,8 +444,9 @@
           public void warning(SAXParseException exception) {
               // depending on implementation, XMLReader can yield hips of warning,
               // only output then if user explicitely asked for it
  -            if (warn)
  +            if (warn) {
                   doLog(exception,Project.MSG_WARN);
  +            }
           }
   
           private void doLog(SAXParseException e, int logLevel) {
  
  
  

--
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