Position start = currentLocation.getStart(); if (start != null) { int line = start.getLine(); if (line >= 0) {
int line = start.getLine(); int column = start.getColumn(); int offset = start.getOffset();
int line = start.getLine(); int column = start.getColumn(); int offset = start.getOffset();
@Override @NonNull public Location getNameLocation(@NonNull XmlContext context, @NonNull Node node) { Location location = getLocation(context, node); Position start = location.getStart(); Position end = location.getEnd(); if (start == null || end == null) { return location; } int delta = node instanceof Element ? 1 : 0; // Elements: skip "<" int length = node.getNodeName().length(); int startOffset = start.getOffset() + delta; int startColumn = start.getColumn() + delta; return Location.create(location.getFile(), new DefaultPosition(start.getLine(), startColumn, startOffset), new DefaultPosition(end.getLine(), startColumn + length, startOffset + length)); }
if (message != null && !message.isEmpty()) { Position start = l.getStart(); int line = start != null ? start.getLine() : -1; String path = client.getDisplayPath(warning.project, l.getFile()); writeLocation(l.getFile(), path, line); while (l != null) { Position start = l.getStart(); int line = start != null ? start.getLine() : -1; String path = client.getDisplayPath(warning.project, l.getFile()); writer.write("<li> ");
@Override @NonNull public Location getValueLocation(@NonNull XmlContext context, @NonNull Attr node) { Location location = getLocation(context, node); Position start = location.getStart(); Position end = location.getEnd(); if (start == null || end == null) { return location; } int totalLength = end.getOffset() - start.getOffset(); int length = node.getValue().length(); int delta = totalLength - 1 - length; int startOffset = start.getOffset() + delta; int startColumn = start.getColumn() + delta; return Location.create(location.getFile(), new DefaultPosition(start.getLine(), startColumn, startOffset), new DefaultPosition(end.getLine(), startColumn + length, startOffset + length)); }
new DefaultPosition(start.getLine(), start.getColumn() + length, start.getOffset() + length));
Position start = location.getStart(); if (start != null) { int line = start.getLine(); int column = start.getColumn(); if (line >= 0) {
Position start = location.getStart(); int startColumn = start.getColumn(); int startLine = start.getLine(); start = new DefaultPosition(startLine, startColumn + startOffset - start.getOffset(), startOffset); Position existingStart = existingLocation.getStart(); if (start != null && existingStart != null && start.getLine() == existingStart.getLine()) { return true;
@Override @NonNull public Location getNameLocation(@NonNull JavaContext context, @NonNull Node node) { // The range on method name identifiers is wrong in the ECJ nodes; just take start of // name + length of name if (node instanceof MethodDeclaration) { MethodDeclaration declaration = (MethodDeclaration) node; Identifier identifier = declaration.astMethodName(); Location location = getLocation(context, identifier); com.android.tools.lint.detector.api.Position start = location.getStart(); com.android.tools.lint.detector.api.Position end = location.getEnd(); int methodNameLength = identifier.astValue().length(); if (start != null && end != null && end.getOffset() - start.getOffset() > methodNameLength) { end = new DefaultPosition(start.getLine(), start.getColumn() + methodNameLength, start.getOffset() + methodNameLength); return Location.create(location.getFile(), start, end); } return location; } return super.getNameLocation(context, node); }
if (message != null && !message.isEmpty()) { Position start = l.getStart(); int line = start != null ? start.getLine() : -1; String path = client .getDisplayPath(warning.project, l.getFile()); while (l != null) { Position start = l.getStart(); int line = start != null ? start.getLine() : -1; String path = client .getDisplayPath(warning.project, l.getFile());