mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[java, rt] move instantiation to the branch with instance main
GitOrigin-RevId: 485de3c72dec3e0398168201a58cc209283804fd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1edf614aff
commit
2aa38dc112
@@ -105,19 +105,18 @@ public final class AppMainV2 {
|
||||
return;
|
||||
}
|
||||
|
||||
Constructor<?> declaredConstructor;
|
||||
try {
|
||||
declaredConstructor = appClass.getDeclaredConstructor();
|
||||
} catch (NoSuchMethodException e) {
|
||||
System.err.println("Non-static main() method was invoked: class must have constructor with no parameters");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
m.setAccessible(true);
|
||||
int parameterCount = m.getParameterTypes().length;
|
||||
Object objInstance = null;
|
||||
if (!Modifier.isStatic(m.getModifiers())) {
|
||||
Constructor<?> declaredConstructor;
|
||||
try {
|
||||
declaredConstructor = appClass.getDeclaredConstructor();
|
||||
} catch (NoSuchMethodException e) {
|
||||
System.err.println("Non-static main() method was invoked: class must have constructor with no parameters");
|
||||
return;
|
||||
}
|
||||
declaredConstructor.setAccessible(true);
|
||||
objInstance = declaredConstructor.newInstance();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user