jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikhil C. Khedkar" <nikhilckhed...@yahoo.com>
Subject Illegal signature
Date Mon, 09 Feb 2004 09:50:20 GMT
Hi,
	I have put few instructions in a method after each
line. After I do that I am getting the following
error. Note the ClassLOader has found one input
parameter to the method, which was not there before
and after the method was instrumented. Any clues?

Thanks,
	Nikhil Khedkar

instrumentMethod() : name = <init> signature = ()V
EXITING instrumentMethod() : name = <init> signature =
()V

instrumentMethod() : name = calculate signature =
(II)V
EXITING instrumentMethod() : name = calculate
signature = (II)V

instrumentMethod() : name = exposedAPI signature =
()Ljava/lang/String;
EXITING instrumentMethod() : name = exposedAPI
signature = ()Ljava/lang/String;

instrumentMethod() : name = simpleStatements signature
= ()V
EXITING instrumentMethod() : name = simpleStatements
signature = ()V

instrumentMethod() : name = main signature =
([Ljava/lang/String;)V
EXITING instrumentMethod() : name = main signature =
([Ljava/lang/String;)V

Exception in thread "main" java.lang.ClassFormatError:
com/training/db/Addition

(Method "<init>" has illegal signature "(V)V")
        at java.lang.ClassLoader.defineClass0(Native
Method)
        at
java.lang.ClassLoader.defineClass(ClassLoader.java:502)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at
java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
        at
java.net.URLClassLoader.access$100(URLClassLoader.java:54)
        at
java.net.URLClassLoader$1.run(URLClassLoader.java:193)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at
java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
        at
java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)


Here's the code I want to instrument

package com.training.db;

import java.lang.StringBuffer;

public class Addition
{
	private StringBuffer test = new StringBuffer("");

	public Addition()
	{
		test = new StringBuffer("Test Message");
	}

	public void calculate(int i, int j)
	{
		if(i == 0)
		{
			j = j + 5;
		}
		else
		{
			j = j + 5;
		}
	}

	public String exposedAPI()
	{
		simpleStatements();
		int x = 9;
		int j = (x = 55);

		String sName = null;int i = 0;
		return sName;
	}

	private void simpleStatements()
	{
		int x = 12;
		int y = 10;
		System.out.println(x);
		int z = 1 + 6;
	}

	public static void main(String []args) throws
InterruptedException
	{
		System.out.println("main 1");
		Thread.sleep(10000);

		System.out.println("main 2");
		Thread.sleep(10000);
	}
}

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Mime
View raw message