@Test public void allLinesFor_traverses_all_flows() { DbIssues.Locations.Builder locations = DbIssues.Locations.newBuilder(); locations.addFlowBuilder() .addLocation(newLocation("file1", 5, 5)) .addLocation(newLocation("file2", 10, 11)) .build(); locations.addFlowBuilder() .addLocation(newLocation("file1", 7, 9)) .addLocation(newLocation("file2", 12, 12)) .build(); DefaultIssue issue = new DefaultIssue().setLocations(locations.build()); assertThat(IssueLocations.allLinesFor(issue, "file1")).containsExactlyInAnyOrder(5, 7, 8, 9); assertThat(IssueLocations.allLinesFor(issue, "file2")).containsExactlyInAnyOrder(10, 11, 12); }
bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocationIsMutable(); location_.addAll(other.location_); onChanged(); locationBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getLocationFieldBuilder() : null; } else { locationBuilder_.addAllMessages(other.location_); this.mergeUnknownFields(other.unknownFields); onChanged(); return this;
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder setLocation( int index, org.sonar.db.protobuf.DbIssues.Location value) { if (locationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureLocationIsMutable(); location_.set(index, value); onChanged(); } else { locationBuilder_.setMessage(index, value); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder addLocation( int index, org.sonar.db.protobuf.DbIssues.Location value) { if (locationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureLocationIsMutable(); location_.add(index, value); onChanged(); } else { locationBuilder_.addMessage(index, value); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder addLocation(org.sonar.db.protobuf.DbIssues.Location value) { if (locationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureLocationIsMutable(); location_.add(value); onChanged(); } else { locationBuilder_.addMessage(value); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder addLocation( int index, org.sonar.db.protobuf.DbIssues.Location.Builder builderForValue) { if (locationBuilder_ == null) { ensureLocationIsMutable(); location_.add(index, builderForValue.build()); onChanged(); } else { locationBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Flow flow = 2;</code> */ public Builder addFlow( org.sonar.db.protobuf.DbIssues.Flow.Builder builderForValue) { if (flowBuilder_ == null) { ensureFlowIsMutable(); flow_.add(builderForValue.build()); onChanged(); } else { flowBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder addAllLocation( java.lang.Iterable<? extends org.sonar.db.protobuf.DbIssues.Location> values) { if (locationBuilder_ == null) { ensureLocationIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, location_); onChanged(); } else { locationBuilder_.addAllMessages(values); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder setLocation( int index, org.sonar.db.protobuf.DbIssues.Location.Builder builderForValue) { if (locationBuilder_ == null) { ensureLocationIsMutable(); location_.set(index, builderForValue.build()); onChanged(); } else { locationBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Flow flow = 2;</code> */ public Builder setFlow( int index, org.sonar.db.protobuf.DbIssues.Flow.Builder builderForValue) { if (flowBuilder_ == null) { ensureFlowIsMutable(); flow_.set(index, builderForValue.build()); onChanged(); } else { flowBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Flow flow = 2;</code> */ public Builder addFlow( int index, org.sonar.db.protobuf.DbIssues.Flow.Builder builderForValue) { if (flowBuilder_ == null) { ensureFlowIsMutable(); flow_.add(index, builderForValue.build()); onChanged(); } else { flowBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
private Builder() { maybeForceBuilderInitialization(); }
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder removeLocation(int index) { if (locationBuilder_ == null) { ensureLocationIsMutable(); location_.remove(index); onChanged(); } else { locationBuilder_.remove(index); } return this; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public Builder addLocation( org.sonar.db.protobuf.DbIssues.Location.Builder builderForValue) { if (locationBuilder_ == null) { ensureLocationIsMutable(); location_.add(builderForValue.build()); onChanged(); } else { locationBuilder_.addMessage(builderForValue.build()); } return this; } /**
private com.google.protobuf.RepeatedFieldBuilder< org.sonar.db.protobuf.DbIssues.Location, org.sonar.db.protobuf.DbIssues.Location.Builder, org.sonar.db.protobuf.DbIssues.LocationOrBuilder> getLocationFieldBuilder() { if (locationBuilder_ == null) { locationBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< org.sonar.db.protobuf.DbIssues.Location, org.sonar.db.protobuf.DbIssues.Location.Builder, org.sonar.db.protobuf.DbIssues.LocationOrBuilder>( location_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean()); location_ = null; } return locationBuilder_; }
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public java.util.List<org.sonar.db.protobuf.DbIssues.Location.Builder> getLocationBuilderList() { return getLocationFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder<
private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getLocationFieldBuilder(); } } public Builder clear() {
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
/** * <code>repeated .sonarqube.db.issues.Location location = 1;</code> */ public org.sonar.db.protobuf.DbIssues.Location.Builder addLocationBuilder( int index) { return getLocationFieldBuilder().addBuilder( index, org.sonar.db.protobuf.DbIssues.Location.getDefaultInstance()); } /**