cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2004-04-23 Thread peterreilly
peterreilly2004/04/23 09:56:20

  Modified:.WHATSNEW
   src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
  Log:
  JDependTask did not close an output file
  PR: 28557
  Obtained from: Jeff Badorek
  
  Revision  ChangesPath
  1.598 +2 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.597
  retrieving revision 1.598
  diff -u -r1.597 -r1.598
  --- WHATSNEW  23 Apr 2004 15:15:39 -  1.597
  +++ WHATSNEW  23 Apr 2004 16:56:20 -  1.598
  @@ -126,6 +126,8 @@
   * I/O-intensive processes hung when executed via exec spawn=true.
 Bugzilla reports 23893/26852.
   
  +* JDependTask did not close an output file. Bugzilla Report 28557.
  +
   Other changes:
   --
   
  
  
  
  1.32  +83 -72
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- JDependTask.java  9 Mar 2004 16:48:30 -   1.31
  +++ JDependTask.java  23 Apr 2004 16:56:20 -  1.32
  @@ -453,8 +453,8 @@
   jdepend = new jdepend.textui.JDepend();
   }
   
  +FileWriter fw = null;
   if (getOutputFile() != null) {
  -FileWriter fw;
   try {
   fw = new FileWriter(getOutputFile().getPath());
   } catch (IOException e) {
  @@ -467,87 +467,98 @@
   log(Output to be stored in  + getOutputFile().getPath());
   }
   
  -if (getClassespath() != null) {
  -// This is the new, better way - use classespath instead
  -// of sourcespath.  The code is currently the same - you
  -// need class files in a directory to use this - jar files
  -// coming soon
  -String[] classesPath = getClassespath().list();
  -for (int i = 0; i  classesPath.length; i++) {
  -File f = new File(classesPath[i]);
  -// not necessary as JDepend would fail, but why loose
  -// some time?
  -if (!f.exists() || !f.isDirectory()) {
  -String msg = \
  -+ f.getPath()
  -+ \ does not represent a valid
  -+  directory. JDepend would fail.;
  -log(msg);
  -throw new BuildException(msg);
  -}
  -try {
  -jdepend.addDirectory(f.getPath());
  -} catch (IOException e) {
  -String msg =
  -JDepend Failed when adding a class directory: 
  -+ e.getMessage();
  -log(msg);
  -throw new BuildException(msg);
  +
  +try {
  +if (getClassespath() != null) {
  +// This is the new, better way - use classespath instead
  +// of sourcespath.  The code is currently the same - you
  +// need class files in a directory to use this - jar files
  +// coming soon
  +String[] classesPath = getClassespath().list();
  +for (int i = 0; i  classesPath.length; i++) {
  +File f = new File(classesPath[i]);
  +// not necessary as JDepend would fail, but why loose
  +// some time?
  +if (!f.exists() || !f.isDirectory()) {
  +String msg = \
  ++ f.getPath()
  ++ \ does not represent a valid
  ++  directory. JDepend would fail.;
  +log(msg);
  +throw new BuildException(msg);
  +}
  +try {
  +jdepend.addDirectory(f.getPath());
  +} catch (IOException e) {
  +String msg =
  +JDepend Failed when adding a class directory: 
  ++ e.getMessage();
  +log(msg);
  +throw new BuildException(msg);
  +}
  +}
  +
  +} else if (getSourcespath() != null) {
  +
  +// This is the old way and is deprecated - classespath is
  +// the right way to do this and is above
  +String[] sourcesPath = getSourcespath().list();
  +for (int i = 0; i  sourcesPath.length; i++) {
  +   

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2004-04-23 Thread peterreilly
peterreilly2004/04/23 09:57:26

  Modified:.Tag: ANT_16_BRANCH WHATSNEW
   src/main/org/apache/tools/ant/taskdefs/optional/jdepend Tag:
ANT_16_BRANCH JDependTask.java
  Log:
  sync
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.503.2.86 +2 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.85
  retrieving revision 1.503.2.86
  diff -u -r1.503.2.85 -r1.503.2.86
  --- WHATSNEW  23 Apr 2004 15:47:31 -  1.503.2.85
  +++ WHATSNEW  23 Apr 2004 16:57:26 -  1.503.2.86
  @@ -164,6 +164,8 @@
   
   * failOnAny attribute for parallel was broken. Bugzilla Report 28122.
   
  +* JDependTask did not close an output file. Bugzilla Report 28557.
  +
   Other changes:
   --
   
  
  
  
  No   revision
  No   revision
  1.22.2.8  +83 -72
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.22.2.7
  retrieving revision 1.22.2.8
  diff -u -r1.22.2.7 -r1.22.2.8
  --- JDependTask.java  9 Mar 2004 17:01:48 -   1.22.2.7
  +++ JDependTask.java  23 Apr 2004 16:57:26 -  1.22.2.8
  @@ -453,8 +453,8 @@
   jdepend = new jdepend.textui.JDepend();
   }
   
  +FileWriter fw = null;
   if (getOutputFile() != null) {
  -FileWriter fw;
   try {
   fw = new FileWriter(getOutputFile().getPath());
   } catch (IOException e) {
  @@ -467,87 +467,98 @@
   log(Output to be stored in  + getOutputFile().getPath());
   }
   
  -if (getClassespath() != null) {
  -// This is the new, better way - use classespath instead
  -// of sourcespath.  The code is currently the same - you
  -// need class files in a directory to use this - jar files
  -// coming soon
  -String[] classesPath = getClassespath().list();
  -for (int i = 0; i  classesPath.length; i++) {
  -File f = new File(classesPath[i]);
  -// not necessary as JDepend would fail, but why loose
  -// some time?
  -if (!f.exists() || !f.isDirectory()) {
  -String msg = \
  -+ f.getPath()
  -+ \ does not represent a valid
  -+  directory. JDepend would fail.;
  -log(msg);
  -throw new BuildException(msg);
  -}
  -try {
  -jdepend.addDirectory(f.getPath());
  -} catch (IOException e) {
  -String msg =
  -JDepend Failed when adding a class directory: 
  -+ e.getMessage();
  -log(msg);
  -throw new BuildException(msg);
  +
  +try {
  +if (getClassespath() != null) {
  +// This is the new, better way - use classespath instead
  +// of sourcespath.  The code is currently the same - you
  +// need class files in a directory to use this - jar files
  +// coming soon
  +String[] classesPath = getClassespath().list();
  +for (int i = 0; i  classesPath.length; i++) {
  +File f = new File(classesPath[i]);
  +// not necessary as JDepend would fail, but why loose
  +// some time?
  +if (!f.exists() || !f.isDirectory()) {
  +String msg = \
  ++ f.getPath()
  ++ \ does not represent a valid
  ++  directory. JDepend would fail.;
  +log(msg);
  +throw new BuildException(msg);
  +}
  +try {
  +jdepend.addDirectory(f.getPath());
  +} catch (IOException e) {
  +String msg =
  +JDepend Failed when adding a class directory: 
  ++ e.getMessage();
  +log(msg);
  +throw new BuildException(msg);
  +}
  +}
  +
  +} else if (getSourcespath() != null) {
  +
  +// This is the old way and is deprecated - classespath is
  +// the right way to do this and is above
  +String[] 

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2003-11-03 Thread peterreilly
peterreilly2003/11/03 07:01:41

  Modified:src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
  Log:
  checkstyle
  
  Revision  ChangesPath
  1.23  +93 -48
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- JDependTask.java  19 Jul 2003 11:20:18 -  1.22
  +++ JDependTask.java  3 Nov 2003 15:01:41 -   1.23
  @@ -90,18 +90,18 @@
   //private CommandlineJava commandline = new CommandlineJava();
   
   // required attributes
  -private Path _sourcesPath; // Deprecated!
  -private Path _classesPath; // Use this going forward
  +private Path sourcesPath; // Deprecated!
  +private Path classesPath; // Use this going forward
   
   // optional attributes
  -private File _outputFile;
  -private File _dir;
  -private Path _compileClasspath;
  -private boolean _haltonerror = false;
  -private boolean _fork = false;
  +private File outputFile;
  +private File dir;
  +private Path compileClasspath;
  +private boolean haltonerror = false;
  +private boolean fork = false;
   //private Integer _timeout = null;
   
  -private String _jvm = null;
  +private String jvm = null;
   private String format = text;
   private PatternSet defaultPatterns = new PatternSet();
   
  @@ -124,9 +124,6 @@
   }
   }
   
  -public JDependTask() {
  -}
  -
   /*
 public void setTimeout(Integer value) {
 _timeout = value;
  @@ -140,38 +137,49 @@
   /**
* The output file name.
*
  - * @param outputFile
  + * @param outputFile the output file name
*/
   public void setOutputFile(File outputFile) {
  -_outputFile = outputFile;
  +this.outputFile = outputFile;
   }
   
  +/**
  + * @return the output file name
  + */
   public File getOutputFile() {
  -return _outputFile;
  +return outputFile;
   }
   
   /**
* Whether or not to halt on failure. Default: false.
  + * @param haltonerror the value to set
*/
  -public void setHaltonerror(boolean value) {
  -_haltonerror = value;
  +public void setHaltonerror(boolean haltonerror) {
  +this.haltonerror = haltonerror;
   }
   
  +/**
  + * @return the value of the haltonerror attribute
  + */
   public boolean getHaltonerror() {
  -return _haltonerror;
  +return haltonerror;
   }
   
   /**
* If true, forks into a new JVM. Default: false.
*
  - * @param   value   tttrue/tt if a JVM should be forked, otherwise 
ttfalsett
  + * @param   value   tttrue/tt if a JVM should be forked,
  + *  otherwise ttfalsett
*/
   public void setFork(boolean value) {
  -_fork = value;
  +fork = value;
   }
   
  +/**
  + * @return the value of the fork attribute
  + */
   public boolean getFork() {
  -return _fork;
  +return fork;
   }
   
   /**
  @@ -182,47 +190,49 @@
* @see #setFork(boolean)
*/
   public void setJvm(String value) {
  -_jvm = value;
  +jvm = value;
   
   }
   
   /**
* Adds a path to source code to analyze.
  + * @return a source path
* @deprecated
*/
   public Path createSourcespath() {
  -if (_sourcesPath == null) {
  -_sourcesPath = new Path(getProject());
  +if (sourcesPath == null) {
  +sourcesPath = new Path(getProject());
   }
  -return _sourcesPath.createPath();
  +return sourcesPath.createPath();
   }
   
   /**
* Gets the sourcepath.
  - *
  + * @return the sources path
* @deprecated
*
*/
   public Path getSourcespath() {
  -return _sourcesPath;
  +return sourcesPath;
   }
   
   /**
* Adds a path to class code to analyze.
  + * @return a classes path
*/
   public Path createClassespath() {
  -if (_classesPath == null) {
  -_classesPath = new Path(getProject());
  +if (classesPath == null) {
  +classesPath = new Path(getProject());
   }
  -return _classesPath.createPath();
  +return classesPath.createPath();
   }
   
   /**
* Gets the classespath.
  - *
  + * @return the classes path
*/
   public Path getClassespath() {
  -return _classesPath;
  +return classesPath;
   }
   
   /**
  @@ -231,42 +241,52 @@
* @see 

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2003-11-03 Thread bodewig
bodewig 2003/11/03 07:19:50

  Modified:src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
  Log:
  Fix NPE, PR: 24344
  
  Revision  ChangesPath
  1.24  +4 -0  
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- JDependTask.java  3 Nov 2003 15:01:41 -   1.23
  +++ JDependTask.java  3 Nov 2003 15:19:50 -   1.24
  @@ -559,6 +559,7 @@
   // we have to find a cleaner way to put this output
   }
   
  +if (getSourcespath() != null) {
   // This is deprecated - use classespath in the future
   String[] sourcesPath = getSourcespath().list();
   for (int i = 0; i  sourcesPath.length; i++) {
  @@ -571,7 +572,9 @@
   }
   commandline.createArgument().setValue(f.getPath());
   }
  +}
   
  +if (getClassespath() != null) {
   // This is the new way - use classespath - code is the same for now
   String[] classesPath = getClassespath().list();
   for (int i = 0; i  classesPath.length; i++) {
  @@ -582,6 +585,7 @@
+ represent a valid directory. 
JDepend would fail.);
   }
   commandline.createArgument().setValue(f.getPath());
  +}
   }
   
   Execute execute = new Execute(new LogStreamHandler(this,
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2003-11-03 Thread bodewig
bodewig 2003/11/03 07:22:28

  Modified:src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
  Log:
  Indentation changes
  
  Revision  ChangesPath
  1.25  +27 -20
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JDependTask.java  3 Nov 2003 15:19:50 -   1.24
  +++ JDependTask.java  3 Nov 2003 15:22:28 -   1.25
  @@ -560,32 +560,39 @@
   }
   
   if (getSourcespath() != null) {
  -// This is deprecated - use classespath in the future
  -String[] sourcesPath = getSourcespath().list();
  -for (int i = 0; i  sourcesPath.length; i++) {
  -File f = new File(sourcesPath[i]);
  +// This is deprecated - use classespath in the future
  +String[] sourcesPath = getSourcespath().list();
  +for (int i = 0; i  sourcesPath.length; i++) {
  +File f = new File(sourcesPath[i]);
   
  -// not necessary as JDepend would fail, but why loose some time?
  -if (!f.exists() || !f.isDirectory()) {
  -throw new BuildException(\ + f.getPath() + \ does not 
  - + represent a valid directory. 
JDepend would fail.);
  +// not necessary as JDepend would fail, but why loose
  +// some time?
  +if (!f.exists() || !f.isDirectory()) {
  +throw new BuildException(\ + f.getPath() 
  + + \ does not represent a 
valid
  + +  directory. JDepend would
  + +  fail.);
  +}
  +commandline.createArgument().setValue(f.getPath());
   }
  -commandline.createArgument().setValue(f.getPath());
  -}
   }
   
   if (getClassespath() != null) {
  -// This is the new way - use classespath - code is the same for now
  -String[] classesPath = getClassespath().list();
  -for (int i = 0; i  classesPath.length; i++) {
  -File f = new File(classesPath[i]);
  -// not necessary as JDepend would fail, but why loose some time?
  -if (!f.exists() || !f.isDirectory()) {
  -throw new BuildException(\ + f.getPath() + \ does not 
  - + represent a valid directory. 
JDepend would fail.);
  +// This is the new way - use classespath - code is the
  +// same for now
  +String[] classesPath = getClassespath().list();
  +for (int i = 0; i  classesPath.length; i++) {
  +File f = new File(classesPath[i]);
  +// not necessary as JDepend would fail, but why loose
  +// some time?
  +if (!f.exists() || !f.isDirectory()) {
  +throw new BuildException(\ + f.getPath() 
  + + \ does not represent a 
valid
  + +  directory. JDepend would
  + +  fail.);
  +}
  +commandline.createArgument().setValue(f.getPath());
   }
  -commandline.createArgument().setValue(f.getPath());
  -}
   }
   
   Execute execute = new Execute(new LogStreamHandler(this,
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2003-11-03 Thread bodewig
bodewig 2003/11/03 07:23:57

  Modified:src/main/org/apache/tools/ant/taskdefs/optional/jdepend Tag:
ANT_16_BRANCH JDependTask.java
  Log:
  Merge from HEAD
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.22.2.1  +29 -18
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.22
  retrieving revision 1.22.2.1
  diff -u -r1.22 -r1.22.2.1
  --- JDependTask.java  19 Jul 2003 11:20:18 -  1.22
  +++ JDependTask.java  3 Nov 2003 15:23:57 -   1.22.2.1
  @@ -515,29 +515,40 @@
   // we have to find a cleaner way to put this output
   }
   
  -// This is deprecated - use classespath in the future
  -String[] sourcesPath = getSourcespath().list();
  -for (int i = 0; i  sourcesPath.length; i++) {
  -File f = new File(sourcesPath[i]);
  +if (getSourcespath() != null) {
  +// This is deprecated - use classespath in the future
  +String[] sourcesPath = getSourcespath().list();
  +for (int i = 0; i  sourcesPath.length; i++) {
  +File f = new File(sourcesPath[i]);
   
  -// not necessary as JDepend would fail, but why loose some time?
  -if (!f.exists() || !f.isDirectory()) {
  -throw new BuildException(\ + f.getPath() + \ does not 
  - + represent a valid directory. 
JDepend would fail.);
  +// not necessary as JDepend would fail, but why loose
  +// some time?
  +if (!f.exists() || !f.isDirectory()) {
  +throw new BuildException(\ + f.getPath() 
  + + \ does not represent a 
valid
  + +  directory. JDepend would
  + +  fail.);
  +}
  +commandline.createArgument().setValue(f.getPath());
   }
  -commandline.createArgument().setValue(f.getPath());
   }
   
  -// This is the new way - use classespath - code is the same for now
  -String[] classesPath = getClassespath().list();
  -for (int i = 0; i  classesPath.length; i++) {
  -File f = new File(classesPath[i]);
  -// not necessary as JDepend would fail, but why loose some time?
  -if (!f.exists() || !f.isDirectory()) {
  -throw new BuildException(\ + f.getPath() + \ does not 
  - + represent a valid directory. 
JDepend would fail.);
  +if (getClassespath() != null) {
  +// This is the new way - use classespath - code is the
  +// same for now
  +String[] classesPath = getClassespath().list();
  +for (int i = 0; i  classesPath.length; i++) {
  +File f = new File(classesPath[i]);
  +// not necessary as JDepend would fail, but why loose
  +// some time?
  +if (!f.exists() || !f.isDirectory()) {
  +throw new BuildException(\ + f.getPath() 
  + + \ does not represent a 
valid
  + +  directory. JDepend would
  + +  fail.);
  +}
  +commandline.createArgument().setValue(f.getPath());
   }
  -commandline.createArgument().setValue(f.getPath());
   }
   
   Execute execute = new Execute(new LogStreamHandler(this,
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2003-04-03 Thread bodewig
bodewig 2003/04/03 07:49:48

  Modified:docs/manual/OptionalTasks jdepend.html
   src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
  Log:
  Apply some reflection to become JDepend version independent
  
  Revision  ChangesPath
  1.10  +1 -1  ant/docs/manual/OptionalTasks/jdepend.html
  
  Index: jdepend.html
  ===
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/jdepend.html,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jdepend.html  2 Apr 2003 12:00:27 -   1.9
  +++ jdepend.html  3 Apr 2003 15:49:47 -   1.10
  @@ -93,7 +93,7 @@
   the paths of compiled class code to analyze; the lt;sourcespathgt;
   variable is still available in case you are using an earlier version
   of JDepend.  The lt;excludegt; element can be used to set packages
  -to ignore./p
  +to ignore (requires JDepend 2.5 or above)./p
   
   h3Examples/h3
   
  
  
  
  1.19  +48 -17
ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java
  
  Index: JDependTask.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend/JDependTask.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JDependTask.java  2 Apr 2003 12:00:27 -   1.18
  +++ JDependTask.java  3 Apr 2003 15:49:48 -   1.19
  @@ -58,6 +58,8 @@
   import java.io.FileWriter;
   import java.io.IOException;
   import java.io.PrintWriter;
  +import java.lang.reflect.Constructor;
  +import java.lang.reflect.Method;
   import java.util.Vector;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.PathTokenizer;
  @@ -104,19 +106,37 @@
   private String format = text;
   private PatternSet defaultPatterns = new PatternSet();
   
  -public JDependTask() {
  +private static Constructor packageFilterC;
  +private static Method setFilter;
   
  +static {
  +try {
  +Class packageFilter = 
  +Class.forName(jdepend.framework.PackageFilter);
  +packageFilterC = 
  +packageFilter.getConstructor(new Class[] 
{java.util.Collection.class});
  +setFilter = 
  +jdepend.textui.JDepend.class.getDeclaredMethod(setFilter,
  +   new Class[] 
{packageFilter});
  +} catch (Throwable t) {
  +if (setFilter == null) {
  +packageFilterC = null;
  +}
  +}
   }
   
  -/*
  -public void setTimeout(Integer value) {
  -_timeout = value;
  +public JDependTask() {
   }
   
  -public Integer getTimeout() {
  -return _timeout;
  -}
  -*/
  +/*
  +  public void setTimeout(Integer value) {
  +  _timeout = value;
  +  }
  +
  +  public Integer getTimeout() {
  +  return _timeout;
  +  }
  +*/
   
   /**
* The output file name.
  @@ -305,9 +325,9 @@
   if (text.equals(format)) {
   commandline.setClassname(jdepend.textui.JDepend);
   } else
  -if (xml.equals(format)) {
  -commandline.setClassname(jdepend.xmlui.JDepend);
  -}
  +if (xml.equals(format)) {
  +commandline.setClassname(jdepend.xmlui.JDepend);
  +}
   
   if (_jvm != null) {
   commandline.setVm(_jvm);
  @@ -443,11 +463,22 @@
   // This bit turns exclude child tags into patters to ignore
   String[] patterns = defaultPatterns.getExcludePatterns(getProject());
   if (patterns != null  patterns.length  0) {
  -Vector v = new Vector();
  -for (int i = 0; i  patterns.length; i++) {
  -v.addElement(patterns[i]);
  +if (setFilter != null) {
  +Vector v = new Vector();
  +for (int i = 0; i  patterns.length; i++) {
  +v.addElement(patterns[i]);
  +}
  +try {
  +Object o = packageFilterC.newInstance(new Object[] {v});
  +setFilter.invoke(jdepend, new Object[] {o});
  +} catch (Throwable e) {
  +log(excludes will be ignored as JDepend doesn't like 
me: 
  ++ e.getMessage(), Project.MSG_WARN);
  +}
  +} else {
  +log(Sorry, your version of JDepend doesn't support 
excludes,
  +Project.MSG_WARN);
   }
  -jdepend.setFilter(new jdepend.framework.PackageFilter(v));
   }
   
   jdepend.analyze();
  @@ -493,7 +524,7 @@
   // not necessary as JDepend would fail, but why loose some 

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/jdepend JDependTask.java

2003-04-02 Thread bodewig
bodewig 2003/04/02 04:00:27

  Modified:.WHATSNEW
   docs/manual/OptionalTasks jdepend.html
   src/main/org/apache/tools/ant/taskdefs/optional/jdepend
JDependTask.java
  Log:
  Add classespath nested element to mirror sourcespath but point to
  compiled classes.
  
  Add exclude nested element to conditionally exclude packages from
  being parsed.
  
  PR: 17134
  Submitted by: Bob Hays electricbob at alephnaught dot com
  
  Revision  ChangesPath
  1.384 +6 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.383
  retrieving revision 1.384
  diff -u -r1.383 -r1.384
  --- WHATSNEW  1 Apr 2003 14:44:00 -   1.383
  +++ WHATSNEW  2 Apr 2003 12:00:27 -   1.384
  @@ -202,6 +202,12 @@
   * junit has a new attribute tempdir that controls the placement of
 temporary files.  Bugzilla Report 15454.
   
  +* jdepend now supports a new nested element classespath which is
  +  the same as sourcespath but point to compiled classes (the
  +  prefered mode of operation for JDepend  2.5).  Additionally, nested
  +  exclude elements can be used to exclude certain packages from
  +  being parsed.  Bugzilla Report 17134.
  +
   Changes from Ant 1.5.2 to Ant 1.5.3
   ===
   
  
  
  
  1.9   +44 -15ant/docs/manual/OptionalTasks/jdepend.html
  
  Index: jdepend.html
  ===
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/jdepend.html,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jdepend.html  4 Sep 2002 11:05:18 -   1.8
  +++ jdepend.html  2 Apr 2003 12:00:27 -   1.9
  @@ -19,14 +19,15 @@
   It allows to quot;automatically measure the quality of a design in terms of 
its extensibility, reusability, and maintainability to
   effectively manage and control package dependencies.quot;/P
   
  -pSource file directories are defined by nested 
codelt;sourcespathgt;/code, see a href=#nestednested elements/a./p
  +pSource file directories are defined by nested
  +codelt;sourcespathgt;/code; Class file directories are defined
  +by nested codelt;classesespathgt;/code, see a
  +href=#nestednested elements/a./p
   
   pOptionally, you can also set the codeoutputfile/code name where the 
output is stored. By default the task writes its report to the standard 
output./P
   
   p The task requires at least the JDepend 1.2 version. /p
   
  -PNote: whereas the JDepend tool can be customized to exclude some 
packages, the current jdepend And Task does not have parameters to allow these 
exclusions. Read JDepend specific documentation for that purpose./P
  -
   h3Parameters/h3
   
   table BORDER=1 CELLSPACING=0 CELLPADDING=2 
  @@ -79,26 +80,37 @@
   
   h3a name=nestedNested Elements/a/h3
   
  -pcodejdepend/code supports two nested elements 
codelt;classpathgt;/code and codelt;sourcespathgt;/code,
  -that represent a href=../using.html#pathPATH like structures/a./p
  -
  -pcodelt;sourcespathgt;/code is used to define the paths of the 
source code to analyze./p
  +pcodejdepend/code supports four nested elements:
  +codelt;classpathgt;, lt;classespathgt; /code and
  +codelt;sourcespathgt;/code, that represent a
  +href=../using.html#pathPATH like structures/a, and
  +codelt;excludegt;/code./p
  +
  +pcodelt;sourcespathgt;/code is used to define the paths of the
  +source code to analyze, but it is deprecated. With version 2.5 of
  +JDepend, only class files are analyzed. The nested element
  +lt;classespathgt; replaces lt;sourcespathgt; and is used to define
  +the paths of compiled class code to analyze; the lt;sourcespathgt;
  +variable is still available in case you are using an earlier version
  +of JDepend.  The lt;excludegt; element can be used to set packages
  +to ignore./p
   
   h3Examples/h3
   
   blockquote
   pre
   lt;jdepend classpathref=base.pathgt;
  -nbsp;nbsp;nbsp; lt;sourcespathgt;
  -nbsp;nbsp;nbsp; nbsp;nbsp;nbsp; lt;pathelement location=src/gt;
  -nbsp;nbsp;nbsp; lt;/sourcespathgt;
  +nbsp;nbsp;nbsp; lt;classespathgt;
  +nbsp;nbsp;nbsp; nbsp;nbsp;nbsp; lt;pathelement location=build/gt;
  +nbsp;nbsp;nbsp; lt;/classespathgt;
   lt;/jdependgt;
   
   /pre
   /blockquote
   
  -This invokes JDepend on the codesrc/code directory, writing the output 
on the standard output.
  -The classpath is defined using a classpath reference.
  +pThis invokes JDepend on the codebuild/code directory, writing
  +the output on the standard output. The classpath is defined using a
  +classpath reference./p
   
   blockquote
   pre
  @@ -111,15 +123,32 @@
   nbsp;nbsp;nbsp; nbsp;nbsp;nbsp; lt;pathelement 
location=lib/jdepend.jar/gt;
   nbsp;nbsp;nbsp; lt;/classpathgt;
   lt;/jdependgt;
  +/pre
  +/blockquote
  +
  +pThis invokes JDepend in a separate VM on the