Mylyn and trac 0.11

Eclipse, Java No Comments »

I am using trac now since about half a year for one of my current Java projects. One thing I missed from the start was the Mylyn integration in Eclipse - with bugzilla I was used to handle most of my issue tracking inside Eclipse. If you get used to this kind of “task oriented” working it is hard to do anything without.

Today I found a nice post about how to enable Mylyn to work with trac version 0.11. Basically you have to add the XMLRPC plugin to your trac installation and to configure the XMLRPC connection mode in the Mylyn trac connector.

Eclipse building workspace hangs

Eclipse, Java No Comments »

Today I encountered the problem that every time I started one of my Eclipse workspaces it always started to build the workplace and could not finish it. The progress monitor showed additional tasks waiting but I could not stop them. After killing the Java VM process several times and starting up again I searched for a solution and found this page.

I already heard about the clean command line argument and after adding it to the command line it resolved my problem. I will not add this permanently to my Eclipse links because it takes significantly longer to start up but I did a good job to fix the workspace.

Spring, AspectJ and Maven troubles

Eclipse, Java, Software No Comments »

In one of the applications I am currently working on I am using the following combination:

  • Eclipse IDE with AJDT
  • Spring
  • Maven

This week I upgraded Spring to version 2.5.5 and had some troubles with compiling my aspects in the maven build.I always encountered the following error message when trying to compile my project:

Unable to continue, this version of AspectJ supports classes built with weaver version 3.0 but the class org.springframework.beans.factory.aspectj.AbstractBeanConfigurerAspect is version 5.0

After doing some web search I found this JIRA entry for Spring about the changes in AspectJ dependencies. Then I found out that the aspectj-maven-plugin 1.0-beta-2 had dependencies to to AspectJ 1.5.2a in his pom file. To override this I did as described in this blog post and added the dependencies in my pom to AspectJ 1.6.0 - now I was able to do a build again.

Spartan Programming

.NET, Java, Software 1 Comment »

I feel good because the way I am trying to write code follows more and more the principles described on this wiki page:

Spartan programming strives for simultaneous minimization of all of the following measures of code complexity:

  1. horizontal complexity, that is, the depth of nesting of control structures, just as the total line length.
  2. vertical complexity, that is, the code length in lines.
  3. token count
  4. character count
  5. parameters that is the number of parameters to a routine or a generic structure.
  6. variables
  7. looping instruction, that is the number of iterative instructions and their nesting level.
  8. conditionals, that is the number of if and multiple branch switch statements.

Check out the post and this example!

Eclipse Ganymede release

Eclipse, Java, Uncategorized No Comments »

I am using Eclipse Ganymede for about three months now (since RC5 or RC6) and I am really excited about the new version. Here are my favorite improvements:

  1. Performance
    • Java compile on multi-CPU machines – the Eclipse Compiles now takes advantage of multi-threading capabilities of multi-CPU machines. Builds are a lot faster!
  2. UI improvements
    • I am a Firefox user so I am happy that it is now possible to close tabs by clicking on them with the middle mouse button
    • Focus on tooltips on mouse over – this means you do not have to press F2 to focus a tooltip. It allows selecting text inside a tooltip just by moving the mouse into it.
    • Quickfixes are focused on mouse over too. No double clicking on the small warning icon in front of the code line anymore – just moving the mouse over the wavy line below the bad code and click on the hyperlinked quickfix.
    • Debug tooltips show more detailed information – like in the variable view.
    • Values of constants are shown in tooltips too on mouseover
    • Rearranging code elements by drag and drop in the outline
  3. Coding
    • Code completion helps with casts – it reads the type of the instanceof condition and automatically offers more methods

      Afterwards it adds the necessary cast
    • Convert to StringBuffer quick assist – is useful sometimes when refactoring bad usage of String concatenation
  4. Formatting and cleanup
    • Format edited lines only – this setting allows you to format the code you added or changed and leaving the rest of the class untouched
    • The new cleanup settings allow to correct indentation and adding unimplemented methods automatically
    • Undo formatting for a set of Java elements – If you format your whole source or a package it can be undone again
    • Comments are formatted at the same time as code is formatted – happens in one pass and is a lot faster (for big classes)

See the New and Noteworthy for the whole list of new features.

There are a lot of plugins that are released simultaneous in new versions:

  • Web Tools Project version 3.0 – now includes a very nice JavaScript editor that allows to format JavaScript code in the same way as it is possible with Java code
  • Subversive version 1.0 – the official SVN plugin the Eclipse project chose
  • Mylyn 3.0 – no list of changes available until now

Thanks to the Eclipse team for bringing us this exciting new version of such a great tool!

Maven Eclipse plugin with better WTP support

Eclipse, Java, Software No Comments »

Seems like the new version 0.9.4.20080603-0114 of the Maven Eclipse plugin now provides better supports for WTP. In the last versions I had troubles when opening or closing depending Java projects. They were not added as jar files when the utility project was closed and the source project was not added to the maven dependency when opened again.

Check out the New and Noteworthy for more details about the new version.

JavaScript games

Fun, Java, Web No Comments »

Lately there a lot of people are experimenting what is possible wiht JavaScript. Libraries like prototype and scriptaculous are building the base für writing extensive object oriented JavaScript code. Some weeks ago the nihilogic blog presented a Super Mario implemented in 14kB of code playable in the browser. It even includes music ;-)

Today I found ProtoRPG an RPG engine written in JavaScript based on prototype and scriptaculous. There is also a playable demo online.

The last example is very interesting: A japanese user group managed to port parts of the Java VM to JavaScript. It allows to convert Java into byte code and embed it into the document. They created a cool Tetris clone.

The size of java.util.Calendar

Java No Comments »

A friend of mine asked me why his Java batch job reading a 23MB text file took over 300MB Memory. He read some text and date values and stored them in String an Calendar objects. A short web search brought up this blog post of Jason Rennie writing about the size of java.util.Calendar. He points out that a single instance of java.util.Calendar takes 432 bytes of memory. This was the explanation - 500000 calendar objects need 206MB memory! This was new to me …

Internationalization and JavaScript

Java, Web 2 Comments »

Lately the amount of JavaScript in web applications has grown a lot. JavaScript has always been there but with the need of AJAX and more and more dynamical features modern web developers can not avoid it.

Luckily there are a lot of good concepts arising and libraries available (e.g. prototype, yui, …) that show how to control the JavaScript monster. Something that always bothered me was that I was not able to find a good editor for JavaScript. Since about six months I am using JSEclipse from Adobe which is a free Eclipse plugin that provides a lot support for writing JavaScript (code-completion, syntac check, …).

The JSEclipse editor allows me to edit standalone JS files and script code included in JSPs but many times I ran into the problem that I needed to mix JavaScript and Java code. For example to define an URL for an AJAX request or to get a message from a resource bundle that has to be displayed in a JavaScript dialog. The JSEclipse editor does not understand this “mixed” code parts. Additionally it is not possible to externalize the JavaScript code into external files and the code looks ugly.

Yesterday I found this article about how to do I18N in JavaScript. I like the approach with the externalized constants very much because

  • it allows me to create a central include containing all the information from Java needed for the JavaScript code -> only one place to change
  • the main JavaScript code is “JavaScript only” -> editable by the JSEclipse editor
  • the JavaScript only code may be externalized into separate files
  • the appearance of the constants instantly makes their purpose clear and the JS code looks clean

There Ain’t No Such Thing as Plain Text

Java, Web No Comments »

Jeff Atwood posted a link to a site that sells T-shirts and stickers with the following image:

unicode

I am thinking of ordering some of them. Handling encodings is a very important part of programming and from my experience a lot of developers do not care enough about it. I encourage every developer to read “The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)” from Joel Spolsky. It describes the evolution of encodings in a very easy way.

Some months ago I wrote a post about how to deal with encodings when using Tomcat as web application container.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in