private static DbIssues.Location newLocation(@Nullable String componentId, int startLine, int endLine) { DbIssues.Location.Builder builder = DbIssues.Location.newBuilder() .setTextRange(DbCommons.TextRange.newBuilder().setStartLine(startLine).setEndLine(endLine).build()); ofNullable(componentId).ifPresent(builder::setComponentId); return builder.build(); } }
.setStartLine(10) .setEndLine(12) .build()) .build(); DefaultIssue base = new DefaultIssue()
.setStartLine(10) .setEndLine(12) .build()) .build(); DefaultIssue base = new DefaultIssue()
/** * <code>optional .sonarqube.db.commons.TextRange text_range = 2;</code> * * <pre> * Only when component is a file. Can be empty for a file if this is an issue global to the file. * </pre> */ public Builder setTextRange( org.sonar.db.protobuf.DbCommons.TextRange.Builder builderForValue) { if (textRangeBuilder_ == null) { textRange_ = builderForValue.build(); onChanged(); } else { textRangeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; return this; } /**
/** * <code>optional .sonarqube.db.commons.TextRange text_range = 1;</code> */ public Builder setTextRange( org.sonar.db.protobuf.DbCommons.TextRange.Builder builderForValue) { if (textRangeBuilder_ == null) { textRange_ = builderForValue.build(); onChanged(); } else { textRangeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000001; return this; } /**
.setStartLine(10) .setEndLine(12) .build()) .build(); DefaultIssue base = new DefaultIssue()
private static org.sonar.db.protobuf.DbCommons.TextRange range(int startLine, int endLine) { return TextRange.newBuilder().setStartLine(startLine).setEndLine(endLine).build(); }
private static DbIssues.Location newLocation(int line) { return DbIssues.Location.newBuilder() .setComponentId(FILE.getUuid()) .setTextRange(DbCommons.TextRange.newBuilder().setStartLine(line).setEndLine(line).build()).build(); }