From 9a9ae180513f1355a73560874939e62bdc830a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Tue, 9 Jul 2013 15:36:39 +0200 Subject: [PATCH] Issue #151 Memory caching fixed --- .../decompiler/flash/gui/abc/DecompiledEditorPane.java | 9 +++++---- trunk/src/com/jpexs/decompiler/flash/helpers/Cache.java | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index e22419fe2..2b567c0f0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -356,6 +356,10 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL } setText("//" + translate("pleasewait") + "..."); + this.abc = abc; + this.abcList = abcList; + this.script = scriptLeaf; + String hilightedCode = ""; cacheScriptPack(scriptLeaf, abcList); CachedDecompilation cd = getCached(scriptLeaf); @@ -363,10 +367,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL highlights = cd.getHighlights(); traitHighlights = cd.getTraitHighlights(); methodHighlights = cd.getMethodHighlights(); - classHighlights = cd.getClassHighlights(); - this.abc = abc; - this.abcList = abcList; - this.script = scriptLeaf; + classHighlights = cd.getClassHighlights(); setText(hilightedCode); } diff --git a/trunk/src/com/jpexs/decompiler/flash/helpers/Cache.java b/trunk/src/com/jpexs/decompiler/flash/helpers/Cache.java index 9850d3913..70cd6942b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/helpers/Cache.java +++ b/trunk/src/com/jpexs/decompiler/flash/helpers/Cache.java @@ -127,7 +127,7 @@ public class Cache { } return null; } else if (storageType == STORAGE_MEMORY) { - if (!cacheMemory.containsKey(key)) { + if (cacheMemory.containsKey(key)) { return cacheMemory.get(key); } return null;