Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4801

Netbeans 12.0 syntax checking doesn't parse anonymous inner class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 12.0
    • None
    • cnd - Editor
    • None
    • Windows 10
      Netbeans 12.0
      JDK 14

    Description

      Example is from a simple GUI meant as a class review/demonstration. A JButton was added to a JFrame and an anonymous inner class used to respond to the ActionEvent. Following code does not indicate any errors for inner class - the error does appear when compiled. Problem reported should be that the anonymous class is not declared abstract because it does not override the abstract method actionPerformed(). The syntax of the method is correct - but it is named improperly (on purpose for demonstration purposes).

      No hint is displayed.

      Also - "Source"->"Insert code" menu does not provide ability to implement abstract method

      Edit: I tried pasting source code into this using "preformatted text" style - but it adds a lot of distraction with added brackets (etc). Probably best to examine the attached source code.

      Attachments

        1. HelloWorldGui.java
          1 kB
          James

        Activity

          People

            Unassigned Unassigned
            JavaJim James
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: