From 531a1d5477a6af8c9986792ab1fd23e84b539054 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 22 Jan 2015 15:39:45 +0300 Subject: [PATCH] decompiler: lazy create bytecodes set --- .../decompiler/modules/decompiler/exps/Exprent.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java index 21a3be8..82be5ca 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class Exprent { public final int type; public final int id; - public final Set bytecode = new HashSet(); // offsets of bytecode instructions decompiled to this exprent + public Set bytecode = null; // offsets of bytecode instructions decompiled to this exprent public Exprent(int type) { this.type = type; @@ -122,8 +122,13 @@ public class Exprent { public void replaceExprent(Exprent oldExpr, Exprent newExpr) { } public void addBytecodeOffsets(Collection bytecodeOffsets) { - if (bytecodeOffsets != null) { - bytecode.addAll(bytecodeOffsets); + if (bytecodeOffsets != null && !bytecodeOffsets.isEmpty()) { + if (bytecode == null) { + bytecode = new HashSet(bytecodeOffsets); + } + else { + bytecode.addAll(bytecodeOffsets); + } } } }