Reduce SAT warnings (#3586)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
pull/3588/head
Holger Friedrich 2023-05-01 09:08:26 +02:00 committed by GitHub
parent a77a303dc3
commit 5e0a4ff25a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 0 additions and 21 deletions

View File

@ -153,7 +153,6 @@ public class ProfileTypeResource implements RESTResource {
private boolean triggerProfileMatchesProfileType(ProfileType profileType, ChannelType channelType) {
if (profileType instanceof TriggerProfileType triggerProfileType) {
if (triggerProfileType.getSupportedChannelTypeUIDs().isEmpty()) {
return true;
}
@ -167,7 +166,6 @@ public class ProfileTypeResource implements RESTResource {
private boolean stateProfileMatchesProfileType(ProfileType profileType, ChannelType channelType) {
if (profileType instanceof StateProfileType stateProfileType) {
if (stateProfileType.getSupportedItemTypesOfChannel().isEmpty()) {
return true;
}

View File

@ -47,8 +47,6 @@ import org.osgi.service.jaxrs.whiteboard.propertytypes.JSONRequired;
import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsApplicationSelect;
import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsName;
import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@ -75,8 +73,6 @@ public class TagResource implements RESTResource {
/** The URI path to this resource */
public static final String PATH_TAGS = "tags";
private final Logger logger = LoggerFactory.getLogger(TagResource.class);
private final LocaleService localeService;
@Activate
@ -91,7 +87,6 @@ public class TagResource implements RESTResource {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TagDTO.class)))) })
public Response getTags(final @Context UriInfo uriInfo, final @Context HttpHeaders httpHeaders,
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language) {
final Locale locale = localeService.getLocale(language);
Map<String, List<TagDTO>> tags = Map.of( //

View File

@ -51,7 +51,6 @@ public class SseUtil {
* @return a new OutboundEvent
*/
public static OutboundSseEvent buildEvent(OutboundSseEvent.Builder eventBuilder, EventDTO event) {
return eventBuilder.name("message") //
.mediaType(MediaType.APPLICATION_JSON_TYPE) //
.data(event) //

View File

@ -52,8 +52,6 @@ import org.slf4j.LoggerFactory;
@Component(immediate = true)
public class PersistenceExtensions {
private static final BigDecimal BIG_DECIMAL_TWO = BigDecimal.valueOf(2);
private static PersistenceServiceRegistry registry;
@Activate

View File

@ -142,7 +142,6 @@ public class AutoUpdateManager {
final String itemName = commandEvent.getItemName();
final Command command = commandEvent.getItemCommand();
if (command instanceof State state) {
Recommendation autoUpdate = shouldAutoUpdate(item);
// consider user-override via item meta-data

View File

@ -60,7 +60,6 @@ public class OSGiEventPublisher implements EventPublisher {
properties.put("source", source);
}
eventAdmin.postEvent(new org.osgi.service.event.Event("openhab", properties));
} catch (Exception e) {
throw new IllegalStateException("Cannot post the event via the event bus. Error message: " + e.getMessage(),
e);

View File

@ -231,7 +231,6 @@ public class WatchServiceImpl implements WatchService, DirectoryChangeListener {
future = scheduler.schedule(() -> notifyListeners(path), PROCESSING_TIME, TimeUnit.MILLISECONDS);
scheduledEventKinds.computeIfAbsent(path, k -> new CopyOnWriteArrayList<>()).add(directoryChangeEvent);
scheduledEvents.put(path, future);
}
}

View File

@ -16,9 +16,6 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.junit.jupiter.api.Test;
@ -63,11 +60,6 @@ public class HSBTypeTest {
compareHsbToRgbValues("300,100,40", 102, 0, 102);
}
private int convertPercentToByte(PercentType percent) {
return percent.value.multiply(BigDecimal.valueOf(255)).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
.intValue();
}
private void compareHsbToRgbValues(String hsbValues, int red, int green, int blue) {
HSBType hsb = new HSBType(hsbValues);
HSBType hsbRgb = HSBType.fromRGB(red, green, blue);