Redundant error message on private abstract interface method with body

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: tools
    • b67
    • generic
    • generic
    • Verified

        $ catt PrivAndAbstract.java public class PrivAndAbstract {
            interface P {
                private abstract void foo() {};
            }
        }

        $ javac PrivAndAbstract.java
        PrivAndAbstract.java:3: error: illegal combination of modifiers: abstract and private
                private abstract void foo() {};
                                      ^
        PrivAndAbstract.java:3: error: interface abstract methods cannot have body
                private abstract void foo() {};
                                            ^
        2 errors

        First message is correct. Second message shows that javac at this position treats the method as abstract. Choosing one of two modifiers for error analysis is not correct and could confuse the user.

              Assignee:
              Srikanth Adayapalam (Inactive)
              Reporter:
              Sergei Pikalev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: