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

Dead stores in method javax.swing.plaf.basic.BasicSliderUI.paintTrack(Graphics)

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b32
    • CPU:
      generic
    • OS:
      generic

      Description

      In the public method called javax.swing.plaf.basic.BasicSliderUI.paintTrack(Graphics) there are assignments to local objects, but they are never used in the method.

          public void paintTrack(Graphics g) {
              int cx, cy, cw, ch;
              int pad; <---------------- local object, useless

              Rectangle trackBounds = trackRect;

              if ( slider.getOrientation() == JSlider.HORIZONTAL ) {
                  pad = trackBuffer; <----------------- dead store
                  cx = pad; // <----------------------- dead store
                  cy = (trackBounds.height / 2) - 2;
                  cw = trackBounds.width;

                  g.translate(trackBounds.x, trackBounds.y + cy);

                  g.setColor(getShadowColor());
                  g.drawLine(0, 0, cw - 1, 0);
                  g.drawLine(0, 1, 0, 2);
                  g.setColor(getHighlightColor());
                  g.drawLine(0, 3, cw, 3);
                  g.drawLine(cw, 0, cw, 3);
                  g.setColor(Color.black);
                  g.drawLine(1, 1, cw-2, 1);

                  g.translate(-trackBounds.x, -(trackBounds.y + cy));
              }
              else {
                  pad = trackBuffer; // <------------- dead store
                  cx = (trackBounds.width / 2) - 2;
                  cy = pad; // <--------------------- dead store
                  ch = trackBounds.height;

                  g.translate(trackBounds.x + cx, trackBounds.y);

                  g.setColor(getShadowColor());
                  g.drawLine(0, 0, 0, ch - 1);
                  g.drawLine(1, 0, 2, 0);
                  g.setColor(getHighlightColor());
                  g.drawLine(3, 0, 3, ch);
                  g.drawLine(0, ch, 3, ch);
                  g.setColor(Color.black);
                  g.drawLine(1, 1, 1, ch-2);

                  g.translate(-(trackBounds.x + cx), -trackBounds.y);
              }
          }

      ###@###.### 2005-03-11 12:40:00 GMT

        Attachments

          Activity

            People

            Assignee:
            shickeysunw Shannon Hickey (Inactive)
            Reporter:
            jloefflm Johann Löfflmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: