mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-02 20:04:37 +00:00
Added #1875 Remove no longer accessed items from cache after certain amount of time
This commit is contained in:
@@ -47,9 +47,9 @@ public class IdentifiersDeobfuscation {
|
||||
|
||||
private final HashMap<String, Integer> typeCounts = new HashMap<>();
|
||||
|
||||
private static final Cache<String, String> as2NameCache = Cache.getInstance(false, true, "as2_ident");
|
||||
private static final Cache<String, String> as2NameCache = Cache.getInstance(false, true, "as2_ident", true);
|
||||
|
||||
private static final Cache<String, String> as3NameCache = Cache.getInstance(false, true, "as3_ident");
|
||||
private static final Cache<String, String> as3NameCache = Cache.getInstance(false, true, "as3_ident", true);
|
||||
|
||||
public static final String VALID_FIRST_CHARACTERS = "\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}_$";
|
||||
|
||||
|
||||
@@ -341,16 +341,16 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
private final IdentifiersDeobfuscation deobfuscation = new IdentifiersDeobfuscation();
|
||||
|
||||
@Internal
|
||||
private final Cache<String, SerializableImage> frameCache = Cache.getInstance(false, false, "frame");
|
||||
private final Cache<String, SerializableImage> frameCache = Cache.getInstance(false, false, "frame", true);
|
||||
|
||||
@Internal
|
||||
private final Cache<CharacterTag, RECT> rectCache = Cache.getInstance(true, true, "rect");
|
||||
private final Cache<CharacterTag, RECT> rectCache = Cache.getInstance(true, true, "rect", true);
|
||||
|
||||
@Internal
|
||||
private final Cache<SHAPE, ShapeExportData> shapeExportDataCache = Cache.getInstance(true, true, "shapeExportData");
|
||||
private final Cache<SHAPE, ShapeExportData> shapeExportDataCache = Cache.getInstance(true, true, "shapeExportData", true);
|
||||
|
||||
@Internal
|
||||
private final Cache<SoundInfoSoundCacheEntry, byte[]> soundCache = Cache.getInstance(false, false, "sound");
|
||||
private final Cache<SoundInfoSoundCacheEntry, byte[]> soundCache = Cache.getInstance(false, false, "sound", true);
|
||||
|
||||
@Internal
|
||||
public final AS2Cache as2Cache = new AS2Cache();
|
||||
|
||||
@@ -27,9 +27,9 @@ import com.jpexs.helpers.Cache;
|
||||
*/
|
||||
public class AS2Cache {
|
||||
|
||||
private final Cache<ASMSource, HighlightedText> cache = Cache.getInstance(true, false, "as2");
|
||||
private final Cache<ASMSource, HighlightedText> cache = Cache.getInstance(true, false, "as2", false);
|
||||
|
||||
private final Cache<ASMSource, ActionList> pcodeCache = Cache.getInstance(true, true, "as2pcode");
|
||||
private final Cache<ASMSource, ActionList> pcodeCache = Cache.getInstance(true, true, "as2pcode", false);
|
||||
|
||||
public void clear() {
|
||||
pcodeCache.clear();
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.jpexs.helpers.Cache;
|
||||
*/
|
||||
public class AS3Cache {
|
||||
|
||||
private final Cache<ScriptPack, HighlightedText> cache = Cache.getInstance(true, false, "as3");
|
||||
private final Cache<ScriptPack, HighlightedText> cache = Cache.getInstance(true, false, "as3", false);
|
||||
|
||||
public void clear() {
|
||||
cache.clear();
|
||||
|
||||
@@ -787,6 +787,10 @@ public final class Configuration {
|
||||
@ConfigurationDefaultBoolean(true)
|
||||
@ConfigurationCategory("display")
|
||||
public static ConfigurationItem<Boolean> autoPlayPreviews = null;
|
||||
|
||||
@ConfigurationDefaultInt(5 * 60 * 1000)
|
||||
@ConfigurationCategory("limit")
|
||||
public static ConfigurationItem<Integer> maxCachedTime = null;
|
||||
|
||||
private enum OSId {
|
||||
WINDOWS, OSX, UNIX
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.logging.Logger;
|
||||
|
||||
public class AbstractDocs {
|
||||
|
||||
protected static Cache<String, String> docsCache = Cache.getInstance(false, true, "abstractDocsCache");
|
||||
protected static Cache<String, String> docsCache = Cache.getInstance(false, true, "abstractDocsCache", false);
|
||||
|
||||
protected static String htmlFooter() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user