This commit is contained in:
serso
2016-01-30 22:43:06 +01:00
parent 3797f26330
commit c68b6c5803
11 changed files with 53 additions and 74 deletions

View File

@@ -1,14 +1,13 @@
package jscl.text;
import java.lang.reflect.Array;
import java.util.Collections;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jscl.math.Generic;
import jscl.text.msg.Messages;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.reflect.Array;
import java.util.Collections;
/**
* User: serso
* Date: 10/27/11
@@ -130,7 +129,7 @@ public class ParserUtils {
}
public static <T, U> T[] copyOf(U[] array, int newLength, Class<? extends T[]> newType) {
T[] copy = (newType == Object[].class)
T[] copy = ((Object) newType == (Object) Object[].class)
? (T[]) new Object[newLength]
: (T[]) Array.newInstance(newType.getComponentType(), newLength);