Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove unnecessary suppress warnings annotations

  • Loading branch information...
commit b521586f1f6afc2a68ac493adacd5d668c61d053 1 parent 7681ddc
Mike Anderson authored
1  src/main/java/mikera/engine/ArrayGrid.java
View
@@ -112,7 +112,6 @@ public void visitBlocks(BlockVisitor<T> bf) {
- @SuppressWarnings("unchecked")
public ArrayGrid<T> clone() {
ArrayGrid<T> nbg;
try {
4 src/main/java/mikera/engine/BaseObject.java
View
@@ -31,7 +31,6 @@ public BaseObject() {
// no properties for default BaseObject
}
- @SuppressWarnings("unchecked")
public BaseObject(HashMap<String,Object> propertiesToCopy, BaseObject parent) {
if (propertiesToCopy!=null) {
local=(HashMap<String,Object>)propertiesToCopy.clone();
@@ -43,8 +42,7 @@ public BaseObject(HashMap<String,Object> propertiesToCopy, BaseObject parent) {
* Clone copies a BaseObject instance, maintaining
* the same inherited properties
*/
- @SuppressWarnings("unchecked")
- public Object clone() {
+ public Object clone() {
BaseObject o;
try {
o = (BaseObject) super.clone();
1  src/main/java/mikera/engine/Octreap.java
View
@@ -345,7 +345,6 @@ public void floodFill(int x, int y, int z, T value, T fromValue) {
return o3;
}
- @SuppressWarnings("unchecked")
public Octreap<T> clone() {
try {
Octreap<T> zn=(Octreap<T>)super.clone();
1  src/main/java/mikera/engine/PersistentTreeGrid.java
View
@@ -173,7 +173,6 @@ private void visitBlocksLocal(BlockVisitor<T> bf, int cx, int cy, int cz,int x1,
}
}
- @SuppressWarnings("unchecked")
@Override
public PersistentTreeGrid<T> clear() {
return EMPTY;
1  src/main/java/mikera/persistent/IntSet.java
View
@@ -439,7 +439,6 @@ public int size() {
return toArrayLocal(a);
}
- @SuppressWarnings("unchecked")
private <T> T[] toArrayLocal(T[] a) {
for (int i=0; i<a.length; i++) {
a[i]=(T)Integer.valueOf(data[i]);
1  src/main/java/mikera/persistent/PersistentHashMap.java
View
@@ -761,7 +761,6 @@ public int size() {
return PersistentHashMap.this.size();
}
- @SuppressWarnings("unchecked")
public boolean contains(Object o) {
if (!(o instanceof Map.Entry<?,?>)) return false;
Map.Entry<?,?> ent=(Map.Entry<?,?>)o;
1  src/main/java/mikera/persistent/PersistentMap.java
View
@@ -59,7 +59,6 @@ public V remove(Object arg0) {
public abstract PersistentCollection<V> values();
- @SuppressWarnings("unchecked")
public PersistentMap<K,V> clone() {
return (PersistentMap<K,V>)super.clone();
}
2  src/main/java/mikera/persistent/impl/ArraySet.java
View
@@ -23,12 +23,10 @@
public final class ArraySet<T> extends BasePersistentSet<T> {
private final T[] data;
- @SuppressWarnings("unchecked")
public static <T> ArraySet<T> createFromSet(Set<T> source) {
return new ArraySet<T>((T[])source.toArray());
}
- @SuppressWarnings("unchecked")
public static <T> ArraySet<T> createFromSet(PersistentSet<T> source) {
if (source instanceof ArraySet<?>) return (ArraySet<T>)source;
return new ArraySet<T>((T[])source.toArray());
5 src/main/java/mikera/util/Arrays.java
View
@@ -45,7 +45,6 @@
return true;
}
- @SuppressWarnings("unchecked")
public static <T> T[] insertElement(T[] array, T value, int i) {
int count=array.length;
T[] newarray=(T[]) Array.newInstance(array.getClass().getComponentType(), count+1);
@@ -56,7 +55,6 @@
return newarray;
}
-
public static float[] insertElement(float[] array, float value, int i) {
int count=array.length;
@@ -71,7 +69,6 @@
public static <T> T[] deleteElement(T[] array, int i) {
int count=array.length;
- @SuppressWarnings("unchecked")
T[] newarray=(T[]) Array.newInstance(array.getClass().getComponentType(), count-1);
System.arraycopy(array, 0, newarray, 0, i);
@@ -324,7 +321,6 @@ public static void main(String[] args) {
System.out.println(Arrays.isSorted(al));
}
- @SuppressWarnings("unchecked")
public static <T> T[] resize(T[] array, int newsize) {
int len=array.length;
T[] newarray=(T[]) Array.newInstance(array.getClass().getComponentType(), newsize);
@@ -651,7 +647,6 @@ public static void copy(double[] src, double[] dest) {
System.arraycopy(src, 0,dest,0,src.length);
}
- @SuppressWarnings("unchecked")
public static <T> T[] subArray(T[] array, int start, int end) {
int len=end-start;
T[] newarray=(T[]) Array.newInstance(array.getClass().getComponentType(), len);
5 src/test/java/mikera/persistent/TestPersistent.java
View
@@ -97,7 +97,6 @@
public <T> void testSizing(PersistentCollection<T> a) {
assertTrue(a.size()>=0);
- @SuppressWarnings("unchecked")
T[] output=(T[]) a.toArray();
assertEquals(a.size(),output.length);
@@ -131,7 +130,6 @@
//assertTrue(ca!=a);
}
- @SuppressWarnings("unchecked")
public <T> void testInclude(PersistentCollection<T> a) {
T[] ar=(T[])a.toArray();
if (ar.length>0) {
@@ -193,7 +191,6 @@
assertEquals(a,f.append(b));
}
- @SuppressWarnings("unchecked")
public <T> void testHashCode(PersistentList<T> a) {
int ah=a.hashCode();
@@ -274,8 +271,6 @@
}
-
- @SuppressWarnings("unchecked")
public <T> void testEquals(PersistentList<T> a) {
assertEquals(a,a.clone());
assertTrue(a==a.append((PersistentList<T>)ListFactory.emptyList()));
Please sign in to comment.
Something went wrong with that request. Please try again.