Author: austen.ito
Date: Tue Oct 30 02:51:41 2007
New Revision: 117
Added:
trunk/lib/svn/
- copied from r116, /branches/v8_svn_port/lib/svn/
trunk/lib/svn/javasvn.jar
- copied unchanged from r116, /branches/v8_svn_port/lib/svn/javasvn.jar
trunk/lib/svn/javasvn.license.txt
- copied unchanged from r116, /branches/v8_svn_port/lib/svn/javasvn.license.txt
trunk/lib/vcs/
- copied from r116, /branches/v8_svn_port/lib/vcs/
trunk/lib/vcs/JRCS.jar
- copied unchanged from r116, /branches/v8_svn_port/lib/vcs/JRCS.jar
trunk/src/org/hackystat/sensor/ant/svn/
- copied from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/
trunk/src/org/hackystat/sensor/ant/svn/CommitRecord.java
- copied, changed from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/CommitRecord.java
trunk/src/org/hackystat/sensor/ant/svn/CommitRecordEntry.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/CommitRecordEntry.ja va
trunk/src/org/hackystat/sensor/ant/svn/SVNCommitProcessor.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/SVNCommitProcessor.j ava
trunk/src/org/hackystat/sensor/ant/svn/SvnSensor.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/SvnSensor.java
trunk/src/org/hackystat/sensor/ant/svn/TestAll.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/TestAll.java
trunk/src/org/hackystat/sensor/ant/svn/package.html
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/package.html
trunk/src/org/hackystat/sensor/vcs/
- copied from r116, /branches/v8_svn_port/src/org/hackystat/sensor/vcs/
trunk/src/org/hackystat/sensor/vcs/GenericDiffCounter.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/vcs/GenericDiffCounter.java
trunk/src/org/hackystat/sensor/vcs/GenericSizeCounter.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/vcs/GenericSizeCounter.java
trunk/src/org/hackystat/sensor/vcs/TestGenericSizeCounter.java
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/vcs/TestGenericSizeCounter.j ava
trunk/src/org/hackystat/sensor/vcs/package.html
- copied unchanged from r116, /branches/v8_svn_port/src/org/hackystat/sensor/vcs/package.html
Removed:
trunk/testdata/pmd/pmd3.xml
trunk/testdata/pmd/src/
Modified:
trunk/ (props changed)
trunk/.classpath
trunk/.project
trunk/antSensorTest.build.xml
trunk/build.xml
trunk/jar.build.xml
trunk/jaxb.build.xml
trunk/pmd.build.xml
trunk/src/org/hackystat/sensor/ant/antbuild/BuildSensorAntListener.java
trunk/src/org/hackystat/sensor/ant/checkstyle/CheckstyleSensor.java
trunk/src/org/hackystat/sensor/ant/checkstyle/TestCheckstyleSensor.java
trunk/src/org/hackystat/sensor/ant/pmd/PmdSensor.java
trunk/src/org/hackystat/sensor/ant/pmd/TestPmdSensor.java
trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/File.java
trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/ObjectFactory.java
trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Pmd.java
trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Violation.java
trunk/testdata/pmd/pmd.xml
trunk/xml/antlib/antlib.xml
trunk/xml/schema/pmd.xsd
Log:
Merged Subversion sensor code to the main line.
Modified: trunk/.classpath
=========================================================================== ===
--- trunk/.classpath (original)
+++ trunk/.classpath Tue Oct 30 02:51:41 2007
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry path="src" kind="src"/>
- <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/>
- <classpathentry sourcepath="/HACKYSTAT_SENSORSHELL_HOME/src"
path="HACKYSTAT_SENSORSHELL_HOME/sensorshell.jar" kind="var"/>
- <classpathentry path="ANT_HOME/lib/ant.jar" kind="var"/>
- <classpathentry path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4" kind="con"/>
- <classpathentry path="HACKYSTAT_UTILITIES_HOME/tstamp.lib.jar" kind="var"/>
- <classpathentry path="build/classes" kind="output"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var"
path="HACKYSTAT_SENSORSHELL_HOME/sensorshell.jar" sourcepath="/SENSOR_BASE_HOME/src"/>
+ <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="var" path="HACKYSTAT_UTILITIES_HOME/tstamp.lib.jar"/>
+ <classpathentry kind="lib" path="lib/svn/javasvn.jar"/>
+ <classpathentry kind="lib" path="lib/vcs/JRCS.jar"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/.project
=========================================================================== ===
--- trunk/.project (original)
+++ trunk/.project Tue Oct 30 02:51:41 2007
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>hackystat-sensor-ant</name>
+ <name>AntSensors</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/antSensorTest.build.xml
=========================================================================== ===
--- trunk/antSensorTest.build.xml (original)
+++ trunk/antSensorTest.build.xml Tue Oct 30 02:51:41 2007
@@ -39,14 +39,8 @@
<target name="test.pmd.sensor" description="Sends PMD CodeIssue data
to Hackystat using the PMD sensor.">
<!-- Send PMD data to Hackystat. -->
- <hacky-pmd verbose="false" sourcePath="${testdata.dir}/pmd/src">
+ <hacky-pmd verbose="false">
<fileset file="${testdata.dir}/pmd/pmd.xml"/>
- <sourcePath>
- <fileset dir="${testdata.dir}/pmd/src">
- <include name="**/*.java"/>
- <exclude name="**/jaxb/**"/>
- </fileset>
- </sourcePath>
</hacky-pmd>
</target>
Modified: trunk/build.xml
=========================================================================== ===
--- trunk/build.xml (original)
+++ trunk/build.xml Tue Oct 30 02:51:41 2007
@@ -60,6 +60,7 @@
<fileset file="${env.FINDBUGS_HOME}/lib/annotations.jar"/>
<fileset file="${env.HACKYSTAT_SENSORSHELL_HOME}/sensorshell.jar"/>
<fileset file="${env.HACKYSTAT_UTILITIES_HOME}/tstamp.lib.jar"/>
+ <fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<target name="compile" description="Compiles the code.">
Modified: trunk/jar.build.xml
=========================================================================== ===
--- trunk/jar.build.xml (original)
+++ trunk/jar.build.xml Tue Oct 30 02:51:41 2007
@@ -23,8 +23,13 @@
<unjar src="${env.HACKYSTAT_SENSORSHELL_HOME}/sensorshell.jar" dest="${tmp.dir}"/>
<unjar src="${env.HACKYSTAT_UTILITIES_HOME}/tstamp.lib.jar" dest="${tmp.dir}"/>
-
- <jar destfile="${basedir}/antsensors.jar" basedir="${tmp.dir}">
+ <unjar dest="${tmp.dir}">
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </unjar>
+
+ <jar destfile="${basedir}/antsensors.jar" basedir="${tmp.dir}">
<manifest>
<attribute name="Implementation-Title" value="AntSensors"/>
<attribute name="Implementation-Version" value="${version}"/>
Modified: trunk/jaxb.build.xml
=========================================================================== ===
--- trunk/jaxb.build.xml (original)
+++ trunk/jaxb.build.xml Tue Oct 30 02:51:41 2007
@@ -3,17 +3,20 @@
Supports JAXB binding process (creation of Java classes from the
XmlSchema documents.)
</description>
- <!-- import file="build.xml"/ -->
+ <import file="build.xml"/>
<property environment="env"/>
- <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"/>
+ <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
+ <classpath>
+ <fileset dir="${env.JAXB_HOME}/lib" includes="*.jar" />
+ </classpath>
+ </taskdef>
<target name="jaxb" description="Runs the XJC compiler.">
-
<xjc schema="${basedir}/xml/schema/junit.xsd" destdir="src" package="org.hackystat.sensor.ant.junit.resource.jaxb"/>
<xjc schema="${basedir}/xml/schema/emma.xsd" destdir="src" package="org.hackystat.sensor.ant.emma.resource.jaxb"/>
<xjc schema="${basedir}/xml/schema/findbugs.xsd" destdir="src" package="org.hackystat.sensor.ant.findbugs.resource.jaxb"/>
- <xjc schema="${basedir}/xml/schema/checkstyle.xsd" destdir="src" package="org.hackystat.sensor.ant.checkstyle.resource.jaxb"/>
+ <xjc schema="${basedir}/xml/schema/checkstyle.xsd" destdir="src" package="org.hackystat.sensor.ant.checkstyle.resource.jaxb"/>
<xjc schema="${basedir}/xml/schema/pmd.xsd" destdir="src" package="org.hackystat.sensor.ant.pmd.resource.jaxb"/>
</target>
</project>
Modified: trunk/pmd.build.xml
=========================================================================== ===
--- trunk/pmd.build.xml (original)
+++ trunk/pmd.build.xml Tue Oct 30 02:51:41 2007
@@ -47,9 +47,6 @@
<hackystat:hacky-pmd verbose="${hackystat.verbose.mode}">
<fileset file="${pmd.dir}/pmd.xml"/>
- <sourcePath>
- <fileset dir="${src.dir}" includes="**/*.java" excludes="**/jaxb/**"/>
- </sourcePath>
</hackystat:hacky-pmd>
</target>
Modified: trunk/src/org/hackystat/sensor/ant/antbuild/BuildSensorAntListener.java
=========================================================================== ===
---
trunk/src/org/hackystat/sensor/ant/antbuild/BuildSensorAntListener.java (original)
+++
trunk/src/org/hackystat/sensor/ant/antbuild/BuildSensorAntListener.java
Tue Oct 30 02:51:41 2007
@@ -11,6 +11,7 @@
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildListener;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.hackystat.sensor.ant.util.LongTimeConverter;
import org.hackystat.sensorshell.SensorProperties;
@@ -114,6 +115,8 @@
*/
public void buildFinished(BuildEvent buildEvent) {
long endTimeMillis = System.currentTimeMillis();
+ Project project = (Project) buildEvent.getSource();
+ System.out.println("Base Dir: " + project.getBaseDir());
String workingDirectory = buildEvent.getProject().getBaseDir().getAbsolutePath();
Map<String, String> keyValMap = new TreeMap<String, String>();
@@ -172,6 +175,7 @@
* @param buildEvent The build event object.
*/
public void targetFinished(BuildEvent buildEvent) {
+// System.out.println("target finished=" + buildEvent);
String targetName = buildEvent.getTarget().getName();
this.logDebugMessage("TargetFinished - " + targetName);
@@ -208,6 +212,7 @@
* @param buildEvent The build event object.
*/
public void taskFinished(BuildEvent buildEvent) {
+ System.out.println("");
String taskName = buildEvent.getTask().getTaskName();
this.logDebugMessage("TaskFinished - " + taskName + "; error = "
+ (buildEvent.getException() != null));
Modified: trunk/src/org/hackystat/sensor/ant/checkstyle/CheckstyleSensor.java
=========================================================================== ===
--- trunk/src/org/hackystat/sensor/ant/checkstyle/CheckstyleSensor.java (original)
+++ trunk/src/org/hackystat/sensor/ant/checkstyle/CheckstyleSensor.java
Tue Oct 30 02:51:41 2007
@@ -196,7 +196,7 @@
System.out.println("No data to send.");
}
else {
- System.out.println("Failed to send Checkstyle data.");
+ System.out.println("Failed to send Hackystat Code Issue data.");
}
}
@@ -229,36 +229,20 @@
List<org.hackystat.sensor.ant.checkstyle.resource.jaxb.File>
checkedFiles = checkstyle
.getFile();
- int codeIssueCount = 0;
+ // TODO when zero data is implemented this should count entries sent
+ int errorCount = 0;
for (org.hackystat.sensor.ant.checkstyle.resource.jaxb.File
file : checkedFiles) {
// Fully qualified name of the file checked
String fileName = file.getName();
- // Base unique timestamp off of the runtime (which is when it
start running)
- long uniqueTstamp = this.tstampSet.getUniqueTstamp(this.runtime);
-
- // Get altered time as XMLGregorianCalendar
- XMLGregorianCalendar uniqueTstampGregorian = LongTimeConverter
- .convertLongToGregorian(uniqueTstamp);
-
-
// gets all error elements for the file
List<Error> errors = file.getError();
-
+
+ // TODO take zero data into account and remove this
if (errors.isEmpty()) {
- // this resource has no errors, just send required information
- Map<String, String> keyValMap = new HashMap<String, String>();
- keyValMap.put("Tool", "Checkstyle");
- keyValMap.put("SensorDataType", "CodeIssue");
- keyValMap.put("Timestamp", uniqueTstampGregorian.toString());
- keyValMap.put("Runtime", runtimeGregorian.toString());
- keyValMap.put("Resource", fileName);
- this.sensorShell.add(keyValMap);
- codeIssueCount++;
continue;
}
- // file has errors, send one entry per error
for (Error error : errors) {
int line = error.getLine();
String errorMessage = error.getMessage();
@@ -266,16 +250,24 @@
String source = error.getSource();
Integer column = error.getColumn(); // not all errors will
have a column
- // required
+ // Base unique timestamp off of the runtime (which is when
it start running)
+ long uniqueTstamp = this.tstampSet.getUniqueTstamp(this.runtime);
+
+ // Get altered time as XMLGregorianCalendar
+ XMLGregorianCalendar uniqueTstampGregorian = LongTimeConverter
+ .convertLongToGregorian(uniqueTstamp);
+
Map<String, String> keyValMap = new HashMap<String, String>();
keyValMap.put("Tool", "Checkstyle");
keyValMap.put("SensorDataType", "CodeIssue");
+
+ // Required
keyValMap.put("Timestamp", uniqueTstampGregorian.toString());
keyValMap.put("Runtime", runtimeGregorian.toString());
keyValMap.put("Resource", fileName);
-
- // add information about the error to the mapping
keyValMap.put("Type", source);
+
+ // Optional
keyValMap.put("Line", String.valueOf(line));
keyValMap.put("Severity", severity);
keyValMap.put("Message", errorMessage);
@@ -283,10 +275,11 @@
keyValMap.put("Column", String.valueOf(column));
}
this.sensorShell.add(keyValMap);
- codeIssueCount++;
+ errorCount++;
}
}
- return codeIssueCount;
+ // TODO this should return the number of issues and zero data entries
+ return errorCount;
}
catch (Exception e) {
throw new BuildException("Failed to process " + fileNameString
+ " " + e);
Modified: trunk/src/org/hackystat/sensor/ant/checkstyle/TestCheckstyleSensor.java
=========================================================================== ===
---
trunk/src/org/hackystat/sensor/ant/checkstyle/TestCheckstyleSensor.java (original)
+++
trunk/src/org/hackystat/sensor/ant/checkstyle/TestCheckstyleSensor.java
Tue Oct 30 02:51:41 2007
@@ -90,6 +90,6 @@
File.separator + fileName);
}
}
- assertEquals("Should have 15 issues.", 15, codeIssues);
+ assertEquals("Should have 9 issues.", 9, codeIssues);
}
}
Modified: trunk/src/org/hackystat/sensor/ant/pmd/PmdSensor.java
=========================================================================== ===
--- trunk/src/org/hackystat/sensor/ant/pmd/PmdSensor.java (original)
+++ trunk/src/org/hackystat/sensor/ant/pmd/PmdSensor.java Tue Oct 30
02:51:41 2007
@@ -4,11 +4,9 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
@@ -19,8 +17,6 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Reference;
import org.hackystat.sensor.ant.pmd.resource.jaxb.ObjectFactory;
import org.hackystat.sensor.ant.pmd.resource.jaxb.Pmd;
import org.hackystat.sensor.ant.pmd.resource.jaxb.Violation;
@@ -43,12 +39,6 @@
/** The list of all XML file sets generated by the Pmd task. */
private ArrayList<FileSet> filesets;
-
- /** The path of the source code PMD analyzed. */
- private Path sourcePath = null;
-
- /** The list of source files analyzed by PMD. */
- private ArrayList<FileSet> sourceFileSets;
/** Whether or not to print out messages during pmd send. */
private boolean verbose = false;
@@ -74,7 +64,6 @@
/** Initialize a new instance of a PmdSensor. */
public PmdSensor() {
this.filesets = new ArrayList<FileSet>();
- this.sourceFileSets = new ArrayList<FileSet>();
this.tstampSet = new TstampSet();
this.runtime = new Date().getTime();
}
@@ -92,7 +81,6 @@
this.sensorProps = new SensorProperties(host, email, password);
this.sensorShell = new SensorShell(sensorProps, false, "test", false);
this.filesets = new ArrayList<FileSet>();
- this.sourceFileSets = new ArrayList<FileSet>();
this.tstampSet = new TstampSet();
this.runtime = new Date().getTime();
}
@@ -120,41 +108,6 @@
this.toolAccount = toolAccount;
}
- /**
- * Sets the path for the source code PMD analyzed.
- *
- * @param src The path containing source code.
- */
- public void setSourcePath(Path src) {
- if (this.sourcePath == null) {
- this.sourcePath = src;
- }
- else {
- this.sourcePath.append(src);
- }
- }
-
- /**
- * Initializes the source path if it has not already been initialized.
- *
- * @return Returns the create path.
- */
- public Path createSourcePath() {
- if (this.sourcePath == null) {
- this.sourcePath = new Path(getProject());
- }
- return this.sourcePath.createPath();
- }
-
- /**
- * Sets a source path using refid.
- *
- * @param r The reference to the source path.
- */
- public void setSourcePathRef(Reference r) {
- this.createSourcePath().setRefid(r);
- }
-
/**
* Set the verbose attribute to "on", "true", or "yes" to enable
trace messages
* while the Pmd sensor is running.
@@ -276,29 +229,16 @@
JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
- Set<String> allSourceFiles = this.getAllSourceFiles();
- Set<String> filesWithViolations = new HashSet<String>();
-
Pmd pmdResults = (Pmd) unmarshaller.unmarshal(xmlFile);
List<org.hackystat.sensor.ant.pmd.resource.jaxb.File> files = pmdResults.getFile();
int codeIssueCount = 0;
for (org.hackystat.sensor.ant.pmd.resource.jaxb.File file :
files) {
- // derive the full path name from the file name
String fileName = file.getName();
- String fullFilePath = this.findSrcFile(allSourceFiles, fileName);
- filesWithViolations.add(fullFilePath);
-
List<Violation> violations = file.getViolation();
for (Violation violation : violations) {
- // PMD 3.9 and earlier
Integer line = violation.getLine();
-
- // PMD 4.0
- Integer beginLine = violation.getBeginline();
- Integer beginColumn = violation.getBegincolumn();
-
String rule = violation.getRule();
String ruleset = violation.getRuleset();
String packageName = violation.getPackage();
@@ -306,7 +246,7 @@
String className = violation.getClazz(); // XJC did this not me
String methodName = violation.getMethod();
- // Base unique timestamp off of the runtime (which is when
it started running)
+ // Base unique timestamp off of the runtime (which is when
it start running)
long uniqueTstamp = this.tstampSet.getUniqueTstamp(this.runtime);
// Get altered time as XMLGregorianCalendar
@@ -320,10 +260,11 @@
// Required
keyValMap.put("Timestamp", uniqueTstampGregorian.toString());
keyValMap.put("Runtime", runtimeGregorian.toString());
- keyValMap.put("Resource", fullFilePath);
+ keyValMap.put("Resource", fileName);
+ keyValMap.put("Type", rule);
// Optional
- keyValMap.put("Type", rule);
+ keyValMap.put("Line", line.toString());
keyValMap.put("Ruleset", ruleset);
keyValMap.put("PackageName", packageName);
keyValMap.put("Priority", priority.toString());
@@ -333,46 +274,10 @@
if (methodName != null) {
keyValMap.put("MethodName", methodName);
}
- if (line == null) {
- // indicates that this is PMD 4.0, use begin line
- keyValMap.put("Line", beginLine.toString());
- }
- else {
- // indicates PMD 3.9
- keyValMap.put("Line", line.toString());
- }
- if (beginColumn != null) {
- // only in PMD 4.0
- keyValMap.put("Column", beginColumn.toString());
- }
-
- this.sensorShell.add(keyValMap); // add data to sensorshell
+ this.sensorShell.add(keyValMap);
codeIssueCount++;
}
}
-
- //process the zero issues
- allSourceFiles.removeAll(filesWithViolations);
- for (String srcFile : allSourceFiles) {
- // Alter startTime to guarantee uniqueness.
- long uniqueTstamp = this.tstampSet.getUniqueTstamp(this.runtime);
-
- // Get altered time as XMLGregorianCalendar
- XMLGregorianCalendar uniqueTstampGregorian = LongTimeConverter
- .convertLongToGregorian(uniqueTstamp);
-
- Map<String, String> keyValMap = new HashMap<String, String>();
- keyValMap.put("Tool", "PMD");
- keyValMap.put("SensorDataType", "CodeIssue");
-
- // Required
- keyValMap.put("Timestamp", uniqueTstampGregorian.toString());
- keyValMap.put("Runtime", runtimeGregorian.toString());
- keyValMap.put("Resource", srcFile);
- this.sensorShell.add(keyValMap); // add data to sensorshell
- codeIssueCount++;
- }
-
return codeIssueCount;
}
catch (Exception e) {
@@ -381,31 +286,6 @@
}
/**
- * Finds the full file path of the source path within the src files
collection. For example,
- * srcFiles could contain: [c:\foo\src\org\Foo.java,
c:\foo\src\org\Bar.java] and the
- * sourcePath could be org\Foo.java. This method will find and
return the full path of the
- * Foo.java file.
- * @param srcFiles Contains the full path to the files.
- * @param sourcePath Contains a trimmed version of a file path.
- * @return The full file path, or null if the path is not found.
- */
- private String findSrcFile(Set<String> srcFiles, String sourcePath) {
- for (String srcFile : srcFiles) {
- if (srcFile == null) {
- continue;
- }
- String alteredSourcePath = sourcePath;
- if (srcFile.contains("\\")) {
- alteredSourcePath = sourcePath.replace('/', '\\');
- }
- if (srcFile != null && srcFile.contains(alteredSourcePath)) {
- return srcFile;
- }
- }
- return null;
- }
-
- /**
* Gets whether or not this sensor instance is using a mapping in
the UserMap.
*
* @return Returns true of the tool and tool account are set,
otherwise false.
@@ -414,6 +294,7 @@
return (this.tool != null && this.toolAccount != null);
}
+
/**
* Add a file set which contains the Pmd report xml file to be processed.
* Invoked automatically by Ant.
@@ -422,15 +303,6 @@
public void addFileSet(FileSet fs) {
filesets.add(fs);
}
-
- /**
- * Add a file set which contains the source code PMD analyzed.
- * Invoked automatically by Ant.
- * @param fs The new file set of source files.
- */
- public void addSourceFileSet(FileSet fs) {
- this.sourceFileSets.add(fs);
- }
/**
* Get all of the files in the file set.
@@ -453,22 +325,5 @@
}
}
return fileList;
- }
-
- /**
- * Gets all files specified by the user specified source path.
- *
- * @return Returns a set of all fully qualified source files.
- */
- private Set<String> getAllSourceFiles() {
- Set<String> sourceFiles = new HashSet<String>();
- String[] files = this.sourcePath.list();
- for (int i = 0; i < files.length; i++) {
- String path = files[i];
- if (new File(path).isFile()) {
- sourceFiles.add(path);
- }
- }
- return sourceFiles;
}
}
Modified: trunk/src/org/hackystat/sensor/ant/pmd/TestPmdSensor.java
=========================================================================== ===
--- trunk/src/org/hackystat/sensor/ant/pmd/TestPmdSensor.java (original)
+++ trunk/src/org/hackystat/sensor/ant/pmd/TestPmdSensor.java Tue Oct
30 02:51:41 2007
@@ -5,9 +5,6 @@
import junit.framework.TestCase;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
import org.hackystat.sensorbase.client.SensorBaseClient;
import org.hackystat.sensorbase.resource.sensordata.jaxb.SensorDataIndex;
import org.hackystat.sensorbase.resource.sensordata.jaxb.SensorDataRef;
@@ -52,39 +49,28 @@
// Now delete the user too.
client.deleteUser(user);
}
-
+
/**
* Tests PmdSensor by processing some test pmd files. This test case
does not
- * check that the server received the data, s long as we can send
the data
+ * check that the server recieved the data, s long as we can send
the data
* then we assume everything is ok.
* @throws Exception If a program occurs.
*/
public void testPmdSensorOnTestDataSetFiles() throws Exception {
- String testFileDirPath = System.getProperty("pmdtestfiles");
-
PmdSensor sensor = new PmdSensor(host, user, user);
sensor.setVerbose("on");
- sensor.setProject(new Project());
- Path path = sensor.createSourcePath();
- FileSet fileSet = new FileSet();
- fileSet.setDir(new File(testFileDirPath + "/src"));
- fileSet.setExcludes("**/jaxb/**");
- fileSet.setIncludes("**/*.java");
- fileSet.setProject(path.getProject());
- path.addFileset(fileSet);
- sensor.setSourcePath(path);
-
+ String testFileDirPath = System.getProperty("pmdtestfiles");
File directory = new File(testFileDirPath);
if (!directory.isDirectory()) {
fail("cannot find pmd test files");
}
File[] files = directory.listFiles();
- // create a file filter that only accepts pmd.xml
+ // create a file filter that only accepts xml files
FileFilter filter = new FileFilter() {
public boolean accept(File pathname) {
- if ("pmd.xml".equals(pathname.getName())) {
+ if (pathname.getName().endsWith(".xml")) {
return true;
}
return false;
@@ -98,7 +84,7 @@
// Process the file and send it.
int count = sensor.processIssueXmlFile(directory.getCanonicalPath()
+ File.separator + fileName);
- assertEquals("Checkin number of CodeIssue entries", 10, count);
+ assertEquals("checking number of issues", 56, count);
}
}
}
Modified: trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/File.java
=========================================================================== ===
--- trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/File.java (original)
+++ trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/File.java Tue
Oct 30 02:51:41 2007
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of
the source schema.
-// Generated on: 2007.10.28 at 12:28:25 AM GMT
+// Generated on: 2007.10.14 at 11:10:45 AM HST
//
Modified: trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/ObjectFactory.java
=========================================================================== ===
---
trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/ObjectFactory.java (original)
+++
trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/ObjectFactory.java
Tue Oct 30 02:51:41 2007
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of
the source schema.
-// Generated on: 2007.10.28 at 12:28:25 AM GMT
+// Generated on: 2007.10.14 at 11:10:45 AM HST
//
@@ -37,14 +37,6 @@
}
/**
- * Create an instance of {@link File }
- *
- */
- public File createFile() {
- return new File();
- }
-
- /**
* Create an instance of {@link Pmd }
*
*/
@@ -58,6 +50,14 @@
*/
public Violation createViolation() {
return new Violation();
+ }
+
+ /**
+ * Create an instance of {@link File }
+ *
+ */
+ public File createFile() {
+ return new File();
}
}
Modified: trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Pmd.java
=========================================================================== ===
--- trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Pmd.java (original)
+++ trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Pmd.java Tue
Oct 30 02:51:41 2007
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of
the source schema.
-// Generated on: 2007.10.28 at 12:28:25 AM GMT
+// Generated on: 2007.10.14 at 11:10:45 AM HST
//
Modified: trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Violation.java
=========================================================================== ===
--- trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Violation.java (original)
+++ trunk/src/org/hackystat/sensor/ant/pmd/resource/jaxb/Violation.java
Tue Oct 30 02:51:41 2007
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of
the source schema.
-// Generated on: 2007.10.28 at 12:28:25 AM GMT
+// Generated on: 2007.10.14 at 11:10:45 AM HST
//
@@ -24,14 +24,10 @@
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="begincolumn"
type="{http://www.w3.org/2001/XMLSchema}int" />
- * <attribute name="beginline"
type="{http://www.w3.org/2001/XMLSchema}int" />
- * <attribute name="class"
type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="endcolumn"
type="{http://www.w3.org/2001/XMLSchema}int" />
- * <attribute name="endline"
type="{http://www.w3.org/2001/XMLSchema}int" />
- * <attribute name="externalInfoUrl"
type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="line"
type="{http://www.w3.org/2001/XMLSchema}int" />
- * <attribute name="method"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="class"
type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * <attribute name="externalInfoUrl"
type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ * <attribute ref="{}line"/>
+ * <attribute name="method"
type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
* <attribute ref="{}package"/>
* <attribute ref="{}priority"/>
* <attribute ref="{}rule"/>
@@ -48,17 +44,9 @@
@XmlRootElement(name = "violation")
public class Violation {
- @XmlAttribute
- protected Integer begincolumn;
- @XmlAttribute
- protected Integer beginline;
@XmlAttribute(name = "class")
protected String clazz;
@XmlAttribute
- protected Integer endcolumn;
- @XmlAttribute
- protected Integer endline;
- @XmlAttribute
protected String externalInfoUrl;
@XmlAttribute
protected Integer line;
@@ -74,54 +62,6 @@
protected String ruleset;
/**
- * Gets the value of the begincolumn property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
- */
- public Integer getBegincolumn() {
- return begincolumn;
- }
-
- /**
- * Sets the value of the begincolumn property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
- */
- public void setBegincolumn(Integer value) {
- this.begincolumn = value;
- }
-
- /**
- * Gets the value of the beginline property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
- */
- public Integer getBeginline() {
- return beginline;
- }
-
- /**
- * Sets the value of the beginline property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
- */
- public void setBeginline(Integer value) {
- this.beginline = value;
- }
-
- /**
* Gets the value of the clazz property.
*
* @return
@@ -143,54 +83,6 @@
*/
public void setClazz(String value) {
this.clazz = value;
- }
-
- /**
- * Gets the value of the endcolumn property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
- */
- public Integer getEndcolumn() {
- return endcolumn;
- }
-
- /**
- * Sets the value of the endcolumn property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
- */
- public void setEndcolumn(Integer value) {
- this.endcolumn = value;
- }
-
- /**
- * Gets the value of the endline property.
- *
- * @return
- * possible object is
- * {@link Integer }
- *
- */
- public Integer getEndline() {
- return endline;
- }
-
- /**
- * Sets the value of the endline property.
- *
- * @param value
- * allowed object is
- * {@link Integer }
- *
- */
- public void setEndline(Integer value) {
- this.endline = value;
}
/**
Copied: trunk/src/org/hackystat/sensor/ant/svn/CommitRecord.java (from
r116, /branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/CommitRecord.java)
=========================================================================== ===
---
/branches/v8_svn_port/src/org/hackystat/sensor/ant/svn/CommitRecord.java (original)
+++ trunk/src/org/hackystat/sensor/ant/svn/CommitRecord.java Tue Oct 30
02:51:41 2007
@@ -182,6 +182,15 @@
}
/**
+ * Returns the string representation of this record.
+ * @return the string representation.
+ */
+ public String toString() {
+ return "Author=" + this.getAuthor() + ", Message=" +
this.getMessage() + ", CommitTime="
+ + this.getCommitTime();
+ }
+
+ /**
* Gets all changed items in this revision.
*
* @return A collection of <code>CommitRecordEntry</code> instances.
Modified: trunk/testdata/pmd/pmd.xml
=========================================================================== ===
--- trunk/testdata/pmd/pmd.xml (original)
+++ trunk/testdata/pmd/pmd.xml Tue Oct 30 02:51:41 2007
@@ -1,33 +1,183 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pmd version="4.0" timestamp="2007-10-26T09:27:28.855">
-<file name="edu/hawaii/stack/ClearStack.java">
-<violation beginline="4" endline="4" begincolumn="1" endcolumn="20"
rule="UnusedImports" ruleset="Import Statement Rules"
package="edu.hawaii.stack"
externalInfoUrl="http://pmd.sourceforge.net/rules/imports.html#UnusedImports" priority="4">
-Avoid unused imports such as 'java.io.File'
-</violation>
-</file>
-<file name="edu/hawaii/stack/TestClearStack.java">
-<violation beginline="18" endline="18" begincolumn="19" endcolumn="21"
rule="ImmutableField" ruleset="Design Rules" package="edu.hawaii.stack"
class="TestClearStack" variable="ONE"
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#ImmutableField" priority="3">
-Private field 'ONE' could be made final; it is only initialized in the
declaration or constructor.
-</violation>
-<violation beginline="19" endline="19" begincolumn="19" endcolumn="21"
rule="ImmutableField" ruleset="Design Rules" package="edu.hawaii.stack"
class="TestClearStack" variable="TWO"
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#ImmutableField" priority="3">
-Private field 'TWO' could be made final; it is only initialized in the
declaration or constructor.
-</violation>
-<violation beginline="20" endline="20" begincolumn="19" endcolumn="23"
rule="ImmutableField" ruleset="Design Rules" package="edu.hawaii.stack"
class="TestClearStack" variable="THREE"
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#ImmutableField" priority="3">
-Private field 'THREE' could be made final; it is only initialized in
the declaration or constructor.
-</violation>
-<violation beginline="38" endline="38" begincolumn="5" endcolumn="14"
rule="JUnitAssertionsShouldIncludeMessage" ruleset="JUnit Rules"
package="edu.hawaii.stack" class="TestClearStack"
method="testNormalOperation"
externalInfoUrl="http://pmd.sourceforge.net/rules/junit.html#JUnitAssertionsShouldIncl..." priority="3">
-JUnit assertions should include a message
-</violation>
-<violation beginline="39" endline="39" begincolumn="5" endcolumn="14"
rule="JUnitAssertionsShouldIncludeMessage" ruleset="JUnit Rules"
package="edu.hawaii.stack" class="TestClearStack"
method="testNormalOperation"
externalInfoUrl="http://pmd.sourceforge.net/rules/junit.html#JUnitAssertionsShouldIncl..." priority="3">
-JUnit assertions should include a message
-</violation>
-<violation beginline="40" endline="40" begincolumn="5" endcolumn="14"
rule="JUnitAssertionsShouldIncludeMessage" ruleset="JUnit Rules"
package="edu.hawaii.stack" class="TestClearStack"
method="testNormalOperation"
externalInfoUrl="http://pmd.sourceforge.net/rules/junit.html#JUnitAssertionsShouldIncl..." priority="3">
-JUnit assertions should include a message
-</violation>
-</file>
-<file name="edu/hawaii/stack/TestStack.java">
-<violation beginline="70" endline="72" begincolumn="5" endcolumn="5"
rule="EmptyCatchBlock" ruleset="Basic Rules" package="edu.hawaii.stack"
class="TestStack" method="testIllegalTop"
externalInfoUrl="http://pmd.sourceforge.net/rules/basic.html#EmptyCatchBlock" priority="3">
-Avoid empty catch blocks
-</violation>
-</file>
-</pmd>
+<?xml version="1.0" encoding="UTF-8"?>
+<pmd version="3.3" timestamp="2005-10-15T12:03:57.265" elapsedTime="1s">
+<file name="C:\java\cvs\stackyHack\src\edu\hawaii\stack\BogusStack.java">
+<violation line="5" rule="UnusedImports" ruleset="Import Statement
Rules" package="edu.hawaii.stack" priority="4">
+Avoid unused imports such as 'java.applet.Applet'
+</violation>
+<violation line="6" rule="UnusedImports" ruleset="Import Statement
Rules" package="edu.hawaii.stack" priority="4">
+Avoid unused imports such as 'java.applet.AppletContext'
+</violation>
+<violation line="15" rule="MissingSerialVersionUID" ruleset="JavaBean
Rules" package="edu.hawaii.stack" priority="3">
+Classes implementing Serializable should set a serialVersionUID
+</violation>
+<violation line="15" rule="AtLeastOneConstructor"
ruleset="Controversial Rules" package="edu.hawaii.stack" priority="3">
+Each class should declare at least one constructor
+</violation>
+<violation line="17" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="BogusStack" priority="3">
+Perhaps 'bogus' could be replaced by a local variable.
+</violation>
+<violation line="17" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="BogusStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="31" rule="MethodNamingConventions" ruleset="Naming
Rules" package="edu.hawaii.stack" class="BogusStack"
method="RealyBogusMethod" priority="1">
+Method name does not begin with a lower case character.
+</violation>
+<violation line="33" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="BogusStack" method="RealyBogusMethod" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="34" rule="ShortVariable" ruleset="Naming Rules"
package="edu.hawaii.stack" class="BogusStack" method="RealyBogusMethod" priority="3">
+Avoid variables with short names like Avoid variables with short names
like i
+</violation>
+<violation line="34" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="BogusStack" method="RealyBogusMethod" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="35" rule="EqualsNull" ruleset="Design Rules"
package="edu.hawaii.stack" class="BogusStack" method="RealyBogusMethod" priority="1">
+Avoid using equals() to compare against null
+</violation>
+<violation line="35" rule="IfStmtsMustUseBraces" ruleset="Braces
Rules" package="edu.hawaii.stack" class="BogusStack"
method="RealyBogusMethod" priority="3">
+Avoid using if statements without curly braces
+</violation>
+<violation line="35" rule="PositionLiteralsFirstInComparisons"
ruleset="Design Rules" package="edu.hawaii.stack" class="BogusStack"
method="RealyBogusMethod" priority="3">
+Position literals first in String comparisons
+</violation>
+<violation line="40" rule="AvoidReassigningParameters" ruleset="Design
Rules" package="edu.hawaii.stack" class="BogusStack" method="setBogus" priority="2">
+Avoid reassigning parameters such as 'bogus'
+</violation>
+<violation line="41" rule="IdempotentOperations" ruleset="Design
Rules" package="edu.hawaii.stack" class="BogusStack" method="setBogus" priority="3">
+Avoid idempotent operations (like assigning a variable to itself)
+</violation>
+</file>
+<file name="C:\java\cvs\stackyHack\src\edu\hawaii\stack\ClearStack.java">
+<violation line="14" rule="MissingSerialVersionUID" ruleset="JavaBean
Rules" package="edu.hawaii.stack" priority="3">
+Classes implementing Serializable should set a serialVersionUID
+</violation>
+<violation line="14" rule="AtLeastOneConstructor"
ruleset="Controversial Rules" package="edu.hawaii.stack" priority="3">
+Each class should declare at least one constructor
+</violation>
+</file>
+<file name="C:\java\cvs\stackyHack\src\edu\hawaii\stack\EmptyStackException.java" >
+<violation line="15" rule="ShortVariable" ruleset="Naming Rules"
package="edu.hawaii.stack" class="EmptyStackException" priority="3">
+Avoid variables with short names like Avoid variables with short names
like e
+</violation>
+</file>
+<file name="C:\java\cvs\stackyHack\src\edu\hawaii\stack\Stack.java">
+<violation line="16" rule="MissingSerialVersionUID" ruleset="JavaBean
Rules" package="edu.hawaii.stack" priority="3">
+Classes implementing Serializable should set a serialVersionUID
+</violation>
+<violation line="16" rule="AtLeastOneConstructor"
ruleset="Controversial Rules" package="edu.hawaii.stack" priority="3">
+Each class should declare at least one constructor
+</violation>
+<violation line="22" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack" class="Stack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="30" rule="MethodArgumentCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack" class="Stack"
method="push" priority="3">
+Parameter 'obj' is not assigned and could be declared final
+</violation>
+<violation line="43" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack" class="Stack"
method="pop" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="61" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack" class="Stack"
method="top" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="62" rule="UnnecessaryLocalBeforeReturn"
ruleset="Design Rules" package="edu.hawaii.stack" class="Stack"
method="top" priority="3">
+Consider simply returning the value vs storing it in local variable 'obj'
+</violation>
+<violation line="76" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack" class="Stack"
method="toArray" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="88" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack" class="Stack"
method="getVersion" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="91" rule="EmptyCatchBlock" ruleset="Basic Rules"
package="edu.hawaii.stack" class="Stack" method="getVersion"
externalInfoUrl="http://pmd.sourceforge.net/rules/basic.html#EmptyCatchBlock" priority="3">
+Avoid empty catch blocks
+</violation>
+<violation line="111" rule="MethodArgumentCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack" class="Stack"
method="main" priority="3">
+Parameter 'args' is not assigned and could be declared final
+</violation>
+</file>
+<file name="C:\java\cvs\stackyHack\src\edu\hawaii\stack\TestClearStack.java">
+<violation line="15" rule="AtLeastOneConstructor"
ruleset="Controversial Rules" package="edu.hawaii.stack" priority="3">
+Each class should declare at least one constructor
+</violation>
+<violation line="18" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack"
class="TestClearStack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="18" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="TestClearStack" priority="3">
+Perhaps 'one' could be replaced by a local variable.
+</violation>
+<violation line="18" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="TestClearStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="19" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack"
class="TestClearStack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="19" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="TestClearStack" priority="3">
+Perhaps 'two' could be replaced by a local variable.
+</violation>
+<violation line="19" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="TestClearStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="20" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack"
class="TestClearStack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="20" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="TestClearStack" priority="3">
+Perhaps 'three' could be replaced by a local variable.
+</violation>
+<violation line="20" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="TestClearStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="26" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="TestClearStack" method="testNormalOperation" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="30" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="TestClearStack" method="testNormalOperation" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="32" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="TestClearStack" method="testNormalOperation" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="33" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="TestClearStack" method="testNormalOperation" priority="3">
+Local variable could be declared final
+</violation>
+</file>
+<file name="C:\java\cvs\stackyHack\src\edu\hawaii\stack\TestStack.java">
+<violation line="13" rule="AtLeastOneConstructor"
ruleset="Controversial Rules" package="edu.hawaii.stack" priority="3">
+Each class should declare at least one constructor
+</violation>
+<violation line="16" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack" class="TestStack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="16" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="TestStack" priority="3">
+Perhaps 'one' could be replaced by a local variable.
+</violation>
+<violation line="16" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="TestStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="17" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack" class="TestStack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="17" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="TestStack" priority="3">
+Perhaps 'two' could be replaced by a local variable.
+</violation>
+<violation line="17" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="TestStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="18" rule="BeanMembersShouldSerialize"
ruleset="JavaBean Rules" package="edu.hawaii.stack" class="TestStack" priority="3">
+Found non-transient, non-static member. Please mark as transient or
provide accessors.
+</violation>
+<violation line="18" rule="SingularField" ruleset="Controversial
Rules" package="edu.hawaii.stack" class="TestStack" priority="3">
+Perhaps 'three' could be replaced by a local variable.
+</violation>
+<violation line="18" rule="ImmutableField" ruleset="Design Rules"
package="edu.hawaii.stack" class="TestStack" priority="3">
+Private field could be made final. It is only initialized in the
declaration or constructor.
+</violation>
+<violation line="27" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="TestStack" method="testNormalOperation" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="43" rule="LocalVariableCouldBeFinal"
ruleset="Optimization Rules" package="edu.hawaii.stack"
class="TestStack" method="testIllegalPop" priority="3">
+Local variable could be declared final
+</violation>
+<violation line="48" rule="EmptyCatchBlock" ruleset="Basic Rules"
package="edu.hawaii.stack" class="TestStack" method="testIllegalPop"
externalInfoUrl="http://pmd.sourceforge.net/rules/basic.html#EmptyCatchBlock" priority="3">
+Avoid empty catch blocks
+</violation>
+</file>
+</pmd>
Modified: trunk/xml/antlib/antlib.xml
=========================================================================== ===
--- trunk/xml/antlib/antlib.xml (original)
+++ trunk/xml/antlib/antlib.xml Tue Oct 30 02:51:41 2007
@@ -5,4 +5,5 @@
<taskdef name="hacky-checkstyle"
classname="org.hackystat.sensor.ant.checkstyle.CheckstyleSensor" />
<taskdef name="hacky-pmd"
classname="org.hackystat.sensor.ant.pmd.PmdSensor" />
<taskdef name="hacky-findbugs"
classname="org.hackystat.sensor.ant.findbugs.FindBugsSensor" />
+ <taskdef name="hacky-svn"
classname="org.hackystat.sensor.ant.svn.SvnSensor" />
</antlib>
Modified: trunk/xml/schema/pmd.xsd
=========================================================================== ===
--- trunk/xml/schema/pmd.xsd (original)
+++ trunk/xml/schema/pmd.xsd Tue Oct 30 02:51:41 2007
@@ -5,6 +5,7 @@
<xs:attribute name="timestamp" type="xs:dateTime" />
<xs:attribute name="elapsedTime" type="xs:string" />
<xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="line" type="xs:int" />
<xs:attribute name="rule" type="xs:string" />
<xs:attribute name="ruleset" type="xs:string" />
<xs:attribute name="package" type="xs:string" />
@@ -13,22 +14,14 @@
<!-- Complex elements -->
<xs:element name="violation">
<xs:complexType>
- <!-- line is used in PMD 3.9 and earlier -->
- <xs:attribute name="line" type="xs:int" use="optional"/>
-
- <!-- beginline, endline, beingcolumn, and end column are used in
PMD 4.0 -->
- <xs:attribute name="beginline" type="xs:int" use="optional"/>
- <xs:attribute name="endline" type="xs:int" use="optional"/>
- <xs:attribute name="begincolumn" type="xs:int" use="optional"/>
- <xs:attribute name="endcolumn" type="xs:int" use="optional"/>
-
+ <xs:attribute ref="line"/>
<xs:attribute ref="rule"/>
<xs:attribute ref="ruleset"/>
<xs:attribute ref="package"/>
<xs:attribute ref="priority"/>
- <xs:attribute name="class" type="xs:string" use="optional" />
- <xs:attribute name="method" type="xs:string" use="optional" />
- <xs:attribute name="externalInfoUrl" type="xs:string"
use="optional" />
+ <xs:attribute name="class" use="optional" />
+ <xs:attribute name="method" use="optional" />
+ <xs:attribute name="externalInfoUrl" use="optional" />
</xs:complexType>
</xs:element>