Skip to content
Snippets Groups Projects
Verified Commit 56ec76a9 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Remove some calls to deprecated code

parent 77e8cae6
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ import caosdb.server.utils.ServerMessages; ...@@ -31,6 +31,7 @@ import caosdb.server.utils.ServerMessages;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
...@@ -72,12 +73,14 @@ public class UserSources extends HashMap<String, UserSource> { ...@@ -72,12 +73,14 @@ public class UserSources extends HashMap<String, UserSource> {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
final Class<? extends UserSource> clazz = final Class<? extends UserSource> clazz =
(Class<? extends UserSource>) Class.forName(className); (Class<? extends UserSource>) Class.forName(className);
this.put(clazz.newInstance()); this.put(clazz.getDeclaredConstructor().newInstance());
} catch (final ClassNotFoundException e) { } catch (IllegalArgumentException
logger.error("LOAD_USER_SOURCE", e); | InvocationTargetException
} catch (final InstantiationException e) { | NoSuchMethodException
logger.error("LOAD_USER_SOURCE", e); | SecurityException
} catch (final IllegalAccessException e) { | ClassNotFoundException
| InstantiationException
| IllegalAccessException e) {
logger.error("LOAD_USER_SOURCE", e); logger.error("LOAD_USER_SOURCE", e);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment