mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
cosmetics: generics
This commit is contained in:
parent
fa91dcc051
commit
f766cfa76c
1 changed files with 5 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2010 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
public class ListComparator {
|
public class ListComparator {
|
||||||
private static Comparator fDefaultComparator;
|
private static Comparator fDefaultComparator;
|
||||||
|
|
||||||
|
@ -45,14 +46,14 @@ public class ListComparator {
|
||||||
if(a1 == null || a1.length == 0)
|
if(a1 == null || a1.length == 0)
|
||||||
return null;
|
return null;
|
||||||
if(a2 == null || a2.length == 0){
|
if(a2 == null || a2.length == 0){
|
||||||
List list = new ArrayList(a1.length);
|
List<Object> list = new ArrayList<Object>(a1.length);
|
||||||
for(int i = 0; i < a1.length; i++){
|
for(int i = 0; i < a1.length; i++){
|
||||||
list.add(a1[i]);
|
list.add(a1[i]);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
List list = new ArrayList(a1.length);
|
List<Object> list = new ArrayList<Object>(a1.length);
|
||||||
Object o1;
|
Object o1;
|
||||||
for(int i = 0; i < a1.length; i++){
|
for(int i = 0; i < a1.length; i++){
|
||||||
o1 = a1[i];
|
o1 = a1[i];
|
||||||
|
@ -65,6 +66,7 @@ public class ListComparator {
|
||||||
return list.size() != 0 ? list : null;
|
return list.size() != 0 ? list : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static boolean match(Object a1[], Object a2[], Comparator c){
|
public static boolean match(Object a1[], Object a2[], Comparator c){
|
||||||
if(a1 == null)
|
if(a1 == null)
|
||||||
return a2 == null;
|
return a2 == null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue