Author: ebourg Date: Wed Nov 9 16:58:32 2011 New Revision: 1199845 URL: http://svn.apache.org/viewvc?rev=1199845&view=rev Log: Upgrading to Java 5
Modified: commons/sandbox/csv/trunk/pom.xml commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/writer/CSVConfig.java Modified: commons/sandbox/csv/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/pom.xml?rev=1199845&r1=1199844&r2=1199845&view=diff ============================================================================== --- commons/sandbox/csv/trunk/pom.xml (original) +++ commons/sandbox/csv/trunk/pom.xml Wed Nov 9 16:58:32 2011 @@ -61,6 +61,8 @@ <properties> <commons.componentid>csv</commons.componentid> <commons.jira.componentid>12311182</commons.jira.componentid> + <maven.compile.source>1.5</maven.compile.source> + <maven.compile.target>1.5</maven.compile.target> </properties> <reporting> Modified: commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java?rev=1199845&r1=1199844&r2=1199845&view=diff ============================================================================== --- commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java (original) +++ commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java Wed Nov 9 16:58:32 2011 @@ -79,7 +79,7 @@ public class CSVParser { /** * A record buffer for getLine(). Grows as necessary and is reused. */ - private final List record = new ArrayList(); + private final List<String> record = new ArrayList<String>(); private final Token reusableToken = new Token(); private final CharBuffer wsBuf = new CharBuffer(); private final CharBuffer code = new CharBuffer(4); @@ -152,7 +152,7 @@ public class CSVParser { * @throws IOException on parse error or input read-failure */ public String[][] getAllValues() throws IOException { - List records = new ArrayList(); + List<String[]> records = new ArrayList<String[]>(); String[] values; String[][] ret = null; while ((values = getLine()) != null) { Modified: commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java?rev=1199845&r1=1199844&r2=1199845&view=diff ============================================================================== --- commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java (original) +++ commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java Wed Nov 9 16:58:32 2011 @@ -74,8 +74,8 @@ public class CSVPrinter { * @param values values to be outputted. */ public void println(String[] values) throws IOException { - for (int i = 0; i < values.length; i++) { - print(values[i]); + for (String value : values) { + print(value); } println(); } Modified: commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/writer/CSVConfig.java URL: http://svn.apache.org/viewvc/commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/writer/CSVConfig.java?rev=1199845&r1=1199844&r2=1199845&view=diff ============================================================================== --- commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/writer/CSVConfig.java (original) +++ commons/sandbox/csv/trunk/src/main/java/org/apache/commons/csv/writer/CSVConfig.java Wed Nov 9 16:58:32 2011 @@ -32,73 +32,49 @@ import java.util.List; */ public class CSVConfig { - /** - * specifies if it is a fixed width csv file * - */ + /** specifies if it is a fixed width csv file */ private boolean fixedWidth; - /** - * list of fields * - */ - private List fields; + + /** list of fields */ + private List<CSVField> fields; - /** - * Do no do any filling * - */ + /** Do no do any filling */ public static final int FILLNONE = 0; - /** - * Fill content the the left. Mainly usable together with fixedWidth * - */ + + /** Fill content the the left. Mainly usable together with fixedWidth */ public static final int FILLLEFT = 1; - /** - * Fill content to the right. Mainly usable together with fixedWidth * - */ + + /** Fill content to the right. Mainly usable together with fixedWidth */ public static final int FILLRIGHT = 2; - /** - * The fill pattern - */ + /** The fill pattern */ private int fill; - /** - * The fill char. Defaults to a space - */ + + /** The fill char. Defaults to a space */ private char fillChar = ' '; - /** - * The seperator character. Defaults to , - */ + + /** The seperator character. Defaults to ,*/ private char delimiter = ','; - /** - * The row separator. Defaults to \n - */ + + /** The row separator. Defaults to \n */ private String rowDelimiter = "\n"; - /** - * Should we ignore the delimiter. Defaults to false - */ + + /** Should we ignore the delimiter. Defaults to false */ private boolean ignoreDelimiter = false; - /** - * the value delimiter. Defaults to " - */ + + /** the value delimiter. Defaults to " */ private char valueDelimiter = '"'; - /** - * Should we ignore the value delimiter. Defaults to true - */ + + /** Should we ignore the value delimiter. Defaults to true */ private boolean ignoreValueDelimiter = true; - /** - * Specifies if we want to use a field header - */ + + /** Specifies if we want to use a field header */ private boolean fieldHeader = false; - /** - * Specifies if the end of the line needs to be trimmed - */ + + /** Specifies if the end of the line needs to be trimmed */ private boolean endTrimmed = false; /** - * - */ - public CSVConfig() { - super(); - } - - /** * @return if the CSV file is fixedWidth */ public boolean isFixedWidth() { @@ -117,7 +93,7 @@ public class CSVConfig { public void addField(CSVField field) { if (fields == null) { - fields = new ArrayList(); + fields = new ArrayList<CSVField>(); } fields.add(field); }