Trivial code householding

- Replace `if (!x) ... else ...` with `if(x) ... else ...`
- Avoid throwing RuntimeException; use children
This commit is contained in:
ljacqu
2016-05-30 12:18:55 +02:00
parent 9349993faf
commit 9b1ee86b2f
19 changed files with 77 additions and 82 deletions
@@ -73,13 +73,13 @@ public class PasswordSecurityTest {
Object[] arguments = invocation.getArguments();
if (arguments[0] instanceof PasswordEncryptionEvent) {
PasswordEncryptionEvent event = (PasswordEncryptionEvent) arguments[0];
caughtClassInEvent = event.getMethod() != null ? event.getMethod().getClass() : null;
caughtClassInEvent = event.getMethod() == null ? null : event.getMethod().getClass();
event.setMethod(method);
}
return null;
}
}).when(pluginManager).callEvent(any(Event.class));
initializer = new AuthMeServiceInitializer(new String[]{});
initializer = new AuthMeServiceInitializer();
initializer.register(NewSetting.class, settings);
initializer.register(DataSource.class, dataSource);
initializer.register(PluginManager.class, pluginManager);
@@ -152,7 +152,7 @@ public abstract class AbstractEncryptionMethodTest {
*
* @param method The method to create a test class for
*/
static void generateTest(EncryptionMethod method) {
protected static void generateTest(EncryptionMethod method) {
String className = method.getClass().getSimpleName();
// Create javadoc and "public class extends" and the constructor call "super(new Class(),"
System.out.println("/**\n * Test for {@link " + className + "}.\n */");