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/jdepend JDependTask.java
Date Tue, 08 Jan 2002 22:44:56 GMT
sbailliez    02/01/08 14:44:56

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/jdepend
                        JDependTask.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.5       +18 -11    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JDependTask.java	27 Nov 2001 18:04:53 -0000	1.4
  +++ JDependTask.java	8 Jan 2002 22:44:56 -0000	1.5
  @@ -257,17 +257,20 @@
   
           CommandlineJava commandline = new CommandlineJava();
   
  -        if("text".equals(format))
  +        if("text".equals(format)) {
               commandline.setClassname("jdepend.textui.JDepend");
  -        else
  -        if("xml".equals(format))
  +        } else
  +        if("xml".equals(format)) {
               commandline.setClassname("jdepend.xmlui.JDepend");
  +        }
   
  -        if(_jvm!=null)
  +        if(_jvm!=null) {
               commandline.setVm(_jvm);
  +        }
   
  -        if (getSourcespath() == null)
  +        if (getSourcespath() == null) {
               throw new BuildException("Missing Sourcepath required argument");
  +        }
   
           // execute the test and get the return code
           int exitValue = JDependTask.ERRORS;
  @@ -289,11 +292,12 @@
           boolean errorOccurred = exitValue == JDependTask.ERRORS;
   
           if (errorOccurred) {
  -            if  (getHaltonerror())
  +            if  (getHaltonerror()) {
                   throw new BuildException("JDepend failed",
                                            location);
  -            else
  +            } else {
                   log("JDepend FAILED", Project.MSG_ERR);
  +            }
           }
       }
   
  @@ -310,10 +314,11 @@
       public int executeInVM(CommandlineJava commandline) throws BuildException {
           jdepend.textui.JDepend jdepend;
   
  -        if("xml".equals(format))
  +        if("xml".equals(format)) {
               jdepend = new jdepend.xmlui.JDepend();
  -        else
  +        } else {
               jdepend = new jdepend.textui.JDepend();
  +        }
   
           if (getOutputFile() != null) {
               FileWriter fw;
  @@ -386,8 +391,9 @@
               File f = new File(sourcesPath.nextToken());
   
               // not necessary as JDepend would fail, but why loose some time?
  -            if (! f.exists() || !f.isDirectory())
  +            if (! f.exists() || !f.isDirectory()) {
                   throw new BuildException("\""+ f.getPath() + "\" does not represent a valid
directory. JDepend would fail.");
  +            }
               commandline.createArgument().setValue(f.getPath());
           }
   
  @@ -398,8 +404,9 @@
               execute.setAntRun(project);
           }
   
  -        if (getOutputFile() != null)
  +        if (getOutputFile() != null) {
               log("Output to be stored in " + getOutputFile().getPath());
  +        }
           log("Executing: "+commandline.toString(), Project.MSG_VERBOSE);
           try {
               return execute.execute();
  
  
  

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