Dubbo-3473 Fix Not Properly Closed Resources (#3474)
This commit is contained in:
parent
d414c7b53f
commit
2e660dfef7
|
|
@ -76,8 +76,7 @@ public class GenericFilter implements Filter {
|
|||
} 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();
|
||||
|
|
|
|||
|
|
@ -55,8 +55,7 @@ public class LogTelnetHandler implements TelnetHandler {
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue