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

[Android] Boolean.hashCode(boolean) reference to JDK8 causes compile failure on Android

    XMLWordPrintable

    Details

      Description

      com/sun/scenario/effect/impl/prism/PrFilterContext.java contains a reference to Boolean.hashCode(boolean) which is a Java 8 method.
      It only occurs at one place, and can easily be replaced by the implementation of that method in OpenJDK:

      diff -r 286217918102 modules/graphics/src/main/java/com/sun/scenario/effect/impl/prism/PrFilterContext.java
      --- a/modules/graphics/src/main/java/com/sun/scenario/effect/impl/prism/PrFilterContext.java Thu Jun 12 18:51:06 2014 +0300
      +++ b/modules/graphics/src/main/java/com/sun/scenario/effect/impl/prism/PrFilterContext.java Thu Jun 12 18:55:53 2014 +0200
      @@ -93,7 +93,7 @@
       
           @Override
           public int hashCode() {
      - return getReferent().hashCode() ^ Boolean.hashCode(forceSW);
      + return getReferent().hashCode() ^ (forceSW ? 1231 : 1237);
           }
       
           @Override

        Attachments

          Activity

            People

            Assignee:
            kcr Kevin Rushforth
            Reporter:
            jvos Johan Vos
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: