[jboss-jira] [JBoss JIRA] Resolved: (JASSIST-67) Strange Exception: Register x contains wrong type
Shigeru Chiba (JIRA)
jira-events at lists.jboss.org
Tue Jun 9 06:59:56 EDT 2009
[ https://jira.jboss.org/jira/browse/JASSIST-67?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shigeru Chiba resolved JASSIST-67.
----------------------------------
Fix Version/s: 3.11.0.GA
Resolution: Done
> Strange Exception: Register x contains wrong type
> -------------------------------------------------
>
> Key: JASSIST-67
> URL: https://jira.jboss.org/jira/browse/JASSIST-67
> Project: Javassist
> Issue Type: Bug
> Affects Versions: 3.8.1.GA
> Environment: windowsXP
> Reporter: kobe valiant
> Assignee: Shigeru Chiba
> Priority: Blocker
> Fix For: 3.11.0.GA
>
>
> ClassPool pool = new ClassPool(true);
> CtClass ctc = pool.makeClass("my.Clazz");
> StringBuilder sb = new StringBuilder("public void test() {");
> for (int i = 0; i < 1000; i++) {
> sb.append("for(int i=0; i<10; i++) {}"); // line 1
> // sb.append("for(int i=0; i<10; i++) {int j=i;}"); // line 2
> }
> sb.append("}");
> ctc.addMethod(CtNewMethod.make(sb.toString(), ctc));
> ctc.toClass().newInstance();
>
> the code above will throw an exception:
> Exception in thread "main" java.lang.VerifyError: (class: my/Clazz, method: test signature: ()V) Register 0 contains wrong type
> But if you comment the line 1 and uncomment the line 2, there will no exception at all.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list