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

scala: error while loading Vector$1, class file ... is broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.1, Scala 2.11.0-M2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Running under IntelliJ 12.1.2.

      Description

      scala: error while loading Vector$1, class file 'C:\Program Files\Java\jdk1.7.0_21\jre\lib\rt.jar(java/util/Vector$1.class)' is broken
      (class java.util.NoSuchElementException/key not found: E)

      I am not using scala-swing, but I am using Swing components directly. My code compiles OK in Scala 2.9.3. I don't know how to find any useful log information. I have 80,000 LOC so it will be extremely difficult to narrow down where the problem is.

        Issue Links

          Activity

          Hide
          Samuel Halliday added a comment -

          we need to compile with java 7

          Show
          Samuel Halliday added a comment - we need to compile with java 7
          Hide
          Jason Zaugg added a comment -

          This particular bug isn't directly connected to Swing, BTW.

          From my pull-request comment:

          This bug is often reported by Java 7 Swing users but is unrelated to scala-swing, raw types, or newly-generified Java standard library classes. It could pop up anytime. It is also usually only seen within SBT when its custom compiler phase captures API snapshots.

          Given our limited resources, we typically don't backport bug fixes to maintainance releases unless they are deemed showstoppers, or if it needed by a customer with a Typesafe support contract. PIng me at jason.zaugg@typesafe.com if the latter is a possibility for you.

          Show
          Jason Zaugg added a comment - This particular bug isn't directly connected to Swing, BTW. From my pull-request comment: This bug is often reported by Java 7 Swing users but is unrelated to scala-swing, raw types, or newly-generified Java standard library classes. It could pop up anytime. It is also usually only seen within SBT when its custom compiler phase captures API snapshots. Given our limited resources, we typically don't backport bug fixes to maintainance releases unless they are deemed showstoppers, or if it needed by a customer with a Typesafe support contract. PIng me at jason.zaugg@typesafe.com if the latter is a possibility for you.
          Hide
          Samuel Halliday added a comment -

          Hmm, maybe we need a patch fix to sbt then. Is there no way to trick SBT or the compiler into compiling this? Even with layers of java in between?

          Show
          Samuel Halliday added a comment - Hmm, maybe we need a patch fix to sbt then. Is there no way to trick SBT or the compiler into compiling this? Even with layers of java in between?
          Hide
          Jason Zaugg added a comment -

          The problem is when scalac reads the class file Vector.class. If a Scala class extends JList, even indirectly, SBT's custom compiler phase that extracts the API of all classes in your project will end up forcing the type of this constructor:

          public JList(final Vector<?> listData) {
          

          which triggers loading of Vector.class.

          You might have more luck by wrapping, rather than inheriting from JList.

          Show
          Jason Zaugg added a comment - The problem is when scalac reads the class file Vector.class . If a Scala class extends JList , even indirectly, SBT's custom compiler phase that extracts the API of all classes in your project will end up forcing the type of this constructor: public JList(final Vector<?> listData) { which triggers loading of Vector.class . You might have more luck by wrapping, rather than inheriting from JList.
          Hide
          Samuel Halliday added a comment -

          thanks, yeah I think that's the way to go

          Show
          Samuel Halliday added a comment - thanks, yeah I think that's the way to go

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Rick Mugridge
            • Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development