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

Address source incompatability of JSlider generification

XMLWordPrintable

    • source
    • minimal
    • Reverting to pre-generification version of the methods in question.
    • Java API
    • SE

      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/)

            darcy Joe Darcy
            darcy Joe Darcy
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: