Reduce SAT warnings (#3586)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>pull/3588/head
parent
a77a303dc3
commit
5e0a4ff25a
|
@ -153,7 +153,6 @@ public class ProfileTypeResource implements RESTResource {
|
||||||
|
|
||||||
private boolean triggerProfileMatchesProfileType(ProfileType profileType, ChannelType channelType) {
|
private boolean triggerProfileMatchesProfileType(ProfileType profileType, ChannelType channelType) {
|
||||||
if (profileType instanceof TriggerProfileType triggerProfileType) {
|
if (profileType instanceof TriggerProfileType triggerProfileType) {
|
||||||
|
|
||||||
if (triggerProfileType.getSupportedChannelTypeUIDs().isEmpty()) {
|
if (triggerProfileType.getSupportedChannelTypeUIDs().isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +166,6 @@ public class ProfileTypeResource implements RESTResource {
|
||||||
|
|
||||||
private boolean stateProfileMatchesProfileType(ProfileType profileType, ChannelType channelType) {
|
private boolean stateProfileMatchesProfileType(ProfileType profileType, ChannelType channelType) {
|
||||||
if (profileType instanceof StateProfileType stateProfileType) {
|
if (profileType instanceof StateProfileType stateProfileType) {
|
||||||
|
|
||||||
if (stateProfileType.getSupportedItemTypesOfChannel().isEmpty()) {
|
if (stateProfileType.getSupportedItemTypesOfChannel().isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.JaxrsApplicationSelect;
|
||||||
import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsName;
|
import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsName;
|
||||||
import org.osgi.service.jaxrs.whiteboard.propertytypes.JaxrsResource;
|
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.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
@ -75,8 +73,6 @@ public class TagResource implements RESTResource {
|
||||||
/** The URI path to this resource */
|
/** The URI path to this resource */
|
||||||
public static final String PATH_TAGS = "tags";
|
public static final String PATH_TAGS = "tags";
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(TagResource.class);
|
|
||||||
|
|
||||||
private final LocaleService localeService;
|
private final LocaleService localeService;
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
|
@ -91,7 +87,6 @@ public class TagResource implements RESTResource {
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TagDTO.class)))) })
|
@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,
|
public Response getTags(final @Context UriInfo uriInfo, final @Context HttpHeaders httpHeaders,
|
||||||
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language) {
|
@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language) {
|
||||||
|
|
||||||
final Locale locale = localeService.getLocale(language);
|
final Locale locale = localeService.getLocale(language);
|
||||||
|
|
||||||
Map<String, List<TagDTO>> tags = Map.of( //
|
Map<String, List<TagDTO>> tags = Map.of( //
|
||||||
|
|
|
@ -51,7 +51,6 @@ public class SseUtil {
|
||||||
* @return a new OutboundEvent
|
* @return a new OutboundEvent
|
||||||
*/
|
*/
|
||||||
public static OutboundSseEvent buildEvent(OutboundSseEvent.Builder eventBuilder, EventDTO event) {
|
public static OutboundSseEvent buildEvent(OutboundSseEvent.Builder eventBuilder, EventDTO event) {
|
||||||
|
|
||||||
return eventBuilder.name("message") //
|
return eventBuilder.name("message") //
|
||||||
.mediaType(MediaType.APPLICATION_JSON_TYPE) //
|
.mediaType(MediaType.APPLICATION_JSON_TYPE) //
|
||||||
.data(event) //
|
.data(event) //
|
||||||
|
|
|
@ -52,8 +52,6 @@ import org.slf4j.LoggerFactory;
|
||||||
@Component(immediate = true)
|
@Component(immediate = true)
|
||||||
public class PersistenceExtensions {
|
public class PersistenceExtensions {
|
||||||
|
|
||||||
private static final BigDecimal BIG_DECIMAL_TWO = BigDecimal.valueOf(2);
|
|
||||||
|
|
||||||
private static PersistenceServiceRegistry registry;
|
private static PersistenceServiceRegistry registry;
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
|
|
|
@ -142,7 +142,6 @@ public class AutoUpdateManager {
|
||||||
final String itemName = commandEvent.getItemName();
|
final String itemName = commandEvent.getItemName();
|
||||||
final Command command = commandEvent.getItemCommand();
|
final Command command = commandEvent.getItemCommand();
|
||||||
if (command instanceof State state) {
|
if (command instanceof State state) {
|
||||||
|
|
||||||
Recommendation autoUpdate = shouldAutoUpdate(item);
|
Recommendation autoUpdate = shouldAutoUpdate(item);
|
||||||
|
|
||||||
// consider user-override via item meta-data
|
// consider user-override via item meta-data
|
||||||
|
|
|
@ -60,7 +60,6 @@ public class OSGiEventPublisher implements EventPublisher {
|
||||||
properties.put("source", source);
|
properties.put("source", source);
|
||||||
}
|
}
|
||||||
eventAdmin.postEvent(new org.osgi.service.event.Event("openhab", properties));
|
eventAdmin.postEvent(new org.osgi.service.event.Event("openhab", properties));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new IllegalStateException("Cannot post the event via the event bus. Error message: " + e.getMessage(),
|
throw new IllegalStateException("Cannot post the event via the event bus. Error message: " + e.getMessage(),
|
||||||
e);
|
e);
|
||||||
|
|
|
@ -231,7 +231,6 @@ public class WatchServiceImpl implements WatchService, DirectoryChangeListener {
|
||||||
future = scheduler.schedule(() -> notifyListeners(path), PROCESSING_TIME, TimeUnit.MILLISECONDS);
|
future = scheduler.schedule(() -> notifyListeners(path), PROCESSING_TIME, TimeUnit.MILLISECONDS);
|
||||||
scheduledEventKinds.computeIfAbsent(path, k -> new CopyOnWriteArrayList<>()).add(directoryChangeEvent);
|
scheduledEventKinds.computeIfAbsent(path, k -> new CopyOnWriteArrayList<>()).add(directoryChangeEvent);
|
||||||
scheduledEvents.put(path, future);
|
scheduledEvents.put(path, future);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,6 @@ import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
@ -63,11 +60,6 @@ public class HSBTypeTest {
|
||||||
compareHsbToRgbValues("300,100,40", 102, 0, 102);
|
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) {
|
private void compareHsbToRgbValues(String hsbValues, int red, int green, int blue) {
|
||||||
HSBType hsb = new HSBType(hsbValues);
|
HSBType hsb = new HSBType(hsbValues);
|
||||||
HSBType hsbRgb = HSBType.fromRGB(red, green, blue);
|
HSBType hsbRgb = HSBType.fromRGB(red, green, blue);
|
||||||
|
|
Loading…
Reference in New Issue