Skip to content

Commit

Permalink
Dubbo-3473 Fix Not Properly Closed Resources (#3474)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaci authored and lixiaojiee committed Mar 7, 2019
1 parent d414c7b commit 2e660df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
} else if (ProtocolUtils.isJavaGenericSerialization(generic)) {
for (int i = 0; i < args.length; i++) {
if (byte[].class == args[i].getClass()) {
try {
UnsafeByteArrayInputStream is = new UnsafeByteArrayInputStream((byte[]) args[i]);
try(UnsafeByteArrayInputStream is = new UnsafeByteArrayInputStream((byte[]) args[i])) {
args[i] = ExtensionLoader.getExtensionLoader(Serialization.class)
.getExtension(Constants.GENERIC_SERIALIZATION_NATIVE_JAVA)
.deserialize(null, is).readObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public String telnet(Channel channel, String message) {
int showLogLength = Integer.parseInt(str[0]);

if (file != null && file.exists()) {
try {
FileInputStream fis = new FileInputStream(file);
try(FileInputStream fis = new FileInputStream(file)) {
FileChannel filechannel = fis.getChannel();
size = filechannel.size();
ByteBuffer bb;
Expand Down

0 comments on commit 2e660df

Please sign in to comment.