[Minor] Automated Code cleanup

This commit is contained in:
Robert von Burg 2023-04-04 15:02:07 +02:00
parent 1885a19c9e
commit 12f92c3c8d
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
10 changed files with 11 additions and 34 deletions

View File

@ -66,7 +66,7 @@ public interface StrolchDao<T extends StrolchRootElement> {
/**
* Queries the current list of types from the underlying persistence layer
*
* @return the list of types
* @return the set of types
*
* @throws StrolchPersistenceException
* if something goes wrong
@ -338,5 +338,7 @@ public interface StrolchDao<T extends StrolchRootElement> {
* @throws StrolchPersistenceException
* if something goes wrong
*/
void flush() throws StrolchPersistenceException;
default void flush() throws StrolchPersistenceException {
// empty implementation
}
}

View File

@ -100,7 +100,7 @@ public class ComponentContainerTest {
ComponentContainer container = agent.getContainer();
ServiceHandlerTest serviceHandler = container.getComponent(ServiceHandlerTest.class);
ServiceResultTest result = serviceHandler.doService();
assertEquals(1, result.getResult());
assertEquals(1, result.result());
});
} catch (Exception e) {
logger.error(e.getMessage(), e);
@ -114,7 +114,7 @@ public class ComponentContainerTest {
ServiceHandlerTest serviceHandler = container.getComponent(ServiceHandlerTest.class);
ServiceResultTest result = serviceHandler.doService();
assertEquals(1, result.getResult());
assertEquals(1, result.result());
ResourceGeneratorHandlerTest resourceGeneratorHandler = container
.getComponent(ResourceGeneratorHandlerTest.class);
@ -134,7 +134,7 @@ public class ComponentContainerTest {
ServiceHandlerTest serviceHandler = container.getComponent(ServiceHandlerTest.class);
ServiceResultTest result = serviceHandler.doService();
assertEquals(1, result.getResult());
assertEquals(1, result.result());
Certificate certificate = login(agent);
try (StrolchTransaction tx = container.getRealm(StrolchConstants.DEFAULT_REALM)

View File

@ -1,12 +1,12 @@
/*
* Copyright 2013 Robert von Burg <eitch@eitchnet.ch>
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -15,15 +15,6 @@
*/
package li.strolch.runtime.configuration.model;
public class ServiceResultTest {
public record ServiceResultTest(int result) {
private final int result;
public ServiceResultTest(int result) {
this.result = result;
}
public int getResult() {
return this.result;
}
}

View File

@ -2,7 +2,6 @@ package li.strolch.model.log;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.Objects;
import java.util.Properties;
import java.util.ResourceBundle;

View File

@ -24,7 +24,6 @@ import li.strolch.persistence.api.StrolchDao;
import li.strolch.persistence.api.StrolchPersistenceException;
import li.strolch.persistence.api.StrolchTransaction;
import li.strolch.xmlpers.api.PersistenceTransaction;
import li.strolch.xmlpers.objref.IdOfSubTypeRef;
import li.strolch.xmlpers.objref.SubTypeRef;
import li.strolch.xmlpers.objref.TypeRef;
@ -44,10 +43,6 @@ public abstract class AbstractDao<T extends StrolchRootElement> implements Strol
protected abstract String getClassType();
protected IdOfSubTypeRef getIdRef(String type, String id) {
return this.tx.getManager().getObjectRefCache().getIdOfSubTypeRef(getClassType(), type, id);
}
protected SubTypeRef getTypeRef(String type) {
return this.tx.getManager().getObjectRefCache().getSubTypeRef(getClassType(), type);
}
@ -160,11 +155,6 @@ public abstract class AbstractDao<T extends StrolchRootElement> implements Strol
return this.tx.getObjectDao().removeAllBy(typeRef, file -> true);
}
@Override
public void flush() {
// nothing to do
}
@Override
public List<T> queryAll(long limit, long offset) throws StrolchPersistenceException {
throw new UnsupportedOperationException("Paging not supported! Check first with supportsPaging()");

View File

@ -3,7 +3,6 @@ package li.strolch.privilege.test;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import li.strolch.privilege.base.PrivilegeException;

View File

@ -16,7 +16,6 @@
package li.strolch.xmlpers.objref;
import java.text.MessageFormat;
import java.util.Objects;
import li.strolch.xmlpers.api.PersistenceContext;
import li.strolch.xmlpers.api.PersistenceContextFactory;

View File

@ -16,7 +16,6 @@
package li.strolch.xmlpers.objref;
import java.text.MessageFormat;
import java.util.Objects;
import li.strolch.xmlpers.api.PersistenceContext;
import li.strolch.xmlpers.api.PersistenceContextFactory;

View File

@ -17,7 +17,6 @@ package li.strolch.xmlpers.objref;
import java.io.File;
import java.text.MessageFormat;
import java.util.Objects;
import li.strolch.xmlpers.api.PersistenceContext;
import li.strolch.xmlpers.api.PersistenceTransaction;

View File

@ -16,7 +16,6 @@
package li.strolch.xmlpers.objref;
import java.text.MessageFormat;
import java.util.Objects;
import li.strolch.xmlpers.api.PersistenceContext;
import li.strolch.xmlpers.api.PersistenceTransaction;