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

Cast to DefaultButtonModel to access getGroup() is unnecessary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 10, 11, 17
    • Fix Version/s: tbd_major
    • Component/s: client-libs
    • Labels:

      Description

      As of JDK-8182577, ButtonModel interface has the method getGroup(). Previously, whenever getGroup() was needed, the model object required casting to DefaultButtonModel.

      There are a couple of places where model object is cast to DefaultButtonModel before calling getGroup() method.

      BasicButtonUI.ButtonGroupInfo.getButtonGroupInfo() (lines 717-719):
                  ButtonModel model = activeBtn.getModel();
                  if (!(model instanceof DefaultButtonModel))
                      return false;

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aivanov Alexey Ivanov
              Reporter:
              aivanov Alexey Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: