Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-10-10 07:45:33 +0000
committerAlexander Kurtakov2017-10-10 07:46:25 +0000
commit2bd564959cb6175878b84e34a158397509e54ea4 (patch)
tree0d72f36f7707f8326bd4e8d5761af92f416eb056 /bundles/org.eclipse.swt.tools
parent927fb7921c3d90a8532093827fb04fc895179e35 (diff)
downloadeclipse.platform.swt-2bd564959cb6175878b84e34a158397509e54ea4.tar.gz
eclipse.platform.swt-2bd564959cb6175878b84e34a158397509e54ea4.tar.xz
eclipse.platform.swt-2bd564959cb6175878b84e34a158397509e54ea4.zip
Bug 525436 - Some foreach conversions
In swt.tools. Change-Id: I8c1fd577db2bf0e82dc1f2d926c63d0da7d3de52 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools')
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java3
-rw-r--r--bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java23
2 files changed, 11 insertions, 15 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
index a8cd8ce367..ce87a233af 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
@@ -64,8 +64,7 @@ public ASTMethod(ASTClass declaringClass, String source, MethodDeclaration metho
paramTypes64 = new ASTType[parameters.size()];
this.parameters = new ASTParameter[paramTypes.length];
int i = 0;
- for (Iterator<SingleVariableDeclaration> iterator = parameters.iterator(); iterator.hasNext(); i++) {
- SingleVariableDeclaration param = iterator.next();
+ for (SingleVariableDeclaration param : parameters) {
paramTypes[i] = new ASTType(declaringClass.resolver, param.getType(), param.getExtraDimensions());
paramTypes64[i] = paramTypes[i];
this.parameters[i] = new ASTParameter(this, i, param.getName().getIdentifier());
diff --git a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
index efdf4f2b23..1f5f2d917d 100644
--- a/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
+++ b/bundles/org.eclipse.swt.tools/Mac Generation/org/eclipse/swt/tools/internal/MacGenerator.java
@@ -265,9 +265,8 @@ String getParamName(Node param, int i) {
return paramName;
}
-void generateFields(ArrayList<?> fields) {
- for (Iterator<?> iterator = fields.iterator(); iterator.hasNext();) {
- Node field = (Node)iterator.next();
+void generateFields(ArrayList<Node> fields) {
+ for (Node field : fields) {
NamedNodeMap fieldAttributes = field.getAttributes();
String fieldName = fieldAttributes.getNamedItem("name").getNodeValue();
String type = getJavaType(field), type64 = getJavaType64(field);
@@ -309,9 +308,8 @@ private String getDeclaredType(NamedNodeMap map, Node location) {
return value;
}
-void generateMethods(String className, ArrayList<?> methods) {
- for (Iterator<?> iterator = methods.iterator(); iterator.hasNext();) {
- Node method = (Node)iterator.next();
+void generateMethods(String className, ArrayList<Node> methods) {
+ for (Node method : methods) {
NamedNodeMap mthAttributes = method.getAttributes();
String sel = mthAttributes.getNamedItem("selector").getNodeValue();
if ("NSObject".equals(className)) {
@@ -671,8 +669,8 @@ void copyClassMethodsDown(final Map<String, Object[]> classes) {
ArrayList<Node> methods = (ArrayList<Node>)clazz[1];
Object[] superclass = classes.get(getSuperclassName(node));
if (superclass != null) {
- for (Iterator<?> iterator2 = ((ArrayList<?>)superclass[1]).iterator(); iterator2.hasNext();) {
- Node method = (Node) iterator2.next();
+ for (Iterator<Node> iterator2 = ((ArrayList<Node>)superclass[1]).iterator(); iterator2.hasNext();) {
+ Node method = iterator2.next();
if (isStatic(method)) {
methods.add(method);
}
@@ -708,7 +706,7 @@ void generateClasses() {
String className = clazzes.getKey();
Object[] clazz = clazzes.getValue();
Node node = (Node)clazz[0];
- ArrayList<?> methods = (ArrayList<?>)clazz[1];
+ ArrayList<Node> methods = (ArrayList<Node>)clazz[1];
out("package ");
String packageName = getPackageName();
out(packageName);
@@ -746,7 +744,7 @@ void generateStructs() {
String className = structEntry.getKey();
Object[] clazz = structEntry.getValue();
- ArrayList<?> methods = (ArrayList<?>)clazz[1];
+ ArrayList<Node> methods = (ArrayList<Node>)clazz[1];
out("package ");
String packageName = getPackageName();
out(packageName);
@@ -1245,7 +1243,7 @@ void buildLookup(Node node, HashMap<String, Node> table) {
}
}
-boolean isUnique(Node method, ArrayList<?> methods) {
+boolean isUnique(Node method, ArrayList<Node> methods) {
String methodName = method.getAttributes().getNamedItem("selector").getNodeValue();
String signature = "";
NodeList params = method.getChildNodes();
@@ -1257,8 +1255,7 @@ boolean isUnique(Node method, ArrayList<?> methods) {
}
int index = methodName.indexOf(":");
if (index != -1) methodName = methodName.substring(0, index);
- for (Iterator<?> iterator = methods.iterator(); iterator.hasNext();) {
- Node other = (Node) iterator.next();
+ for (Node other : methods) {
NamedNodeMap attributes = other.getAttributes();
Node otherSel = null;
if (attributes != null) otherSel = attributes.getNamedItem("selector");

Back to the top