Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/nattable')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.classpath2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/parsers/CSVLexer.java23
4 files changed, 17 insertions, 16 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.classpath b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.classpath
index ad32c83a788..eca7bdba8f0 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.classpath
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.settings/org.eclipse.jdt.core.prefs
index 94d61f00da6..b3aa6d60f94 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
index 57459ddee32..d83484b7bdb 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
@@ -80,6 +80,6 @@ Bundle-Activator: org.eclipse.papyrus.infra.nattable.Activator
Bundle-ManifestVersion: 2
Bundle-Description: %pluginDescription
Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable;singleton:=true
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.google.common.collect;version="21.0.0"
Automatic-Module-Name: org.eclipse.papyrus.infra.nattable
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/parsers/CSVLexer.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/parsers/CSVLexer.java
index caaca58e7ae..bac9e92c48a 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/parsers/CSVLexer.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/parsers/CSVLexer.java
@@ -65,7 +65,7 @@ public class CSVLexer {
private RewindableTextStream input; // the input stream
private char separator; // The cell separator character
private char textMarker; // The raw text beginning and end character
- private char[] builder; // The buffer used to build the tokens
+ private StringBuilder builder; // The buffer used to build the tokens
private int lastTokenType; // The type of the last matched token
private String lastTokenValue; // The value of the last matched token
@@ -82,7 +82,7 @@ public class CSVLexer {
public CSVLexer(final Reader input, final char valueSeparator, final char textMarker) {
this(input, valueSeparator, textMarker, false);
}
-
+
/**
* Initializes this lexer with boolean to determinate if the beginning whitespace must be kept.
*
@@ -99,7 +99,7 @@ public class CSVLexer {
this.input = new RewindableTextStream(input);
this.separator = valueSeparator;
this.textMarker = textMarker;
- this.builder = new char[BUFFER_SIZE];
+ this.builder = new StringBuilder(BUFFER_SIZE);
this.lastTokenType = TOKEN_ERROR;
this.lastTokenValue = null;
this.keepBeginningWhiteSpace = keepBeginningWhiteSpace;
@@ -155,8 +155,7 @@ public class CSVLexer {
}
// Here we are on normal data
- int length = 1;
- builder[0] = c;
+ builder.append(c);
while (true) {
c = input.read();
if (input.isAtEnd()) {
@@ -166,13 +165,14 @@ public class CSVLexer {
input.rewind(1);
break;
}
- builder[length] = c;
- length++;
+ builder.append(c);
}
// we matched the data
// Now, trim the trailing white spaces
- while (length > 0 && isWhitespace(builder[length - 1])) {
+ int length = builder.length() - 1;
+ while (length > 0 && isWhitespace(builder.charAt(length))) {
+ builder.deleteCharAt(length);
length--;
}
@@ -229,14 +229,14 @@ public class CSVLexer {
return getTokenError();
}
if (c != textMarker) {
- builder[length] = c;
+ builder.append(c);
length++;
} else {
// get the following char
c = input.read();
if (c == textMarker) {
// This is a double marker
- builder[length] = c;
+ builder.append(c);
length++;
} else {
// This was the end of the quoted text
@@ -302,7 +302,8 @@ public class CSVLexer {
*/
private String getTokenValue(int length) {
lastTokenType = TOKEN_VALUE;
- lastTokenValue = new String(builder, 0, length);
+ lastTokenValue = builder.toString();
+ builder.setLength(0);
return lastTokenValue;
}

Back to the top