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(); } } }
/** * 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(); int splittedLength = nextLocation.getLength() - nextLength; int splittedBeginLine = nextEndLine; ILocationData splitted = new LocationData(currentEndOffset, splittedLength, splittedBeginLine, nextLocation.getEndLineNumber(), nextLocation.getPath()); for(int j = i + 1; j < locations.size() && splitted != null; j++) { ILocationData shiftMe = locations.get(j).getFirst(); current = new TraceRegion(nextLocation.getOffset(), nextLocation.getLength(), nextLocation.getLineNumber(), nextLocation.getEndLineNumber(), createLocationData(nextRegion, myPath), null); currentEndOffset = nextLocation.getOffset() + nextLocation.getLength();