Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code rule #3016

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static Class<?> forName(String className) {
}

public static Class<?> _forName(String className) throws ClassNotFoundException {
switch(className){
switch (className) {
case "boolean":
return boolean.class;
case "byte":
Expand Down Expand Up @@ -112,6 +112,7 @@ public static Class<?> _forName(String className) throws ClassNotFoundException
return float[].class;
case "double[]":
return double[].class;
default:
}
try {
return arrayForName(className);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ private static Object parse(Reader reader, JSONVisitor handler, int expect) thro
handler.objectItemValue(value, false);
break;
}
default:
}
}
break;
Expand Down Expand Up @@ -629,6 +630,7 @@ private static Object parse(Reader reader, JSONVisitor handler, int expect) thro
handler.objectItemValue(value, false);
break;
}
default:
}
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ private void beforeValue() throws IOException {
case OBJECT_VALUE:
mState.type = OBJECT;
return;
default:
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ public JSONToken yylex() throws java.io.IOException, ParseException {
return null;
} else {
zzScanError(ZZ_NO_MATCH);
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@
* <p>
* <b>header fields in version 1</b>
* <ol>
* <li>string - service name</li>
* <li>long - dubbo request id</li>
* <li>string - service name</li>
* <li>long - dubbo request id</li>
* </ol>
* </p>
*/

/**
* @since 2.7.0, use https://github.com/dubbo/dubbo-rpc-native-thrift instead
*/
Expand Down Expand Up @@ -108,7 +109,7 @@ public void encode(Channel channel, ChannelBuffer buffer, Object message)
} else if (message instanceof Response) {
encodeResponse(channel, buffer, (Response) message);
} else {
throw new UnsupportedOperationException("Thrift codec only support encode "
throw new UnsupportedOperationException("Thrift codec only support encode "
+ Request.class.getName() + " and " + Response.class.getName());
}

Expand Down Expand Up @@ -299,7 +300,7 @@ private Object decode(TProtocol protocol)
.getExtension(ThriftClassNameGenerator.NAME).generateResultClassName(serviceName, message.name);

if (StringUtils.isEmpty(resultClassName)) {
throw new IllegalArgumentException("Could not infer service result class name from service name "
throw new IllegalArgumentException("Could not infer service result class name from service name "
+ serviceName + ", the service name you specified may not generated by thrift idl compiler");
}

Expand Down Expand Up @@ -401,7 +402,7 @@ private void encodeRequest(Channel channel, ChannelBuffer buffer, Request reques
String serviceName = inv.getAttachment(Constants.INTERFACE_KEY);

if (StringUtils.isEmpty(serviceName)) {
throw new IllegalArgumentException("Could not find service name in attachment with key "
throw new IllegalArgumentException("Could not find service name in attachment with key "
+ Constants.INTERFACE_KEY);
}

Expand Down Expand Up @@ -667,6 +668,7 @@ private void encodeResponse(Channel channel, ChannelBuffer buffer, Response resp
case TMessageType.REPLY:
resultObj.write(protocol);
break;
default:
}
protocol.writeMessageEnd();
protocol.getTransport().flush();
Expand Down