Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to get actual IMethodBinding for anonymous class constructor?
How to get actual IMethodBinding for anonymous class constructor? [message #1719971] Wed, 13 January 2016 09:04 Go to next message
Eclipse UserFriend
Hello,
Let's assume that I have a code
class Base
{
	public Base()
	{
		System.out.println("Hello");
	}
}

new Base()
{
	public void test()
	{
		
	}
};

It means that when I call
new Base(){...} 

this constructor will be called
public Base()
{
	System.out.println("Hello");
}

but when I try to get key of IMethodBinding of this ClassInstanceCreation, I receive another key than actual constructor has. So my question is how to get this key? Thanks
Re: How to get actual IMethodBinding for anonymous class constructor? [message #1720339 is a reply to message #1719971] Sun, 17 January 2016 15:20 Go to previous messageGo to next message
Eclipse UserFriend
Strictly speaking, the anonymous instantiation will invoke the ctor of Base only indirectly via super().
That means that seeing different keys from the instance creation and the ctor declaration should be expected.
OTOH, I'm not 100% sure, what exactly you're trying to achieve.
Stephan
Re: How to get actual IMethodBinding for anonymous class constructor? [message #1720355 is a reply to message #1720339] Mon, 18 January 2016 02:42 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, but I want to get IMethodBinding in implicit ctor call. The given example demonstrates this. Here is no implitic call to super(...), but it's called. So my point is to get somehow IMethodBinding for super() which will be called
Re: How to get actual IMethodBinding for anonymous class constructor? [message #1720356 is a reply to message #1720339] Mon, 18 January 2016 02:42 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: How to get actual IMethodBinding for anonymous class constructor? [message #1721447 is a reply to message #1720356] Wed, 27 January 2016 09:40 Go to previous message
Eclipse UserFriend
Any ideas?
Previous Topic:running Java program problem
Next Topic:Creating a new Eclipse project with a Git repository
Goto Forum:
  


Current Time: Fri Sep 19 02:20:35 EDT 2025

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

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

Back to the top