Author: jhm Date: Wed Oct 24 05:20:01 2007 New Revision: 587872 URL: http://svn.apache.org/viewvc?rev=587872&view=rev Log: checkstyle
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java?rev=587872&r1=587871&r2=587872&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java Wed Oct 24 05:20:01 2007 @@ -64,7 +64,7 @@ * the failing test cases in a static list. Because we dont have a finalizer * method in the formatters "lifecycle", we register this formatter as * BuildListener and generate the new java source on taskFinished event. - * + * * @since Ant 1.8.0 */ public class FailureRecorder extends DataType implements JUnitResultFormatter, BuildListener { @@ -91,7 +91,7 @@ /** A writer for writing the generated source to. */ private PrintWriter writer; - + /** * Location and name of the generated JUnit class. * Lazy instantiated via getLocationName(). @@ -121,7 +121,8 @@ } else { locationName = DEFAULT_CLASS_LOCATION; verbose("System property '" + MAGIC_PROPERTY_CLASS_LOCATION + "' not set, so use " - + "value as location for collector class: '" + DEFAULT_CLASS_LOCATION + "'"); + + "value as location for collector class: '" + + DEFAULT_CLASS_LOCATION + "'"); } File locationFile = new File(locationName); @@ -132,14 +133,14 @@ + " use absolute path instead (" + locationName + ")"); } } - + return locationName; } /** * This method is called by the Ant runtime by reflection. We use the project reference for * registration of this class as BuildListener. - * + * * @param project * project reference */ @@ -149,7 +150,7 @@ // check if already registered boolean alreadyRegistered = false; Vector allListeners = project.getBuildListeners(); - for(int i=0; i<allListeners.size(); i++) { + for (int i = 0; i < allListeners.size(); i++) { Object listener = allListeners.get(i); if (listener instanceof FailureRecorder) { alreadyRegistered = true; @@ -162,9 +163,9 @@ project.addBuildListener(this); } } - + // ===== JUnitResultFormatter ===== - + /** * Not used * [EMAIL PROTECTED] @@ -242,7 +243,7 @@ try { File sourceFile = new File((getLocationName() + ".java")); verbose("Write collector class to '" + sourceFile.getAbsolutePath() + "'"); - + sourceFile.delete(); writer = new PrintWriter(new FileOutputStream(sourceFile)); @@ -295,10 +296,17 @@ } // ===== Helper classes and methods ===== - + + /** + * Logging facade in INFO-mode. + */ public void log(String message) { getProject().log(LOG_PREFIX + " " + message, Project.MSG_INFO); } + + /** + * Logging facade in VERBOSE-mode. + */ public void verbose(String message) { getProject().log(LOG_PREFIX + " " + message, Project.MSG_VERBOSE); } @@ -351,7 +359,7 @@ } } } - + // ===== BuildListener ===== /** @@ -390,8 +398,9 @@ } /** - * The task outside of this JUnitResultFormatter is the <junit> task. So all tests passed - * and we could create the new java class. + * The task outside of this JUnitResultFormatter is the <junit> task. So all tests passed + * and we could create the new java class. + * @param event not used * @see org.apache.tools.ant.BuildListener#taskFinished(org.apache.tools.ant.BuildEvent) */ public void taskFinished(BuildEvent event) { @@ -406,5 +415,5 @@ */ public void taskStarted(BuildEvent event) { } - + } Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java?rev=587872&r1=587871&r2=587872&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java Wed Oct 24 05:20:01 2007 @@ -98,7 +98,6 @@ * @param type the enumerated value to use. */ public void setType(TypeAttribute type) { - //TODO: Besseren Zugriffsalgorithums: TypeAttribut.getClassname() if ("xml".equals(type.getValue())) { setClassname(XML_FORMATTER_CLASS_NAME); } else { @@ -240,8 +239,8 @@ public void setProject(Project project) { this.project = project; } - - + + /** * @since Ant 1.6 */ @@ -270,7 +269,7 @@ "Using loader " + loader + " on class " + classname + ": " + e, e); } - + Object o = null; try { o = f.newInstance(); @@ -279,7 +278,7 @@ } catch (IllegalAccessException e) { throw new BuildException(e); } - + if (!(o instanceof JUnitTaskMirror.JUnitResultFormatterMirror)) { throw new BuildException(classname + " is not a JUnitResultFormatter"); } @@ -293,7 +292,7 @@ } } r.setOutput(out); - + boolean needToSetProjectReference = true; try { @@ -306,17 +305,17 @@ } catch (Exception e) { // no field present, so no previous reference exists } - + if (needToSetProjectReference) { Method setter; try { - setter = r.getClass().getMethod("setProject", new Class[] { Project.class }); - setter.invoke(r, new Object[] { project }); + setter = r.getClass().getMethod("setProject", new Class[] {Project.class}); + setter.invoke(r, new Object[] {project} ); } catch (Exception e) { // no setProject to invoke; just ignore } } - + return r; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]