mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
[java] IDEA-375134 Can't run non-static main method for Java 21 Preview
(cherry picked from commit f9d8a7a3b8b6f24ae8014ffb05b9b5b28ba9d3c0) (cherry picked from commit f0966f81713bd81f4128c2a1c1fbd717dc394682) IJ-MR-169535 GitOrigin-RevId: f9bfafb5e635f684d124d8fd4a7a5a996c6971e7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5fa62ff23e
commit
bc7eb9f89f
@@ -123,7 +123,9 @@ public final class AppMainV2 {
|
||||
if ("main".equals(method.getName())) {
|
||||
if (!Modifier.isPrivate(method.getModifiers())) {
|
||||
if (mode == MainMethodSearchMode.ALL_METHOD ||
|
||||
(mode == MainMethodSearchMode.STATIC_METHOD && Modifier.isStatic(method.getModifiers()))) {
|
||||
(mode == MainMethodSearchMode.STATIC_METHOD && Modifier.isStatic(method.getModifiers())) ||
|
||||
(mode == MainMethodSearchMode.NON_STATIC_METHOD && !Modifier.isStatic(method.getModifiers()))
|
||||
) {
|
||||
Class<?>[] parameterTypes = method.getParameterTypes();
|
||||
if (parameterTypes.length == 1 && parameterTypes[0] == String[].class) {
|
||||
return MainMethodStatus.WithArgs;
|
||||
|
||||
Reference in New Issue
Block a user