@Nullable protected ILocationInResource getMergedLocationInResource(AbstractTraceRegion region) { ILocationData locationData = region.getMergedAssociatedLocation(); if (locationData != null) return createLocationInResourceFor(locationData, region); return null; }
protected Set<Integer> createSmapInfo(AbstractTraceRegion targetRegion, Set<LineMapping> lineMappings) { Set<Integer> mapped = newHashSet(); for (AbstractTraceRegion nested : targetRegion.getNestedRegions()) { mapped.addAll(createSmapInfo(nested, lineMappings)); } if (targetRegion.isUseForDebugging()) { ILocationData location = targetRegion.getMergedAssociatedLocation(); if (location != null) { final URI path = targetRegion.getAssociatedPath(); if (path != null) { int myLineNumber = targetRegion.getMyLineNumber(); int myEndLineNumber = targetRegion.getMyEndLineNumber(); for (int i = myLineNumber; i <= myEndLineNumber; i++) { if (!mapped.contains(i)) { final LineMapping e = new LineMapping(location.getLineNumber() + 1, i, i, path); lineMappings.add(e); mapped.add(i); } } } } } return mapped; }
@Nullable public URI getAssociatedPath() { ILocationData data = getMergedAssociatedLocation(); if (data != null) { URI result = data.getPath(); if (result != null) { return result; } } if (parent == null) return null; boolean uriSeen = false; for (ILocationData associated : getAssociatedLocations()) if (associated.getPath() != null) { if (!uriSeen) uriSeen = true; else return null; } return parent.getAssociatedPath(); }
for(AbstractTraceRegion child: result) { rootLocation = rootLocation.merge(new TextRegionWithLineInformation(child.getMyOffset(), child.getMyLength(), child.getMyLineNumber(), child.getMyEndLineNumber())); ILocationData childAssociation = child.getMergedAssociatedLocation(); if (childAssociation != null) associated = associated.merge(childAssociation);
path = leftChild.getAssociatedPath(); ITextRegionWithLineInformation merged = parent.getMergedAssociatedLocation(); if (merged != null) { return new LocationInResource(merged.getOffset(), merged.getLength(), merged.getLineNumber(), merged.getEndLineNumber(), path, this);