- if (((SSJavaType) rhs.getType().getExtension()).getCompLoc() != null) {
- rhsLocTuple.addAll(((SSJavaType) rhs.getType().getExtension()).getCompLoc()
- .getTuple());
+ NTuple<Location> rhsLocTuple = new NTuple<Location>();
+ NTuple<Location> lhsLocTuple = new NTuple<Location>();
+ if (mapDescriptorToLocationPath.containsKey(rhs)) {
+ mapDescriptorToLocationPath.put(lhs, mapDescriptorToLocationPath.get(rhs));
+ } else {
+ // rhs side
+ if (rhs.getType().getExtension() != null
+ && rhs.getType().getExtension() instanceof SSJavaType) {
+
+ if (((SSJavaType) rhs.getType().getExtension()).getCompLoc() != null) {
+ rhsLocTuple.addAll(((SSJavaType) rhs.getType().getExtension()).getCompLoc()
+ .getTuple());
+ }
+
+ } else {
+ NTuple<Location> locTuple = deriveLocationTuple(md, rhs);
+ if (locTuple != null) {
+ rhsLocTuple.addAll(locTuple);
+ }
+ }
+ if (rhsLocTuple.size() > 0) {
+ mapDescriptorToLocationPath.put(rhs, rhsLocTuple);