private String toReportableString(final ILocationData locationData) { int _lineNumber = locationData.getLineNumber(); int _endLineNumber = locationData.getEndLineNumber(); boolean _equals = (_lineNumber == _endLineNumber); if (_equals) { int _lineNumber_1 = locationData.getLineNumber(); int _plus = (_lineNumber_1 + 1); return Integer.toString(_plus); } else { StringConcatenation _builder = new StringConcatenation(); int _lineNumber_2 = locationData.getLineNumber(); int _plus_1 = (_lineNumber_2 + 1); _builder.append(_plus_1); _builder.append("-"); int _endLineNumber_1 = locationData.getEndLineNumber(); int _plus_2 = (_endLineNumber_1 + 1); _builder.append(_plus_2); return _builder.toString(); } } }
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; }
/** * Creates a new location for a target resource that matches the given {@code location}. * @param location the location * @return the location in resource, <code>null</code> detecting a path fails. */ @Nullable protected ILocationInResource createLocationInResourceFor(ILocationData location, AbstractTraceRegion traceRegion) { URI path = location.getPath(); if (path == null) path = traceRegion.getAssociatedPath(); if (path == null) return null; return new LocationInResource(location.getOffset(), location.getLength(), location.getLineNumber(), location.getEndLineNumber(), path, this); }
public void writeLocation(ILocationData location, Callback<AbstractTraceRegion, ILocationData> callback) throws IOException { callback.doWriteLocation(location.getOffset(), location.getLength(), location.getLineNumber(), location.getEndLineNumber(), location.getPath()); }
region = region.merge(new TextRegionWithLineInformation(data.getOffset(), data.getLength(), data.getLineNumber(), data.getEndLineNumber()));
int nextOffset = nextLocation.getOffset(); if (nextOffset + nextLocation.getLength() <= currentEndOffset) { current = new TraceRegion(nextOffset, nextLocation.getLength(), nextLocation.getLineNumber(), nextLocation.getEndLineNumber(), createLocationData(nextRegion, myPath), current); currentEndOffset = nextLocation.getOffset() + nextLocation.getLength(); locations.add(Tuples.create(splitted, nextRegion)); current = new TraceRegion(nextOffset, nextLength, nextLocation.getLineNumber(), splittedBeginLine, createLocationData(nextRegion, myPath), current); currentEndOffset = nextOffset + nextLength; current = new TraceRegion(nextLocation.getOffset(), nextLocation.getLength(), nextLocation.getLineNumber(), nextLocation.getEndLineNumber(), createLocationData(nextRegion, myPath), null); currentEndOffset = nextLocation.getOffset() + nextLocation.getLength();