Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacek Sieka2015-01-31 01:54:27 +0000
committerAlexander Kurtakov2015-02-05 13:11:51 +0000
commitd300e2688460c9cb038b34738400e5e7784e0ea1 (patch)
treead24bd494e2fa048468741fc6ba3ac05ef941279 /bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt
parent5393c314884f81e7873e0b3aea9edace6e1d3343 (diff)
downloadeclipse.platform.swt-d300e2688460c9cb038b34738400e5e7784e0ea1.tar.gz
eclipse.platform.swt-d300e2688460c9cb038b34738400e5e7784e0ea1.tar.xz
eclipse.platform.swt-d300e2688460c9cb038b34738400e5e7784e0ea1.zip
Bug 458863 - Replace Vector with ArrayList where appropriate
- examples & tools Change-Id: I861981fc3a497c1143adf83f358b1dc61864871f Signed-off-by: Jacek Sieka <arnetheduck@gmail.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java4
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/EmbedMetaData.java7
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java2
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorApp.java11
4 files changed, 13 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java
index f367471502..d415a3cf00 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java
@@ -100,7 +100,7 @@ public ASTClass(String sourcePath, MetaData metaData) {
}
FieldDeclaration[] fields = type.getFields();
- ArrayList<ASTField> fid = new ArrayList<ASTField>();
+ List<ASTField> fid = new ArrayList<ASTField>();
for (int i = 0; i < fields.length; i++) {
FieldDeclaration field = fields[i];
List<VariableDeclarationFragment> fragments = field.fragments();
@@ -111,7 +111,7 @@ public ASTClass(String sourcePath, MetaData metaData) {
}
this.fields = fid.toArray(new ASTField[fid.size()]);
MethodDeclaration[] methods = type.getMethods();
- ArrayList<ASTMethod> mid = new ArrayList<ASTMethod>();
+ List<ASTMethod> mid = new ArrayList<ASTMethod>();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getReturnType2() == null) continue;
mid.add(new ASTMethod(this, source, methods[i]));
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/EmbedMetaData.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/EmbedMetaData.java
index 5f8fe56aab..e7747204a8 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/EmbedMetaData.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/EmbedMetaData.java
@@ -11,11 +11,12 @@
package org.eclipse.swt.tools.internal;
import java.lang.reflect.Modifier;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import java.util.TreeMap;
-import java.util.ArrayList;
public class EmbedMetaData extends JNIGenerator {
TreeMap<Integer, String> inserts;
@@ -36,7 +37,7 @@ public void generate(JNIClass clazz) {
String sourcePath = ((ASTClass)clazz).sourcePath;
String source = JNIGenerator.loadFile(sourcePath);
Set<Integer> set = inserts.keySet();
- ArrayList<Integer> keys = new ArrayList<Integer>();
+ List<Integer> keys = new ArrayList<Integer>();
keys.addAll(set);
Collections.reverse(keys);
StringBuffer buffer = new StringBuffer(source);
@@ -83,7 +84,7 @@ public void generate(JNIMethod[] methods) {
}
public void generate(JNIMethod method) {
- ArrayList<String> tags = new ArrayList<String>();
+ List<String> tags = new ArrayList<String>();
String data = ((AbstractItem)method).flatten();
if (data != null && data.length() != 0) {
tags.add("@method " + data);
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java
index 14ecf35b2d..335859c60a 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java
@@ -199,7 +199,7 @@ static void sort(JNIClass[] classes) {
static String[] split(String str, String separator) {
StringTokenizer tk = new StringTokenizer(str, separator);
- ArrayList<String> result = new ArrayList<String>();
+ List<String> result = new ArrayList<String>();
while (tk.hasMoreTokens()) {
result.add(tk.nextToken());
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorApp.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorApp.java
index 7ff1031ba5..0b2e032c71 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorApp.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGeneratorApp.java
@@ -13,9 +13,10 @@ package org.eclipse.swt.tools.internal;
import java.io.*;
import java.lang.reflect.*;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Enumeration;
+import java.util.List;
import java.util.zip.*;
-import java.util.Arrays;
import org.eclipse.swt.SWT;
@@ -273,7 +274,7 @@ String[] getClassNames(String mainClassName) {
if (classpath == null) classpath = System.getProperty("java.class.path");
String pkgPath = pkgName.replace('.', File.separatorChar);
String pkgZipPath = pkgName.replace('.', '/');
- ArrayList<String> classes = new ArrayList<String>();
+ List<String> classes = new ArrayList<String>();
int start = 0;
int index = 0;
while (index < classpath.length()) {
@@ -352,7 +353,7 @@ JNIClass[] getASTClasses() {
if (mainClassName == null) return new JNIClass[0];
String root = classesDir != null ? classesDir : new File(outputDir).getParent() + "/";
String mainPath = new File(root + mainClassName.replace('.', '/') + ".java").getAbsolutePath();
- ArrayList<JNIClass> classes = new ArrayList<JNIClass>();
+ List<JNIClass> classes = new ArrayList<JNIClass>();
String packageName = getPackageName(mainClassName);
File dir = new File(root + "/" + packageName.replace('.', '/'));
File[] files = dir.listFiles();
@@ -376,7 +377,7 @@ JNIClass[] getASTClasses() {
public JNIClass[] getNativesClasses(JNIClass[] classes) {
if (mainClass == null) return new JNIClass[0];
- ArrayList<JNIClass> result = new ArrayList<JNIClass>();
+ List<JNIClass> result = new ArrayList<JNIClass>();
for (int i = 0; i < classes.length; i++) {
JNIClass clazz = classes[i];
JNIMethod[] methods = clazz.getDeclaredMethods();
@@ -394,7 +395,7 @@ public JNIClass[] getNativesClasses(JNIClass[] classes) {
public JNIClass[] getStructureClasses(JNIClass[] classes) {
if (mainClass == null) return new JNIClass[0];
- ArrayList<JNIClass> result = new ArrayList<JNIClass>();
+ List<JNIClass> result = new ArrayList<JNIClass>();
outer:
for (int i = 0; i < classes.length; i++) {
JNIClass clazz = classes[i];

Back to the top