Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 18:01 Go to next message
Adeyemi Adeseye is currently offline Adeyemi AdeseyeFriend
Messages: 2
Registered: March 2012
Junior Member
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 15:59 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
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 11:54 Go to previous message
Adeyemi Adeseye is currently offline Adeyemi AdeseyeFriend
Messages: 2
Registered: March 2012
Junior Member
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: Wed Apr 24 16:19:06 GMT 2024

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

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

Back to the top