Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
fix-newInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Little-Excited committed Apr 7, 2024
1 parent e832da7 commit 8025d2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ public class ResourceConfig extends org.glassfish.jersey.server.ResourceConfig {
* @throws ClassNotFoundException if a class was not found when attempting to load it
* @throws InstantiationException if a class was not able to be instantiated
* @throws IllegalAccessException if there was a problem accessing something due to security restrictions
* @throws NoSuchMethodException if a matching method is not found
* @throws InvocationTargetException if the underlying constructor throws an exception
*/
@Inject
public ResourceConfig() throws ClassNotFoundException, InstantiationException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException {
NoSuchMethodException, InvocationTargetException{
final Class<? extends BinderFactory> binderClass = Class.forName(getBindingFactory())
.asSubclass(BinderFactory.class);
final BinderFactory binderFactory = binderClass.getDeclaredConstructor().newInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ private static Provider<DataSource> initProvider(final @NotNull String dataSourc
throw new IllegalStateException(message, exception);
} catch (final InvocationTargetException exception) {
final String message = String.format(
"this Constructor of '%s' is enforcing Java language access control and the underlying " +
"constructor is inaccessible",
"the underlying constructor of '%s' throws an exception",
dataSourceProviderClass
);
throw new IllegalStateException(message, exception);
Expand Down

0 comments on commit 8025d2c

Please sign in to comment.