• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I find the references of a class programatically?  RSS feed

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm working in an existing project and I want to find out references of some classes programatically becuase those classes have some "static final" variables and whenever I'm changing anything in those variables I have to recompile whole application so that reference classes can take the latest changes. I can do it manually in "Eclipse" by using Eclipse properties-References.

As because those variables are static, reference classes calling those variables using class name.

I know one solution is instead calling those variables using class name I can use object of those classes or by removing those "final" modifier from those variables but as because it's a huge application I don't want to go for this solution and another reason is I'm creating patch of latest modification in the application so I don't want to recompile whole application again and again.

If I can find out references of those classes programatically, then I can recompile only those classes.

Any help will be highly appreciated.

Thanks & Regards
Bikash
[ February 28, 2006: Message edited by: Bikash Paul ]
 
Paul Clapham
Sheriff
Posts: 22708
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a couple of approaches you might try:

1. Stop changing those static final variables. (Design first, program later)

2. Recompile all your classes regularly. (Eclipse does that by default anyway)
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you build and how do you see it not working out for you? Eclipse and Ant and all those should keep track and only compile what needs it, no?

Many tools like JDepend will find all dependencies for you. I'm not sure what you'd do with that, though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!