Skip to content

Commit

Permalink
Sonar Scanner updates
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Nov 2, 2023
1 parent f2faced commit 787c2e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public synchronized void processTimeAdvanceGrant(long time) throws InternalFeder
// CARLA but it seems to increment every time processTimeAdvanceGrant is called
rti.requestAdvanceTime(nextTimeStep + this.executedTimes, 0, (byte) 2);
this.executedTimes++;
List<DetectedObjectInteraction> detectedObjectInteractions = new ArrayList<DetectedObjectInteraction>();
List<DetectedObjectInteraction> detectedObjectInteractions = new ArrayList<>();
// Get all detections from all currently registered detectors.
for (DetectorRegistration registration: registeredDetectors ) {
DetectedObject[] detections = carlaXmlRpcClient.getDetectedObjects( registration.getInfrastructureId() , registration.getDetector().getSensorId());
Expand Down Expand Up @@ -623,7 +623,7 @@ private void sendReceivedV2xMessageToCarla() {
}
}
} catch (Exception e) {
log.error("error occurs during sending messages to bridge: " + e.getMessage());
log.error("error occurs during sending messages to bridge: {}", e.getMessage());
}
}

Expand All @@ -649,7 +649,7 @@ private String[] processReceivedV2xMessageFromCarla(int length, byte[] command)
carlaConnection.getDataOutputStream().write(new byte[] { 0x07, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00 });
}
} catch (Exception e) {
log.error("error occurs during process received messages: " + e.getMessage());
log.error("error occurs during process received messages: {}", e.getMessage());
}
return message.split(";");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ public DetectedObject[] getDetectedObjects(String infrastructureId ,String senso
log.debug("Detections from infrastructure {} sensor {} : {}", infrastructureId, sensorId, result);
String jsonResult = (String)result;
Gson gson = new Gson();
DetectedObject[] parsedMessage = gson.fromJson(jsonResult,
DetectedObject[].class);
return parsedMessage;
return gson.fromJson(jsonResult,DetectedObject[].class);
}
else {
throw new XmlRpcException("XMLRpcClient is not connected to CARLA Adapter!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.eclipse.mosaic.lib.objects.addressing.IpResolver;
import org.eclipse.mosaic.lib.objects.communication.AdHocConfiguration;
import org.eclipse.mosaic.lib.objects.communication.InterfaceConfiguration;
import org.eclipse.mosaic.lib.objects.detector.DetectedObject;
import org.eclipse.mosaic.lib.objects.detector.Detector;
import org.eclipse.mosaic.lib.objects.v2x.ExternalV2xMessage;
import org.eclipse.mosaic.lib.objects.v2x.V2xMessage;
Expand Down

0 comments on commit 787c2e5

Please sign in to comment.