Scratch That NetBeans Itch: Matthias Bläsing

DZone 's Guide to

Scratch That NetBeans Itch: Matthias Bläsing

· Java Zone ·
Free Resource
Matthias Bläsing is a programmer in Germany. His work responsibilities range from part-time end-user support to developing Java EE applications. His development interests range from basic libraries to high-level-frameworks.

Hi Matthias! You've been using NetBeans for a while. What do you think about it and what are some of your favorite features?

The best feature is that it stays out of my way most of the time! It just works and that's what makes it useful for me.

If I need a Java GUI, there is the GUI builder. If I want to work with PHP and HTML, there is syntax highlighting and syntax completion. If I need to work with our databases (MySQL, MSSQL, Informix, DB2), I use the database explorer.

I don't use NetBeans for everything, there are situations where a small editor like vim is much better and there are situations where the database specific tools work better. It's just that considering the whole package, NetBeans gets a really large cut.

Recently you provided some patches relating to the database tools in NetBeans, can you tell us a bit about that?

I won't cover all of the patches. Most things are problems I fixed because I got annoyed with the current state, some just out of interest.

  • I started with patches scratching only the surface, like changing the way dialogs or panels are displayed. Things you only notice in special settings, so I saw the problem and could locate the single line/few lines that needed changing. In this case it was the insertion dialog for new lines, that on my dual-head setup exceeded the main screen and made it unusable. Disabling the enforced minimum size fixed it. Similarly there were missing model<->view transformations when dealing with JTables and their models. If you know the mechanics, its easy to fix.

  • Another thing that was more involved was a fix to the dbschema module, which in itself is very small, but took more time to analyse. The dbschema module was used to create entity beans. The relationships showed "ghost" composite keys, which were not present in the schema. I traced it down to the way Informix reported index statistics, the fix in itself was just ignoring the additional entries.

  • The biggest change so far is changing the way NetBeans IDE handles BLOBs and CLOBs. Till 7.1, NetBeans truncated CLOBs to 2000 chars and encoded BLOBs to hexadecimal strings. All in all, it was a bit messy. I had serious problems using NetBeans IDE with tables containing LOBs. My idea - skip the truncating and encoding and use simulated LOBs. These pseudo blobs are file-backed, so that they don't flood the main memory (still, loading a 600MB image from a database could prove interesting). The basic implementation is done and got merged.

  • Currently some more patches wait to smooth the transition, as some assumptions - like "value can't be null" don't hold anymore.

  • In my queue sits the ability to cancel queries in the NetBeans GUI. If you ever saw a seemingly non-ending query in NetBeans you know the sinking feeling when you see the error, but can't do anything.

How was the process of contributing patches to NetBeans?

Actually it's not as difficult as I thought at first.

You have to get used to respecting API boundaries and know that inside the module pretty much everything is allowed, while you have to be very careful when module boundaries are crossed. This makes fixing bugs easier with respect to things you have to consider. You can get pretty far without understanding the whole NetBeans IDE and concentrate on the concrete problem.

Mostly the patches were directly applied to core-main (the development tree of NetBeans IDE) or suggested small fixes were similarly directly done. In the cases where the patches did not work directly, there was the required feedback from the maintainer. Reasons for errors ranged from overlooked interactions or missing test cases in my personal tests. This didn't harm the end result, as further tests were done and the modified patches were then applied.

What would you like to say to anyone else who encounters bugs and would like to contribute patches?

As I said above: scratch your own itch! Work on the things you like and fix the things that annoy you. Don't close your eyes, look right and left and maybe you'll find some low hanging fruit that annoy not only you, but also others. And then... fix it! :-)


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}