private static Location convertLocation(Issue.Builder issueBuilder, DbIssues.Location source, SearchResponseData data) { Location.Builder target = Location.newBuilder(); if (source.hasMsg()) { target.setMsg(source.getMsg()); } if (source.hasTextRange()) { DbCommons.TextRange sourceRange = source.getTextRange(); Common.TextRange.Builder targetRange = convertTextRange(sourceRange); target.setTextRange(targetRange); } if (source.hasComponentId()) { ofNullable(data.getComponentByUuid(source.getComponentId())).ifPresent(c -> target.setComponent(c.getKey())); } else { target.setComponent(issueBuilder.getComponent()); } return target.build(); }
public Builder mergeFrom(org.sonar.db.protobuf.DbIssues.Location other) { if (other == org.sonar.db.protobuf.DbIssues.Location.getDefaultInstance()) return this; if (other.hasComponentId()) { bitField0_ |= 0x00000001; componentId_ = other.componentId_; onChanged(); } if (other.hasTextRange()) { mergeTextRange(other.getTextRange()); } if (other.hasMsg()) { bitField0_ |= 0x00000004; msg_ = other.msg_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
private static Location convertLocation(Issue.Builder issueBuilder, DbIssues.Location source, SearchResponseData data) { Location.Builder target = Location.newBuilder(); if (source.hasMsg()) { target.setMsg(source.getMsg()); } if (source.hasTextRange()) { DbCommons.TextRange sourceRange = source.getTextRange(); Common.TextRange.Builder targetRange = convertTextRange(sourceRange); target.setTextRange(targetRange); } if (source.hasComponentId()) { setNullable(data.getComponentByUuid(source.getComponentId()), c -> target.setComponent(c.getKey())); } else { target.setComponent(issueBuilder.getComponent()); } return target.build(); }