Skip to main content

Take A Look

Posted by editor on September 20, 2006 at 5:48 AM PDT


A new way to view and navigate your code

Prolific blogger and developer Kohsuke Kawaguchi is at it again. As if JAXB and Hudson weren't enough, now he's started a project to make it easier to browse your code, with a better understanding of how classes and members are related than previous tools have provided.

In today's Weblogs, Kohsuke takes the wraps off
Sorcerer: a better source-code cross referencing tool:

There have been a few source code cross reference generators, like JXR in Maven and OpenGrok, but the problem I found with all of those tools is that they don't understand Java semantics. It can do lexical analysis, but none of them do the semantic analysis of the Java code. So the end result is that the generated HTML doesn't have much intelligence. The best it can do is to do syntax-coloring or do some keyword match (the tool basically just guess that this token MySAXParserFilterImpl probably means org/acme/MySAXParserFilterImpl.java.) I'm used to modern Java IDEs, so my expectation was higher.

This is where sorcerer does a better job. It actually builds the AST of Java source files, just like javac does (by using javac tree API.) So when it sees something like p.println(5) in your source file, it knows that "p" is a local variable defined in line 95 as PrintWriter, the println method invocation is PrintWriter.println(int), and so on.

To get a sense of what this project can do, Kohsuke has run it on sourcerer itself, to produce a sample report. Take a look and see if this will help with your own development.


Also in today's Weblogs, Tom Ball is
Hacking javac... but in a good way:
"The news that JSR-199, JSR-269, and the javac Tree API are almost finished seems to be flying under the radar, but tool nerds should take notice: there is a lot more you can do with these API than just compile source files and process annotations. In the spirit of O'Reilly Media's Hacks series, here are some alternative areas to explore."

Finally, John O'Conner has some thoughts on the combination of
Ubuntu, Free Software, and Sun's JDK:
"I may have just experienced the easiest OS install of my life. Ubuntu was a snap, but where's JDK 5.0?"


Today's Forums, also take note of Kohsuke's project mentioned at the top of this daily blog. In

Sorcerer, coxcu wonders if it could be exposed to a Swing GUI:
"Sorcerer provides a cool new way to browse Java source. Perhaps it could be easily appropriated to be the ultimate code/API review tool. Right now, it provides a really great first effort at Java code browsing. I'm curious how polished the user interface will eventually become. Will it hit the wall with browser technology? Kohsuke doesn't tend to reach for Swing first. Supporting migration between broswers and Swing is going to remain incredibly important."

dfuchs points out a JMX challenge in the thread
Re: some JMX questions:
"There is no existing JMX connector that I know of, which doesn't use a socket at some point to communicate with the remote process. The JMX specification will let you write new connectors, thanks to the JMXConnectorFactory/JMXConnectorServerFactory provider API, but this is no small task, and it wouldn't be a 'standard' connector anyway. I believe it would be much easier for you to teach your end users how to configure their firewall to let JMX traffic flow, if need be."


Topping off the items in Java Today,

the NetBeans 6.0 (Dev) Milestone 3 is now available for download at the Milestones downloads page.
Milestone 3 contains new and noteworthy improvements, including: * Ant output window now features Stop and Re-run buttons, * Windows Vista look and feel is fully supported if you run NetBeans 6.0 on latest available build of Java SE 6.0, *Run configurations is now avaialable also for Java SE projects.

Frank Sommers is considering The JVM as an (Un)Common Language Runtime: "Efforts to make non-Java languages perform well on the JVM accelerated in recent years. The benefits of turning the JVM into a highly-optimized, general-purpose execution environment are many, but so are the challenges."

The JUGJF discussion group was created on 8th August of 2006 as an academic student initiative in Juiz de Fora - Minas Gerais. The main goal is to do studies about the Java platform and technologies related with them. By the use of software engineering methodologies, the group aims to share knowledge and contribute with other java user groups.


In today's java.net
News Headlines
:

Registered users can submit news items for the href="http://today.java.net/today/news/">java.net News Page using our
news submission
form
. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the href="http://today.java.net/pub/q/news_rss?x-ver=1.0">java.net News RSS
feed.


Current and upcoming Java
Events
:

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
site.


Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.

A new way to view and navigate your code