Fixed a warning
This commit is contained in:
parent
6c87c3595c
commit
c5afae5aad
1 changed files with 3 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ import zutil.db.DBConnection;
|
||||||
import zutil.log.LogUtil;
|
import zutil.log.LogUtil;
|
||||||
import zutil.parser.json.JSONParser;
|
import zutil.parser.json.JSONParser;
|
||||||
import zutil.parser.json.JSONWriter;
|
import zutil.parser.json.JSONWriter;
|
||||||
import zutil.ui.Configurator;
|
import zutil.ui.conf.Configurator;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
@ -57,13 +57,14 @@ public abstract class DBBeanObjectDSO<T> extends DBBean {
|
||||||
private transient T cachedObj;
|
private transient T cachedObj;
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
protected void postUpdateAction() {
|
protected void postUpdateAction() {
|
||||||
if (type != null && !type.isEmpty()) {
|
if (type != null && !type.isEmpty()) {
|
||||||
if (cachedObj == null) {
|
if (cachedObj == null) {
|
||||||
try {
|
try {
|
||||||
Class clazz = Class.forName(type);
|
Class clazz = Class.forName(type);
|
||||||
cachedObj = (T) clazz.newInstance();
|
cachedObj = (T) clazz.getDeclaredConstructor().newInstance();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Unable instantiate class: " + type, e);
|
logger.log(Level.SEVERE, "Unable instantiate class: " + type, e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue