Fix SAT ModifierOrderCheck findings by using JLS suggested modifier order (#1103)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born 2019-10-08 06:24:16 +02:00 committed by Kai Kreuzer
parent 7d3c5a1874
commit 3dacba3510
44 changed files with 133 additions and 133 deletions

View File

@ -44,8 +44,8 @@ public abstract class AbstractAudioServletTest extends JavaTest {
private int port;
private TestServer server;
private final static String AUDIO_SERVLET_PROTOCOL = "http";
private final static String AUDIO_SERVLET_HOSTNAME = "localhost";
private static final String AUDIO_SERVLET_PROTOCOL = "http";
private static final String AUDIO_SERVLET_HOSTNAME = "localhost";
private CompletableFuture<Boolean> serverStarted;

View File

@ -59,7 +59,7 @@ public class OAuthClientServiceImpl implements OAuthClientService {
private static final String EXCEPTION_MESSAGE_CLOSED = "Client service is closed";
private transient final Logger logger = LoggerFactory.getLogger(OAuthClientServiceImpl.class);
private final transient Logger logger = LoggerFactory.getLogger(OAuthClientServiceImpl.class);
private @NonNullByDefault({}) OAuthStoreHandler storeHandler;

View File

@ -32,7 +32,7 @@ import org.openhab.core.automation.module.script.internal.provider.ScriptModuleT
@NonNullByDefault
public interface ScriptEngineFactory {
final static ScriptEngineManager engineManager = new ScriptEngineManager();
static final ScriptEngineManager engineManager = new ScriptEngineManager();
/**
* This method returns a list of file extensions and MimeTypes that are supported by the ScriptEngine, e.g. py,

View File

@ -40,7 +40,7 @@ public class OpenHAB {
*
* @return the openHAB runtime version
*/
static public String getVersion() {
public static String getVersion() {
String versionString = FrameworkUtil.getBundle(OpenHAB.class).getVersion().toString();
// if the version string contains a "snapshot" qualifier, remove it!
if (StringUtils.countMatches(versionString, ".") == 3) {
@ -52,7 +52,7 @@ public class OpenHAB {
return versionString;
}
static public String buildString() {
public static String buildString() {
Properties prop = new Properties();
Path versionFilePath = Paths.get(ConfigConstants.getUserDataFolder(), "etc", "version.properties");

View File

@ -34,10 +34,10 @@ public class IconForwarder extends HttpServlet {
private static final long serialVersionUID = 5220836868829415723L;
final static private Logger logger = LoggerFactory.getLogger(IconForwarder.class);
private static final String IMAGES_ALIAS = "/images";
private Logger logger = LoggerFactory.getLogger(IconForwarder.class);
@Reference
protected void setHttpService(HttpService httpService) {
try {

View File

@ -31,7 +31,7 @@ public class CompatibilityActivator implements BundleActivator {
public static ServiceTracker<EventPublisher, EventPublisher> eventPublisherTracker;
public static ServiceTracker<ScriptEngine, ScriptEngine> scriptEngineTracker;
static public BundleContext getContext() {
public static BundleContext getContext() {
return context;
}

View File

@ -24,7 +24,7 @@ import org.osgi.service.event.EventHandler;
*
* @author Kai Kreuzer - Initial contribution
*/
abstract public class AbstractEventSubscriber implements EventHandler {
public abstract class AbstractEventSubscriber implements EventHandler {
@Override
public void handleEvent(Event event) {
String itemName = (String) event.getProperty("item");

View File

@ -32,7 +32,7 @@ import org.openhab.core.types.UnDefType;
* @author Kai Kreuzer
*
*/
abstract public class GenericItem implements Item {
public abstract class GenericItem implements Item {
protected EventPublisher eventPublisher;
@ -41,7 +41,7 @@ abstract public class GenericItem implements Item {
protected List<String> groupNames = new ArrayList<>();
final protected String name;
protected final String name;
protected State state = UnDefType.NULL;

View File

@ -24,7 +24,7 @@ import org.openhab.core.types.UnDefType;
* @author Kai Kreuzer
*
*/
abstract public interface GroupFunction {
public abstract interface GroupFunction {
/**
* Determines the current state of a group based on a list of items

View File

@ -29,7 +29,7 @@ public class DecimalType extends Number implements PrimitiveType, State, Command
private static final long serialVersionUID = 4226845847123464690L;
final static public DecimalType ZERO = new DecimalType(0);
public static final DecimalType ZERO = new DecimalType(0);
protected BigDecimal value;

View File

@ -34,16 +34,16 @@ public class HSBType extends PercentType implements ComplexType, State, Command
private static final long serialVersionUID = 322902950356613226L;
// constants for the constituents
static final public String KEY_HUE = "h";
static final public String KEY_SATURATION = "s";
static final public String KEY_BRIGHTNESS = "b";
public static final String KEY_HUE = "h";
public static final String KEY_SATURATION = "s";
public static final String KEY_BRIGHTNESS = "b";
// constants for colors
static final public HSBType BLACK = new HSBType(Color.BLACK);
static final public HSBType WHITE = new HSBType(Color.WHITE);
static final public HSBType RED = new HSBType(Color.RED);
static final public HSBType GREEN = new HSBType(Color.GREEN);
static final public HSBType BLUE = new HSBType(Color.BLUE);
public static final HSBType BLACK = new HSBType(Color.BLACK);
public static final HSBType WHITE = new HSBType(Color.WHITE);
public static final HSBType RED = new HSBType(Color.RED);
public static final HSBType GREEN = new HSBType(Color.GREEN);
public static final HSBType BLUE = new HSBType(Color.BLUE);
protected BigDecimal hue;
protected BigDecimal saturation;

View File

@ -24,8 +24,8 @@ public class PercentType extends DecimalType {
private static final long serialVersionUID = -9066279845951780879L;
final static public PercentType ZERO = new PercentType(0);
final static public PercentType HUNDRED = new PercentType(100);
public static final PercentType ZERO = new PercentType(0);
public static final PercentType HUNDRED = new PercentType(100);
public PercentType() {
super();

View File

@ -38,9 +38,9 @@ public class PointType implements ComplexType, Command, State {
private BigDecimal longitude = BigDecimal.ZERO; // in decimal degrees
private BigDecimal altitude = BigDecimal.ZERO; // in decimal meters
// constants for the constituents
static final public String KEY_LATITUDE = "lat";
static final public String KEY_LONGITUDE = "long";
static final public String KEY_ALTITUDE = "alt";
public static final String KEY_LATITUDE = "lat";
public static final String KEY_LONGITUDE = "long";
public static final String KEY_ALTITUDE = "alt";
private static final BigDecimal circle = new BigDecimal(360);
private static final BigDecimal flat = new BigDecimal(180);
private static final BigDecimal right = new BigDecimal(90);

View File

@ -22,7 +22,7 @@ import org.openhab.core.types.State;
*/
public class StringType implements PrimitiveType, State, Command {
public final static StringType EMPTY = new StringType("");
public static final StringType EMPTY = new StringType("");
private final String value;

View File

@ -100,7 +100,7 @@ public abstract class AbstractActiveService {
* @return <code>true</code> if this binding is configured properly which means
* that all necessary data is available
*/
final public boolean isProperlyConfigured() {
public final boolean isProperlyConfigured() {
return properlyConfigured;
}

View File

@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
*/
public class TransformationHelper {
private static Logger logger = LoggerFactory.getLogger(TransformationHelper.class);
private static final Logger LOGGER = LoggerFactory.getLogger(TransformationHelper.class);
/**
* Queries the OSGi service registry for a service that provides a transformation service of
@ -35,7 +35,7 @@ public class TransformationHelper {
* @param transformationType the desired transformation type
* @return a service instance or null, if none could be found
*/
static public TransformationService getTransformationService(BundleContext context, String transformationType) {
public static TransformationService getTransformationService(BundleContext context, String transformationType) {
if (context != null) {
String filter = "(smarthome.transform=" + transformationType + ")";
try {
@ -44,18 +44,18 @@ public class TransformationHelper {
if (refs != null && refs.size() > 0) {
return new TransformationServiceDelegate(context.getService(refs.iterator().next()));
} else {
logger.warn("Cannot get service reference for transformation service of type {}",
LOGGER.warn("Cannot get service reference for transformation service of type {}",
transformationType);
}
} catch (InvalidSyntaxException e) {
logger.warn("Cannot get service reference for transformation service of type {}", transformationType,
LOGGER.warn("Cannot get service reference for transformation service of type {}", transformationType,
e);
}
}
return null;
}
static private class TransformationServiceDelegate implements TransformationService {
private static class TransformationServiceDelegate implements TransformationService {
org.eclipse.smarthome.core.transform.TransformationService delegate;

View File

@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
*/
public class Transformation {
static private final Logger logger = LoggerFactory.getLogger(Transformation.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Transformation.class);
/**
* Applies a transformation of a given type with some function to a value.
@ -48,11 +48,11 @@ public class Transformation {
try {
result = service.transform(function, value);
} catch (TransformationException e) {
logger.error("Error executing the transformation '{}': {}", type, e.getMessage());
LOGGER.error("Error executing the transformation '{}': {}", type, e.getMessage());
result = value;
}
} else {
logger.warn("No transformation service '{}' could be found.", type);
LOGGER.warn("No transformation service '{}' could be found.", type);
result = value;
}
return result;

View File

@ -32,7 +32,7 @@ public class ConsoleInterpreter {
* @param args array which contains the console command and all its arguments
* @param console the console for printing messages for the user
*/
static public void handleRequest(String[] args, Console console) {
public static void handleRequest(String[] args, Console console) {
}
/**
@ -41,7 +41,7 @@ public class ConsoleInterpreter {
* @param args array which contains the arguments for the update command
* @param console the console for printing messages for the user
*/
static public void handleUpdate(String[] args, Console console) {
public static void handleUpdate(String[] args, Console console) {
}
/**
@ -50,7 +50,7 @@ public class ConsoleInterpreter {
* @param args array which contains the arguments for the send command
* @param console the console for printing messages for the user
*/
static public void handleSend(String[] args, Console console) {
public static void handleSend(String[] args, Console console) {
}
/**
@ -59,7 +59,7 @@ public class ConsoleInterpreter {
* @param args array which contains the arguments for the items command
* @param console the console for printing messages for the user
*/
static public void handleItems(String[] args, Console console) {
public static void handleItems(String[] args, Console console) {
}
/**
@ -68,7 +68,7 @@ public class ConsoleInterpreter {
* @param args array which contains the arguments for the status command
* @param console the console for printing messages for the user
*/
static public void handleStatus(String[] args, Console console) {
public static void handleStatus(String[] args, Console console) {
}
/**
@ -77,7 +77,7 @@ public class ConsoleInterpreter {
* @param args array which contains the arguments for the status command
* @param console the console for printing messages for the user
*/
static public void handleSay(String[] args, Console console) {
public static void handleSay(String[] args, Console console) {
}
public static void handleScript(String[] args, Console console) {
@ -93,24 +93,24 @@ public class ConsoleInterpreter {
}
/** returns an array of the usage texts for all available commands */
static public String[] getUsages() {
public static String[] getUsages() {
return new String[] { getUpdateUsage(), getCommandUsage(), getStatusUsage(), getItemsUsage(), getSayUsage(),
getScriptUsage() };
}
static public String getUpdateUsage() {
public static String getUpdateUsage() {
return "update <item> <state> - sends a status update for an item";
}
static public String getCommandUsage() {
public static String getCommandUsage() {
return "send <item> <command> - sends a command for an item";
}
static public String getStatusUsage() {
public static String getStatusUsage() {
return "status <item> - shows the current status of an item";
}
static public String getItemsUsage() {
public static String getItemsUsage() {
return "items [<pattern>] - lists names and types of all items matching the pattern";
}

View File

@ -46,7 +46,7 @@ public class Exec {
* @see http://www.peterfriese.de/running-applescript-from-java/
*/
@ActionDoc(text = "Executes <code>commandLine</code>.")
static public void executeCommandLine(@ParamDoc(name = "commandLine") String commandLine) {
public static void executeCommandLine(@ParamDoc(name = "commandLine") String commandLine) {
ExecUtil.executeCommandLine(commandLine);
}
@ -71,7 +71,7 @@ public class Exec {
* @return response data from executed command line
*/
@ActionDoc(text = "Executes <code>commandLine</code>.")
static public String executeCommandLine(@ParamDoc(name = "commandLine") String commandLine,
public static String executeCommandLine(@ParamDoc(name = "commandLine") String commandLine,
@ParamDoc(name = "timeout", text = "timeout for execution in milliseconds") int timeout) {
return ExecUtil.executeCommandLineAndWaitResponse(commandLine, timeout);
}

View File

@ -25,7 +25,7 @@ import org.openhab.io.net.http.HttpUtil;
public class HTTP {
/** Constant which represents the content type <code>application/json</code> */
public final static String CONTENT_TYPE_JSON = "application/json";
public static final String CONTENT_TYPE_JSON = "application/json";
/**
* Send out a GET-HTTP request. Errors will be logged, returned values just ignored.
@ -33,7 +33,7 @@ public class HTTP {
* @param url the URL to be used for the GET request.
* @return the response body or <code>NULL</code> when the request went wrong
*/
static public String sendHttpGetRequest(String url) {
public static String sendHttpGetRequest(String url) {
return HttpUtil.executeUrl("GET", url, 5000);
}
@ -43,7 +43,7 @@ public class HTTP {
* @param url the URL to be used for the PUT request.
* @return the response body or <code>NULL</code> when the request went wrong
*/
static public String sendHttpPutRequest(String url) {
public static String sendHttpPutRequest(String url) {
return HttpUtil.executeUrl("PUT", url, 1000);
}
@ -56,7 +56,7 @@ public class HTTP {
* <code>null</code> if no content should be send.
* @return the response body or <code>NULL</code> when the request went wrong
*/
static public String sendHttpPutRequest(String url, String contentType, String content) {
public static String sendHttpPutRequest(String url, String contentType, String content) {
return HttpUtil.executeUrl("PUT", url, IOUtils.toInputStream(content), contentType, 1000);
}
@ -66,7 +66,7 @@ public class HTTP {
* @param url the URL to be used for the POST request.
* @return the response body or <code>NULL</code> when the request went wrong
*/
static public String sendHttpPostRequest(String url) {
public static String sendHttpPostRequest(String url) {
return HttpUtil.executeUrl("POST", url, 1000);
}
@ -79,7 +79,7 @@ public class HTTP {
* <code>null</code> if no content should be send.
* @return the response body or <code>NULL</code> when the request went wrong
*/
static public String sendHttpPostRequest(String url, String contentType, String content) {
public static String sendHttpPostRequest(String url, String contentType, String content) {
return HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content), contentType, 1000);
}
@ -89,7 +89,7 @@ public class HTTP {
* @param url the URL to be used for the DELETE request.
* @return the response body or <code>NULL</code> when the request went wrong
*/
static public String sendHttpDeleteRequest(String url) {
public static String sendHttpDeleteRequest(String url) {
return HttpUtil.executeUrl("DELETE", url, 1000);
}

View File

@ -34,7 +34,7 @@ import org.junit.Test;
*/
public class ConfigurationTest {
public final static class ConfigClass {
public static final class ConfigClass {
public enum MyEnum {
ON,
OFF,

View File

@ -56,16 +56,16 @@ public class InboxPredicatesTest {
private static final String PROP_VAL1 = "propVal1";
private static final String PROP_VAL2 = "propVal2";
private final static ThingTypeUID THING_TYPE_UID11 = new ThingTypeUID(BINDING_ID1, THING_TYPE_ID1);
private final static ThingTypeUID THING_TYPE_UID12 = new ThingTypeUID(BINDING_ID1, THING_TYPE_ID2);
private final static ThingTypeUID THING_TYPE_UID21 = new ThingTypeUID(BINDING_ID2, THING_TYPE_ID1);
private static final ThingTypeUID THING_TYPE_UID11 = new ThingTypeUID(BINDING_ID1, THING_TYPE_ID1);
private static final ThingTypeUID THING_TYPE_UID12 = new ThingTypeUID(BINDING_ID1, THING_TYPE_ID2);
private static final ThingTypeUID THING_TYPE_UID21 = new ThingTypeUID(BINDING_ID2, THING_TYPE_ID1);
private final static Map<String, Object> PROPS1 = Collections
private static final Map<String, Object> PROPS1 = Collections
.unmodifiableMap(Stream.of(new SimpleEntry<>(PROP1, PROP_VAL1), new SimpleEntry<>(PROP2, PROP_VAL2))
.collect(Collectors.toMap(Entry::getKey, Entry::getValue)));
private final static Map<String, Object> PROPS2 = Collections.singletonMap(PROP2, PROP_VAL2);
private static final Map<String, Object> PROPS2 = Collections.singletonMap(PROP2, PROP_VAL2);
private final static List<DiscoveryResultImpl> results = Arrays.asList(
private static final List<DiscoveryResultImpl> results = Arrays.asList(
new DiscoveryResultImpl(THING_TYPE_UID11, THING_UID11, null, PROPS1, PROP1, "label",
DiscoveryResult.TTL_UNLIMITED),
new DiscoveryResultImpl(THING_TYPE_UID11, THING_UID12, null, PROPS1, null, "label",

View File

@ -82,10 +82,10 @@ public class AutomaticInboxProcessorTest {
private static final ThingType THING_TYPE3 = ThingTypeBuilder.instance(THING_TYPE_UID3, "label").isListed(true)
.withRepresentationProperty(OTHER_KEY).build();
private final static Map<String, String> THING_PROPERTIES = Collections.singletonMap(DEVICE_ID_KEY, DEVICE_ID);
private final static Map<String, String> OTHER_THING_PROPERTIES = Collections.singletonMap(OTHER_KEY, OTHER_VALUE);
private static final Map<String, String> THING_PROPERTIES = Collections.singletonMap(DEVICE_ID_KEY, DEVICE_ID);
private static final Map<String, String> OTHER_THING_PROPERTIES = Collections.singletonMap(OTHER_KEY, OTHER_VALUE);
private final static Configuration CONFIG = new Configuration(Collections.singletonMap(CONFIG_KEY, CONFIG_VALUE));
private static final Configuration CONFIG = new Configuration(Collections.singletonMap(CONFIG_KEY, CONFIG_VALUE));
private AutomaticInboxProcessor automaticInboxProcessor;
private PersistentInbox inbox;

View File

@ -34,7 +34,7 @@ import gnu.io.rfc2217.TelnetSerialPort;
@Component(service = SerialPortProvider.class)
public class RFC2217PortProvider implements SerialPortProvider {
private final static String PROTOCOL = "rfc2217";
private static final String PROTOCOL = "rfc2217";
@Override
public @Nullable SerialPortIdentifier getPortIdentifier(URI portName) {

View File

@ -36,11 +36,11 @@ public class SerialPortUtil {
private static final String GNU_IO_RXTX_SERIAL_PORTS = "gnu.io.rxtx.SerialPorts";
private synchronized static boolean isSerialPortsKeySet() {
private static synchronized boolean isSerialPortsKeySet() {
return System.getProperties().containsKey(GNU_IO_RXTX_SERIAL_PORTS);
}
public synchronized static CommPortIdentifier getPortIdentifier(String port) throws NoSuchPortException {
public static synchronized CommPortIdentifier getPortIdentifier(String port) throws NoSuchPortException {
if ((System.getProperty("os.name").toLowerCase().indexOf("linux") != -1)) {
appendSerialPortProperty(port);
}
@ -54,7 +54,7 @@ public class SerialPortUtil {
*
* @param port the port to be registered
*/
private synchronized static void appendSerialPortProperty(String port) {
private static synchronized void appendSerialPortProperty(String port) {
String serialPortsProperty = System.getProperty(GNU_IO_RXTX_SERIAL_PORTS);
String newValue = initSerialPort(port, serialPortsProperty);
if (newValue != null) {
@ -69,7 +69,7 @@ public class SerialPortUtil {
* @return the scanned port identifiers
*/
@SuppressWarnings("unchecked")
public synchronized static Stream<CommPortIdentifier> getPortIdentifiersUsingScan() {
public static synchronized Stream<CommPortIdentifier> getPortIdentifiersUsingScan() {
Enumeration<CommPortIdentifier> identifiers;
if (isSerialPortsKeySet()) {
// Save the existing serial ports property
@ -94,7 +94,7 @@ public class SerialPortUtil {
* @return the port identifiers for the ports defined in the {@value #GNU_IO_RXTX_SERIAL_PORTS} property
*/
@SuppressWarnings("unchecked")
public synchronized static Stream<CommPortIdentifier> getPortIdentifiersUsingProperty() {
public static synchronized Stream<CommPortIdentifier> getPortIdentifiersUsingProperty() {
if (isSerialPortsKeySet()) {
// Save the Enumeration to a new list so the result is thread safe
return Collections.list(CommPortIdentifier.getPortIdentifiers()).stream();

View File

@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
* @author Gaël L'hopital - Initial contribution
*/
public class Ephemeris {
private final static Logger logger = LoggerFactory.getLogger(Ephemeris.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Ephemeris.class);
@ActionDoc(text = "checks if today is a weekend day")
public static boolean isWeekend() {
@ -63,7 +63,7 @@ public class Ephemeris {
try {
return EphemerisActionService.ephemerisManager.isBankHoliday(offset, filename);
} catch (FileNotFoundException e) {
logger.error("Error reading holiday user file {} : {}", filename, e.getMessage());
LOGGER.error("Error reading holiday user file {} : {}", filename, e.getMessage());
return false;
}
}
@ -88,7 +88,7 @@ public class Ephemeris {
try {
return EphemerisActionService.ephemerisManager.getBankHolidayName(offset, filename);
} catch (FileNotFoundException e) {
logger.error("Error reading holiday user file {} : {}", filename, e.getMessage());
LOGGER.error("Error reading holiday user file {} : {}", filename, e.getMessage());
return null;
}
}

View File

@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
public class HTTP {
/** Constant which represents the content type <code>application/json</code> */
public final static String CONTENT_TYPE_JSON = "application/json";
public static final String CONTENT_TYPE_JSON = "application/json";
private static Logger logger = LoggerFactory.getLogger(HTTP.class);

View File

@ -23,7 +23,7 @@ import org.slf4j.LoggerFactory;
*/
public class LogAction {
private final static String LOGGER_NAME_PREFIX = "org.eclipse.smarthome.model.script.";
private static final String LOGGER_NAME_PREFIX = "org.eclipse.smarthome.model.script.";
/**
* Creates the Log-Entry <code>format</code> with level <code>DEBUG</code> and logs under the loggers name

View File

@ -34,7 +34,7 @@ public class QueueingThreadPoolExecutorTest {
* we know that the QueuingTPE uses a core pool timeout of 10 seconds. Will
* be needed to check if all threads are down after this timeout.
*/
private final static int CORE_POOL_TIMEOUT = 10000;
private static final int CORE_POOL_TIMEOUT = 10000;
/**
* We can enable logging for all test cases.

View File

@ -38,7 +38,7 @@ public class VolumetricFlowRateTest {
/**
* While its not SI base unit it produces nice and fairly rounded numbers (si base is m3/s).
*/
private final static Unit<VolumetricFlowRate> BASE_UNIT = SmartHomeUnits.CUBICMETRE_PER_HOUR;
private static final Unit<VolumetricFlowRate> BASE_UNIT = SmartHomeUnits.CUBICMETRE_PER_HOUR;
private final Unit<VolumetricFlowRate> unit;
private final String symbol;

View File

@ -39,7 +39,7 @@ import org.junit.Test;
*/
public class PersistenceResourceTest {
private final static String PERSISTENCE_SERVICE_ID = "TestServiceID";
private static final String PERSISTENCE_SERVICE_ID = "TestServiceID";
private PersistenceResource pResource;
private ArrayList<HistoricItem> items;

View File

@ -46,8 +46,8 @@ import org.mockito.Mock;
*/
public class GenericItemChannelLinkProviderJavaTest extends JavaOSGiTest {
private final static String THINGS_TESTMODEL_NAME = "test.things";
private final static String ITEMS_TESTMODEL_NAME = "test.items";
private static final String THINGS_TESTMODEL_NAME = "test.things";
private static final String ITEMS_TESTMODEL_NAME = "test.items";
private static final String ITEM = "test";
private static final String CHANNEL = "test:test:test:test";

View File

@ -38,8 +38,8 @@ import org.junit.Test;;
*/
public class GenericItemChannelLinkProviderTest extends JavaOSGiTest {
private final static String THINGS_TESTMODEL_NAME = "test.things";
private final static String ITEMS_TESTMODEL_NAME = "test.items";
private static final String THINGS_TESTMODEL_NAME = "test.things";
private static final String ITEMS_TESTMODEL_NAME = "test.items";
private ModelRepository modelRepository;
private ThingRegistry thingRegistry;

View File

@ -50,7 +50,7 @@ import org.junit.Test;
*/
public class GenericThingProviderTest extends JavaOSGiTest {
private final static String TESTMODEL_NAME = "testModel.things";
private static final String TESTMODEL_NAME = "testModel.things";
private ModelRepository modelRepository;
private ThingRegistry thingRegistry;

View File

@ -35,7 +35,7 @@ import org.osgi.service.component.ComponentContext;
*/
public class GenericThingProviderTest2 extends JavaOSGiTest {
private final static String TESTMODEL_NAME = "testModelX.things";
private static final String TESTMODEL_NAME = "testModelX.things";
private ModelRepository modelRepository;
private ThingRegistry thingRegistry;

View File

@ -53,7 +53,7 @@ import org.osgi.service.component.ComponentContext;
public class GenericThingProviderTest3 extends JavaOSGiTest {
private DumbThingHandlerFactory dumbThingHandlerFactory;
private final static String TESTMODEL_NAME = "testModel3.things";
private static final String TESTMODEL_NAME = "testModel3.things";
private ModelRepository modelRepository;
private ThingRegistry thingRegistry;

View File

@ -64,7 +64,7 @@ public class GenericThingProviderTest4 extends JavaOSGiTest {
private int thingInitializeCounter;
final boolean slowInit;
private final static String TESTMODEL_NAME = "testModelX.things";
private static final String TESTMODEL_NAME = "testModelX.things";
ModelRepository modelRepository;
ThingRegistry thingRegistry;

View File

@ -36,9 +36,9 @@ public class DumbThingHandlerFactory extends BaseThingHandlerFactory implements
public static final String BINDING_ID = "dumb";
public final static ThingTypeUID THING_TYPE_TEST = new ThingTypeUID(BINDING_ID, "DUMB");
public static final ThingTypeUID THING_TYPE_TEST = new ThingTypeUID(BINDING_ID, "DUMB");
public final static Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_TEST);
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_TEST);
private boolean dumb;

View File

@ -44,20 +44,20 @@ public class TestHueThingHandlerFactory extends BaseThingHandlerFactory {
public static final String BINDING_ID = "hue";
public final static ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
public final static ThingTypeUID THING_TYPE_LCT001 = new ThingTypeUID(BINDING_ID, "LCT001");
public final static ThingTypeUID THING_TYPE_SENSOR = new ThingTypeUID(BINDING_ID, "SENSOR");
public final static ThingTypeUID THING_TYPE_TEST = new ThingTypeUID(BINDING_ID, "TEST");
public final static ThingTypeUID THING_TYPE_GROUPED = new ThingTypeUID(BINDING_ID, "grouped");
public final static ThingTypeUID THING_TYPE_LONG_NAME = new ThingTypeUID(BINDING_ID,
public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge");
public static final ThingTypeUID THING_TYPE_LCT001 = new ThingTypeUID(BINDING_ID, "LCT001");
public static final ThingTypeUID THING_TYPE_SENSOR = new ThingTypeUID(BINDING_ID, "SENSOR");
public static final ThingTypeUID THING_TYPE_TEST = new ThingTypeUID(BINDING_ID, "TEST");
public static final ThingTypeUID THING_TYPE_GROUPED = new ThingTypeUID(BINDING_ID, "grouped");
public static final ThingTypeUID THING_TYPE_LONG_NAME = new ThingTypeUID(BINDING_ID,
"1-thing-id-with-5-dashes_and_3_underscores");
public final static Set<ThingTypeUID> SUPPORTED_BRIDGE_TYPES = Stream.of(THING_TYPE_BRIDGE)
public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_TYPES = Stream.of(THING_TYPE_BRIDGE)
.collect(Collectors.toSet());
public final static Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream
.of(THING_TYPE_LCT001, THING_TYPE_SENSOR, THING_TYPE_TEST, THING_TYPE_LONG_NAME, THING_TYPE_GROUPED)
.collect(Collectors.toSet());
public final static Set<ThingTypeUID> SUPPORTED_TYPES = Stream
public static final Set<ThingTypeUID> SUPPORTED_TYPES = Stream
.concat(SUPPORTED_BRIDGE_TYPES.stream(), SUPPORTED_THING_TYPES.stream()).collect(Collectors.toSet());
// List all channels

View File

@ -34,15 +34,15 @@ public class TestHueThingHandlerFactoryX extends BaseThingHandlerFactory impleme
public static final String BINDING_ID = "Xhue";
public final static ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "Xbridge");
public final static ThingTypeUID THING_TYPE_LCT001 = new ThingTypeUID(BINDING_ID, "XLCT001");
public final static ThingTypeUID THING_TYPE_TEST = new ThingTypeUID(BINDING_ID, "XTEST");
public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "Xbridge");
public static final ThingTypeUID THING_TYPE_LCT001 = new ThingTypeUID(BINDING_ID, "XLCT001");
public static final ThingTypeUID THING_TYPE_TEST = new ThingTypeUID(BINDING_ID, "XTEST");
public final static Set<ThingTypeUID> SUPPORTED_BRIDGE_TYPES = Stream.of(THING_TYPE_BRIDGE)
public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_TYPES = Stream.of(THING_TYPE_BRIDGE)
.collect(Collectors.toSet());
public final static Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream.of(THING_TYPE_LCT001, THING_TYPE_TEST)
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream.of(THING_TYPE_LCT001, THING_TYPE_TEST)
.collect(Collectors.toSet());
public final static Set<ThingTypeUID> SUPPORTED_TYPES = Stream
public static final Set<ThingTypeUID> SUPPORTED_TYPES = Stream
.concat(SUPPORTED_BRIDGE_TYPES.stream(), SUPPORTED_THING_TYPES.stream()).collect(Collectors.toSet());
// List all channels

View File

@ -71,7 +71,7 @@ import tec.uom.se.unit.Units;
public class GroupItemOSGiTest extends JavaOSGiTest {
/** Time to sleep when a file is created/modified/deleted, so the event can be handled */
private final static int WAIT_EVENT_TO_BE_HANDLED = 1000;
private static final int WAIT_EVENT_TO_BE_HANDLED = 1000;
List<Event> events = new LinkedList<>();
EventPublisher publisher;

View File

@ -57,15 +57,15 @@ import org.mockito.Mock;
@SuppressWarnings("null")
public class ItemRegistryImplTest extends JavaTest {
private final static String ITEM_NAME = "switchItem";
private final static String CAMERA_ITEM_NAME1 = "cameraItem1";
private final static String CAMERA_ITEM_NAME2 = "cameraItem2";
private final static String CAMERA_ITEM_NAME3 = "cameraItem3";
private final static String CAMERA_ITEM_NAME4 = "cameraItem4";
private final static String CAMERA_TAG = "camera";
private final static String CAMERA_TAG_UPPERCASE = "CAMERA";
private final static String SENSOR_TAG = "sensor";
private final static String OTHER_TAG = "other";
private static final String ITEM_NAME = "switchItem";
private static final String CAMERA_ITEM_NAME1 = "cameraItem1";
private static final String CAMERA_ITEM_NAME2 = "cameraItem2";
private static final String CAMERA_ITEM_NAME3 = "cameraItem3";
private static final String CAMERA_ITEM_NAME4 = "cameraItem4";
private static final String CAMERA_TAG = "camera";
private static final String CAMERA_TAG_UPPERCASE = "CAMERA";
private static final String SENSOR_TAG = "sensor";
private static final String OTHER_TAG = "other";
private ItemRegistry itemRegistry;
private ManagedItemProvider itemProvider;

View File

@ -72,21 +72,21 @@ public class ChangeThingTypeOSGiTest extends JavaOSGiTest {
private SampleThingHandlerFactory thingHandlerFactory;
private boolean selfChanging = false;
private final static String BINDING_ID = "testBinding";
private final static String THING_TYPE_GENERIC_ID = "generic";
private final static String THING_TYPE_SPECIFIC_ID = "specific";
private final static ThingTypeUID THING_TYPE_GENERIC_UID = new ThingTypeUID(BINDING_ID, THING_TYPE_GENERIC_ID);
private final static ThingTypeUID THING_TYPE_SPECIFIC_UID = new ThingTypeUID(BINDING_ID, THING_TYPE_SPECIFIC_ID);
private final static String THING_ID = "testThing";
private final static ChannelUID CHANNEL_GENERIC_UID = new ChannelUID(
private static final String BINDING_ID = "testBinding";
private static final String THING_TYPE_GENERIC_ID = "generic";
private static final String THING_TYPE_SPECIFIC_ID = "specific";
private static final ThingTypeUID THING_TYPE_GENERIC_UID = new ThingTypeUID(BINDING_ID, THING_TYPE_GENERIC_ID);
private static final ThingTypeUID THING_TYPE_SPECIFIC_UID = new ThingTypeUID(BINDING_ID, THING_TYPE_SPECIFIC_ID);
private static final String THING_ID = "testThing";
private static final ChannelUID CHANNEL_GENERIC_UID = new ChannelUID(
BINDING_ID + "::" + THING_ID + ":" + "channel" + THING_TYPE_GENERIC_ID);
private final static ChannelUID CHANNEL_SPECIFIC_UID = new ChannelUID(
private static final ChannelUID CHANNEL_SPECIFIC_UID = new ChannelUID(
BINDING_ID + "::" + THING_ID + ":" + "channel" + THING_TYPE_SPECIFIC_ID);
private final static String ITEM_GENERIC = "item" + THING_TYPE_GENERIC_ID;
private final static String ITEM_SPECIFIC = "item" + THING_TYPE_SPECIFIC_ID;
private final static ItemChannelLink ITEM_CHANNEL_LINK_GENERIC = new ItemChannelLink(ITEM_GENERIC,
private static final String ITEM_GENERIC = "item" + THING_TYPE_GENERIC_ID;
private static final String ITEM_SPECIFIC = "item" + THING_TYPE_SPECIFIC_ID;
private static final ItemChannelLink ITEM_CHANNEL_LINK_GENERIC = new ItemChannelLink(ITEM_GENERIC,
CHANNEL_GENERIC_UID);
private final static ItemChannelLink ITEM_CHANNEL_LINK_SPECIFIC = new ItemChannelLink(ITEM_SPECIFIC,
private static final ItemChannelLink ITEM_CHANNEL_LINK_SPECIFIC = new ItemChannelLink(ITEM_SPECIFIC,
CHANNEL_SPECIFIC_UID);
private static final String PROPERTY_ON_GENERIC_THING_TYPE = "onlyGeneric";

View File

@ -37,11 +37,11 @@ import org.junit.Test;
*/
public class ManagedThingProviderOSGiTest extends JavaOSGiTest {
private final static String BINDIND_ID = "testBinding";
private final static String THING_TYPE_ID = "testThingType";
private final static ThingTypeUID THING_TYPE_UID = new ThingTypeUID(BINDIND_ID, THING_TYPE_ID);
private final static String THING1_ID = "testThing1";
private final static String THING2_ID = "testThing2";
private static final String BINDIND_ID = "testBinding";
private static final String THING_TYPE_ID = "testThingType";
private static final ThingTypeUID THING_TYPE_UID = new ThingTypeUID(BINDIND_ID, THING_TYPE_ID);
private static final String THING1_ID = "testThing1";
private static final String THING2_ID = "testThing2";
private ManagedThingProvider managedThingProvider;
private ProviderChangeListener<Thing> thingChangeListener;