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

ParsedSynthStyle: parameter name "direction" should be changed to "tabIndex"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 7
    • client-libs
    • b14
    • x86
    • linux

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      In class javax.swing.plaf.synth.ParsedSynthStyle in build 126 of JDK 7
      a method parameter is named "direction", but it should be named
      "tabIndex".
      Starting at line 1937 of ParsedSynthStyle we have:

              public void paintTabbedPaneTabBackground(SynthContext context,
                           Graphics g, int x, int y, int w, int h, int direction) {
                  getPainter(context, "tabbedpanetabbackground", -1).
                      paintTabbedPaneTabBackground(context, g, x, y, w, h, direction);
              }

      However, the last parameter to the called paintTabbedPaneTabBackground
      method expects a tabIndex, not a direction.

      I used the Fenum Checker from the Checker Framework
      (http://types.cs.washington.edu/checker-framework/) to check for
      consistent usage of directions and found this inconsistency.

      The attached patch fixes this problem.



      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      This is a patch for ParsedSynthStyle.java from OpenJDK 7 build 126:

      1938c1938
      < Graphics g, int x, int y, int w, int h, int direction) {
      ---
      > Graphics g, int x, int y, int w, int h, int tabIndex) {
      1940c1940
      < paintTabbedPaneTabBackground(context, g, x, y, w, h, direction);
      ---
      > paintTabbedPaneTabBackground(context, g, x, y, w, h, tabIndex);

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: