swing - Class re-appears in a class loader after using embedded interpreter -


I am seeing a strange problem when using an embedded scalable interpreter, this hosting (non-interpreter) class loader Corruption (?) Reveals itself as a

  • i foo some place ( case f: foo = & gt; ... )
  • I am running an interpreter at some point ( IMIN -> interpretation )
  • followed by Foo Pattern matching fails; If I check the class then this is Foo , but it does not match with Foo

    , so I just That is why two competitive class loaders that generate two non-similar examples of square Foo in my whole class path, is only one foo , therefore There is no way that it can be shaded. Apart from this, it is enough to run something like 1 + 1 in the interpreter, so there is no way that imain tried to load its class Foo .

    I know this is very vague, but I am hoping for a signal to detect bugs.


    Edit : After further investigation, this problem occurs only when building against Scala 2.11.0, but when building against 2.10.4 Disappears; I have ensured that it was constructed from clean states. Does it concern me because it can indicate a new problem with the 2.11 interpreter?

    The class included in it (example Foo ) is a Java class, so there is no reason to believe it was compiled against the wrong Scala version.


    Edit : After further investigation, this problem may be related to the Java swing rather than Scala Interpreter. foo is actually a javax.swing.text.Document sub-class, and I see some problems with JEditorPane () and swing threading I can ( ). I am using OpenJDK 6 and OpenJDK7, I believe that OpenJDK has a fork of 6 OpenJDK 7, so it can still be a problem appearing in the bug database.

    It appears that in Scala 2.11.0, the context of the interpreter thread sets square loader, But does not restore it to its previous value

    The following is a workaround:

      val th = thread currentThread () val CL = th.getContextClassLoader {intp.interpret (text)} Finally {th.setContextClassLoader ( CL)}    

  • Comments

    Popular posts from this blog

    Verilog Error: output or inout port "Q" must be connected to a structural net expression -

    jasper reports - How to center align barcode using jasperreports and barcode4j -

    c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -