Eclipse allows to get all references to a function. I'd like to go further and know if anyone knows of a tool or script that would do this recursively ie from a function it would produce the list of different possible function stacks to access to it.
I am looking for this to make sure all the impacts of a change are captured in the spaghetti old legacy code I am looking at the moment. Thanks.
Try eclipse's Call Hierarchy.
It's CTRL-ALT-H on Windows, CTRL-OPTION-H on OS X.
(Hotkeys for eclipse 3.x, I have yet to use eclipse 4)
Its called the Call Hierarchy and you can open it with Ctrl+Alt+H
http://www.javaprogrammingforums.com/java-jdk-ide-tutorials/19-list-shortcuts-key-eclipse.html
Related
I'm trying to implement a plug-in for Eclipse (using Java) for C programmers, in which the user could right click on any variable in his/her C code and I would give him all sorts of information on that variable (like usages or which function is it passed to ... etc.).
Do you know how can I achieve this? If so - can I get the C syntax tree ?
Are there any open source project I could use as a reference ?
Not a direct answer to your question, but have you heard of the program Doxygen (also has an eclipse plugin? Take a look and see if it meets your needs. Sometimes it is easier to use pre-existing plugins rather than creating your own.
i need to detect if a class relies on another class programatically,to detect inappropriate intimacy code smell(i want to analyze other java programs ,using my program).Any directions on
how to achieve this will be a great help.
And
How to identify all the objects created in a java program?
How to identify all the called methods in a java program?
Any help would be appreciated.
You might want to use what's already there instead of building something yourself. Especially if you're not very familiar with the internals of Java and the JVM.
Have a look at JDepend: http://clarkware.com/software/JDepend.html
Use a profiler as JConsole or VisualVM. With the use of profilers you can pretty much see everything that happens at runtime.
One way i think of is using logger, Put some log statement in the construct and in the methods you want to monitor. So through logs you can find out the objects created and methods accessed
I have found very useful the ObjectWeb asm-all Java bytecode manipulation and analysis library, also known as asm-all.jar
It allows you to convert any *.jar application into equivalent XML file. You can fully inspect the application structure, change it in the XML format and convert back into *.jar file
In order to use the XML files you'll need to understand what it contains. Oracle's The Java® Virtual Machine Specification is very good reference to start with
BTW: one thing you can do with this tool is to instrument the bytecode so that it creates runtime profiling information - which methods were called and by whom (as suggested by #upog)
Is it possible to edit the content assistance of Eclipse? Sort of add rules or functions for it? I'm aware that Eclipse is open-sourced, but I was there an "easier way" or an interface?
For example, I'm working in Java 1.4.2, so I don't believe I have the magical "autoboxing"(am I correct in thinking that autoboxing would solve this issue?) . So when I'm working with getting parameters from a request, they all return strings when I may need a Long or an Int. I'm always interested in making things more automated (as any computer scientist usually would), so I was wondering if it was possible to have content assist suggest to use the common java parse functions (Integer.parseInt, Long.parseLong, etc) for the passed in parameters.
If you want to actually augment Content Assist in a highly detailed, customized way, you'd have to write a plugin. Eclipse is very well architected such that there are endless extension points via which plugins can extend base functionality, including Content Assist. But, writing one is not a trivial matter (though a skill that could serve you well, if you have the time to learn it).
Another option is to write your own Java editor template, which can emit any pre-defined snippet of code you want (including inserting parameter values), and will be included in Content Assist. Open Eclipse's Preferences and navigate to Java > Editor > Templates. You can use the ? help button on that Preferences page to learn more about them.
I'm not sure if what I'm asking is possible, but I would like to do the following:
When a file is created in a certain folder (Windows), my program should respond. I'd like to let Windows call a callback method when a file is created.
Another option is of course just use a loop and constantly check if a new file is in the folder, but I'd like to know it instantly, so a callback method would be much more efficient.
Is this possible? The language is not important, although Java is preferred.
With Java nio 2 (available in Java 1.7 +), you can "watch" a directory and get notified when that directory changes.
The method proposed in the tutorial linked above uses the WatchService API.
Commons IO contains a FileAlterationListener wich has a onDirectoryChangemethod. Can be an alternative if Java 1.7 is not available.
If you are not bound to Java, then you could use very convenient FileSystemWatcher in C# or VisualBasic. It will allow you to watch all kinds of events which can occur in folder and it's quite easy to implement it.
The user needs to browse sites through the Java program (not netbeans IDE), it should behave exactly like FireFox browser or IE, any suggestions ? I need to be able to access the DOM so I can manipulate DOM elements.
Also, is there something equivalent to Perl's CPAN but for Java ?
ugh, i've done something like this a while back in ... c++ i think. that must have been in 2002 or something like that. i used a component from Borland's C++ Builder back then (or did i use delphi?) anyways, i did a quick google search and found a rather antique post from '99; if nothing else, it's perhaps a good place to start.
http://www.javaworld.com/javaworld/javatips/jw-javatip66.html
you may also want to look at http://www.velocityreviews.com/forums/t682627-embedding-web-browser-prefer-firefox-in-java-application.html
i hope this helps!
check out http://www.mozilla.org/projects/blackwood/webclient/