# HG changeset patch # User Shinji KONO # Date 1579931125 -32400 # Node ID e8f6c35e6b69eb604aa032051dbf41db77fcd39e # Parent 9697be80d1f6d4ac9f19ee38c4e7ac785eff5bbe minor fix diff -r 9697be80d1f6 -r e8f6c35e6b69 build.gradle --- a/build.gradle Fri Jan 24 20:47:53 2020 +0900 +++ b/build.gradle Sat Jan 25 14:45:25 2020 +0900 @@ -16,7 +16,7 @@ dependencies { compile fileTree(dir: 'lib', include: '*.jar') testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0') - //compile group: 'org.msgpack', name: 'msgpack-core', version: '0.8.16' + //compile group: 'org.msgpack', name: 'msgpack-core', version: '0.8.20' //compile group: 'org.msgpack', name: 'jackson-dataformat-msgpack', version: '0.8.16' compile group: 'org.msgpack', name: 'msgpack', version: '0.6.12' compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.1' diff -r 9697be80d1f6 -r e8f6c35e6b69 src/main/java/christie/datagear/command/CommandBuilder.java --- a/src/main/java/christie/datagear/command/CommandBuilder.java Fri Jan 24 20:47:53 2020 +0900 +++ b/src/main/java/christie/datagear/command/CommandBuilder.java Sat Jan 25 14:45:25 2020 +0900 @@ -71,18 +71,17 @@ return this; } - public Command build(){ + public Command build() { if(type == null) throw new NullPointerException(); return factory.getCommand(type, this); } - private class CommandFactory{ + private class CommandFactory { public Command getCommand(CommandType type, CommandBuilder cb) { switch (type) { case PUT: //check need param - checkNull(cb.key, cb.dg); return new PutCommand(cb); case TAKE: @@ -93,15 +92,18 @@ checkNull(cb.cgmID, cb.cg, cb.toDgmName, cb.key, cb.dg); return new PeekCommand(cb); case REMOTETAKE: - if (cb.fromDgmName.equals("local")) throw new NullPointerException(); + if (cb.fromDgmName.equals("local")) + throw new NullPointerException(); checkNull(cb.key, cb.connection, cb.clazz); return new RemoteTakeCommand(cb); case REMOTEPEEK: - if (cb.fromDgmName.equals("local")) throw new NullPointerException(); + if (cb.fromDgmName.equals("local")) + throw new NullPointerException(); checkNull(cb.key, cb.connection, cb.clazz); return new RemotePeekCommand(cb); case REPLY: - if (cb.fromDgmName.equals("local")) throw new NullPointerException(); + //if (cb.fromDgmName.equals("local")) + // throw new NullPointerException(); checkNull(cb.key, cb.connection, cb.dg); return new ReplyCommand(cb); case CLOSE: @@ -113,11 +115,10 @@ return null; } - public void checkNull(Object... params){ - for(Object param: params){ - if(param == null){ + public void checkNull(Object... params) { + for(Object param: params) { + if(param == null) { throw new NullPointerException(); - } } } diff -r 9697be80d1f6 -r e8f6c35e6b69 src/test/java/christie/example/RemoteTake/StartRemoteTake.java --- a/src/test/java/christie/example/RemoteTake/StartRemoteTake.java Fri Jan 24 20:47:53 2020 +0900 +++ b/src/test/java/christie/example/RemoteTake/StartRemoteTake.java Sat Jan 25 14:45:25 2020 +0900 @@ -9,7 +9,7 @@ super(cgm); } - public static void main(String args[]){ + public static void main(String args[]) { CodeGearManager cgm = createCGM(10000); new StartRemoteTake(cgm); cgm.createRemoteDGM("remote", "localhost", 10000);