private void collectComponentsFromIssueLocations(IssueDto issue) { DbIssues.Locations locations = issue.parseLocations(); if (locations != null) { for (DbIssues.Flow flow : locations.getFlowList()) { for (DbIssues.Location location : flow.getLocationList()) { if (location.hasComponentId()) { componentUuids.add(location.getComponentId()); } } } } }
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(); }
private void collectComponentsFromIssueLocations(IssueDto issue) { DbIssues.Locations locations = issue.parseLocations(); if (locations != null) { for (DbIssues.Flow flow : locations.getFlowList()) { for (DbIssues.Location location : flow.getLocationList()) { if (location.hasComponentId()) { componentUuids.add(location.getComponentId()); } } } } }
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(); }
private static String componentIdOf(DefaultIssue issue, DbIssues.Location location) { if (location.hasComponentId()) { return StringUtils.defaultIfEmpty(location.getComponentId(), issue.componentUuid()); } return issue.componentUuid(); } }