Home » 2009 » 2009 » September

Updated Plugin: Yoxos Eclipse Distribution – v4.2.2

Yoxos Eclipse Distribution
Category: IDE

Description:

Manage your team’s Eclipse environment by using Yoxos to distribute Eclipse installations and configurations throughout your enterprise.

There are three great ways to get Yoxos working for your team: 

  • Yoxos OnDemand – a free and open Eclipse Configurator
  • Yoxos Hosted – a secure, hosted configurator exclusively for your team and enterprise. 
  • Yoxos Enterprise – all the Yoxos features custom-configured onsite for your specific requirements. 
  • Yoxos SecureSource – validated, virus scanned, signed and securely delivered Eclipse bundles

Yoxos provides the ability to manage, distribute and share configurations and to ensure the integrity and completeness of custom toolsets. Yoxos is based on our extensive library of Eclipse commercial and open source plug-ins. 

Our suite of quality tools is designed to compose, validate and test Eclipse plug-ins. The composed toolsets can be reviewed for consistency, completeness and even the plug-in design quality. 

Our collaboration tools allow sharing of plug-in sets and as well as the projects in your workspace, plug-in configurations and Eclipse preferences.  All through a user-friendly GUI or web-based interface. 

To find out more about the Yoxos distribution product suite, visit us at http://eclipsesource.com/yoxos/

EclipseSource completes TÜV certification for Secure Eclipse Plug-in Repository

EclipseSource Introduces Industry’s First TÜV Certified Process for Validating and Securing Open Source Libraries

Denis & Karl: Wow, what a painful release this was (is?)

If you were able to upgrade to Galileo SR1/Eclipse 3.5.1 in a timely manner, you were probably just lucky.  Even today, 5 full days after the release, our servers are still crawling.

What happened?

In late August, Karl and I had installed our new Cisco load balancer and firewall.  Unbeknownst to us, we were dropping connections.  A few committers noted that CVS connections were causing broken builds, and we had early reports from our mirrors that their RSYNC connections were being terminated.  We didn’t pay too much attention to the RSYNC issue in favour of resolving CVS, since RSYNC is one of those robust protocols that is essentially bomb-proof.

Mistake 1.

Fast forward to Friday, Sept. 25. I did real quick mirror check and everything checked out.  We’re good to go.

Mistake 2.

I mean, this is just a point release, and I’ve done millions of these. Business as usual, right?

Mistake 3.

At around 3:00pm ET on Friday, I was getting reports that the ZIP files were missing on most of the mirrors, despite the fact that they were considered in sync.  Uh oh.  Since Karl had found (and fixed) some short timeouts that may have caused the dropped connections, I went on to assume that mirrors were simply not yet fully up-to-date with Galileo SR1, and that they would be in sync sometime during the weekend.

Mistake 4

As it turns out, since late August, our mirrors would begin syncing, but would never finish.  They were all badly out of date, but still considered in sync but because they checked in regularly. So they spent most of the weekend simply catching up, without actually getting the new SR1/3.5.1 files.

On Monday, the above became painfully apparent when we were caught serving p2 updates for most of the planet from a single 100 megabit internet connection. At this point, mirrors were having a difficult time pulling updates from us.  I then brilliantly re-routed most of our downloads to our Amazon AWS account, after making sure it was in sync.

Wrong again, hero.

My uploads to AWS were also not completing. Apparently, when you update Eclipse, there are content/artifact jar files everywhere in our tree that need to be fetched. Some of those were not on AWS yet, causing the updates to fail.

“Epic Fail.” What have you learned?

When you think it’s business as usual, you’re probably wrong.  Plenty of learned lessons here.

What happens now?

Most of our mirrors are now in sync, and so is our Amazon AWS.  p2 probably got burned by many broken mirrors and now only trusts the home site.  It will eventually learn to trust its mirrors again. Until then, updates may be a bit slow, but they should succeed.

Virgil Dodson: BIRT Exchange Turns Two Years Old

The BIRT Exchange Community site has been quite a busy place over the past two years.  There are now over 21,000 registered members of BIRT Exchange from 157 different countries and over 30,000 unique visitors each month.  There have been more that 15,000 new forum posts on BIRT Exchange over the past 2 years making BIRT Exchange the most active BIRT resource on the Internet.  There were 32 webinars conducted from BIRT Exchange and over 500 BIRT related code examples, report designs, tutorials, and tips submitted to the DevShare area of BIRT Exchange.  Some of these items have been viewed or downloaded more than 20,000 times.

This year we developed a contest designed to reward BIRT Exchange members for their valuable contributions to the site. The contest is called the DevShare Contributor of the Month contest and  rewards the person who has submitted the most popular DevShare item each month with their choice of an animated BIRT Rocks! T-shirt, a set of BIRT books, or an iPod Shuffle. 

We expanded the BIRT Exchange community this year by inviting BIRT partners to participate in our Global Partner Connection program.  So far we have signed up 42 partners and many of these partners have become quite active in the forums and creating examples for the DevShare.  This month we also launched the Beta of our Open Marketplace on BIRT Exchange and several partners have already added their items to the Application Showcase.  We expect this to be one of the fastest growing areas of BIRT Exchange this year.

We hired an official Community Manager this year who will focus on engaging the BIRT Exchange community.  Watch for new and cool changes this year designed to increase the participation and amount of valuable resources available on BIRT Exchange.

Podcast with Eclipse Summit Europe Keynote Don Syme of Microsoft Research

Ian Skerrett (Eclipse Foundation), Don Syme (Microsoft Research)
 

Virgil Dodson: BIRT Exchange at SpringOne 2GX

The BIRT-Exchange team will be at the SpringOne 2GX show at the Roosevelt Hotel, in New Orleans, October 19th - 22nd.  Visit us at our booth in the exhibit hall to talk about BIRT or just to say hi!  You can find out more information on the SpringOne 2GX show at http://www.springone2gx.com.  Hope to see you there!

New Plugin: Lady4j assistant Eclipse plugin – v1.0.130

Lady4j assistant Eclipse plugin
Category: Application Server

Description: Lady4j is a Data Mining system designed to help you work with Java(c) applications. Lady4j allows you to improve your Java skills, solve problems and errors, understand code and improve your programming skills. From now on you wont be on your own, Lady4j will help you every time you may need it.

New Plugin: JASMINe Design – v1.2.1-M2

JASMINe Design
Category: Application Server

Description: JASMINe Design is GUI that allows you to design and configure a middleware architecture.

Once your architecture is designed, you can deploy it with DeployME or Jade, tools from JASMINe Deploy.

MyEclipse 8.0 Milestone 1: Eclipse Galileo, Struts 2 and Eclipse Profiler Suppor

We’re proud to announce that MyEclipse 8.0 M1 is here with Eclipse Galileo, Struts 2 and Eclipse Profiler Support for the Enterprise.Download MyEclipse now | New & NoteworthyOur newest release is built to support Eclipse Galileo and delivers a powe…

EclipseSource completes TÜV certification for Secure Eclipse Plug-in Repository

EclipseSource Inc, the leading provider of Eclipse runtime products and services today announced that it has received TÜV certification of its proprietary process for validating and securing open source components. This industry-first achievement offers unprecedented protection and reassurance for organizations using open source components in their tool chain as well as those building applications on top of Eclipse and OSGi runtime technologies.

Bob Balfe: More structured Tutorials page on Wiki for new users.

I went ahead and changed the Tutorials page on the Composite Application Wiki.  The page now has a couple of sections at the top to get people started.  With 25 tutorials I can see it be pretty difficult to “get started” in this area so hopefully this helps.  Any other suggestions on things like this are great so keep them coming.

Referenced page is here.

technorati tags: ,


MyEclipse 8.0 Milestone 1: Eclipse Galileo, Struts 2 and Eclipse Profiler Support for the Enterprise

Our newest release is built to support Eclipse Galileo and delivers a powerful Java Profiler that can be used as a standalone tool outside of MyEclipse to profile any Java application, Eclipse plug-in or applet, as well as industry-leading support for the much-requested Struts 2 framework, enabling the development of enterprise-class Java Web applications.

Jens von Pilgrim: String.format vs. MessageFormat.format vs. String.+ vs. StringBuilder.append

Usually I’m not a performance hacker, i.e. I seldom use the final keyword, and I dare to use List.size() in loop expressions. But I’m a little bit sensitive when it comes to string operations, as they can cause severe performance problems, and sometimes security issues as well, e.g., if an SQL query is to be created (ok, bad example, one can use PerparedStatement instead of hacking an SQL string).

For logging I often have to concatenate strings, such as

if (log.isLoggable(Level.INFO)) {    log.info("Command created - cmd=" + cmd); //$NON-NLS-1$}

Actually I’m not writing lines like this myself, I let log4e do the job — I really love that tool!

But sometimes these string concatenations are hard to read, using a String.format or MessageFormat.format would make it much easier. Here are some examples:

foo(String.format("Iteration %d, result '%s'", i, value[i%2]));

foo(MessageFormat.format("Iteration {0}, result ''{1}''", i, value[i%2]));

// single line:foo( "Iteration " + i + ", result '" + value[i%2] + "'");

// multi line:String s;s = "Iteration ";foo(s); s+= i; foo(s); s+= ",\nresult '";foo(s); s+= largeString(i); foo(s); s+= "', '"; foo(s); s+= largeString(i+1); foo(s); s+= "'";

foo(new StringBuilder("Iteration '")    .append(i).append(", result '").append(value[i%2]).append("'")    .toString());

(Update: the multi line test was added after daObi and Laurent commented the first version)

Hmm… maybe the “+” isn’t that bad ;-) I do not understand why String.format andMessageFormat.format have these different notations, and frankly I seldom get the format string right in the first run. So, besides the aesthetics, what about performance. What would you guess? My guess was StringBuilder would be the fastest, followed by the format methods, and the String operator “+” would be the slowest as new Strings are to be created all along. I run a little test (calling these methods 100000 times, foo() is doing nothing and was, besides other things, only added in order to avoid too much compiler optimizations, although I have no idea if that worked ;-) ). Note that in the test only a few strings are concatenated, but I think that’s a typical example and it was the setting I was thinking about to use format methods instead of string concatenation (and it’s quite similar to many toString methods). I was surprised by the result:

String.format: 757 ms
MessageFormat.format: 1078 ms
String +: 61 ms
String + (multi line): 162 ms
StringBuilder: 74 ms

Gosh! The “+” operator clearly is the winner! It is 10 (ten!) times faster then the format methods. 10 times, can you believe that. I was really surprised, and frankly, I couldn’t believe it. (Update: daObi and Laurent explain it, see their comments below). Thus I changed the test, assuming the compiler tricked me, but I always got more or less the same results. I figured it may be the size of the strings, so I also changed that. That is, I used large strings (with 70.000 characters, the method returns one of two strings in order to avoid compiler optimization) in the concatenation:

for (int i = 0; i < n; i++) {    s = MessageFormat.format("Iteration {0,number,#},\nresult ''{1}'', ''{2}''", i,   largeString(i), largeString(i+1));}

for (int i = 0; i < n; i++) { s =  "Iteration " + i + ",\nresult '" + largeString(i) + "', '" + largeString(i+1) + "'";}

Actually, the test is a little bit unfair, as in all cases at least the result string has to be created (i.e. also the format methods have to create strings), but at least the string is rather long. The result string s has a length of 140027 characters, so this is a pretty long string, isnt’t? Here are the result of the long-string-test:

String.format: 584 ms
MessageFormat.format: 816 ms
String +: 621 ms
String + (multi line): 867 ms
StringBuilder: 555 ms

Yeah! Now we have the order I expected in the first place: StringBuffer.append is the winner, followed by String.format. MessageFormat.format has a little problem and is even slower than the String concatenation. But compared to the result of the first test, all methods are at the same speed.

So, what did I learn? First, I will use the plain and simple string concatenation in the future more often, as it is easier to write in many cases compared to some weird format strings. I will use String.format only if I probably need to translate my code, since this is easier to translate a format string than changing the code (if the order of the sentence components change in another language). And, of course, I will use StringBuilder if large strings have to be concatenated, but I think I use it less in toString-methods. And maybe I’m going to read a book about performance hacking — do you have any recommendations? Anyway, this test also teaches me (again) that good performance is not (only) a question of single statements, but a question of good algorithms and good design in general.

Note: Actually this is not the first time I was surprised by the result of a preformance test. I did a test once comparing the performance of different class library designs in case of a math library for matrices and vectors. I have documented the test in the LWJGL forum, and its results influenced the design of the GEF3D geometry package (see package documentation).

Erwin Tenhumberg: SAP Usability Test Center at SAP TechEd Vienna

SAP Usability Test Center at SAP TechEd Vienna has opened for registration usability test persons

Update für Suns Java Communications Suite – Heise Newsticker

Update für Suns Java Communications Suite
Heise Newsticker
Sun hat eine neue Version seiner Java-basierten Messaging- und Collaboration-Lösung freigegeben. Die Java Communications Suite 7 besteht unter anderem aus
Neue Kollaborationslösung von Sun Microsystemssilicon.de

Alle 6 Artikel »

Eike Stepper: EMF Tips #2: Tweaking my Genmodel

The major part of this month I’ve been on vacation in Toronto and spent a wonderful time with René, Ed and Frank. Ed’s garden is as beautiful as one might expect and I was busy collecting evidence of that.


Too busy to keep up with my EMF Tips blog series. In part #1 we discussed ways to easily generate multiple models. Thanks for all the helpful comments.


This part focusses on tayloring and tweaking the outputs of a single generator model. The default Genmodel properties lead to generation of four plug-ins: model, edit, editor and tests.


We will always need the model plug-in itself but often we don’t need all of the other three outputs, so how do we exclude particular plug-ins from generation?


The Genmodel has a properties category for each of the output plug-ins: Edit, Editor and Tests. Completely switching off the generation of any of these is as simple as deleting the respective Directory property.


The generator UI will immediately reflect this by disabling the respective Generate menu item. Even the Shift+Alt+G dialog from tip #1 will adjust accordingly.


The next part of this series will focus on the interesting question “Why should I want to generate editors?”. For now, you’d know how to avoid it. Stay tuned.


I was just told that there are still three seats available for the Eclipse Modeling Code Camp training that Ed and I will be giving next month (starting October, 12th) in Munich. Don’t miss this great opportunity to spend four days with us and become

the world’s greatest modeler!

Eike Stepper: EMF Tips #3: Why should I want to generate editors?

I thought about treating you with more of those beautiful flowers in Ed’s garden but there’s still material from our trip to Toronto. Thanks to Dave (Dave, the book, not the Google Bear!) and Kevin for organizing cool downtown and clubbing tours. And for demonstrating how dynamic IBM really is. Thanks also to Lynn and Kenn for showing us Ottawa. Damn, from getting almost one finger between Toronto and Ottawa on the map I deduced that it might be an hour’s trip. It is not! Canada is sooo big.


So, why should I want to generate editors for my models? Have you ever thought about this? Or are you politely generating these editor plug-ins, just because it’s possible? Or fun?


You might remember that I have 28 models in my workspace. Let’s, for a moment, assume I generated 28 additional editor plug-ins into my workspace. A lot of code to maintain and we should be absolutely sure that this is (a) necessary and (b) appropriate!


To judge if it’s necessary to generate editors on a per-model basis we need to compare the generated code of two such editor plu-ins. Interestingly, it boils down to a single difference in the initializeEditingDomain() method where the ItemProviderAdapterFactory for the model is added to the ComposedAdapterFactory. More interestingly, the editor will continue to function properly even if you remove this model-specific line! The reason is that the ComposedAdapterFactory delegates to a registry of descriptors which are contributed to the extension registry by the edit plug-ins. You see, it’s clearly not necessary to have a generated editor per model.


And usually it’s also not appropriate to have vast numbers of editors that are all alike. Model editors are a means to implement functionality that is orthogonal to the models. Things like ordering of nodes and properties, changing colors, fonts and so on are achieved by customizing the editor. I really don’t want to duplicate all these UI-related, i.e. model-independent, aspects over 28 editors! And don’t forget, your model can be used in other generated editors (other than the one that has been generated for this particular model).

All we need is a single generated editor for all our models.


Eventually we’ll need additional editors for additional UI-related requirements, but not for additional models. The same arguments are certainly valid for the generated wizards. One difference between the generated editor plug-ins that I did not talk about, yet, is the editor and wizard markup in the plugin.xml. Our reusable editor would at least have to be prepared that it can be associated with different file extensions, depending on the set of deployed model or edit plug-ins.

Ajax-Framework ZK 5 bringt Ajax-as-a-Service

Das ZK-Team hat Version 5.0 RC ihres Ajax- und Mobile-Frameworks veröffentlicht. Lag der Fokus bei ZK bislang auf dem Server, ist das Open-Source-Framework nun einen Schritt in Richtung Client-Side-Programmierung gegangen: jQuery wird bereits …

Tonny Madsen: Teaching MDD and DSLs at ITU, Copenhagen

This fall I have accepted a position as extern lecturer at the IT University in Copenhagen teaching model driven development and domain specific languages. I share the position with Steen Brahe from Danske Bank – one of the major banks in Denmark – who have a very solid practical experience in GMF models.

The class runs every Monday and is a required part of the Master degree on software construction at ITU.

As the tool bench for the classes, we use Eclipse Galileo Modeling Tools, which have turned out be a very good choice as a platform, as it is both pretty solid and contains all the bits and pieces we need in the classes.

The IT University is a rather interesting place – not only from an architectural point of view – see the picture at the right – but also because the students are required to hold a bachelor degree as well as at least two years of real practical experience. This later requirement means, most of the students actually have a qualified opinion about the subjects that is taught.

The classes we teach includes the following subjects:

  • OSGi
  • Basic Eclipse Plug-in Structure
  • MDD Theory
  • EMF
  • OCL
  • Textual DSL design an theory
  • XText
  • GMF
  • Model Transformations
  • QVT
  • Xpand
  • and a number of lectures on alternatives like UML

As it can be seen, this a very mixed bag with both theory and lots of practical exercises based on the Eclipse tool bench.

Sun Java Communications Suite 7

Die Kommunikations- und Collaboration-Lösung Java Communications Suite von Sun ist in Version 7 erschienen. Neu ist unter anderem der Calendar Server, der den CalDAV-Standard unterstützt, außerdem wurde Sun Convergence 1 …

Andrew Eisenberg: Groovy-Eclipse plugin now supports Eclipse 3.5.1

The Groovy-Eclipse plugin can now be installed into Eclipse 3.5.1. As always, the update site is here:

http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5/

You can stop reading here if you don’t care how I got this to work, or why I am a little bit surprised by this.

The Groovy-Eclipse plugin uses a feature patch on the JDT core bundle in order to achieve a high level of integration with JDT. Typically, feature patches can only apply to a specific version of a feature (e.g., 3.5.0.v20090527-2000-7r88FEeFJePyvYeA33DjZ_c1 or some ugliness). This means that Groovy-Eclipse, until recently could only install in a specific version of Eclipse, the one that ships the JDT feature version 3.5.0.v20090527-2000-7r88FEeFJePyvYeA33DjZ_c1. However, Andrew Niefer describes how to get around this by editing the content.xml file to widen the range that the patch applies to. Excellent stuff, and lucky for me, because I didn’t want to branch the Groovy-Eclipse code base every time a new service release of Eclipse comes out.

Unfortunately, his instructions were not entirely accurate. Andrew mentions that the range attribute in the <patchscope> element needs to be widened in order allow the patch to be installable on multiple versions. I tried exactly what he suggested, but could not get my patch to install in both 3.5.0 and 3.5.1. After a little bit of exploration, I found that I also needed to change the range attribute in the <lifecycle> element.

All this meant was adding a single line to my ant script, to be executed after the p2 repository is generated:

    <replace file="${updateSiteDir}/content.xml"              summary="yes" token="${orig.jdt.feature.version.range}"              value="${new.jdt.feature.version.range}"/>

And this turned out to be very simple. Thanks for the hint!

Dave Carver: Common Eclipse Build Failures and Causes

This has been floating around for a while in my head so it’s time to shake it out. Considering I’ve been breaking the XSL Tools build recently, but everything runs fine locally, I’d thought I’d share the common failure points and why:

  1. Can’t locate Plugin – build crashes after 2 minutes during feature dependency checking. The cause in this case was a dependency range issue. The version of the plugins the build system had from its target platform were not exactly what I had in my system. Solution in this case was to loosen the plugin dependency range to remove the maintenance release version number. Which I didn’t happen to need. Alternate Solution: Update the target platform the build system has (not an option in my case with out involving another person to update it).
  2. Can’t locate Plugin – Yes this one again, but caused by a different issue. In this case it was caused by a MAP file not being updated correctly to contain the new plugins that were needed for the unit tests. Something that running and executing from within the IDE is not going to catch.
  3. Unit Tests fail with NullPointer Exception – this was caused due to the way unit tests have to be unpacked in order to access files and directories in the jar. Note: If using Athena Common Builder this should not be an issue as Nick has this working with Athena.
  4. Missing Directory or Can’t locate file – caused by the build.properties file not being updated to include the appropriate directory in the jarred plugin.
  5. Can’t locate Plugin – Yep again, however, this time caused by plugin.properties not being included in the build.properties file correctly. The feature build couldn’t locate the plugin name or id.

Other items I’ve seen that cause build failures include:

  1. Missing target platform dependencies from either not retrieving from orbit, or not deploying your upstream dependencies to the build machine. In these cases, the provisioning for the build may need to be updated. You may have to update Hudson or CruiseControl if checking code out from head, or you may need to update a build.properties file correctly if using Athena Common Builder.
  2. Incorrect Tagging of Map files – If you don’t tag your map files and release correctly, you can get all sorts of errors that are difficult to track down. It’s one of the reasons I prefer to build directly from head instead of MAP files. If using Hudson, you can always TAG a build after it is done, to lock the file versions that were used to build in place. Also, if you need build promotion, you can use the Hudson Build Promotion plugin to promote a build.
  3. Failure to Continuously Integrate with Head – A common issue that can occur is that your local copy of the files aren’t in synch with what the MAP files have or what is currently in Head. It’s always a good practice to keep your copy synchronized with what is in head to catch integration issues early as possible.

Those are what I have seen, several don’t have to do with Eclipse builds, but builds in general. The five that happened to me recently were because I did not update the appropriate meta data correctly for the automated build. PDE is a bit more lenient when you are running the code from within PDE. Many of these could be caught by exporting the feature or plugins from the build, but some still slip through. All of these errors can be caught by looking at the log files. Hudson’s Console Output is a good way to see what is happening, CruiseControl tends to mangle the log outputs so it’s a bit harder to track down the issues.

So next time you have some build failure issues, hopefully these common causes can help you track down why, and how to fix it.

Brücke zwischen Java und .NET

NET Services, eine gemeinsam von Microsoft und dem französischen Anbieter Noelios entwickelte Schnittstelle, soll Java-Programmierern den einfachen Zugriff auf mit .NET verwaltete Daten erlauben. Die Schnittstelle basiert auf der …

Robert Konigsberg: The Java language feature I want: Exception Sugar

I’ve enjoyed observing all the discussion around the new features to make it in to Java 7. All this time I’ve had an idea about a language feature which I’ve occasionally mentioned to colleagues, and it’s around the domain of exceptions.

Before I discuss the problem, or my proposed solution, let me be frank: I’m no language expert. I have no expectations that a suggestion such as this has a chance of getting in to Java 8 if they can’t even get multi-line strings into Java 7. I don’t even care about the impurities brought up by this proposal. What I do care about is discussing a more graceful way of dealing with exceptions.
I’ll agree with some of the fundamental concerns Misko Hevery brings up around the domain of checked exceptions. People often don’t know what to do with them. Sometimes people just throw Exceptions into RuntimeExceptions and propogate them up the call stack. People also tend to overuse existing exception classes when one more specific to the a class or API domain would do. As is well documented in Effective Java (2ed) Item 61: Throw Exceptions appropriate to the abstraction. However, this all too often requires an undesirable amout of boilerplate code, and I do mean boilerplate. How many Exception classes have you written that look like this?

class MyException extends RuntimeException {
  public MyException() { super(); }
  public MyException(String message) { super(message); }
  public MyException(Throwable cause) { super(cause); }
  public MyException(String m, Throwable c) { super(m, c); }
}

Unless all your methods throw Exception, or if you only throw RuntimeException, IllegalArgumentException, and AssertionError, the answer is: you’ve written them plenty of times, and unless you’re building an API to be consumed by the tens of thousands of engineers, you’re probably not creating abstraction-appropriate exceptions often enough, directly against the advice of Effective Java.
What I propose is lowing the barrier for creating an exception class, which I’m calling Exception Sugar. Again, being no language maven, with no regard to syntax or grammar, I humbly propose:

exception className extends baseClass;

which serves as syntactic sugar for creating a subclass of baseClass named className that also, and here’s the nasty part, “inherits” the base class’s constructors. Yes, I know damn well that constructors aren’t methods; they don’t have instance scope, and there’s really no such thing as constructor inheritance. I read Jeremy Manson’s blog, and he even talks about the worthlessness of constructors. I get it. I couldn’t care less. I just want to make it easier to write exception classes. To avoid the term inheritence I’ll call it constructor propagation.

Maybe you don’t like the proposed syntax. What about:

class className extends baseClass { propogate_ctors(); }
or
@ExceptionSugar className extends baseClass {}

Did you hear that? That, my friends, was the sound of a thousand shattering coffee cups from Java programmers whose grips loosened uncontrollably from the awful syntax. Relax, girls and boys. I’m not trying to sell syntax. I’m just trying to sell an idea. Get over the syntax, and mop up your coffee.

Q: Why can’t you write your own exception class?
A. I might get it wrong. And I want to do it a lot. I want to make creating a domain-specific exception class even easier than creating a class for the domain.

Q: How could you use Exception Sugar to create subclasses that have additional attributes, or slightly different constructors?
A: I don’t have any illusion of doing so. It seems to me that 99% of the time, people want to subclass Exception or RuntimeException, and even then, they only define just one constructor instead of all four.

Q: Why can’t constructor propagation be applied to non-exception classes? Why should exceptions be the, ahem, exception?
A: Ha ha nice one. They don’t have to be, but I’m not interested in easily propagating for classes outside the exception hierarchy. But if I’m pressed, constructor propagation in non-exception classes is almost certainly a Bad Idea, but am not going down that path tonight.

Q: Why not focus on something more valuable, like properties?
A: Properties sounds like a good idea. Go for it. The reason I bring up this particular idea is because I don’t see anyone else thinking about it. That isn’t to say I haven’t brought it up before. I even mentioned it to Alex Buckley at last year’s EclipseCon. Poor Alex, it was 1:30AM, and he and I somehow managed to win the party that evening, and so he had to suffer listening to yet another armchair language designer. But I will say, when I mentioned exceptions, he thought I was referring to catching multiple exception types. At least he was surprised, which means the idea might be awful.

Or awfully brilliant!

To be fair, Alex described some of the details that demonstrate the difficulty of this idea, but the combination of many drinks and the late hour made it impossible to understand. (Sorry, Alex.)

But getting back to the value of such a proposal: if people can propose literals with underbars and the Elvis operator, I can talk about this, too. (Don’t get me wrong, I very much want the Elvis operator.)

As a conclusion of sorts, I’m about 95% confident there’s a technical reason for prohibiting Exception Sugar, and about 99% confident it would never make it in to Java. I’d be honored if someone with an understanding greater than mine of Java and language design would be willing to comment on this idea, and provide some thoughts about the technical issues, if at least to educate.

Thanks for reading. Thanks to David Mankin for his feedback.

Sun Newsflash: Virtualisierte Rechenzentren mit Ops Center 2.5 verwalten