[ 
https://jira.terracotta.org/jira//browse/CDV-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_23041
 ] 

Tim Eck commented on CDV-422:
-----------------------------

If you're familiar with bytecode, you can add -Dtc.classloader.writeToDisk=true 
to your VM and get the result of our terracotta instrumentation. Judging by the 
stack trace, it looks like it is getting mad about the field set on line 19. 
From that I might guess that the type of the PUTFIELD is being inappropriately 
modified. 

I'll have a look at this with one the bytecode guys here later today. A million 
thanks for providing a standalone test case!

> Problem With Subclass of HashSet
> --------------------------------
>
>                 Key: CDV-422
>                 URL: https://jira.terracotta.org/jira//browse/CDV-422
>             Project: Community Development
>          Issue Type: Bug
>    Affects Versions: 2.4.3
>            Reporter: Geir Ove Grønmo
>            Assignee: Issue Review Board
>
> The following test class triggers a java.lang.IncompatibleClassChangeError 
> like this:
> Exception in thread "main" java.lang.IncompatibleClassChangeError
>         at 
> tutorial.HelloWorldIncompatibleClassChangeError$MySet.<init>(HelloWorldIncompatibleClassChangeError.java:19)
>         at 
> tutorial.HelloWorldIncompatibleClassChangeError.sayHello(HelloWorldIncompatibleClassChangeError.java:35)
>         at 
> tutorial.HelloWorldIncompatibleClassChangeError.main(HelloWorldIncompatibleClassChangeError.java:47)
> - - -
> package tutorial;
> import java.util.List;
> import java.util.ArrayList;
> import java.util.Collection;
> import java.util.Set;
> import java.util.HashSet;
> import java.util.Iterator;
> public class HelloWorldIncompatibleClassChangeError {
>   class MySet extends HashSet {
>     protected String something;
>     
>     public MySet(String something, Collection c) {
>       super(c.size());      
>       Iterator iter = c.iterator();
>       while (iter.hasNext()) {
>         super.add(iter.next());
>       }
>       this.something = something;
>     }
>   }
>   
>   private List hellos = new ArrayList();
>   public void sayHello(){
>     synchronized(hellos){
>       Set abc = new HashSet();
>       abc.add("A");
>       abc.add("B");
>       abc.add("C");
>       hellos.add(abc);
>       Set myset = new MySet("xxx", abc);
>       myset.add("E");
>       hellos.add(myset);
>         
>       for(Iterator it = hellos.iterator();it.hasNext();) {
>         Object o = it.next();
>         System.out.println(o);
>       }
>     }
>   }
>   public static void main(String[] args) {
>     new HelloWorldIncompatibleClassChangeError().sayHello();
>   }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to