Skip to main content



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 09:45 Go to next message
Eclipse UserFriend
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 11: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 13:16 Go to previous message
Eclipse UserFriend
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: Sun Feb 23 11:19:37 EST 2025

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

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

Back to the top