File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
cxx-sensors/src/main/java/org/sonar/cxx/sensors/pclint Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments