projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Collapse identical catch blocks
[Sone.git]
/
src
/
test
/
java
/
net
/
pterodactylus
/
sone
/
test
/
TestUtil.java
diff --git
a/src/test/java/net/pterodactylus/sone/test/TestUtil.java
b/src/test/java/net/pterodactylus/sone/test/TestUtil.java
index
d330281
..
22c2057
100644
(file)
--- a/
src/test/java/net/pterodactylus/sone/test/TestUtil.java
+++ b/
src/test/java/net/pterodactylus/sone/test/TestUtil.java
@@
-18,9
+18,7
@@
public class TestUtil {
modifiersField.setAccessible(true);
modifiersField.setInt(clientCoreField, clientCoreField.getModifiers() & ~Modifier.FINAL);
clientCoreField.set(object, value);
modifiersField.setAccessible(true);
modifiersField.setInt(clientCoreField, clientCoreField.getModifiers() & ~Modifier.FINAL);
clientCoreField.set(object, value);
- } catch (NoSuchFieldException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
+ } catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
throw new RuntimeException(e);
}
}
@@
-30,9
+28,7
@@
public class TestUtil {
Field field = object.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return (T) field.get(object);
Field field = object.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return (T) field.get(object);
- } catch (NoSuchFieldException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
+ } catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
throw new RuntimeException(e);
}
}
@@
-42,11
+38,7
@@
public class TestUtil {
Method method = object.getClass().getDeclaredMethod(methodName, new Class[0]);
method.setAccessible(true);
return (T) method.invoke(object);
Method method = object.getClass().getDeclaredMethod(methodName, new Class[0]);
method.setAccessible(true);
return (T) method.invoke(object);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
throw new RuntimeException(e);
}
}