• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How can I find the references of a class programatically?

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 27451
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I don't even know how to spell CIA. But this tiny ad does:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic