Uploaded image for project: 'CCC Migration Project'
  1. CCC Migration Project
  2. CCC-8055254

Address source incompatability of JSlider generification

    XMLWordPrintable

    Details

    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Reverting to pre-generification version of the methods in question.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Revert to using raw types in some JSlider methods to provide better source compatibility.

      Problem

      The generification of swing as of JDK-8054360 contained an unexpected source incompatibility which prevented one of the SwingSet2 demos from compiling.

      Solution

      For now, make the label table field and associated methods in JSlider raw until a better generification can be explored.

      Specification

      --- old/src/share/classes/javax/swing/JSlider.java  2014-08-17 15:30:41.000000000 -0700
      +++ new/src/share/classes/javax/swing/JSlider.java  2014-08-17 15:30:41.000000000 -0700
      @@ -797,7 +800,8 @@
            * @return the <code>Dictionary</code> containing labels and
            *    where to draw them
            */
      -    public Dictionary<Integer, ? extends JComponent> getLabelTable() {
      +    @SuppressWarnings("rawtypes")
      +    public Dictionary getLabelTable() {
       /*
               if ( labelTable == null && getMajorTickSpacing() > 0 ) {
                   setLabelTable( createStandardLabels( getMajorTickSpacing() ) );
      @@ -830,8 +834,9 @@
            *    attribute: visualUpdate true
            *  description: Specifies what labels will be drawn for any given value.
            */
      -    public void setLabelTable( Dictionary<Integer, ? extends JComponent> labels ) {
      -        Dictionary<Integer, ? extends JComponent> oldTable = labelTable;
      +    @SuppressWarnings("rawtypes")
      +    public void setLabelTable( Dictionary labels ) {
      +        Dictionary oldTable = labelTable;
               labelTable = labels;
               updateLabelUIs();
               firePropertyChange("labelTable", oldTable, labelTable );
      
      (Full webrev at http://cr.openjdk.java.net/~darcy/8055254.0/)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              darcy Joe Darcy
              Reviewed By:
              Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: