You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2014/04/24 16:27:14 UTC

[jira] [Updated] (BCEL-150) LVTT entry for 'ht' does not match any LVT entry

     [ https://issues.apache.org/jira/browse/BCEL-150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg updated BCEL-150:
--------------------------------

    Description: 
I used the BCEL v5.2 to do experiments on my test cases, and met the following problem:
{code}
D:\java test._Test10
Exception in thread "main" java.lang.ClassFormatError: LVTT entry for 'ht' in class file test/_Test10 does not match any LVT entry
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: test._Test10.  Program will exit.
{code}

My test case is as follows:
{code}
public class _Test10 {
    public static void main (String [] args) {
        HashMap <Double,Integer> ht = new HashMap<Double,Integer>();
    }
}
{code}

Using BCEL, I didn't make any change of the original Method. Using it, I generated a new Method and replaced it with the new one.

{code}
ClassGen _cg = new ClassGen(_claz);
for (Method oldMethod : _inMethods) {
    MethodGen mg = new MethodGen(oldMethod, _inClass.getClassName(), _cpg);
    Method newMethod = mg.getMethod();
    _cg.replaceMethod(oldMethod, newMethod);
}
{code}

  was:
I used the BCEL v5.2 to do experiments on my test cases, and met the following problem.

D:\java test._Test10
Exception in thread "main" java.lang.ClassFormatError: LVTT entry for 'ht' in cl
ass file test/_Test10 does not match any LVT entry
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: test._Test10.  Program will exit.


My test case is as follows:
public class _Test10 {
	public static void main (String [] args){
		 HashMap <Double,Integer> ht = new HashMap<Double,Integer>();
	}
}


Using BCEL, I didn't make any change of the original Method. Using it, I generated a new Method and replaced it with the new one.

ClassGen _cg = new ClassGen(_claz);
for (Method oldMethod : _inMethods) {
	MethodGen mg = new MethodGen(oldMethod, _inClass.getClassName(), _cpg);
	Method newMethod = mg.getMethod();
	_cg.replaceMethod(oldMethod, newMethod);
}

       Priority: Major
    Environment:     (was: Operating System: Windows XP
Platform: PC)
       Priority:   (was: P2)
       Severity:   (was: major)

> LVTT entry for 'ht' does not match any LVT entry
> ------------------------------------------------
>
>                 Key: BCEL-150
>                 URL: https://issues.apache.org/jira/browse/BCEL-150
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.2
>            Reporter: Gang
>            Assignee: Apache Commons Developers
>
> I used the BCEL v5.2 to do experiments on my test cases, and met the following problem:
> {code}
> D:\java test._Test10
> Exception in thread "main" java.lang.ClassFormatError: LVTT entry for 'ht' in class file test/_Test10 does not match any LVT entry
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
>         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> Could not find the main class: test._Test10.  Program will exit.
> {code}
> My test case is as follows:
> {code}
> public class _Test10 {
>     public static void main (String [] args) {
>         HashMap <Double,Integer> ht = new HashMap<Double,Integer>();
>     }
> }
> {code}
> Using BCEL, I didn't make any change of the original Method. Using it, I generated a new Method and replaced it with the new one.
> {code}
> ClassGen _cg = new ClassGen(_claz);
> for (Method oldMethod : _inMethods) {
>     MethodGen mg = new MethodGen(oldMethod, _inClass.getClassName(), _cpg);
>     Method newMethod = mg.getMethod();
>     _cg.replaceMethod(oldMethod, newMethod);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)