ICU-8268 impossible cast from double[] to int[].
Java doesn't allow casting array of type A to array of type B. The elements have to be manually casted. X-SVN-Rev: 30723
This commit is contained in:
parent
2fe1f01851
commit
b58534a609
@ -77,8 +77,13 @@ public final class Utility {
|
||||
return(arrayEquals((Object[]) source,target));
|
||||
if (source instanceof int[])
|
||||
return(arrayEquals((int[]) source,target));
|
||||
if (source instanceof double[])
|
||||
return(arrayEquals((int[]) source,target));
|
||||
if (source instanceof double[]) {
|
||||
double[] oldSource = (double[]) source;
|
||||
int[] newSource = new int[oldSource.length];
|
||||
for (int i = 0; i < oldSource.length; i++)
|
||||
newSource[i] = (int)oldSource[i];
|
||||
return arrayEquals(newSource, target);
|
||||
}
|
||||
if (source instanceof byte[])
|
||||
return(arrayEquals((byte[]) source,target));
|
||||
return source.equals(target);
|
||||
|
Loading…
Reference in New Issue
Block a user