Skip to main content



      Home
Home » Language IDEs » AspectJ » Adding a method to the Object Class(intertype declarations)
Adding a method to the Object Class [message #824470] Mon, 19 March 2012 14:01 Go to next message
Eclipse UserFriend
I have a method that I want to add to the Object class as follows:
boolean Object.olderThan(Object value){
		//System.out.println(val+"OLDER");
		return val;
	}

but I am getting the error message typeNotExposedtoWeaver runtime error. Can anyone provide a detailed tip on how to successfully add a method to the Object class ?
Re: Adding a method to the Object Class [message #825211 is a reply to message #824470] Tue, 20 March 2012 11:59 Go to previous messageGo to next message
Eclipse UserFriend
You are trying to weave into the JDK. In general, this is not possible using LTW. The reason is that the weaver itself is written in Java and the weaver must be loaded before weaving can start. In order to be loaded, some portion of the JDK must be loaded as well. These classes that are loaded before the weaver is cannot be woven.

You must use compile time weaving and weave into your tools.jar to create a new one that contains the new byte code.
Re: Adding a method to the Object Class [message #826701 is a reply to message #825211] Thu, 22 March 2012 07:54 Go to previous message
Eclipse UserFriend
please can you throw more light on how to do this.
Previous Topic:Circular advice precedence - how to?
Next Topic:Error plugin
Goto Forum:
  


Current Time: Tue May 20 09:36:20 EDT 2025

Powered by FUDForum. Page generated in 0.03614 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top