private void processEndOfScopes(Integer pc) { BitSet endVars = endOfScopes.get(pc); if (endVars != null) { for (int i = endVars.nextSetBit(0); i >= 0; i = endVars.nextSetBit(i + 1)) { Integer v = Integer.valueOf(i); { Iterator<GroupPair> it = collectionGroups.iterator(); while (it.hasNext()) { GroupPair groupPair = it.next(); if (groupPair.containsMember(v)) { groupPair.removeMember(v); } } } { Iterator<Integer> it = groupToIterator.values().iterator(); while (it.hasNext()) { if (v.equals(it.next())) { it.remove(); } } } } } }
private void processEndOfScopes(Integer pc) { BitSet endVars = endOfScopes.get(pc); if (endVars != null) { for (int i = endVars.nextSetBit(0); i >= 0; i = endVars.nextSetBit(i + 1)) { Integer v = Integer.valueOf(i); { Iterator<GroupPair> it = collectionGroups.iterator(); while (it.hasNext()) { GroupPair groupPair = it.next(); if (groupPair.containsMember(v)) { groupPair.removeMember(v); } } } { Iterator<Integer> it = groupToIterator.values().iterator(); while (it.hasNext()) { if (v.equals(it.next())) { it.remove(); } } } } } }
private int findCollectionGroup(OpcodeStack.Item itm, boolean addIfNotFound) { Integer id = (Integer) itm.getUserValue(); if (id != null) { return id.intValue(); } Comparable<?> groupElement = getGroupElement(itm); if (groupElement == null) { return -1; } int numGroups = collectionGroups.size(); for (int i = 0; i < numGroups; i++) { GroupPair groupPair = collectionGroups.get(i); if (groupPair.containsMember(groupElement)) { return i; } } if (!addIfNotFound) { return -1; } GroupPair groupPair = new GroupPair(groupElement, itm.getSignature()); collectionGroups.add(groupPair); return collectionGroups.size() - 1; }
private int findCollectionGroup(OpcodeStack.Item itm, boolean addIfNotFound) { Integer id = (Integer) itm.getUserValue(); if (id != null) { return id.intValue(); } Comparable<?> groupElement = getGroupElement(itm); if (groupElement == null) { return -1; } int numGroups = collectionGroups.size(); for (int i = 0; i < numGroups; i++) { GroupPair groupPair = collectionGroups.get(i); if (groupPair.containsMember(groupElement)) { return i; } } if (!addIfNotFound) { return -1; } GroupPair groupPair = new GroupPair(groupElement, itm.getSignature()); collectionGroups.add(groupPair); return collectionGroups.size() - 1; }
private void removeFromCollectionGroup(OpcodeStack.Item itm) { Comparable<?> groupElement = getGroupElement(itm); if (groupElement != null) { for (GroupPair groupPair : collectionGroups) { if (groupPair.containsMember(groupElement)) { groupPair.removeMember(groupElement); break; } } } }
private void removeFromCollectionGroup(OpcodeStack.Item itm) { Comparable<?> groupElement = getGroupElement(itm); if (groupElement != null) { for (GroupPair groupPair : collectionGroups) { if (groupPair.containsMember(groupElement)) { groupPair.removeMember(groupElement); break; } } } }