Commit 0f6f88ee authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

replace some deprecated calls.

parent 3424af6d
...@@ -16,7 +16,7 @@ public class CellState implements Cloneable { ...@@ -16,7 +16,7 @@ public class CellState implements Cloneable {
@Override @Override
public CellState clone() { public CellState clone() {
return new CellState(new Double(potential), tag); return new CellState(Double.valueOf(potential), tag);
} }
@Override @Override
......
package org.vadere.util.reflection; package org.vadere.util.reflection;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/** /**
* For example, this class can be used for creating {@link attributes.Attributes} or * For example, this class can be used for creating {@link attributes.Attributes} or
* {@link models.Model}s. * {@link models.Model}s.
...@@ -24,8 +27,8 @@ public class DynamicClassInstantiator<T> { ...@@ -24,8 +27,8 @@ public class DynamicClassInstantiator<T> {
// I cannot provoke a ClassCastException by doing: // I cannot provoke a ClassCastException by doing:
// T result = clazz.newInstance(); // T result = clazz.newInstance();
// This is an issue that comes back to the user of this API. // This is an issue that comes back to the user of this API.
return clazz.newInstance(); return clazz.getDeclaredConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
throw new CouldNotInstantiateException(e); throw new CouldNotInstantiateException(e);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment