-
- Set<Descriptor> keySet = mapDescToInferCompositeLocation.keySet();
- for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
- Descriptor key = (Descriptor) iterator.next();
- CompositeLocation inferLoc = getInferLocation(key);
-
- CompositeLocation newInferLoc = new CompositeLocation();
- if (inferLoc.getSize() > 1) {
- // local variable has a composite location [refLoc.inferedLoc]
-
- Location oldLoc = inferLoc.get(inferLoc.getSize() - 1);
- // oldLoc corresponds to infered loc.
-
- if (oldLoc.getLocIdentifier().equals(oldLocSymbol)) {
- for (int i = 0; i < inferLoc.getSize() - 1; i++) {
- Location loc = inferLoc.get(i);
- newInferLoc.addLocation(loc);
- }
- Location newLoc = new Location(oldLoc.getDescriptor(), newSharedLoc);
- newInferLoc.addLocation(newLoc);
- mapDescriptorToLocation(key, newInferLoc);
- }
- // else {
- // return;
- // }
- } else {
- // local var has a local location
- Location oldLoc = inferLoc.get(0);
- if (oldLoc.getLocIdentifier().equals(oldLocSymbol)) {
- Location newLoc = new Location(oldLoc.getDescriptor(), newSharedLoc);
- newInferLoc.addLocation(newLoc);
- mapDescriptorToLocation(key, newInferLoc);
- }
- // else {
- // return;
- // }
- }
-
- }