Scala Programming Language
  1. Scala Programming Language
  2. SI-7532

regression in classfile parsing; shows up in android development.

    Details

      Description

      Regressed in: https://github.com/scala/scala/commit/395e90a

      % cat !$
      % curl --silent http://kriomant.net/scala/android.jar > sandbox/android.jar
      
      % cat sandbox/android.scala
      object Test extends App {
        println(android.R.attr.windowBackground)
      }
      
      % RUNNER=scalac scala-hash v2.10.2-RC1~75 -classpath sandbox/android.jar sandbox/android.scala
      [info] v2.10.2-RC => /Users/jason/usr/scala-v2.10.1-149-ged45b71
      error: error while loading attr, class file 'sandbox/android.jar(android/R$attr.class)' has location not matching its contents: contains class android.
      one error found
      
      % RUNNER=scalac scala-hash v2.10.2-RC1~76 -classpath sandbox/android.jar sandbox/android.scala
      [info] v2.10.2-RC => /Users/jason/usr/scala-v2.10.1-147-gc5ad8b4
      
      % jar tf sandbox/android.jar | grep attr
      android/R$attr.class
      
      % javap -classpath android.jar 'android/R$attr' | head
      Compiled from "R.java"
      public final class android.R$attr extends java.lang.Object{
          public static final int absListViewStyle;
          public static final int accessibilityEventTypes;
          public static final int accessibilityFeedbackType;
          public static final int accessibilityFlags;
          public static final int accountPreferences;
          public static final int accountType;
          public static final int action;
          public static final int actionBarDivider;
      

        Issue Links

          Activity

          Hide
          Jason Zaugg added a comment -

          Oh, that was easier and more amusing than expected.

            private def currentIsTopLevel = {
              val r1 = !(currentClass.decodedName containsChar '$')
              val r2 = currentClass.toString.indexOf('$') < 0
              if (r1 != r2)
                println((r1, r2, currentClass.decodedName, currentClass.toString))
              r2
            }
          
          (true,false,android.R@tr,android.R$attr)
          (true,false,android.R@tr,android.R$attr)
          

          I'll try to craft a test case for this and submit a PR shortly.

          Show
          Jason Zaugg added a comment - Oh, that was easier and more amusing than expected. private def currentIsTopLevel = { val r1 = !(currentClass.decodedName containsChar '$') val r2 = currentClass.toString.indexOf('$') < 0 if (r1 != r2) println((r1, r2, currentClass.decodedName, currentClass.toString)) r2 } (true,false,android.R@tr,android.R$attr) (true,false,android.R@tr,android.R$attr) I'll try to craft a test case for this and submit a PR shortly.
          Show
          Jason Zaugg added a comment - https://github.com/scala/scala/pull/2608

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Jason Zaugg
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development