Friday, February 15, 2008

The sly fox' clause

I am working on new status dialog for some time. And my work progress very slowly, so even if this code will be released for M6 it is impossible to make API stable. I do believe that 4 weeks is not enough to do that. This issue seems to have serious impact on my work - it is too late to release the code, because then it will go to API and should be maintained forever. I do not find myself good enough designer to take that risk...
So... should I postpone my work?
Actually I would have a lot of problems if Szymon Brandys and John Arthorne hadn't shared with me their knowledge (yes, they allowed me to write about this if I put their names in the note).
So, the trick is to put following comment into javadoc:

<p>
IMPORTANT: This class is <em>not</em> intended to be subclassed.
</p>

This little clause is warranty of binary compatibility in case of any changes. Well... actually it indicates there is no warranties at all, and if you try to derive from that API anything its your problem.

Of course I could use final clause. But then nobody would be able to use my classes and provide feedback...

The trick is called "soft API".

By the way, if you have a second or two please look at new status dialog.

Regards,
Chris

Friday, February 8, 2008

CoreException anit-pattern

Hello there

I have run recently into bug 212340. There is described anti-pattern that causes stack trace to vanish.

The explanation is quite easy - currently StatusManager#handle accepts IStatus, and CoreException has getStatus method... So it is almost reflex action to write:
StatusManager.getManager().handle(e.getStatus()); CoreException's stack trace is lost...

So... wrap CoreException in IStatus before passing it to StatusManager!

Regards,
Chris

Thursday, February 7, 2008

Automatic generation of BIRT reports

Automatic generation of BIRT reports is a common task for every company that has reports that should be presented to the customers.

Those reports should be delivered regularly. If howto that I am going to present is available somewhere than I am sorry, but I was not able to find it out and I had to merge knowledgle scattered in a several wiki pages.

But in the ends solution seems to be very easy:

1. Download BIRT runtime and unzip it somewhere. You should have now birt-runtime-2_2_1_1 folder.
2. Set up environment variable to point to that folder either in OS or inside birt-runtime-2_2_1_1\ReportEngine\genReport.bat(sh for linux).
3. Put your jdbc jar file in folder birt-runtime-2_2_1_1\ReportEngine\plugins\org.eclipse.birt.report.data.oda.jdbc_2.2.1.r22x_v20070919\drivers.
4. Execute genReport.bat script to see usage. For all those good computer scientists (and good computer scientist is a lazy one) I present sample command:
genReport.bat -f PDF -o outputfile.pdf -F report_design.rptdesign

I hope it will help somebody.
Regards
Chris

Wednesday, February 6, 2008

Exporting RCP application in Eclipse 3.4M4 with Java 1.6 on board

Recently I have been trying to export small RCP application from Eclipse 3.4M4. Unfortunately I encountered problems with exporting plug-ins which were using Java 1.6 specific features. I have even reported new bug, however Remi Chi Jian Suen was on his place and suggested me to add:
jre.compilation.profile = JavaSE-1.6
entry to the build.properties file of my plug-ins. It worked perfectly - thanks Remi! The only doubt I have is: shouldn't it be added automatically when user uses Java 1.6 no to let him go to similar troubles?


Tuesday, February 5, 2008

4'th February - World Cancer Day

How this topic is related to Eclipse ? Well, not directly. But as Eclipse is a community we should take care of each other. I belief at least some of you will find this information really useful.
Link to my blog's record: http://frankfurt-days.blogspot.com/2008/02/4th-february-world-cancer-day.html
Direct link to the presentation about cancer's prevention methods: http://www.cs.put.poznan.pl/bmichalik/cancer/4th_February.pdf

Saturday, February 2, 2008

Cut the tail

As Chris has posted the oldest bug in PDE is fixed. Maybe this is a good starting point for cutting the tail ? The next in queue are:

Maybe there are not most interesting ones but there is a lot more bellow id 100000.
So let's start slicing the tail :)

Btw. the oldest bug is 30.