Author: bayard
Date: Tue Feb 26 00:47:08 2008
New Revision: 631133
URL: http://svn.apache.org/viewvc?rev=631133&view=rev
Log:
Applying checkstyle changes
Modified:
commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java
commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVStrategy.java
commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java
Modified:
commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java?rev=631133&r1=631132&r2=631133&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java
(original)
+++ commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVParser.java
Tue Feb 26 00:47:08 2008
@@ -16,7 +16,10 @@
*/
package org.apache.commons.csv;
-import java.io.*;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.InputStreamReader;
+import java.io.InputStream;
import java.util.ArrayList;
@@ -257,7 +260,9 @@
throw new IOException("(line " + getLineNumber() + ") invalid
parse sequence");
// unreachable: break;
}
- if (reusableToken.type != TT_TOKEN) break;
+ if (reusableToken.type != TT_TOKEN) {
+ break;
+ }
}
if (!record.isEmpty()) {
ret = (String[]) record.toArray(new String[record.size()]);
Modified:
commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVStrategy.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVStrategy.java?rev=631133&r1=631132&r2=631133&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVStrategy.java
(original)
+++ commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CSVStrategy.java
Tue Feb 26 00:47:08 2008
@@ -45,7 +45,7 @@
true, false,
true);
public static CSVStrategy EXCEL_STRATEGY = new CSVStrategy(',', '"',
COMMENTS_DISABLED, ESCAPE_DISABLED, false,
false, false,
false);
- public static CSVStrategy TDF_STRATEGY = new CSVStrategy(' ', '"',
COMMENTS_DISABLED, ESCAPE_DISABLED, true,
+ public static CSVStrategy TDF_STRATEGY = new CSVStrategy('\t', '"',
COMMENTS_DISABLED, ESCAPE_DISABLED, true,
true, false,
true);
Modified:
commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java?rev=631133&r1=631132&r2=631133&view=diff
==============================================================================
--- commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java
(original)
+++ commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java
Tue Feb 26 00:47:08 2008
@@ -27,7 +27,9 @@
* @author Ortwin Gl�ck
*/
public class CharBuffer {
+
private char[] c;
+
/**
* Actually used number of characters in the array.
* It is also the index at which
@@ -47,7 +49,9 @@
* of <code>length</code> characters.
*/
public CharBuffer(final int length) {
- if (length == 0) throw new IllegalArgumentException("Can't create an
empty CharBuffer");
+ if (length == 0) {
+ throw new IllegalArgumentException("Can't create an empty
CharBuffer");
+ }
this.c = new char[length];
}
@@ -81,7 +85,9 @@
* @param cb the CharBuffer to append or null
*/
public void append(final CharBuffer cb) {
- if (cb == null) return;
+ if (cb == null) {
+ return;
+ }
provideCapacity(length + cb.length);
System.arraycopy(cb.c, 0, c, length, cb.length);
length += cb.length;
@@ -93,7 +99,9 @@
* @param s the String to append or null
*/
public void append(final String s) {
- if (s == null) return;
+ if (s == null) {
+ return;
+ }
append(s.toCharArray());
}
@@ -103,7 +111,9 @@
* @param sb the StringBuffer to append or null
*/
public void append(final StringBuffer sb) {
- if (sb == null) return;
+ if (sb == null) {
+ return;
+ }
provideCapacity(length + sb.length());
sb.getChars(0, sb.length(), c, length);
length += sb.length();
@@ -115,7 +125,9 @@
* @param data the char[] to append or null
*/
public void append(final char[] data) {
- if (data == null) return;
+ if (data == null) {
+ return;
+ }
provideCapacity(length + data.length);
System.arraycopy(data, 0, c, length, data.length);
length += data.length;
@@ -137,7 +149,9 @@
* This method involves copying the data once!
*/
public void shrink() {
- if (c.length == length) return;
+ if (c.length == length) {
+ return;
+ }
char[] newc = new char[length];
System.arraycopy(c, 0, newc, 0, length);
c = newc;
@@ -161,7 +175,9 @@
* @return
*/
public char[] getCharacters() {
- if (c.length == length) return c;
+ if (c.length == length) {
+ return c;
+ }
char[] chars = new char[length];
System.arraycopy(c, 0, chars, 0, length);
return chars;
@@ -199,7 +215,9 @@
* @param capacity
*/
public void provideCapacity(final int capacity) {
- if (c.length >= capacity) return;
+ if (c.length >= capacity) {
+ return;
+ }
int newcapacity = ((capacity*3)>>1) + 1;
char[] newc = new char[newcapacity];
System.arraycopy(c, 0, newc, 0, length);