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

AttributeMapper type parameter should be bounded by Attribute

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 24
    • core-libs
    • None
    • source
    • minimal
    • Preview API changes entail minimal compatibility risk.
    • Java API
    • SE

      Summary

      AttributeMapper's type parameter A is now bounded by Attribute<A>.

      Problem

      AttributeMapper's type parameter A is supposed to be bounded by Attribute<A> but is not declared so.

      Solution

      Make it bounded by Attribute<A>. This only affects one use site in implementation that it no longer needs to cast a user AttributeMapper return value to Attribute<?>; other places that can access AttributeMapper, such as Attribute::attributeMapper, already bounds the returned type argument.

      Note this change affects method descriptors, so technically the readAttribute and writeAttribute methods are now removed and re-added due to descriptor update from Object to Attribute.

      Specification

      -public interface AttributeMapper<A> {
      +public interface AttributeMapper<A extends Attribute<A>> {

            liach Chen Liang
            liach Chen Liang
            Adam Sotona
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: