浏览代码

fixed the constructor.

javasabr 8 年之前
父节点
当前提交
06599d1eac
共有 1 个文件被更改,包括 1 次插入7 次删除
  1. 1 7
      jme3-core/src/main/java/com/jme3/util/SafeArrayList.java

+ 1 - 7
jme3-core/src/main/java/com/jme3/util/SafeArrayList.java

@@ -99,13 +99,7 @@ public class SafeArrayList<E> implements List<E>, Cloneable {
 
     public SafeArrayList(final Class<E> elementType, final Collection<? extends E> collection) {
         this.elementType = elementType;
-
-        if (collection instanceof SafeArrayList) {
-            this.buffer = Arrays.asList(((SafeArrayList<E>) collection).getArray());
-        } else {
-            this.buffer = new ArrayList<>(collection);
-        }
-
+        this.buffer = new ArrayList<>(collection);
         this.size = buffer.size();
     }