Applied patches:

916971 - Add useFile property to formatter element in Ant task
1061458 - Trivial fix for SuppressionsLoaderTest.testBadInt()
This commit is contained in:
Oleg Sukhodolsky 2005-06-29 14:47:40 +00:00
parent 28193fd5f0
commit c8aae6e57e
4 changed files with 32 additions and 5 deletions

View File

@ -515,6 +515,8 @@ public class CheckStyleTask
private FormatterType mFormatterType;
/** the file to output to */
private File mToFile;
/** Whether or not the write to the named file. */
private boolean mUseFile = true;
/**
* Set the type of the formatter.
@ -539,6 +541,15 @@ public class CheckStyleTask
mToFile = aTo;
}
/**
* Sets whether or not we write to a file if it is provided.
* @param aUse whether not not to use provided file.
*/
public void setUseFile(boolean aUse)
{
mUseFile = aUse;
}
/**
* Creates a listener for the formatter.
* @param aTask the task running
@ -564,7 +575,7 @@ public class CheckStyleTask
private AuditListener createDefaultLogger(Task aTask)
throws IOException
{
if (mToFile == null) {
if (mToFile == null || !mUseFile) {
return new DefaultLogger(
new LogOutputStream(aTask, Project.MSG_DEBUG), true,
new LogOutputStream(aTask, Project.MSG_ERR), true);
@ -580,7 +591,7 @@ public class CheckStyleTask
private AuditListener createXMLLogger(Task aTask)
throws IOException
{
if (mToFile == null) {
if (mToFile == null || !mUseFile) {
return new XMLLogger(
new LogOutputStream(aTask, Project.MSG_INFO), true);
}

View File

@ -80,9 +80,9 @@ public class SuppressionsLoaderTest extends TestCase
"src/testinputs/com/puppycrawl/tools/checkstyle/suppressions_bad_int.xml");
}
catch (CheckstyleException ex) {
assertEquals(
"number format exception src/testinputs/com/puppycrawl/tools/checkstyle/suppressions_bad_int.xml - For input string: \"a\"",
ex.getMessage());
assertTrue(
ex.getMessage(),
ex.getMessage().startsWith("number format exception src/testinputs/com/puppycrawl/tools/checkstyle/suppressions_bad_int.xml - "));
}
}
}

View File

@ -247,6 +247,12 @@
</td>
<td>No</td>
</tr>
<tr>
<td>useFile</td>
<td>Boolean that determines whether output should be sent to
a file. Default is <span class="default">true</span>.</td>
<td>No</td>
</tr>
</table>
<p>

View File

@ -11,6 +11,12 @@
<body>
<section name="Release 4.0 Beta 5">
<p>New features:</p>
<ul>
<li>Added useFile property of ant task (patch 916971)</li>
</ul>
<p>Fixed Bugs:</p>
<ul>
@ -31,6 +37,10 @@
<li>LocalFinalVariable now also checks catch parameters (bug
1223290)</li>
<li>Applied patch 1061458, hope this helps users who use
checkstyle with JRokit (thank to Ville Skytta for
contribution)</li>
</ul>
<p>Other improvements:</p>