提交 ec82ef2f 编写于 作者: S serge-rider

Deprecated API usage fix


Former-commit-id: 0dfff5e0
上级 9867ff31
......@@ -49,6 +49,6 @@ public interface DBDDataFormatterProfile {
void saveProfile() throws IOException;
DBDDataFormatter createFormatter(String typeId, DBSTypedObject type) throws IllegalAccessException, InstantiationException, IllegalArgumentException;
DBDDataFormatter createFormatter(String typeId, DBSTypedObject type) throws ReflectiveOperationException;
}
......@@ -83,13 +83,13 @@ public class DataFormatterDescriptor extends AbstractDescriptor
return properties;
}
public DBDDataFormatter createFormatter() throws IllegalAccessException, InstantiationException
public DBDDataFormatter createFormatter() throws ReflectiveOperationException
{
Class<? extends DBDDataFormatter> clazz = formatterType.getObjectClass(DBDDataFormatter.class);
if (clazz == null) {
return null;
}
return clazz.newInstance();
return clazz.getConstructor().newInstance();
}
}
......@@ -186,7 +186,7 @@ public class DataFormatterProfile implements DBDDataFormatterProfile, DBPPrefere
@Override
public DBDDataFormatter createFormatter(String typeId, DBSTypedObject type)
throws IllegalAccessException, InstantiationException, IllegalArgumentException
throws ReflectiveOperationException
{
DataFormatterDescriptor descriptor = DataFormatterRegistry.getInstance().getDataFormatter(typeId);
if (descriptor == null) {
......
......@@ -80,7 +80,7 @@ public abstract class ObjectAttributeDescriptor {
final LazyProperty lazyInfo = getter.getAnnotation(LazyProperty.class);
if (lazyInfo != null) {
try {
cacheValidator = lazyInfo.cacheValidator().newInstance();
cacheValidator = lazyInfo.cacheValidator().getConstructor().newInstance();
} catch (Exception e) {
log.warn("Can't instantiate lazy cache validator '" + lazyInfo.cacheValidator().getName() + "'", e);
}
......
......@@ -322,7 +322,7 @@ public class ObjectPropertyDescriptor extends ObjectAttributeDescriptor implemen
Class<? extends Format> formatClass = propInfo.formatter();
if (formatClass != Format.class) {
try {
displayFormat = formatClass.newInstance();
displayFormat = formatClass.getConstructor().newInstance();
} catch (Throwable e) {
log.error(e);
}
......@@ -479,7 +479,7 @@ public class ObjectPropertyDescriptor extends ObjectAttributeDescriptor implemen
if (propInfo.listProvider() != IPropertyValueListProvider.class) {
// List
try {
return propInfo.listProvider().newInstance().allowCustomValue();
return propInfo.listProvider().getConstructor().newInstance().allowCustomValue();
} catch (Exception e) {
log.error(e);
}
......
......@@ -199,13 +199,13 @@ public class SearchDataQuery implements ISearchQuery {
}
operator = DBCLogicalOperator.EQUALS;
try {
value = new Integer(params.searchString);
value = Integer.valueOf(params.searchString);
} catch (NumberFormatException e) {
try {
value = new Long(params.searchString);
value = Long.valueOf(params.searchString);
} catch (NumberFormatException e1) {
try {
value = new Double(params.searchString);
value = Double.valueOf(params.searchString);
} catch (NumberFormatException e2) {
try {
value = new BigDecimal(params.searchString);
......@@ -307,7 +307,7 @@ public class SearchDataQuery implements ISearchQuery {
private int rowCount = 0;
private DBDDataFilter filter;
public TestDataReceiver(SearchTableMonitor searchMonitor) {
TestDataReceiver(SearchTableMonitor searchMonitor) {
this.searchMonitor = searchMonitor;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册