• Post Reply Bookmark Topic Watch Topic
  • New Topic

Methods in a Java file  RSS feed

 
Ananth Ram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wanted to run a java program and see the affected methods in an output file. I have tried with Jinsight, etc all gives the intermediate files for viewing it, i wanted to see in a text file output, so that i can chase the impacted methods in a program.
Thanks
 
Dhamodharan Krishnan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use FileWriter object.
Using that you can
FileWriter fw = new FileWriter("out.log");
fw.write()--> in all the methods.
Then you will get at the end of running the program the output.
If you want to use without putting these then sorry.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use AspectJ to do this. AspectJ "automatically" inserts code at compile time according to the rules you specify.
You can specify a generic rule to have all methods output their names at runtime.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you use the inbuild profiler of the sun JDK: http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/perf3.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!