Author: vgritsenko
Date: Mon Mar 12 19:16:34 2007
New Revision: 517493
URL: http://svn.apache.org/viewvc?view=rev&rev=517493
Log:
nitpicks
Modified:
jakarta/regexp/trunk/src/java/org/apache/regexp/RETest.java
Modified: jakarta/regexp/trunk/src/java/org/apache/regexp/RETest.java
URL:
http://svn.apache.org/viewvc/jakarta/regexp/trunk/src/java/org/apache/regexp/RETest.java?view=diff&rev=517493&r1=517492&r2=517493
==============================================================================
--- jakarta/regexp/trunk/src/java/org/apache/regexp/RETest.java (original)
+++ jakarta/regexp/trunk/src/java/org/apache/regexp/RETest.java Mon Mar 12
19:16:34 2007
@@ -44,10 +44,10 @@
static final boolean showSuccesses = false;
// A new line character.
- static final String NEW_LINE = System.getProperty( "line.separator" );
+ static final String NEW_LINE = System.getProperty("line.separator");
// Construct a debug compiler
- REDebugCompiler compiler = new REDebugCompiler();
+ final REDebugCompiler compiler = new REDebugCompiler();
/**
* Main program entrypoint. If an argument is given, it will be compiled
@@ -202,12 +202,8 @@
say(s);
say("");
// make sure the writer gets flushed.
- if (compiler != null) {
- PrintWriter writer = new PrintWriter( System.out );
- compiler.dumpProgram( writer );
- writer.flush();
- say("" + NEW_LINE + "");
- }
+ compiler.dumpProgram();
+ say("" + NEW_LINE + "");
}
/**
@@ -684,9 +680,7 @@
this.shouldMatch = shouldMatch;
if (parens != null) {
this.parens = new String[parens.length];
- for (int i = 0; i < parens.length; i++) {
- this.parens[i] = parens[i];
- }
+ System.arraycopy(parens, 0, this.parens, 0, parens.length);
} else {
this.parens = null;
}
@@ -744,13 +738,13 @@
private void testMatch()
{
- log.append(" Match against: '" + toMatch + "'\n");
+ log.append(" Match against: '").append(toMatch).append("'\n");
// Try regular matching
try
{
// Match against the string
boolean result = regexp.match(toMatch);
- log.append(" Matched: " + (result ? "YES" : "NO") + "\n");
+ log.append(" Matched: ").append(result ? "YES" :
"NO").append("\n");
// Check result, parens, and iterators
if (checkResult(result) && (!shouldMatch || checkParens()))
@@ -813,7 +807,7 @@
test.showParens(regexp);
}
- log.append(" Paren count: " + regexp.getParenCount() + "\n");
+ log.append(" Paren count:
").append(regexp.getParenCount()).append("\n");
if (!assertEquals(log, "Wrong number of parens", parens.length,
regexp.getParenCount()))
{
return false;
@@ -822,7 +816,7 @@
// Check registers against expected contents
for (int p = 0; p < regexp.getParenCount(); p++)
{
- log.append(" Paren " + p + ": " + regexp.getParen(p) + "\n");
+ log.append(" Paren ").append(p).append(":
").append(regexp.getParen(p)).append("\n");
// Compare expected result with actual
if ("null".equals(parens[p]) && regexp.getParen(p) == null)
@@ -843,7 +837,7 @@
{
try {
boolean result = regexp.match(matchAgainst, 0);
- log.append(" Match: " + (result ? "YES" : "NO") + "\n");
+ log.append(" Match: ").append(result ? "YES" :
"NO").append("\n");
return checkResult(result) && (!shouldMatch || checkParens());
}
// Matcher blew it
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]