Skip to content

Commit

Permalink
153: removed a few deprecations
Browse files Browse the repository at this point in the history
Task-Url: #153
  • Loading branch information
LorenzoBettini committed Mar 4, 2022
1 parent 239a022 commit f3c2f19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Expand Up @@ -31,10 +31,10 @@ public class RuleApplicationTrace {

private static final Logger LOGGER = Logger.getLogger(RuleApplicationTrace.class);

protected List<Object> trace = new ArrayList<Object>();
protected List<Object> trace = new ArrayList<>();

public RuleApplicationTrace() {

// nothing to do
}

public void addToTrace(Object traceElement) {
Expand Down Expand Up @@ -97,16 +97,12 @@ protected RuleApplicationTrace performSafeDeepCloning() {
RuleApplicationTrace cloned = null;

try {
cloned = getClass().newInstance();
} catch (InstantiationException e) {
LOGGER.info(DEEP_CLONING, e);
return this;
} catch (IllegalAccessException e) {
cloned = getClass().getDeclaredConstructor().newInstance();
} catch (Exception e) {
LOGGER.info(DEEP_CLONING, e);
return this;
}

cloned.trace = new ArrayList<Object>();
cloned.trace = new ArrayList<>();
for (Object orig : trace) {
if (orig instanceof RuleApplicationTrace) {
cloned.trace.add(((RuleApplicationTrace)orig).performSafeDeepCloning());
Expand Down
Expand Up @@ -316,7 +316,7 @@ newArrayList("first", "second")
assertNoValidationErrors
// don't assume that the compiled system is the first one
val systemClass = getCompiledClass("my.test.ruleinvokations.System")
val obj = systemClass.newInstance
val obj = systemClass.getDeclaredConstructor().newInstance()
injector.injectMembers(obj)
obj.invoke("init")
instantiated.set(obj as XsemanticsRuntimeSystem)
Expand Down
Expand Up @@ -527,7 +527,7 @@ public void testGetEObjectWithEObject() {

@Test
public void testGetEObjectWithNonEObject() {
assertTrue(ts.getEObject(new Integer(10)) == null);
assertTrue(ts.getEObject(Integer.valueOf(10)) == null);
}

@Test
Expand Down

0 comments on commit f3c2f19

Please sign in to comment.