[Minor] Automated Code cleanup: field can be final
This commit is contained in:
parent
373b582a44
commit
722df70765
|
@ -11,9 +11,9 @@ import li.strolch.model.StrolchRootElement;
|
|||
import li.strolch.utils.collections.MapOfLists;
|
||||
|
||||
public class ObserverEvent {
|
||||
public MapOfLists<String, StrolchRootElement> added = new MapOfLists<>();
|
||||
public MapOfLists<String, StrolchRootElement> updated = new MapOfLists<>();
|
||||
public MapOfLists<String, StrolchRootElement> removed = new MapOfLists<>();
|
||||
public final MapOfLists<String, StrolchRootElement> added = new MapOfLists<>();
|
||||
public final MapOfLists<String, StrolchRootElement> updated = new MapOfLists<>();
|
||||
public final MapOfLists<String, StrolchRootElement> removed = new MapOfLists<>();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -49,7 +49,7 @@ import li.strolch.utils.dbc.DBC;
|
|||
*/
|
||||
public abstract class AuditingElementMapFacade<T extends StrolchRootElement> implements ElementMap<T> {
|
||||
|
||||
protected ElementMap<T> elementMap;
|
||||
protected final ElementMap<T> elementMap;
|
||||
private final boolean readOnly;
|
||||
|
||||
protected Set<T> read;
|
||||
|
@ -59,7 +59,7 @@ public abstract class AuditingElementMapFacade<T extends StrolchRootElement> imp
|
|||
protected long deletedAll;
|
||||
protected Map<String, Long> deletedAllByType;
|
||||
|
||||
protected boolean observeAccessReads;
|
||||
protected final boolean observeAccessReads;
|
||||
|
||||
public AuditingElementMapFacade(ElementMap<T> elementMap, boolean readOnly, boolean observeAccessReads) {
|
||||
DBC.PRE.assertNotNull("ElementMap must be set!", elementMap);
|
||||
|
|
|
@ -11,7 +11,7 @@ import li.strolch.utils.iso8601.ISO8601FormatFactory;
|
|||
|
||||
public class AuditToSaxWriterVisitor implements AuditVisitor<Void> {
|
||||
|
||||
protected XMLStreamWriter writer;
|
||||
protected final XMLStreamWriter writer;
|
||||
|
||||
public AuditToSaxWriterVisitor(XMLStreamWriter writer) {
|
||||
this.writer = writer;
|
||||
|
|
|
@ -12,10 +12,10 @@ public abstract class TimedStateBuilder<T extends StrolchTimedState<?>> {
|
|||
protected final String id;
|
||||
protected final String name;
|
||||
|
||||
protected boolean hidden = false;
|
||||
protected final boolean hidden = false;
|
||||
protected int index;
|
||||
protected String interpretation = INTERPRETATION_NONE;
|
||||
protected String uom = UOM_NONE;
|
||||
protected final String interpretation = INTERPRETATION_NONE;
|
||||
protected final String uom = UOM_NONE;
|
||||
|
||||
public TimedStateBuilder(ResourceBuilder builder, String id, String name) {
|
||||
this.builder = builder;
|
||||
|
|
|
@ -33,7 +33,7 @@ import li.strolch.model.timevalue.IValueChange;
|
|||
@SuppressWarnings("rawtypes")
|
||||
public class TimeVariable<T extends IValue> implements ITimeVariable<T>, Serializable {
|
||||
|
||||
public NavigableSet<ITimeValue<T>> container = new TreeSet<>();
|
||||
public final NavigableSet<ITimeValue<T>> container = new TreeSet<>();
|
||||
private boolean readonly;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.xml.sax.helpers.AttributesImpl;
|
|||
*/
|
||||
public class StrolchElementToSaxVisitor implements StrolchRootElementVisitor<Void> {
|
||||
|
||||
protected ContentHandler contentHandler;
|
||||
protected final ContentHandler contentHandler;
|
||||
|
||||
public StrolchElementToSaxVisitor(ContentHandler contentHandler) {
|
||||
this.contentHandler = contentHandler;
|
||||
|
|
|
@ -46,7 +46,7 @@ import li.strolch.utils.iso8601.ISO8601;
|
|||
*/
|
||||
public class StrolchElementToSaxWriterVisitor implements StrolchRootElementVisitor<Void> {
|
||||
|
||||
protected XMLStreamWriter writer;
|
||||
protected final XMLStreamWriter writer;
|
||||
|
||||
public StrolchElementToSaxWriterVisitor(XMLStreamWriter writer) {
|
||||
this.writer = writer;
|
||||
|
|
|
@ -51,8 +51,8 @@ public class XmlModelSaxReader extends DefaultHandler {
|
|||
|
||||
protected static final Logger logger = LoggerFactory.getLogger(XmlModelSaxReader.class);
|
||||
|
||||
protected StrolchElementListener listener;
|
||||
protected ModelStatistics statistics;
|
||||
protected final StrolchElementListener listener;
|
||||
protected final ModelStatistics statistics;
|
||||
|
||||
private GroupedParameterizedElement parameterizedElement;
|
||||
private TextParameter textParam;
|
||||
|
|
|
@ -42,10 +42,10 @@ import org.slf4j.LoggerFactory;
|
|||
public abstract class PostgreSqlInitializer extends SystemAction {
|
||||
|
||||
protected static final Logger logger = LoggerFactory.getLogger(PostgreSqlInitializer.class);
|
||||
protected StrolchAgent agent;
|
||||
protected PostgreSqlPersistenceHandler persistenceHandler;
|
||||
protected RuntimeConfiguration runtimeConfig;
|
||||
protected ComponentConfiguration realmConfig;
|
||||
protected final StrolchAgent agent;
|
||||
protected final PostgreSqlPersistenceHandler persistenceHandler;
|
||||
protected final RuntimeConfiguration runtimeConfig;
|
||||
protected final ComponentConfiguration realmConfig;
|
||||
|
||||
public PostgreSqlInitializer(StrolchAgent agent, PostgreSqlPersistenceHandler persistenceHandler) {
|
||||
this.agent = agent;
|
||||
|
|
|
@ -66,10 +66,10 @@ public abstract class PostgresqlDao<T extends StrolchRootElement> implements Str
|
|||
private static final String queryAllByTypeAsJsonLimitSqlS = "select id, type, asjson from {0} where type = ANY(?) and latest = true order by id limit {1,number,#} offset {2,number,#}";
|
||||
|
||||
protected final DataType dataType;
|
||||
protected Connection connection;
|
||||
protected final Connection connection;
|
||||
protected final TransactionResult txResult;
|
||||
protected final boolean versioningEnabled;
|
||||
protected List<DaoCommand> commands;
|
||||
protected final List<DaoCommand> commands;
|
||||
|
||||
public PostgresqlDao(DataType dataType, Connection connection, TransactionResult txResult,
|
||||
boolean versioningEnabled) {
|
||||
|
|
|
@ -82,7 +82,7 @@ public class ObserverUpdateTest {
|
|||
|
||||
public static final class ElementAddedObserver implements Observer {
|
||||
|
||||
Map<String, ModificationResult> results = new HashMap<>();
|
||||
final Map<String, ModificationResult> results = new HashMap<>();
|
||||
|
||||
private ModificationResult getModificationResult(String key) {
|
||||
ModificationResult result = this.results.get(key);
|
||||
|
|
|
@ -30,7 +30,7 @@ import li.strolch.xmlpers.objref.TypeRef;
|
|||
|
||||
public abstract class AbstractDao<T extends StrolchRootElement> implements StrolchDao<T> {
|
||||
|
||||
protected PersistenceTransaction tx;
|
||||
protected final PersistenceTransaction tx;
|
||||
|
||||
protected AbstractDao(StrolchTransaction tx) {
|
||||
XmlStrolchTransaction strolchTx = (XmlStrolchTransaction) tx;
|
||||
|
|
|
@ -15,7 +15,7 @@ import li.strolch.utils.iso8601.ISO8601;
|
|||
|
||||
public class LogMessageToSaxWriterVisitor {
|
||||
|
||||
protected XMLStreamWriter writer;
|
||||
protected final XMLStreamWriter writer;
|
||||
|
||||
public LogMessageToSaxWriterVisitor(XMLStreamWriter writer) {
|
||||
this.writer = writer;
|
||||
|
|
|
@ -70,7 +70,7 @@ public class ObserverUpdateTest {
|
|||
|
||||
public static final class ElementAddedObserver implements Observer {
|
||||
|
||||
Map<String, ModificationResult> results = new HashMap<>();
|
||||
final Map<String, ModificationResult> results = new HashMap<>();
|
||||
|
||||
private ModificationResult getModificationResult(String key) {
|
||||
ModificationResult result = this.results.get(key);
|
||||
|
|
|
@ -189,7 +189,7 @@ public class PrivilegeRolesSaxReader extends DefaultHandler {
|
|||
|
||||
// <Property name="organizationalUnit" value="Development" />
|
||||
|
||||
public Map<String, String> parameterMap = new HashMap<>();
|
||||
public final Map<String, String> parameterMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String qName, Attributes attributes) {
|
||||
|
|
|
@ -123,7 +123,7 @@ public class PrivilegeUsersSaxReader extends DefaultHandler {
|
|||
String lastname;
|
||||
UserState userState;
|
||||
Locale locale;
|
||||
Set<String> userRoles;
|
||||
final Set<String> userRoles;
|
||||
Map<String, String> parameters;
|
||||
UserHistory history;
|
||||
boolean passwordChangeRequested;
|
||||
|
@ -239,7 +239,7 @@ public class PrivilegeUsersSaxReader extends DefaultHandler {
|
|||
|
||||
// <Property name="organizationalUnit" value="Development" />
|
||||
|
||||
public Map<String, String> parameterMap = new HashMap<>();
|
||||
public final Map<String, String> parameterMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String qName, Attributes attributes) {
|
||||
|
|
|
@ -13,7 +13,7 @@ import li.strolch.policy.StrolchPolicy;
|
|||
*/
|
||||
public class ConfirmationPolicy extends StrolchPolicy {
|
||||
|
||||
public static PolicyDef DEFAULT_CONFIRMATION = PolicyDef.valueOf(ConfirmationPolicy.class.getSimpleName(),
|
||||
public static final PolicyDef DEFAULT_CONFIRMATION = PolicyDef.valueOf(ConfirmationPolicy.class.getSimpleName(),
|
||||
"key:DefaultConfirmation");
|
||||
|
||||
public ConfirmationPolicy(StrolchTransaction tx) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public abstract class ExecutionPolicy extends StrolchPolicy {
|
|||
private Controller controller;
|
||||
private boolean stopped;
|
||||
|
||||
protected String realm;
|
||||
protected final String realm;
|
||||
protected String actionType;
|
||||
protected Locator resourceLoc;
|
||||
protected Locator actionLoc;
|
||||
|
|
|
@ -8,7 +8,7 @@ import li.strolch.policy.StrolchPolicy;
|
|||
|
||||
public abstract class PlanningPolicy extends StrolchPolicy {
|
||||
|
||||
public static PolicyDef DEFAULT_PLANNING = PolicyDef.getKeyPolicy(PlanningPolicy.class, "DefaultPlanning");
|
||||
public static final PolicyDef DEFAULT_PLANNING = PolicyDef.getKeyPolicy(PlanningPolicy.class, "DefaultPlanning");
|
||||
|
||||
public PlanningPolicy(StrolchTransaction tx) {
|
||||
super(tx);
|
||||
|
|
|
@ -6,5 +6,5 @@ import java.util.Map;
|
|||
import li.strolch.service.api.ServiceArgument;
|
||||
|
||||
public class StringMapArgument extends ServiceArgument {
|
||||
public Map<String, String> map = new HashMap<>();
|
||||
public final Map<String, String> map = new HashMap<>();
|
||||
}
|
||||
|
|
|
@ -26,11 +26,11 @@ public class XmlExportModelArgument extends ServiceArgument {
|
|||
public boolean overwrite;
|
||||
public boolean multiFile;
|
||||
public boolean doOrders = true;
|
||||
public boolean doResources = true;
|
||||
public boolean doActivities = true;
|
||||
public Set<String> orderTypes = new HashSet<>();
|
||||
public Set<String> resourceTypes = new HashSet<>();
|
||||
public Set<String> activityTypes = new HashSet<>();
|
||||
public final boolean doResources = true;
|
||||
public final boolean doActivities = true;
|
||||
public final Set<String> orderTypes = new HashSet<>();
|
||||
public final Set<String> resourceTypes = new HashSet<>();
|
||||
public final Set<String> activityTypes = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -6,7 +6,7 @@ import li.strolch.service.api.ServiceArgument;
|
|||
|
||||
public class PerformanceTestArgument extends ServiceArgument {
|
||||
|
||||
public long duration = 15;
|
||||
public TimeUnit unit = TimeUnit.SECONDS;
|
||||
public final long duration = 15;
|
||||
public final TimeUnit unit = TimeUnit.SECONDS;
|
||||
public int nrOfElements = 1;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class StreamWriterDelegate implements XMLStreamWriter {
|
|||
this.out = out;
|
||||
}
|
||||
|
||||
protected XMLStreamWriter out;
|
||||
protected final XMLStreamWriter out;
|
||||
|
||||
@Override
|
||||
public Object getProperty(String name) throws IllegalArgumentException {
|
||||
|
|
|
@ -33,11 +33,11 @@ public class WebSocketObserverHandler implements Observer {
|
|||
|
||||
protected final StrolchAgent agent;
|
||||
protected final String realmName;
|
||||
protected ObserverHandler observerHandler;
|
||||
protected WebSocketClient client;
|
||||
protected final ObserverHandler observerHandler;
|
||||
protected final WebSocketClient client;
|
||||
|
||||
protected MapOfSets<String, String> observedTypes;
|
||||
protected Map<String, JsonObject> params;
|
||||
protected final MapOfSets<String, String> observedTypes;
|
||||
protected final Map<String, JsonObject> params;
|
||||
|
||||
public WebSocketObserverHandler(StrolchAgent agent, String realmName, ObserverHandler observerHandler,
|
||||
WebSocketClient client) {
|
||||
|
|
|
@ -159,7 +159,7 @@ public class LockingTest extends AbstractPersistenceTest {
|
|||
public abstract class AbstractWorker extends Thread {
|
||||
|
||||
protected boolean success;
|
||||
protected String resourceId;
|
||||
protected final String resourceId;
|
||||
|
||||
public AbstractWorker(String name, String resourceId) {
|
||||
super(name);
|
||||
|
|
Loading…
Reference in New Issue