From 43a8e3ea9df238ad1b490097da8569a208aa724b Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 23 Jul 1999 14:17:14 +0000 Subject: [PATCH] create listener set on demand to save memory git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1124 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/obfuscator/FieldIdentifier.java.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jode/jode/obfuscator/FieldIdentifier.java.in b/jode/jode/obfuscator/FieldIdentifier.java.in index b17873d..74ea015 100644 --- a/jode/jode/obfuscator/FieldIdentifier.java.in +++ b/jode/jode/obfuscator/FieldIdentifier.java.in @@ -44,7 +44,7 @@ public class FieldIdentifier extends Identifier{ * The FieldChangeListener that should be notified if a * write to this field is found. */ - private Collection fieldListeners = new HashSet(); + private Collection fieldListeners; public FieldIdentifier(ClassIdentifier clazz, FieldInfo info) { super(info.getName()); @@ -106,6 +106,8 @@ public class FieldIdentifier extends Identifier{ public void addFieldListener(Identifier ident) { if (ident == null) throw new NullPointerException(); + if (fieldListeners == null) + fieldListeners = new HashSet(); if (!fieldListeners.contains(ident)) fieldListeners.add(ident); } @@ -115,6 +117,9 @@ public class FieldIdentifier extends Identifier{ return; notConstant = true; + if (fieldListeners == null) + return; + for (Iterator i = fieldListeners.iterator(); i.hasNext(); ) Main.getClassBundle().analyzeIdentifier((Identifier) i.next()); fieldListeners = null;