Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » getMethods( ) does not return constructor
getMethods( ) does not return constructor [message #211457] Wed, 03 August 2005 13:45 Go to next message
babich25@hotmail.com is currently offline babich25@hotmail.comFriend
Messages: 16
Registered: July 2009
Junior Member
I am doing introspection of java code using JDT. Once I create compilation
unit from the java source code, I use its types() function to get
TypeDeclaration for that java source file. TypeDeclaration's method
getMethods() neatly returns the array of all methods declared within that
java file including constructors that take arguments. However, default
constructor or constructor that does not take any arguments is not
returned by the method getMethods(). Any suggestions on how to go around
this and abtain the Block from a constructor that does not take any
argumnets will be greatly appriciated. Thank you.
Re: getMethods( ) does not return constructor [message #211481 is a reply to message #211457] Wed, 03 August 2005 15:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: michael.giroux.objectweb.org

You probably don't need it. To use the default constructor invoke
Class.newInstance().

Michael Giroux


"Babich" <babich25@hotmail.com> wrote in message
news:aeec9faf48279736974495ddfd14f827$1@www.eclipse.org...
>I am doing introspection of java code using JDT. Once I create compilation
>unit from the java source code, I use its types() function to get
>TypeDeclaration for that java source file. TypeDeclaration's method
>getMethods() neatly returns the array of all methods declared within that
>java file including constructors that take arguments. However, default
>constructor or constructor that does not take any arguments is not returned
>by the method getMethods(). Any suggestions on how to go around this and
>abtain the Block from a constructor that does not take any argumnets will
>be greatly appriciated. Thank you.
Re: getMethods( ) does not return constructor [message #211489 is a reply to message #211457] Wed, 03 August 2005 17:16 Go to previous message
Adam Kiezun is currently offline Adam KiezunFriend
Messages: 219
Registered: July 2009
Senior Member
that'd be a bug. report it to bugzilla with a reproducible test case
I can;t reproduce it here. I tried AST View
( http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt- ui-home/plugins/org.eclipse.jdt.astview/index.html)
on this class:

class I{
I(){ }
I(int i){}
void foo(){
}
}
/adam
Previous Topic:Problem with multiple source locations & build output locations
Next Topic:[OT] OSCON
Goto Forum:
  


Current Time: Tue Oct 01 10:39:21 GMT 2024

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

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

Back to the top