diff options
author | dwagelaar | 2014-07-13 14:56:40 +0000 |
---|---|---|
committer | dwagelaar | 2014-07-13 14:56:40 +0000 |
commit | 73ecccffb6cffe5b61d68b3eabdb86e70befdf16 (patch) | |
tree | f9166b42664bb171f7dca385f8e8842fcf266e57 /plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse | |
parent | df73a2e2504f09d29d1551dc34bc2e66b356cf65 (diff) | |
download | org.eclipse.atl-73ecccffb6cffe5b61d68b3eabdb86e70befdf16.tar.gz org.eclipse.atl-73ecccffb6cffe5b61d68b3eabdb86e70befdf16.tar.xz org.eclipse.atl-73ecccffb6cffe5b61d68b3eabdb86e70befdf16.zip |
Fix IOException API > 1.5 usage + minor cleanup.R3_5_maintenance
Diffstat (limited to 'plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse')
2 files changed, 2 insertions, 111 deletions
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/ByteCodeSwitch.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/ByteCodeSwitch.java index be9ee145..f8a40928 100644 --- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/ByteCodeSwitch.java +++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/ByteCodeSwitch.java @@ -2170,11 +2170,7 @@ public class ByteCodeSwitch extends EmftvmSwitch<MethodVisitor> implements Opcod final Label ifNull = new Label(); dup(); // [..., array, array] ifnull(ifNull); // jump if array == null: [..., array] - if (Object.class.isAssignableFrom(cType)) { - invokeStat(Arrays.class, "asList", List.class, Object[].class); // Arrays.asList(array): [..., list] - } else { - invokeStat(JITCodeBlock.class, "asList", List.class, cls); // JITCodeBlock.asList(array): [..., list] - } + invokeStat(Arrays.class, "asList", List.class, Object[].class); // Arrays.asList(array): [..., list] new_(LazyListOnList.class); // new LazyListOnList: [..., list, lazylist] dup_x1(); // [..., lazylist, list, lazylist] swap(); // [..., lazylist, lazylist, list] diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/JITCodeBlock.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/JITCodeBlock.java index 0fde80bb..d0388563 100644 --- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/JITCodeBlock.java +++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/jit/JITCodeBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011-2012 Dennis Wagelaar, Vrije Universiteit Brussel. + * Copyright (c) 2011-2014 Dennis Wagelaar, Vrije Universiteit Brussel. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,7 +13,6 @@ package org.eclipse.m2m.atl.emftvm.jit; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashSet; import java.util.List; @@ -1511,108 +1510,4 @@ public abstract class JITCodeBlock { throw new NoSuchFieldException(String.format("Field %s::%s not found", EMFTVMUtil.toPrettyString(type, env), propname)); } - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Boolean> asList(boolean[] array) { - final List<Boolean> list = new ArrayList<Boolean>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Character> asList(char[] array) { - final List<Character> list = new ArrayList<Character>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Byte> asList(byte[] array) { - final List<Byte> list = new ArrayList<Byte>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Short> asList(short[] array) { - final List<Short> list = new ArrayList<Short>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Integer> asList(int[] array) { - final List<Integer> list = new ArrayList<Integer>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Long> asList(long[] array) { - final List<Long> list = new ArrayList<Long>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Float> asList(float[] array) { - final List<Float> list = new ArrayList<Float>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - - /** - * Converts <code>array</code> to a {@link List}. - * @param array the array to convert - * @return the {@link List} containing the <code>array</code> values - */ - protected static List<Double> asList(double[] array) { - final List<Double> list = new ArrayList<Double>(array.length); - for (int i = 0; i < array.length; i++) { - list.add(array[i]); - } - return list; - } - } |