mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java] IDEA-375134 Can't run non-static main method for Java 21 Preview
GitOrigin-RevId: f9d8a7a3b8b6f24ae8014ffb05b9b5b28ba9d3c0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3330c5c783
commit
388ffacaf5
@@ -120,10 +120,12 @@ public final class AppMainV2 {
|
||||
* - MainMethodStatus.WithoutArgs: the method is the main method and does not accept any parameters
|
||||
*/
|
||||
private static MainMethodStatus getMainMethodStatus(Method method, MainMethodSearchMode mode) {
|
||||
if ("main".equals(method.getName()) ) {
|
||||
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