Changes
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user