Skip to content

Commit 344027b

Browse files
committed
Updated the implementation as reviewer suggested.
1 parent 197a18f commit 344027b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cxx-sensors/src/main/java/org/sonar/cxx/sensors/pclint/CxxPCLintSensor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ private void addSecondaryLocationsToCurrentIssue(@Nonnull CxxReportIssue current
158158
String file,
159159
String line,
160160
String msg) {
161+
if (currentIssue.getLocations().isEmpty()) {
162+
LOG.error("The issue of {} must have the primary location. Skip adding more locations",
163+
currentIssue.toString());
164+
return;
165+
}
166+
161167
if (file != null && file.isEmpty() && msg != null) {
162168
Matcher matcher = SUPPLEMENTAL_MSG_PATTERN.matcher(msg);
163169

@@ -171,12 +177,6 @@ private void addSecondaryLocationsToCurrentIssue(@Nonnull CxxReportIssue current
171177
return;
172178
}
173179

174-
if (currentIssue.getLocations().isEmpty()) {
175-
LOG.error("The issue of {} must have the primary location. Skip adding more locations",
176-
currentIssue.toString());
177-
return;
178-
}
179-
180180
// Due to SONAR-9929, even the API supports the extra/flow in different file,
181181
// the UI is not ready. For this case, use the parent issue's file and line for now.
182182
CxxReportLocation primaryLocation = currentIssue.getLocations().get(0);

0 commit comments

Comments
 (0)