Skip to content

Commit

Permalink
Reduce SAT and CodeQL warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Friedrich <[email protected]>
  • Loading branch information
holgerfriedrich committed May 28, 2024
1 parent 9068ab2 commit 9a9f67d
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ public Object createEventSubscription() {
public void getSitemapEvents(@Context final SseEventSink sseEventSink, @Context final HttpServletResponse response,
@PathParam("subscriptionid") @Parameter(description = "subscription id") String subscriptionId,
@QueryParam("sitemap") @Parameter(description = "sitemap name") @Nullable String sitemapname) {

getSitemapEvents(sseEventSink, response, subscriptionId, sitemapname, null, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
*/
public class JSONResponse {

private final Logger logger = LoggerFactory.getLogger(JSONResponse.class);

private static final JSONResponse INSTANCE = new JSONResponse();
private final Gson gson = new GsonBuilder().setDateFormat(DateTimeType.DATE_PATTERN_WITH_TZ_AND_MS).create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ public void testPoolConfigurationWithoutListener() throws Exception {

EndpointPoolConfiguration newConfig = new EndpointPoolConfiguration();
newConfig.setConnectMaxTries(5);
try (ModbusCommunicationInterface comms = modbusManager.newModbusCommunicationInterface(getEndpoint(),
try (ModbusCommunicationInterface ignored = modbusManager.newModbusCommunicationInterface(getEndpoint(),
newConfig)) {
// Sets configuration for the endpoint implicitly
}
Expand All @@ -822,7 +822,7 @@ public void testPoolConfigurationWithoutListener() throws Exception {
assertThat(modbusManager.getEndpointPoolConfiguration(getEndpoint()), is(not(equalTo(defaultConfig))));

// Reset config
try (ModbusCommunicationInterface comms = modbusManager.newModbusCommunicationInterface(getEndpoint(), null)) {
try (ModbusCommunicationInterface ignored = modbusManager.newModbusCommunicationInterface(getEndpoint(), null)) {
// Sets configuration for the endpoint implicitly
}
// Should match the default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public static void increaseMasterVolume(@ParamDoc(name = "percent") final float
if (newVolume - volume < .01) {
// the getMasterVolume() may only returns integers, so we have to make sure that we
// increase the volume level at least by 1%.
newVolume += .01;
newVolume += .01f;
}
if (newVolume > 1) {
newVolume = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected boolean waitFor(BooleanSupplier condition) {
* @return true on success, false on timeout
*/
protected boolean waitFor(BooleanSupplier condition, long timeout, long sleepTime) {
int waitingTime = 0;
long waitingTime = 0;
boolean rv;
while (!(rv = condition.getAsBoolean()) && waitingTime < timeout) {
waitingTime += sleepTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected boolean waitFor(BooleanSupplier condition) {
* @return true on success, false on timeout
*/
protected boolean waitFor(BooleanSupplier condition, long timeout, long sleepTime) {
int waitingTime = 0;
long waitingTime = 0;
boolean rv;
while (!(rv = condition.getAsBoolean()) && waitingTime < timeout) {
waitingTime += sleepTime;
Expand Down

0 comments on commit 9a9f67d

Please sign in to comment.