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

Add lint check for calling overridable methods from a constructor

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8
    • Fix Version/s: tbd_major
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      One of the coding guidelines from "Effective Java" and elsewhere is to not call overridable methods from a constructor. A compiler is an in excellent position to perform this kind of check.

      The Java Specialists newsletter reports instance of this coding pattern in the JDK codebase:

          www.javaspecialists.eu/archive/Issue210.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jlahoda Jan Lahoda
                Reporter:
                darcy Joe Darcy
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: