It’s the table sorter stupid

Today, I just trapped into those pitfalls where thinking in terms of complexity fails. I got the following error message when sorting entries of a JFace TableViewer:

!MESSAGE Workaround for comparator violation:
    - set system property java.util.Arrays.useLegacyMergeSort=true
    - use a 1.6 JRE
message: Comparison method violates its general contract!

Here’s a part of the stack trace:

java.lang.IllegalArgumentException: Comparison method violates its general contract!
    at java.util.TimSort.mergeLo(TimSort.java:747)
    at java.util.TimSort.mergeAt(TimSort.java:483)
    at java.util.TimSort.mergeCollapse(TimSort.java:408)
    at java.util.TimSort.sort(TimSort.java:214)
    at java.util.TimSort.sort(TimSort.java:173)
    at java.util.Arrays.sort(Arrays.java:659)
    at org.eclipse.jface.viewers.ViewerComparator.sort(ViewerComparator.java:189)

I thought that something with the TableViewer is wrong, … or with the data, … or with the label provider, … or with the content provider. Finally, I had a look at the sort algorithm:

int sortOrder = 0;
int size2 = result2.size();
int size1 = result1.size();
sortOrder = (size2 > size1) ? 1 : -1;

If size2 and size1 are the same it crashes, cause 0 shall be returned but in all cases -1 was returned. The following fix made it work.

int sortOrder = 0;
int size2 = result2.size();
int size1 = result1.size();
if(size2 != size1) {
	sortOrder = (size2 > size1) ? 1 : -1;
}

Stupid little mistake :-)!

Posted in Uncategorized | 2 Comments

Eclipse meets Europe

Eclipse-Europe
Foto (C) by Dany Gellert

But Hamburg got foggy again … :-(

Posted in Uncategorized | Leave a comment

Gimp 2.8 – Eclipse Splash

I was wondering why the splash screen is not visible anymore after using Gimp 2.8 to create the *.bmp file. It’s the color profile option that needs to be deactivated. Here’s the workflow:

Create a splash design with Inkscape:

Width: 455 px
Height: 295 px

Export the design to *.png format (90 dpi).

Splash Inkscape

Then open the *.png file with Gimp and export it to *.bmp format.

Splash Gimp

Use the options:

Compatitbility:
> Don’t write color information
24 Bit
> R8 G8 B8

That’s it :-).

Posted in Uncategorized | Leave a comment

Eclipse Hackathon 2015/01 – Hamburg

We had our first 2015 Eclipse Hackathon last friday in Hamburg. The next one will follow approximately in April.

Eclipse-Hackathon-HH-2015

It was a great meeting and I’d like to encourage others to do the same :-).

Posted in Uncategorized | Leave a comment

OSGi “visibility:=reexport” directive

After removing some “visibility:=reexport” directives in my plugins, my workspace crashed as hell. The Eclipse problems view and the error messages where also quite confusing and misleading. Anyhow, I managed to fix all issues after investing some hours of work. I decided to import all needed dependencies in the MANIFEST.MF directly from now on. Furthermore, I decided to not use the “visibility:=reexport” directive anymore.

How are your experiences?

Posted in Uncategorized | 5 Comments

Eclipse Hackathon Hamburg – 2015/01

Folks, it’s time for our next Eclipse Hackathon in Hamburg, Germany!

2015/01/23, 17:30
Hapag-Lloyd AG
Rosenstra├če 17
20095 Hamburg
Germany

https://wiki.eclipse.org/Hackathon_Hamburg_2015

Eclipse is a community-driven platform! Don’t miss to join the event! Food and beverages are supplied too!

Posted in Uncategorized | Leave a comment

OpenChrom 0.9.0 “Mattauch” GA

I proudly announce the official release of OpenChrom 0.9.0 “Mattauch”.
Some new data converters and a lot of improvements have been added. Stay tuned.
Moreover, use IdeaScale to submit new ideas.

https://www.openchrom.net/download

Tell us your ideas and vote!

http://openchrom.ideascale.com

Images tell more than words!

Overlay

PCA

Molecule

Posted in Uncategorized | 2 Comments