From 520b618bd6c1f43155eba4ee9be68584515b1e2e Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Sat, 12 Jan 2019 21:53:18 +0800 Subject: [PATCH] fixed compile error caused by remote index cache --- .idea/misc.xml | 2 +- decode-service.iml | 88 +++++++++++++++++++ .../decoder/service/IRDecodeService.java | 11 ++- 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index a99e9b7..2e25f26 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/decode-service.iml b/decode-service.iml index c75063c..920ced4 100644 --- a/decode-service.iml +++ b/decode-service.iml @@ -113,5 +113,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/net/irext/decoder/service/IRDecodeService.java b/src/main/java/net/irext/decoder/service/IRDecodeService.java index cc95bb2..4fdc2f9 100644 --- a/src/main/java/net/irext/decoder/service/IRDecodeService.java +++ b/src/main/java/net/irext/decoder/service/IRDecodeService.java @@ -79,10 +79,13 @@ public class IRDecodeService extends AbstractBaseService { LoggerUtil.getInstance().trace(TAG, "remoteIndex get : " + remoteIndex.getId() + ", " + remoteIndex.getRemoteMap()); } - byte[] binaryContent = DecodeLogic.getInstance().openIRBinary(context, irBinaryRepository, remoteIndex); + RemoteIndex cachedRemoteIndex = + DecodeLogic.getInstance().openIRBinary(context, irBinaryRepository, remoteIndex); - if (null != binaryContent) { - LoggerUtil.getInstance().trace(TAG, "binary content fetched : " + binaryContent.length); + if (null != cachedRemoteIndex) { + LoggerUtil.getInstance().trace(TAG, "binary content fetched : " + + cachedRemoteIndex.getRemoteMap()); + remoteIndex.setBinaries(cachedRemoteIndex.getBinaries()); // construct a session with this binary String address = request.getRemoteAddr(); LoggerUtil.getInstance().trace(TAG, "request Address = " + address); @@ -132,7 +135,7 @@ public class IRDecodeService extends AbstractBaseService { try { String sessionId = closeRequest.getSessionId(); ServiceResponse response = new ServiceResponse(); - DecodeLogic.getInstance().close(sessionId); + DecodeLogic.getInstance().close(decodeSessionRepository, sessionId); return response; } catch (Exception e) { e.printStackTrace();