Fix a bunch of small issues detected by using an intellij inspection

This commit is contained in:
Mumfrey committed 2017-09-08 18:36:57 +01:00
1 parent ec6fbf5f61
commit 3961a7cbf8
18 files changed
+33 -38

No files matched your search

@@ -75,10 +75,7 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler
}
for (VariableElement param : this.element.getParameters()) {
AnnotationHandle coerce = AnnotationHandle.of(param, Coerce.class);
if (coerce != null) {
return true;
}
return AnnotationHandle.of(param, Coerce.class).exists();
}
return false;
@@ -238,8 +238,7 @@ public final class TargetMap extends HashMap<TypeReference, Set<TypeReference>>
try {
streamIn = new FileInputStream(sessionFile);
objectinputstream = new ObjectInputStream(streamIn);
TargetMap map = (TargetMap)objectinputstream.readObject();
return map;
return (TargetMap)objectinputstream.readObject();
} catch (Exception e) {
e.printStackTrace();
} finally {
@@ -218,7 +218,7 @@ public class TypeHandle {
* Get whether the element is probably public
*/
public boolean isPublic() {
return this.getTargetElement() != null ? this.getTargetElement().getModifiers().contains(Modifier.PUBLIC) : false;
return this.getTargetElement() != null && this.getTargetElement().getModifiers().contains(Modifier.PUBLIC);
}
/**