Skip navigation
ANNOUNCEMENT: is currently Read only due to planned upgrade until 28-Sep-2020 9:30 AM Pacific Time. Any changes made during Read only mode will be lost and will need to be re-entered when the application is back read/write.

Behind the Wheel Blog

Posted by kfarnham Apr 30, 2007

...of a nimble Java-powered robot

If you grew up wishing you could control "Johnny Sokko's Flying Robot" or the Wing Zero Gundam, and don't mind downsizing your ambitions just a bit, a pair of JavaOne contests have just the thing for you. The Robosapiens Developer Contests being held at JavaOne will let developers program theRS Media Java ME powered Robosapiens robot from WowWee Robotics. "The RS Media Robosapien robot provides a complete multimedia robotic experience with the unique ability to be fully customized and programmable. The robot is equipped with a head-mounted camera, a color LCD screen in his chest, a full speaker system embedded in his armor. The robot is capable of playing MP3, taking and displaying photos and videos, recording and playing audio clips, and comes with Java games."

For those ready to program the robot, two contests are being held. The first is The Dance Contest, where the goal is "to create a midlet that successfully integrates original choreography, utilizing the robot's movements, with crowd-pleasing music. Dance moves are limited only by physical constraints of the robot." The second isThe Escape Contest, where you need to "create a midlet that uses all of the robot's sensors and systems to enable the robot to escape the "The Room of Doom," which is a 5' x 5' hexagonal shaped area with a red and white color scheme. The room's exit has a large red area which is recognizable with the robot's vision sensors."

How 'bout that: a dancing, trap-escaping, Java ME robot. All we need now is little missiles to shoot out of its fingers and we'll have total robot street cred.

Also in Java Today, TheServerSide notes the conclusion of a series of blogs on the Top 10 Java EE performance problems. "For the last two and a half months, Vincent Partington has been blogging about the top ten Enterprise Java Application Performance Problems. [...] Now he wraps up the countdown with some conclusions about Enterprise Java performance in general."

The "Plugins" tab on the NetBeans home page now takes you to the newly implemented NetBeans Plugin Portal. You can use the new NetBeans Plugin Portal to add your own plugins, comment on plugins, rate plugins, and add the Plugin Portal as an Update Center to your NetBeans IDE. More details about the new portal are available in NB Evangelist Dave Botterill's blogCheck Out The New NetBeans Plugin Portal.

In today's Forums,rickcarson follows up on an open question from yesterday and makes the case for Jini in Re: Java Cluster, whats the best way? "Jini is a really good way to do a clustered supercomputer. What you do is on each of the computers you put a Jini client. Then you expose a Jini service. What happens is that the client goes to the service and asks for work. The service gives it some work to do. The client does the work. The client goes back to the service to ask for more work. Jini is nice in this case because it has the concept of expiry. Eg if one of the clients bursts into flame its lease will expire, and the service can figure out that if the lease expires whatever piece of work it last handed to that client needs to be handed to a different client. Moreover, real users can be using the computers for other stuff, and you can run the Jini clients highly niced and in the background, just using the spare cpu cycles without stealing from the users."

Joe Shevland offers a reality check on JPA annotations in RE: EJBQL Exception. "I'd say though the cases where you don't need to define a property->column mapping are pretty rare (almost restricted to tutorials and shallow examples I'd say) - all projects I've worked on to date have either had a legacy database, or a schema that's being dictated by DBA's/database standards for column names etc. A JPA-generated database schema is probably not going to be very good if you don't use the Column mapping for things like length, nullability etc. Or on the other hand, you'd have getters/setters like getPrs_Fst_Nm() which I personally wouldn't allow in a codebase."

hunterp reports a seemingly pathological garbage collection problem in GC killing me. "I have an app and GC is killing me. everything is fine until the memory reaches the heap then gc takes forever (while still applying load) and the app is completely unresponsive (up to 2 minute wait times). I thought the time ratio combined with incremental would collect more aggressively (i have lots of free cpu). But with the parameters below, for a 4 minute run, the jvm spent well under a minute GC before it hit the wall and blew up. FYI the PSOldGen space is where 75% of the garbage stays until the wall. I've tried the -XX:MinHeapFreeRatio=30 (instead of default 40) but no difference."



Get the Balance Right Blog

Posted by kfarnham Apr 30, 2007

An accord on closures?

The "closures debate" in the Java community -- recently summarized in a DeveloperWorks article by Brian Goetz -- is really a tangle of several debates. We might well be discussing three very different things:

  1. Whether to add closures to the Java language
  2. What specifically a closures proposal should address
  3. The specific syntax of a closures proposal

Today's news is that at least one of these has been fundamentally addressed. Artima reports that consensus has been reached among the competing JDK 7 closures proposals. They cite a blog entry from Neal Gafter, A Consensus Closures JSR Proposal, which he says "comes as close to achieving consensus as I believe possible. All but one of the authors of the three widely-discussed closures proposals have agreed to support it." The proposaldefines the problem to be solved but does not mandate a specific solution, though it does offer Closures for Java as an example solution.

So, according to Gafter, an agreement has been reached on what the problem is and what a closures JSR will try to address. That's number 2 on the list above. The next question for the group to consider will be the specific form of their proposal, which is debate #3. Assuming that is resolved and then brought to the community in the form of a draft JSR, it will be up to the JCP Executive Committee (and, really, to the community as a whole) to answer the first question: do we really even want this at all?

2-3-1 might seem a strange way to go about it, but it's possible the closure proponents are addressing the problems in order of difficulty. Rather than get consensus from everyone on the need for closures, they'll get the closure proponents to at least agree on a common agenda, see if they can develop a concrete proposal amongst themselves, and then see if, armed with specifics, they can sway some/most/all of the closure skeptics.


Also in Java Today,

the Direct Web Remotingproject has released the long-awaited version 2.0. DWR 2.0's marquee feature is "Reverse Ajax" (explained in a feature article), and also features a JavaScript Proxy API to dynamically generate JavaScript from a Java API. Security improvements help guard against cross-site request forgery and cross-site scripting attacks. Other new features include a much expanded WAR file, support for Spring namespaces and Guice, Jetty continuations, servlet session timeout support, new annotations, and more.

Is EE the right hammer for every nail? Dan Creswell's blog Victims of J2EE Success criticizes some EE developers for assuming an incorrect set of beliefs, namely that "there is nothing beyond the database, POJOs focused purely on business logic, this is distributed programming, Ops is someone elses problem, [and you just] deploy more or bigger boxes to scale." He goes on to say "once you're beyond a certain level of challenge the J2EE way of thought and patterns of design don't work," and lists a series of language/framework-agnostic traits that developers need to handle new and challenging enterprise work.



Crashing By Design Blog

Posted by kfarnham Apr 26, 2007

How realistic is small-party ME development?

One of the books I've long thought someone should publish -- we occasionally kick it around among the O'Reilly editors, but have never found a suitable author -- is Java Deployment. The idea behind this book would be all about how to get your code up and running for your users. Probably the simplest case is all the EE spec-compliant webapp containers, where a common system of deploying WAR files to WEB-INF directories is pretty well understood. Things get trickier for Java SE, particularly on the desktop, as nobody in their right mind is going to suggest end users be expected to type java on the command line (heck, the Classic Mac OS didn't even have a command line!), and the double-clickable JAR has proven only modestly useful, still unable to support obvious needs like custom application icons. No wonder there are "double-clickable makers" like Launch4J, JSmooth, JarBundler, etc., installers like the Java-savvy versions of InstallShield and InstallAnywhere, and technologies like JDIC which provide desktop deployment necessities like document-application association.

And then we have ME. How hard is real-world ME deployment? Well, my idea for this hypothetical Java Deployment book actually evolved from the idea for a "real-world Java ME" book, one which was written not to the fantasy world of the API and specs where it's easy to just write code and run it on an emulator, but to the real world where you have to get your application onto real devices, none of which work the same way and most of which run on mobile telephony networks that are openly hostile (at least in the U.S.) to third party software. Perhaps part of the reason that ME books don't sell terribly well is that developers realize a significant gulf exists between what the existing books and Javadocs say you can do with ME, and what you can actually accomplish on real devices.

Aside: if you think you're the person who's going to write either of these books, and you want to pitch it to O'Reilly, readSo You Want To Write A Book and then send the proposal to    .

The hazards of working with ME, particularly at the hobbyist or beginner level, are highlighted in today's Forums, which continue a discussion from earlier in the week about good handsets for ME development. Joe Bowbeer surveys some of the problems in Re: It depends on the carrier mostly,,, "I agree that Sprint is developer-friendly. A developer who registers at can activate up to 200 handsets for development purposes. However, a VeriSign certificate is required in order to develop a full-featured MIDlet: To access the restricted API's (such as MMAPI, WMA, File I/O, PIM, Location API, etc.), a Java Class 3 signed certificate from VeriSign is required, at a cost of $499.00 per year. This puts it out of reach for most students and hobbyists. (Is a Class 3 certificate even available to individuals?)"

Later, in the same thread, C. Enrique Ortiz says that some of this suffering is probably good for new developers to be exposed to. In Re: Best handset for MIDP hobbyist, he writes: "At the same time, you do want to have the students understand and experience the real details when it comes to deploying apps, this including the good, the bad, and the ugly, including signing and prompts. So the solution goes back to making the process cheaper, even f these special kind of certificates are (more) short-lived; this option would be nice especially for developers that are students or just plain aficionados, etc."

Also in the forums, tvmohan is looking for SwingX to provide a Outlook style popup that fades slowly. "How can we build a outlook style window that has fading effects? Every time a new email arrives, it pops up and slowly fades away. I need build something similar. Can we really make a JWindow translusent by setting the alpha somehow? I looked at the SwingX components, I could not find any that works this way. SwingX lets me set the alpha on a JXPanel but not on a window. So, I was wondering if anybody is working on this kind of window."

The latest Poll asks "How often do you download and read sample code from online articles?" Cast your vote on the front page, then visit the results page for current tallies and discussion.

Stressing the "today" in the Java Today section, today (Friday, April 27) is the last day to submit entries for the Java Mobile Application Video Contest. This contest seeks example of great Java ME applications or services. To enter, create a video of up to three minutes that references Java ME or the open-source phoneME technology used, and post it to YouTube. Prizes include a Ericsson K800 phone, Panasonic Blu-Ray DVD Player, an gift certificate, and PlayStation 3 consoles. Check the official rulesfor more information and specifics of submitting your video.

Issue 119 of the JavaTools Community Newsletter is now available, featuring tool news from around the web. It's a slow week with only one new project in the community and no graduations, perhaps in advance of JavaOne, and on that topic, the newsletter has a call for community members to send in photos for use in the Community Corner slide show. Finally, the newsletter offers a Tool Tip on executing your application using Maven.

In January, the NetBeans community announced the 11 charter members of the NetBeans Dream Team, a community-oriented group of highly skilled NetBeans users devoted to promoting NetBeans and working on the NetBeans Project. The first installment of a new Meet the Dream Team Members seriesintroduces Joerg Plewe, who discusses the strategies of NetBeans evangelism and his 3D flight simulator Flying Guns.



Keep On Working Blog

Posted by kfarnham Apr 26, 2007

A big JavaOne crunch, or 50 little crunches?

Those of you with big announcements to drop at JavaOne have it easy, I'm telling you. No, just kidding, of course -- I know people are crunching pretty hard to have their stuff ready for next week's show. But outside of the single-minded developer focus, for a lot of us involved with the show, the weeks leading up to JavaOne have been a series of mini-crunches.

So far, we've been lining up bloggers for our usual front-page blog-centric coverage, setting up a podcasting infrastructure for new content and the Community Corner mini-talks from JavaOne, arranging the Community Leaders weekend, etc. On the O'Reilly plate, I've been working with marketing on the message for the O'Reilly booth, the crossword puzzle for the daily JavaOne Today newspaper, tracking down e-mail addresses of some FOO's who may or may not be at the show, etc. And I should rehearse my BoF presentation. And write my mini-talk. And hack some more functionality into Keatonso there's something non-trivial to show.

See, it's not one big scary project to work on, just lots of little things piling up. So, if you're waiting on something from me, nagging me about it in my current mood would be a reallybad idea.

Having mentioned the new podcast infrastructure, I don't want to spoil anything, but you'll be seeing more podcast content in the near future. As with last year, we'll be podcasting all themini-talks from the booth's "Community Corner". However, this year, instead of trying to blast everything out in near real-time (an idea predicated on the idea of trying to capture the excitement of the show), we're going to dole them out over the course of several weeks, maybe even months. This approach should be a lot more feed-friendly: instead of mini-talks getting blown away on your computer by new ones after just a few hours, you'll have time to find the talks that interest you.

There are going to be other feeds too, and a "super feed" of all content... but let's not get ahead of ourselves. Let's take a moment to highlight a new podcast feed that's up and running, the Mobile & Embedded Podcast. This series, produced by former Editor Daniel Steinberg, will focus on the people and projects in the small device space. With a podcatcher like Juice or iTunes, you can subscribe to the podcast feed, and iTunes users can also find the podcast in the iTunes store. We're spotlighting the first episode as our Feature Article today. In Mobile and Embedded Podcast 1: Introduction to the CommunityCommunity Leader Roger Brinkley and Technical Evangelist Terrence Barr describe the resources available for Mobile and Embedded developers.

Speaking of ME development, in today's Weblogs, Mauricio


Save It For Later Blog

Posted by kfarnham Apr 25, 2007

There are other conferences, of course...

One of the items on yesterday's front page that might have gotten overlooked is an announcement about the O'Reilly Open Source Convention 2007, and, in particular, its Java track. I think it's a huge improvement over last year's track, which was something of a debacle because of the conference organizers' failure to indicate that Java was one of the topics being sought out for talks. There was a real effort to improve the track this year, particularly in light of Sun's GPL'ing of its ME and SE implementations. As a member of this year's program committee, I sought out proposals from people who I knew were working on interesting stuff, particularly things that might cross over into the consciousness of non-Java OSCON attendees.

Not everything I would have wanted got in, of course, but still, this year's track has a number of sessions, in particular two that directly relate to the GPL'ed ME and SE platforms. Mark Reinhold is offering a talk on OpenJDK: The First Eight Months and Hinkmond Wong will explain How to Build, Run, and Develop Code with the phoneME Open Source Project. There's also Peter von der Ahé's talk on the Kitchen Sink Language project, and Joshua Marinacci talking JSR's 295 and 296 in Better Desktop Java Development using the Beans Binding and Swing Application frameworks.

Lest this sound too centered on or Sun speakers, there are at least as many independent speakers. Geir Magnusson is doing a talk on Harmony, there are talks on Spring, Seam, Velocity, Grails, and a comparison of Java web frameworks. Kirill Grouchnikov is doing a session on Advanced Effects in Java Desktop Applications . Moving beyond the Java track, a look at the web applications track turns up talks on Tapestry 5 and the Apachified Open for Businessproject.

So, it's not all about JavaOne right now.

In Java Today, OpenJDK Program Manager Ray Gans and Mobile and Embedded Community Leader Roger Brinkley discuss Sun's Java open-source efforts in a seven-minute video discussion recently posted to the JavaOne site. The video can be watched in-line with a Flash player, or downloaded as an MP4 video or MP3 audio file. They discuss the ongoing effort to get the full JDK released as open-source, the advantages of an open-source ME, the prospects for community development of the platforms, and more.

Are you plagued by slow-running Java applications? You could have a memory leak. The latest issue of Software Test & Performance Magazine features an article, Baffled By Brain Drain in Your Java Apps? (PDF, 6 MB, p. 22) by NetBeans Evangelist Gregg Sporar and A. Sundararajan on how to plug memory leaks in Java applications.

The HREF Considered Harmful blog makes an interesting comment about the relative performance of Java and scripting languages inTurtles Need Speed: "To me, one thing that's wonderful about both Smalltalk and Java is that all of their libraries, including basic data structures like lists and hashtables, are implemented in, respectively, Smalltalk and Java. That's possible because the underlying execution machinery is fast enough that, although it would certainly still be faster to have highly tuned Collection implementations in C, the pure Smalltalk and pure Java libraries are "fast enough". That's a crucial threshold, and it's one that many languages, including Ruby, have not passed."



Face the Face Blog

Posted by kfarnham Apr 24, 2007

Interviewing cajo's founder

One of the things we're trying to do on the content side is to further focus on the projects on, the people behind them, and the communities they create. Some of the ways to get there involve our feature articles, which we're focusing on the core Java platforms themselves (ME, SE, and EE), since open-source reference implementations of each are now hosted on the site (as phoneME, OpenJDK, and GlassFish, respectively), and on the many active and interesting projects hosted here.

Community Manager Marla Parker has taken an intersting approach to helping us with this effort. She's taken a recent list of the top 50 most active projects and started contacting founders and leaders of those projects. In a series of interviews with these personalities, we hope to deliver a sense of the people in the community, and the possibilities and opportunities that come with working on a successful open-source project.

Today's Feature Articlekicks off the series, with Top 50: Interview with John Catherino of the Cajo Project. In it, Marla talks to the founder of the cajo project, which enhances RMI to allow an application to be distributed across multiple JVM's. In the interview, John discusses the project's successes, the makeup of the cajo community, and challenges and surprises along the way.

This week's Spotlightis on the CommunityOneevent. What's that you ask? Well, combine NetBeans Day with a GlassFish Day, add some OpenJDK and Mobile & Embedded, and you've got Community One, a free and open event sponsored by Sun, taking place in San Francisco on Monday, May 7, on the eve of JavaOne. Along with formal session tracks, the event features a co-located unconference, a startup camp, a lunchtime session of the Java Possepodcast, and an opening general session by Tim O'Reilly.

As noted in the Java Today section, this week we launch the new Mobile and Embedded Community podcast series with an Introduction to the Community. Leader Roger Brinkley and Technical Evangelist Terrence Barr describe the resources available for Mobile and Embedded developers. They also explain how to get started hosting a project on, how to get your questions answered in the forums, and how to stay up to date with the world of Mobile and Embedded development. Hosted by Daniel Steinberg.

Apache's Open Letter to Sun Microsystems about licensing terms for a Java SE TCK has touched off a number of reactions. Dave Gilbert gives Five Reasons Why Apache Will Regret That Open Letter, while Ian Skerrett has posted his concerns about The Silence from an Open Sun, a post that drew A Response from Sun (namely, from Simon Phipps, Sun's Chief Open Source Officer). Geir Magnusson, who wrote the initial open letter, discusses the issue further on Episode 28 of the Feathercast podcast, while former Harmony member Mark J. Wielaard shares his thoughts in the blog OpenJCK.

O'Reilly's Open Source Convention 2007 offers a much improved Java track, featuring a number of speakers familiar to the community, such as Mark Reinhold talking about the first eight months of OpenJDK, Hinkmond Wong on phoneME, Kirill Grouchnikov on advanced Java desktop effects, and Joshua Marinacci on Beans Binding and the Swing Application Framework. Furthermore, there's a talk on the Kitchen Sink Language. Also look for Java-related stuff on the Web Services track, such as talks on Tapestry and OFBiz.

James Gosling's closing JavaOne keynote is turning into The Toy Show, as he describes in today's Weblogs. "Once again, I'm doing the closing keynote at JavaOne. Through some piece of odd mystery math, this year I'ved ended up with two hours of time, which had me paniced: what would I do to fill all that time?"

In Mapping Entities to REST - Learning from History, David


I Am Secure Blog

Posted by kfarnham Apr 23, 2007

...well I thought I was

I grant that I have a pretty cavalier attitude about security, but frankly, I feel entitled to: I develop Java applications on Macs, and both Java and Mac OS X have well-thought-out, highly-regarded security schemes, particularly in comparison to the never-ending fiasco that is security on Windows.

So imagine my surprise when security researchers finally found a security exploit to hit a Mac through a hostile web page, and to do it by means of Java!

Truthfully, we don't know all the details yet, and more than a little speculation is involved, but the salient facts are these: Dino Dai Zovi and Shane Macaulay have won a security challenge (and a $10,000 prize) at the CanSecWest conference by gaining shell-level access to an up-to-date MacBook through use of a malicious web page. According to the Matasano Chargen blog page tracking the story, the current work-around to the security hole is to turn off Java in the browser, implying that the exploit uses Java in some way. Matasano also reports the attack affects Firefox as well. Specifics about the exploit are being publicly withheld, perhaps to give Apple a chance to fix them.

A MacCentralwrite has a few more details, such as nobody cracking the MacBook with no apps running in the contest's first few days, which led organizers to change the rules and allow "attackers" to send URL's to the target machine by e-mail.

This isn't the first time that a Mac OS X security issue has had a Java angle to it. A late 2006 security update addressed a combination of Quartz Composer and QuickTime for Java that could allow a malicious web page to gain access to the user's webcam without their permission (here's a full explanation, with code). The trick there was very orthoganal to Java -- QTJ ordinarily disallowed webcam access to unsigned applets, but approved Quartz Composer code without security checks, and while QC's access to the webcam usually consisted of rendering the image only, running it in QTJ allowed an untrusted applet to get to the rendered pixels and do whatever it wanted.

So it will be interesting to see what the Java angle ends up being in this case: whether it's an issue of applet security or some weird unanticipated side-effect that creates the security hole.

Also in Java Today, Issue 118 of the JavaTools Community Newsletter is out, with news from around the web, including the release of version 1.1 of HDIV (the HTTP data integrity validator), announcements of new projects in the community and a graduation from the incubator (Rmic-Eclipse-plugin), and a Tool Tip on enabling GZIP compression on Tomcat.

Extending OpenSSO(Sun's open Web access management project based on Sun Java System Access Manager) with Windows CardSpace delivers a more secure authentication model than the traditional user name-password model. The SDN article Securing Site Access With CardSpace and OpenSSO: An Overviewdescribes the benefits, basic architecture, and process flow of a lightweight implementation developed by ICSynergy International, by making use of the OpenSSO.



Numbers Blog

Posted by kfarnham Apr 20, 2007

What kind of transparency do you want from JSR expert groups?

Yesterday's blog kicked off some discussion about what the right form a JSR expert group's work should take, whether it be completely private, or exposed to the public in some form as it develops. User robilad, better known to fans as Dalibor Topic, suggested this would make for a good poll, and that's a great idea. Putting it up as a poll will continue the discussion while also getting a broad but quantifiable sense of what the community as a whole wants to see from JSR expert groups.

Specifically, the new Poll asks "How should JSR expert groups typically conduct their work?" You can cast your vote on the front page, and then visit the results pagefor current tallies and discussion.

In today's Weblogs, David


The Model Blog

Posted by kfarnham Apr 19, 2007

Is "open from the start" the right way to develop a JSR?

So how should a JSR work anyways? More and more, this is becoming a hot topic for everyday Java developers, who want their concerns and desires incorporated early in the process, not late in the game when the final draft is being routinely approved, or after the fact. As the ideas for JDK 7 come together, we've already seen vigorous debate about proposed concepts like closures, properties, a module system, type inference (which we'll get back to in a minute), and more. For some, it may be "buyer's remorse" over generics, a feature still somewhat controversial two versions after its release, and the better part of a decade after its initial proposal. Whatever the reason, more and more developers are learning to get involved early.

And maybe that's part of the reason we're also seeing a questioning of how a JSR expert group carries out its work. We ran a blog several months back -- sorry, I can't find the link right now -- that decried the model of an expert group doing both its original research into a problem domain, in private, and then proposing a Java standard for it, all in the scope of one JSR. Would bad JSR's have been headed off sooner if there had been more public visibility into the expert groups' work earlier, while they were working the problem and before the early draft review? Should the experimentation in a field precede even the filing of a JSR and the assembly of an expert group?

One of the goals of JSR 306 is to "further improve the transparency of the process". Its original request has this to say on the topic:

Since the introduction of JCP 2.5 in October 2002 which regulated the right to build independent implementations, the Java community at large has grown accustomed not only to open source software methodologies and business models but on average expects that specification development happens in a similar spirit. The JSR plans to explore what steps can be taken, both mandatory through the process document, as well as voluntary or desired behavior through the Spec Lead Guide and facilities provided by the web site.

Some JSR's are already being developed in this spirit, and some of them are doing their pre-spec experimentation and implementation work here on Two examples are the Beans Binding project (JSR 295) and the Swing Application Framework (JSR 296). Patrick Wright praises both in asking the JavaLobby audience Should JSRs be developed in the open?

In my experience, many JSRs are developed in secret, by which I mean the expert group does not allow outsiders to follow either the work in progress (code or APIs, if there are any), active discussions or records of discussions. The JCP, to my knowledge, does not require opening up the process, but seeing the high-quality feedback on JSR 296 (and how well Hans fields and incorporates it), I'm tempted to say that the default should be to require open access to mailing lists and code, even if read-only.

He also notes the downside of the traditional, closed approach:

I think one of the biggest downsides of having a closed, opaque and private process is that those of us who end up as users of the specification lose sight of the reasons why it ended up the way it did. There are reasons why generics were implemented using erasure; IMO, those reasons are something any educated user of Java generics needs to understand before entering into debate about them. Making the discussion behind those decisions public enables us to understand, or as necessary research, the reasons why we have what we have. It informs and deepens the debate.

But is this really a good idea? If you're an expert in some topic area, do you really want that many eyes on your work, that many people offering opinions (of varying levels of competence), when you need to focus on delivering a solid JSR draft? There are two sides to this story; will the kind of open process being used by JSR 295 and 296 groups work for everyone?

Also in Java Today, Author Elliotte Rusty Harold makes his case against another proposed JDK 7 language feature in Type Inference: Another Bad Idea for Java 7, and goes on to say that too many changes in the Java language have made it practically un-teachable. "It's time to call a halt to new features in the Java language. I am not saying that the features are wrong, just that they don't fit into the language any more. It's already too bloated. I am not saying that generics, type inference, closures, compiler created factory methods, and other kitchen sink proposals are bad. They're not. I am saying that they simply don't fit into or with the current core language, and every one we add makes the language worse, not better."

JavaChecker is a static analyzer of Java source code, allowing you to detect code defects, such as inaccurate exception handling, style defects, violations of standard usage contracts (such as overridingequals() without also overridinghashCode()), and inaccurate resource usage. The project's goals are to discuss approaches detecting common java code defects and to build an open framework for applying rewriting rules to source code analysis.

In our Feature Article, XQuery For Java, An Enabler For SOA , Sowmya Hubert and Binildas C. A. take a look at the abilities of XQuery to simplify working with XML documents. "In this article we are going to talk about XQuery and its derivatives including the XQJ (XQuery API for Java) specification, which is under development as part of JSR-225: XQuery API for Java. The first section of this article will introduce both XQuery and XQJ and equip the reader with some code and tools to get their hands dirty. Then we will revisit the questions raised above, taking a particular context as example. We proceed by first understanding the real pain points experienced by developers in data transformations and then we take the reader through a simple case study, again with some working code."

In today's Weblogs, Elie


Computer World Blog

Posted by kfarnham Apr 18, 2007

Are all these devices good or bad for us?

Two of our bloggers today have very different perspectives on the benefits and effects of the kinds of electronic devices that we generally take for granted. Let's start with Qusay H. Mahmoud, whose blog Java ME and BlackBerry wireless devices in the classroomrelates personal stories about projects for college programming courses, one of which was based on a significant real-world problem: linking doctors and pharmacists, since the latter often can't read the handwriting of the former. He relates the payoff for students in getting out of the desktop development model:

In summary, teaching computer programming in the context of simple mobile applications using Java ME provides a motivating and inspiring framework for students, and raises the level of excitement and satisfaction. I encourage everyone to integrate Java ME into their courses to introduce students to a programming model different than the desktop. In the desktop market, the application is deployed on a platform similar to the one on which it was developed, but in the Java ME space, the application is developed on a desktop platform and deployed on a totally different platform.

On the other hand, David Van Couvering relates the culture shock of returning from a disconnected vacation in Mexico to the ultra-wired environment of the Web 2.0 Expo, in his blog Call me a Luddite...

The whole world is "getting connected." And those of us at the Expo are generally very excited, and see lots of opportunities to make money and and to build things that lots and lots of people will use. But I feel a sadness when I find myself in this environment. I feel like I am losing something. I watch myself "plug in," and I feel like I am actually losing connection. I crave the open sky, the deep stillness and power of the ocean, of the smiles of people who said "Hi" to my son.

Does technology open doors for people or close them off? Or is that not the right way to see things at all? What do you think?

Also in today's Weblogs, Mark


The Telephone Call Blog

Posted by kfarnham Apr 17, 2007

Catching up with phoneME

I discovered the other day that the RSS based system I use to get updates from the various communities doesn't pick up everything from the mobile & embedded community page. I see a lot of that from other channels, notably the weblogs, but some things have been slipping through the cracks, so let's try to catch up with today's daily blog.

Most significantly, Sun has posted an Early Access release of version 2.5.1 of the Sun Java Wireless Toolkit . As noted by Richard Gregor in his blog, the big news in this release is support for Linux. Of course, 2.5.1 also fixes a number of bugs, and contains Nokia's Scalable Network Application Package (SNAP) Mobile API and the SNAP Mobile Sample Application for development of networked, community-enabled multiplayer games.

And if you want to develop for more-capable phones, have a look at the phoneME Advanced project, which just released phoneME Advanced MR2 b14 last week, with implementations of CDC, Foundation Profile, and Personal Basis Profile. Given Sun's acquisition of the SavaJe intellectual property, it's worth wondering whether we'll see a new focus on more powerful mobile devices, leaving behind the "L" (for "limited") in CLDC in favor of CDC.

Anyone care to shake off their iPhone envy with a kick-ass Java phone? This could get interesting.

Also in Java Today, the open-jbi-components project has graduated fom the incubator to a Java Enterprise project. The overall goal of Project Open JBI Components is to foster community-based development of JBI components that conform to the Java Business Integration specification (JSR-208). You can join this project as a JBI component developer or as part of an existing JBI component development team.

Sun has posted an initial response to last week's open letter from Apache, in which Harmony project VP Geir Magnusson Jr complained about difficulties obtaining from Sun an acceptable TCK license for Harmony's open-source JDK. Sun's response indicates the company will need time to consider the issues raised by the letter, says that its GPLv2 Open Source Java efforts include TCK's, that Sun's current priority is making the Java platform accessible to the Linux community as soon as possible, and that with Java's many stakeholders, it will not be possible to please or accommodate everyone.

Back to the topic of phoneME, today's Forums, has a clarification of supported platforms for phoneME Advanced, in the thread Re: Current development release of phoneME Advnaced MR2 b14 now available. cjplummer writes: "Official MR2 releases only include Linux/ARM a Linux/x86, since these are the only platforms we are testing. However, other ports are usually kept working and can be found on the phoneme subversion trunk, which is where MR2 is derived from. Last I checked, both the win32/x86 and Linux/PowerPC ports were working, but keep in mind that neither of these curently support the JSR Optional Packages, JUMP, or MIDP on CDC."

kschaefe announces a new SwingX component in JXSlideoutBar. "I have created a JXSlideoutBar. This is designed to be a toolbar that creates popup panels when you rollover labels. This type of feature is often seen in docking frameworks, is used in Google Desktop, etc. I could not find any such component, so I built one. This is an early raw stage (please be ginger with it). Currently, placing it in the WEST of a BorderLayout is the only sure way to make it work. I thought this might be of interest to others and was hoping for some feedback, so please let me know what you think."

Finally, jada describes the Java 3D strategy for Windows in Re: DirectX. "The driving force for Java 3D 1.5.1, currently in development, is to address Windows Vista support. Java 3D will fall back to D3D on Windows if OpenGL 1.2 or better is unavailable. We understand there is still a gap between D3D and OGL pipes, we have tentative plan to close this gap going forward. We will talk more in the coming Java 3D BOF at JavaOne."

In today's Weblogs, James Gosling talks about the keynote competition and on-site amusements in Contests@JavaOne. "Just in case you think you're going to be bored at JavaOne, we seem to be awash in contests."



Trans Europe Express Blog

Posted by kfarnham Apr 16, 2007

Touring the JUG's (and other points of interest)'s official in-person gatherings, like our booth at JavaOne and the community leaders weekend before it, tend to have a bit of a North American bias just because of the distances involved getting to the U.S. west coast. There's usually a strong Brazilian contingent (cue obligatory cheer) and an occasional European participant, but not fully representative of our community. So it's good to have reminders of how international the community, and the wider Java user base, really is.

A taste of that can be found in today's listing for a JavaOne birds-of-a-feather (BOF) session bringing together the leaders of a number of Java User Groups. The list JUG's participating in JUG Leaders BOF with Sun Technology Outreach sounds like a trans-European tour: Cologne (Germany), Belgium, the Netherlands, Greece, and others. Throw in a stop in Brazil (cue obligatory cheer) for a meeting with SouJava, and it's a grand tour. The group will conduct a panel discsussion about open source initiatives, how to get a Java Champion or Sun engineer or evangelist to talk at your JUG, and more.

But we're still missing a few continents... Asia, Australia, Africa... care to join us?

Also in Java Today, Direct Web Remoting (DWR) creator Joe Walker has announced the release ofDWR 2.0 RC4, with several new features. "The biggy is Guice support. If it wasn't for the fact that we could add this in without touching the core of DWR, I'd say this was too big a change at this point in the release cycle, however Tim Peierls (who you might know from this project) has done a stack of work to make DWR and Guice play really well together." Security and Reverse Ajax have also been improved.

Issue 117of the JavaTools Community Newsletter is available, with announcements of five new community projects, one graduation from the incubator (JFeature), tool-related news from around the web, and a Tool Tip on editing your project web site through a Web user interface, via Content Editor



I Must Be Dim Blog

Posted by kfarnham Apr 13, 2007

So, a day after I finished my AB5k desklet, Josh goes and totally breaks it with a wildly ambitious new version of the desklet container, which "virtualizes" all the components. In other words, all the components really live off-screen in memory and blit their pixels into buffers that Josh can play with, render on a 3D surface, whatever.

Among the breakage is an animated dimming effect I was using. It doesn't seem like desklets should be able to spawn their own windows or dialogs, so for open and save dialogs, and some HTML "about" text, what I decided to do was to use a glass-pane hack: I'd "dim" the glasspane to darken the desklet, then insert theJFileChooser or JScrollPane, with large insets, in the center of the glass-pane. By "darken", I mean that I'd set its background to a black color with a non-trivial alpha value (ie, a translucent black), and fill the pane. I posted a screenshot of it to the Desklet Contributors group back when it worked.

But like I said, the virtualized component scheme broke this, because it depended on my component climbing the heirarchy to find a RootPaneContainer, which would provide access to the glass-pane. In the virtualized world, the components don't live in real frames or root-pane containers anymore, so this doesn't work.

OK, plan B: do my own JLayeredPane. The contents of a RootPaneContainer are just a bigJLayeredPane so this should work, right?

Well, um, no. Not like you'd think it would. It seems to break in really interesting ways. Specifically, if the "dim box" -- the component that fills the layer above the background -- is less than the size of the JLayeredPane in both dimensions, it works as before. On the other hand, if it equals the container's size exactly, or equals or exceeds in both dimensions, then the dim box loses its translucence.

Weird? Let's play. Here's an applet version. You turn on the dim layer with the checkbox, then set its size with the text areas. You'll need to turn it on and set non-zero dimensions in order to see anything. You can also download dimlayertest.jar and run it as an application with java -classpath dimlayertest.jar DimLayerTest.


So, here are a few screenshots, in case you'd rather not play with the applet. First, a 200x200 dim box, just to show it works:


Next, I max out the horizontal dimension, but stay one pixel back from maxing out the vertical.


And finally, a dim box that is exactly the dimensions of the container:


Oops! So much for that approach. Actually, I'm probably screwed anyways, for two reasons. In the desklet, the "too big" dimensions seem to be a good 5 or 6 pixels in, which leaves a weird un-dimmed area. Second, it seems the translucence may not be cross-platform. Here's what happened when I tried it in Windows XP on Virtual PC (my Boot Camp seems hosed at the moment):


Yuck! Ptui! So much for alpha channels, Duke!

Anyways, time to punt. It was a neat idea, but it doesn't work, I've spent too much time on it, and Josh and Cooper now have a simple "get me a dialog" approach that will suffice for the file chooser and the about HTML. Enough of this wild layer chase...

Oh, for the record, here's source: it's only 150 lines, so it shouldn't be too painful to just in-line:

import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.*;
import java.applet.*;

public class DimLayerTest extends Applet {

    JLayeredPane layeredPane;
    JComponent dimBox;
    JLabel iconLabel;
    JTextField widthField, heightField;
    JCheckBox showDimBoxCheckBox;

    public static void main (String[] arrrImAPirate) {
        JFrame f = new JFrame ("Dim Layer Test");
        f.getContentPane().add (new DimLayerTest());

    public DimLayerTest () {

    private void doMyLayout() {
        setLayout (new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        // controls for the dim pane

        add (new JLabel ("Dim width:"), gbc);
        widthField = new JTextField ("0", 5);
        add (widthField, gbc);
        add (new JLabel ("Dim height:"), gbc);
        heightField = new JTextField ("0", 5 );
        add (heightField, gbc);

        showDimBoxCheckBox = new JCheckBox ("Show Dim Layer", false);
        add (showDimBoxCheckBox, gbc);

        // our layers imageURL =
        iconLabel = new JLabel (new ImageIcon (imageURL));
        dimBox = new JPanel();
        dimBox.setBackground (new Color (0, 0, 0, 128));
        layeredPane = new JLayeredPane();
        layeredPane.setPreferredSize (iconLabel.getPreferredSize());
        layeredPane.add (iconLabel, JLayeredPane.DEFAULT_LAYER);
        iconLabel.setBounds (0, 0,
        layeredPane.add (dimBox, JLayeredPane.MODAL_LAYER);
        dimBox.setOpaque (true);

        dimBox.setBounds (0, 0, 0, 0);
        dimBox.setVisible (false);


        add (layeredPane, gbc);

        // bottom row shows image size... also a row that stretches
        // to handle extra applet space
        add (new JLabel ("Image is " + 
                         iconLabel.getSize().width + " x " +
        add (Box.createVerticalGlue(), gbc);


        // wire up listeners to reset dim box any time text is typed
        // into fields or button is clicked
        showDimBoxCheckBox.addActionListener (new ActionListener() {
                public void actionPerformed (ActionEvent e) {

        DocumentListener textFieldListener = new DocumentListener() {
                public void insertUpdate (DocumentEvent e) {
                public void removeUpdate (DocumentEvent e) {
                public void changedUpdate (DocumentEvent e) {
        widthField.getDocument().addDocumentListener (textFieldListener);
        heightField.getDocument().addDocumentListener (textFieldListener);

    // get settings from control widgets and reset bounds of dimBox
    private void resetDimBox() {
        int oldDimWidth = dimBox.getBounds().width;
        int oldDimHeight = dimBox.getBounds().height;
        int newDimWidth = -1;
        int newDimHeight = -1;
        try {
            newDimWidth = Integer.parseInt(widthField.getText());
        } catch (Exception e) {} // ignore garbage
        try {
            newDimHeight = Integer.parseInt(heightField.getText());
        } catch (Exception e) {} // ignore garbage
        boolean newDimVisible = showDimBoxCheckBox.isSelected();

        dimBox.setVisible (newDimVisible);
        dimBox.setBounds (0, 0,
                          ((newDimWidth > 0) ? newDimWidth : oldDimWidth),
                          ((newDimHeight > 0) ? newDimHeight : oldDimHeight));



In A Different Light Blog

Posted by kfarnham Apr 13, 2007

Tuning in to these developer videos?

So, do you watch the developer interview videos? I figure someone must, because they're popping up all over the place (including, among many others, SDN Channel, InfoQ [click the "interviews" tab on the right], BeJUG/JavaPolis/, and TheServerSide). And I'm intrested to know, is this driven by demand, or supply? Are developers particularly intersted in seeing and hearing top developers in an interview format, or are these sites putting it out there because technology has made it easy to do?

[If you're going to vote in the poll, you may want to do so now before I bias your vote with the next paragraph.]

In one of my other blogs, this for O'Reilly's Digital Media site, I recently decried the underlying assumptions (or lack of genuine thought and understanding) and formats of these videos, in We Need an Aesthetic for Technical Interview Video (hurry, my eyes are bleeding). What I'd like to see is a deep re-think of the value of putting video in front of developers and demanding their entire attention; is seeing someone speaking on a single static shot for 20 minutes really valuable? Would you be better off just listening to the interview on an iPod while commuting to work? Or quickly reading a transcript over lunch? There's value in seeing real people, but does this approach really keep the video channel full? I'm interested to hear from people who like these videos and see value in them that I apparently don't.

One thing that I don't really get into in the blog is the idea of whether the interview, or straight exposition, is the only valid form for online videos about Java development. One of the "steps" of content/art that I discuss is the idea of idiom, meaning how you address your audience. Nearly all these videos are largely expository: either one person talking, or someone talking for long stretches in response to an interviewer's quetsions. But that's not the only option. Consider narrative: can we talk about Java in the form of a story? Of course! Matt Quail did just that a few years ago in the brilliant Totally GridBag, a humorous reminder of the drudgery of developing GUI's with the only really powerful layout manager of the time, theGridBagLayout. And there are surely other approaches that might work, maybe better than what everyone's currently doing.

Apropos of all this thinking about technical-content videos, I decided to have the latest Poll ask the question "How often do you watch online developer interview videos?" Cast your vote on the front page, then visit the results pagefor current tallies and discussion.

In today's Weblogs, Fabrizio


Be With You Blog

Posted by kfarnham Apr 12, 2007

Just a few JavaOne reminders

I'm getting a really late start on the blog, so I thought I would just use this space for a few reminders of JavaOne topics that aren't on the front page:

  • Early bird registration has closed, but you can still save $100 by registeringnow, instead of at the show.

  • If you're interested in presenting a mini-talk in the Community Corner, you may want to hurry up: Tuesday and Wednesday are mostly full and Thursday talks are now getting set up. Of course, be sure to read the instructions for proposing a mini-talk, so your talk doesn't get removed (for not having an abstract, not having contact info, etc.)

  • Similarly, if you'd like to volunteer to talk about your community at one of the pods, please do. You'll get a shirt. If you aren't already going to JavaOne and need a pavilion-only pass, we have several to give out to those who sign up to work the booth.

  • We'll be running a continuous slide-show in the booth of our communities, projects, and members, so if you have a photo of your project's team, a community get-together, a screenshot of your application, whatever, and you'd like to share it with the rest of the community, please submit it for inclusion in the show.

  • Are you a member presenting a session or BoF? Please add yourself to the lists on our JavaOne wiki page.

  • Community Leaders who'll be in town on Saturday, May 5 are also invited to the Community Leaders weekend, and we hope you'll sign up on its wiki page.

Test first means, well, test first. But with web applications, there's a great deal of installation and configuration you have to do before you can even test. Couldn't that be slimmed down a bit, so developers can get testing sooner? In our Feature Article,Embedded Integration Testing of Web Applications, Johannes Brodwall shows how to combine some popular pieces to create a simpler container for testing your web apps sooner.

In Java Today, the recently-graduated bean properties project reinvents the concept of JavaBeans while maintaining backwards compatibility with Java SE 5. Bean properties allow a whole new type-safe syntax for using JavaBeans. Support is included for UI binding/factories/validation, JDBC binding (ORM, proof of concept), XML integration etc. "The code within this project aims to simplify the development of current JavaBeans with binding annotation [...] while leading the way to a whole new way of thinking about bean properties."

The ROME Propono subproject is a Java class library that supports publishing protocols, specifically the Atom Publishing Protocol and the legacy MetaWeblog API. Propono includes an Atom client library, an Atom server framework and a Blog client that supports both Atom protocol and the MetaWeblog API. A blog post at Artima notes its release and has a brief discussion of its API.

Issue 286 of the NetBeans Weekly Newsletter offers "Another Reason to Attend NetBeans Day" (hint: it involves prizes), and has features on NetBeans IDE 5.5.1 RC, the UML modeling module, securing communications in web services, a mobile MSN project, a new NetBeans book, building a Ruby sample for NetBeans, Rails & database migrations, and a new screencast.



Return Post Blog

Posted by kfarnham Apr 11, 2007

Awaiting an answer to Apache's open letter

Yesterday, the Apache Foundation sent an open letter to Sun, written and signed by Harmony project VP Geir Magnusson Jr. It calls for Sun to license the Java Compatibility Kit (JCK) on terms acceptable to Apache, so that Apache can verify that Harmony, its implementation of Java SE, can pass compatibility tests and therefore call itself "Java-compatible":

The JCK license Sun is offering imposes IP rights restrictions through limits on the "field of use" available to users of our software.

These restrictions are totally unacceptable to us.

The letter then goes on to say that the restrictions are themselves inconsistent with the JCP, which prohibits specs from imposing contractual conditions that prevent licensees from creating or distributing implementations. But what are these restrictions? A companion FAQ is somewhat opaque on the specifics, but has one concrete example:

To give a concrete example from the Sun / Apache dispute, if Apache accepted Sun's terms, then users of a standard, tested build of Apache Harmony for Linux on a standard general purpose x86-based computer (for example, a Dell desktop) would be prevented from freely using that software and that hardware in any application where the computer was placed in an enclosed cabinet, like an information kiosk at a shopping mall, or an X-ray machine at an airport.

So, that's one side of the dispute, which Apache says has been going on since August of last year. Do they have a legitimate grievance? Tom


Let It Go Blog

Posted by kfarnham Apr 10, 2007

So long, Class.forName()

There's ugly code, and then there's the otherworldly bizarreness that is JDBC driver loading. You don't have to explicitly load a class, per se, you just have to expose its name to the class-loader with Class.forName() and a fully-qualified driver name. So you still have the hassle of getting a classname into this call (which you should provide dynamically through something like a property, but it probably gets hard-coded more often than we'd all like to admit), yet the call doesn't even have the decency to be self-explanatory and clear about why it's there. Frankly, I'd rather just do something like loadJDBCDriver(), so the purpose of this line would be more clear.

Fortunately, for those who've moved to Java SE 6, this isn't a problem anymore. JDBC 4.0, provided as part of SE 6, banishes the crazy Class.forName() driver-loading pseudo-call to netherworld of crummy API's. As Sharad Acharya writes:

Did you think this process should have been improved, or ever would be? They did exactly that in this version of JDBC. You don't have to explicitly load the driver by calling Class.forName anymore. When your application attempts to connect the database for the first time, DriverManager automatically loads the driver found in the application CLASSPATH. This is one of the great additions in this version of JDBC.

In his Feature Article, Sharad answers the rhetorical question What's New in JDBC 4.0?. "JDBC 4.0, specified as JSR-221 under the Java Community Process, provides better code manageability and flexibility, and more complex data type support. In this article I will explore some new features and enhancements available in JDBC 4.0 from the perspective of programming ease and flexibility."

Most drivers don't fully support the 4.0 API yet, but reading this article will give you a good idea of what's coming.

In today's Weblogs, Kirill


Manic Monday Blog

Posted by kfarnham Apr 9, 2007

Crunch-time, anyone?

For those of you working on projects that need to launch in a JavaOne timeframe, the show begins a month from yesterday, so this is probably crunch-time. If you took some time off for a Spring break, it's probably a mixed message of "welcome back" and "get moving". And for those taking Passover off, the crunch begins or resumes on Wednesday.

Today's probably going to be pretty dire here once I finish the blog, as I left everyone's Very Important Problems to pile up in e-mail for a couple afternoons last week during the upgrade, and indulged a little programming time doing a desklet for the AB5k widget environment. If you'll recall, about two years, ago, I complained in this space about the lack of a widget-type approach to doing a sort of "bang out a snippet of code and run it" tool that is provided by BlueJ, and that I'd found handy in the form of the classic Mac's "Java Diddler" application.

Thanks to JSR-199 exposing a programmatic interface to the Java compiler, it is actually a pretty simple matter to code up equivalent functionality. So I used NetBeans to put together NuDiddler, an AB5k desklet that lets you write some code and execute it immediately:


I thought I was close to done with it, and put source for a 1.0b1 up on the project's Google Group, but over the weekend, Josh and Cooper changed the API radically by changing Desklet from an interface to an abstract class (which will allow them to add new methods without requiring a new spec... Josh pointed to LayoutManager2as an example of what he's trying to avoid). So now my desklet, like all others, is broken. Plus, NuDiddler has only worked in the AB5k container within NetBeans and not with the Web-Start'ed version, and the container's error message doesn't give me enough to go on. So, I'm not done yet. Which is too bad, because there's plenty of other work to crunch on.

I'm not the only one playing with AB5k. In today's Weblogs, James Gosling says he's been having Fun with widgets too. "I've been having a lot of fun with Rob Cooper andJoshua Marinacci's AB5k Widgets for the World system. It's vaguely like Mac OS X's Dashboard, Vista's Sidebar, and Yahoo's Widgets, except that it works everywhere..."



Oh Well Blog

Posted by kfarnham Apr 6, 2007

Upgrade complete, please move along...

OK, so, are we good? The project space was back up just about 24 hours after the upgrade began, with a note that the upgrade work was continuing. By last evening (US EDT), the notice on the project pages said "The upgrade of's project area is complete. Happy java.netting!"

Are we out of the woods? Are we done? You tell us. Try out your projects and all their various features (mailing lists, wikis, source control, etc.) and if you see anything that doesn't look right, let us know. Contact information is available on the upgrade page.

In Java Today, the NetBeans 5.5 UML Modeling module is now available for download from the NetBeans Update Center. The module provides UML modeling features to the NetBeans IDE. It allows analysts and designers to design applications using a standard modeling language. Developers are then able to generate source code from the UML model and update the model from changes made in their source code. A Flash demo shows NetBeans' UML Modeling in action.

Most developers think of the Java compiler, javac, as an unobtrusive command-line tool to invoke when you want to turn Java source code into class files. The Java Compiler API, JSR 199, released in final form last December, opens up the Java compiler to programmatic interaction as well. In The Java Compiler API: A Conversation with Peter von der Ahé, Artima's Frank Sommers speaks with JSR 199 spec lead and Sun engineer Peter von der Ahé about what programmatic compiler access means for developers.

In today's Weblogs, Brian


Don't Stop Blog

Posted by kfarnham Apr 3, 2007

A day's pause to upgrade

In just a few hours, 10AM PDT, CollabNet will beging upgrading to the new edition of CollabNet Community Edition. The upside, once any kinks are worked out, should be better performance and the latest versions of essential tools like Subversion. The downside is that much of the site will be unavailable for 24-48 hours during the upgrade. The front page will still be here, but projects will be unavailable, as will forums, blog authoring, and most "write" access to systems. In our meeting yesterday, it was noted that some users may maintain some functionality as long as their authenitcation cookies stay valid, but we decided it's more consistent and useful to simply say we're going to be down for 1-2 days.

When we come back, we'll update the front page to announce the completion of the upgrade, and at that point, we'll be watching for any problems that crop up. We'll thank you in advance for any help you can provide in issues that you find.

See you on the other side...

We're sending our Java Today links offsite today, rather than link into projects that will be offline during the upgrade.

Yori Mihalakopoulos has posted a first preview release (.dmg, 8.5 MB) of MochaCode, "a new Java IDE designed specifically for developers who like to get their work done on a Mac." Aside from the typically-attractive Cocoa appearance, MochaCode offers context-sensitive code completion, background project building, quick access to project files, editor window/pane flexibility, and more. Yori has also kicked off a MochaCode blog.

Gavin King, project lead of Seam (and Hibernate before that) has posted his EE 6 Wishlist, Part 1. "I wanted to give a rundown on the things that are important to me, and why I think they're important. A lot of these items have come out of our experience with Seam, others have been things that have been missing from the platform for a long time. My wishlist is pretty long, so I'm going to spread it over several posts. First up, I'll talk about session beans." Discussion of Gavin's blog is underway at InfoQ and Artima. Will he get his wishes? The EE 6 Review Ballot just went up on Tuesday.

James Gosling finds himself inCrunch time for JavaOne in today's Weblogs. "JavaOne is just a few weeks away and the crunch is already far too intense. We're doing a review of proposed keynote demos tomorrow: it's easlly the longest "cool stuff" list we've ever had. I don't know how we're going to choose."



Never Going Back Again Blog

Posted by kfarnham Apr 3, 2007

Run, don't walk, away fromImage.getScaledInstance()

The downside of Javadoc is that there are general techniques that can't be understood by just looking at all the available classes and methods. This was one of the blockers I found when trying to learn QuickTime for Java many years ago: you'll never use 95% of its method calls, and the important 5% aren't adequately documented.

What might be worse is the "false friend" situation, where what you seem to need exists as a straightforward method call, but isn't the best way to achieve what you want. This is the case explored by today's Feature Article, in which author Chris Campbell explains The Perils of Image.getScaledInstance().

On its face, getScaledInstance() seems to answer a perfectly straightforward need: scaling your images up or down. The problem is how you want your image manipulated, and it turns out that Java 2D has outgrown the simple solutions possible with this call, and you're better off mastering the options available with Graphics.drawImage():

Lots of developers have grown accustomed to the nice quality offered by SCALE_AREA_AVERAGING (orSCALE_SMOOTH) over the years, but the general complaint is about poor performance. Due to the overly complicated (in my opinion) design of the image handling APIs in JDK 1.0 and 1.1 (e.g., having to deal with asynchronous loading, animated GIFs, and the whole consumer/producer model), it is very difficult to optimize this code path, so performance of this case has improved little over the years.

Fast forward to JDK 1.2 and the introduction of the Java 2D API. The redesigned API offered shiny new classes likeBufferedImage and Graphics2D, as well as more flexibility in the form of RenderingHints. Much like the old scaling "hints" in the Image class, theRenderingHints class provides a number of similar switches to help developers control the quality of image scaling in a number of situations, like when calling the scaling variant of Graphics.drawImage().

Read on to find out how to optimize your performance/quality choices with a better understanding of the GraphicsAPI.

In Java Today, Java SE 6 Update 1 is now available for download. A release notes page details the bugs fixed in this release, including many relating to Swing, and others dealing with US Daylight Savings Time changes that had previously been addressed by a separate patch. will be down for 24-48 hours on Wednesday for an upgrade to the latest edition of CollabNet's Community Edition software, as described on an upgrade page The upgrade will offer better performance, online authoring of project pages, and updates such as Subversion 1.4.3. You can test the new site on the staging server by adding "stage." before the "dev." in your project URL; note that you'll be looking at a snapshot of your project from a few weeks ago. If you find a bug on the staging server, report it via the upgrade page and you could win one of two iPods. Thursday's WebEx discussion of the upgrade is available as the java-net project's Upgrade - Find-a-bug Win-an-iPod file.

Issue 285 of the NetBeans Newsletter is out. Contents include: NetBeans @ FISL, NetBeans Day St. Petersburg and Sao Paulo, new modules on Update Center, GWT Support Plug-in, Charlie Nutter on Ruby, JRuby, and JRuby on Rails, Tips and Tricks Contest, 6.0 keyboard shortcuts, using IRB in NetBeans,using a drop down list to display data, instant Rails with NetBeans and much more...

In today's Forums,shan_man has a long-awaited announcement in Re: JSR295. "Alright folks, this is it... drumroll please...! After learning *way* more than I wanted to about software licensing, I've made it through alive (and with many to thank along the way). The Beans Binding project is finally public on with a 0.5 release! As I've spent most of my time on the project over the last few weeks dealing with licensing issues, I can't claim to be an expert on the code yet. In fact, what I've released is in the same state that Scott passed it along to me (which probably means it's excellent, knowing Scott). So this is where Scott finishes, and I begin. We'll learn the ins and outs together, and hopefully you can suggest ways to make it better."

linuxjava details an interesting EDT-management technique for Gettin' work done in Swing. "Quick check here on how I'm doing things: I have a Swing app that does a bunch of stuff to a database. We all know, don't do anything like that from the event dispatch thread (EDT). So here's what I have: I create Actions, like a SaveAction, which saves stuff to the database. The actionPerformed() method of that is a SwingWorker, which has a doInBackground() method which does the database access. It also has a done() method which updates the GUI to reflect the results of the operation (success, failure, etc). Usually before the SwingWorker.execute() is called, the button that was clicked is disabled, so the user can't click it again while the operation is in progress. The button is re-enabled in the done() method Is this the right programming model? It seems like almost everything I do would fit into a model like that..."

dhunter21 has a workaround for a Heap Space Issue in JAX-WS: "Our WSDL includes a byte array that is base64 encoded, and when a client sends us data ~50MB, we notice that it takes 950MB of heap space for JAXWS to read in this data. We also notice a large impact when the file size is just 3MB. Using a profiler, I tracked the problem down to some code in Stax that is using a StringBuilder to read in the byte array. It is constantly creating and copying byte arrays (as is the behavior of StringBuilderwhen not initialized to a good size). In order to fix this, we wrote a Servlet Filter that snarfs the byte array before it is sent to jaxws. Using this method we can ensure that a 50MB byte array only needs 50MB of heap space."

In today's Weblogs, Dean


Go Your Own Way Blog

Posted by kfarnham Apr 2, 2007

Giving credit where credit's due

I think it's very fair to say that this site wouldn't have succeeded without the efforts of its first editor, Daniel Steinberg. Being somewhat privvy to the launch -- I didn't work with O'Reilly at the time, but I was one of Daniel's IM buddies -- it was astonishing to see the amount of hours that went into the launch. Furthermore, the editorial side of the site had to work against what was initially not a particuarly warm reception from some elements of the Java community, who were suspicious of Sun's level of involvment and control, dubious about whether any of the bloggers on the site would have anything to say, and questioned whether such a site was even necessary. As the O'Reilly staff has been reminded by other recent launches, building an editorial pipeline, finding an audience, and contributing to the development of a community is a startlingly difficult task, one that does not always succeed. When it does, plaudits are certainly deserved, though not always granted.

Daniel is leaving O'Reilly today, heading out to further his work in writing, editing, and audio, following up on media opportunities that are rapidly developing elsewhere. I'm sure he'll be a big success... well, really, he already is (you did recognize his voice on those MacWorld podcasts, right?)... and that we'll be seeing and hearing his work all around the web. Plus, he's giving two sessions at JavaOne (did I mention he's an accomplished Java and Obj-C developer?). Far from seeing less of him as he leaves O'Reilly, you'll probably see a lot more of him.

GJ, dude.

In Java Today, will be down for 24-48 hours on Wednesday for an upgrade to the latest edition of CollabNet's Community Edition software, as described on an upgrade page The upgrade will offer better performance, online authoring of project pages, and updates such as Subversion 1.4.3. You can test the new site on the staging server by adding "stage." before the "dev." in your project URL; note that you'll be looking at a snapshot of your project from a few weeks ago. If you find a bug on the staging server, report it via the upgrade page and you could win one of two iPods. Thursday's WebEx discussion of the upgrade is available as the java-net project's Upgrade - Find-a-bug Win-an-iPod file.

After more than a year of intensive development, the SIP Communicator project team is proud to announce a very first alpha1 release which is now available fordownload. The release offers support for instant messaging and presence for the Jabber, MSN and ICQ protocols, as well as support for 1 to 1 phone calls with SIP. The application is available in packages for Windows, Linux (Fedora, Debian and others), and Mac OS X.

The JavaServer Faces Spec project has released an early pre-JCP version of the JSF 2.0 draft specification. As noted by spec lead Ed Burns in a recent blog, the draft "has been through several rounds of Sun internal review and also was reviewed by the JSF 1.2 Expert Group"; Ed invites readers to post comments about the draft directly to his blog.


Filter Blog

By date: