private void buildVariableEndScopeMap() { LocalVariableTable lvt = getMethod().getLocalVariableTable(); if ((lvt == null) || (lvt.getLength() == 0)) { endOfScopes = Collections.emptyMap(); } else { int len = lvt.getLength(); endOfScopes = new HashMap<>((int) (len * 1.6)); for (int i = 0; i < len; i++) { @SuppressWarnings("deprecation") LocalVariable lv = lvt.getLocalVariable(i); if (lv != null) { Integer endPC = Integer.valueOf(lv.getStartPC() + lv.getLength()); BitSet vars = endOfScopes.get(endPC); if (vars == null) { vars = new BitSet(); endOfScopes.put(endPC, vars); } vars.set(lv.getIndex()); } } } }
/** * Initialize from another object. Note that both objects use the same * references (shallow copy). Use copy() for a physical copy. */ public LocalVariableTable(final LocalVariableTable c) { this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(), c.getConstantPool()); }
/** * Initialize from another object. Note that both objects use the same * references (shallow copy). Use copy() for a physical copy. */ public LocalVariableTable(LocalVariableTable c) { this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(), c.getConstantPool()); }
private void buildVariableEndScopeMap() { endOfScopes = new HashMap<>(); LocalVariableTable lvt = getMethod().getLocalVariableTable(); if (lvt != null) { int len = lvt.getLength(); for (int i = 0; i < len; i++) { @SuppressWarnings("deprecation") LocalVariable lv = lvt.getLocalVariable(i); if (lv != null) { Integer endPC = Integer.valueOf(lv.getStartPC() + lv.getLength()); BitSet vars = endOfScopes.get(endPC); if (vars == null) { vars = new BitSet(); endOfScopes.put(endPC, vars); } vars.set(lv.getIndex()); } } } }