Skip to content

Commit

Permalink
test: remove redundant cast (#2704)
Browse files Browse the repository at this point in the history
  • Loading branch information
zielint0 authored and monperrus committed Oct 22, 2018
1 parent 499f0b5 commit 740ed6a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/test/java/spoon/test/ctCase/SwitchCaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void insertBeforeStatementInSwitchCaseWithoutException() throws Exception
}

private <T extends CtElement> List<T> elementsOfType(Class<T> type, Factory factory) {
return (List) Query.getElements(factory, new TypeFilter<>(type));
return Query.getElements(factory, new TypeFilter<>(type));
}

private Factory factoryFor(String packageName, String className) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import spoon.reflect.factory.Factory;
import spoon.reflect.reference.CtExecutableReference;
import spoon.reflect.reference.CtFieldReference;
import spoon.reflect.declaration.CtImport;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.visitor.DefaultJavaPrettyPrinter;
import spoon.reflect.visitor.filter.TypeFilter;
Expand All @@ -41,7 +40,6 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import static org.junit.Assert.assertEquals;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/spoon/test/trycatch/TryCatchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void testTryCatchVariableGetType() {
assertEquals(1, catchVariable.getMultiTypes().size());
assertEquals(IllegalArgumentException.class, catchVariable.getMultiTypes().get(0).getActualClass());

catchVariable.setMultiTypes(Collections.singletonList((CtTypeReference)factory.Type().createReference(UnsupportedOperationException.class)));
catchVariable.setMultiTypes(Collections.singletonList(factory.Type().createReference(UnsupportedOperationException.class)));
assertEquals(UnsupportedOperationException.class,catchVariable.getType().getActualClass());
//contract setType influences multitypes
assertEquals(1, catchVariable.getMultiTypes().size());
Expand Down

0 comments on commit 740ed6a

Please sign in to comment.