Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace argument with empty array #2924

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -90,7 +90,7 @@ public void remove(String property) {

public void loadAll() throws SQLException {
final Set<String> methodNameSet = loaderMap.keySet();
String[] methodNames = methodNameSet.toArray(new String[methodNameSet.size()]);
String[] methodNames = methodNameSet.toArray(new String[0]);
for (String methodName : methodNames) {
load(methodName);
}
Expand Down
Expand Up @@ -93,8 +93,8 @@ static Object createStaticProxy(Class<?> type, Callback callback, List<Class<?>>
if (constructorArgTypes.isEmpty()) {
enhanced = enhancer.create();
} else {
Class<?>[] typesArray = constructorArgTypes.toArray(new Class[constructorArgTypes.size()]);
Object[] valuesArray = constructorArgs.toArray(new Object[constructorArgs.size()]);
Class<?>[] typesArray = constructorArgTypes.toArray(new Class[0]);
Object[] valuesArray = constructorArgs.toArray(new Object[0]);
enhanced = enhancer.create(typesArray, valuesArray);
}
return enhanced;
Expand Down
Expand Up @@ -87,8 +87,8 @@ static Object createStaticProxy(Class<?> type, MethodHandler callback, List<Clas
}

Object enhanced;
Class<?>[] typesArray = constructorArgTypes.toArray(new Class[constructorArgTypes.size()]);
Object[] valuesArray = constructorArgs.toArray(new Object[constructorArgs.size()]);
Class<?>[] typesArray = constructorArgTypes.toArray(new Class[0]);
Object[] valuesArray = constructorArgs.toArray(new Object[0]);
try {
enhanced = enhancer.create(typesArray, valuesArray);
} catch (Exception e) {
Expand Down
Expand Up @@ -53,11 +53,11 @@ private <T> T instantiateClass(Class<T> type, List<Class<?>> constructorArgTypes
}
return constructor.newInstance();
}
constructor = type.getDeclaredConstructor(constructorArgTypes.toArray(new Class[constructorArgTypes.size()]));
constructor = type.getDeclaredConstructor(constructorArgTypes.toArray(new Class[0]));
if (!constructor.isAccessible()) {
constructor.setAccessible(true);
}
return constructor.newInstance(constructorArgs.toArray(new Object[constructorArgs.size()]));
return constructor.newInstance(constructorArgs.toArray(new Object[0]));
} catch (Exception e) {
StringBuilder argTypes = new StringBuilder();
if (constructorArgTypes != null) {
Expand Down