Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8357016

Candidate main methods not computed properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 25
    • 25
    • tools
    • None

      The candidate main methods are not computed properly - methods that are private, or have non-void return type are not candidate methods, but may hide a real candidate method.

      For example:
      ```
      $ cat /tmp/MainPrivate.java
      public class MainPrivate {
          private static void main(String... args) {
          }
          void main() {
              System.out.println("Should be called!");
          }
      }
      $ java /tmp/MainPrivate.java
      error: can't find main(String[]) method in class: MainPrivate
      ```

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: