Ejemplo n.º 1
0
  private static int restrictEndBound(int start, int end, @Nonnull SourceLocation sourceLocation) {
    if (end < start) {
      return start;
    }

    if (end > sourceLocation.getSourceNode().getLength()) {
      return sourceLocation.getSourceNode().getLength();
    }

    return end;
  }
Ejemplo n.º 2
0
  private static int restrictStartBound(int start, @Nonnull SourceLocation sourceLocation) {
    if (start < 0) {
      return 0;
    }

    if (start > sourceLocation.getSourceNode().getLength()) {
      return sourceLocation.getSourceNode().getLength();
    }

    return start;
  }