Home » Author Archives: Rudiger Herrmann

Author Archives: Rudiger Herrmann

Getting Java Event Notification Right

java-logo

Implementing the observer pattern to provide Java event notification seems to be a straight forward thing to do. However there are some pitfalls one easily can run into. Here comes an explanation of common mistakes I carelessly have produced myself on various occasions… Java Event Notification Let’s start with a simple bean StateHolder that encapsulates a private int field state ...

Read More »

How to Map Distinct Value Types Using Java Generics

java-logo

Occasionally the average developer runs into a situation where he has to map values of arbitrary types within a particular container. However the Java collection API provides container related parameterization only. Which limits the type safe usage of HashMap for example to a single value type. But what if you want to mix apples and pears? Luckily there is an ...

Read More »

OSGi Service Test Helper: ServiceRegistrationRule

osgi-alliance-logo

OSGi Service Tests can be an efficient means to avoid problems related to dangling service references. As promised in my post about writing simple service contribution verifications, this time I introduce a JUnit rule that assists in testing interactions between components. OSGi Service Tests for Component Interaction Assume we have a service that notifies related observers bound according to the ...

Read More »

SWT Look and Feel: Customize FlatScrollBar Color and More

java-logo

Recently I introduced a custom slider control useful for improving the SWT look and feel of more subtle view layouts. Happily it seems the widget already found early adopters outside of the Code Affine world. Which led to some enhancements that will be presented in the following sections.                 SWT Look and Feel ...

Read More »

JGit Authentication Explained

git-logo

Authentication in JGit is mostly on par with native Git. Commonly used protocols like SSH and HTTP(S) and their authentication methods are supported. This article summarizes how to use the JGit authentication API to securely access remote Git repositories. Though the examples in this article use the CloneCommand, the described techniques can be applied to all classes that connect to ...

Read More »

Explore Git Internals with the JGit API

git-logo

Have you ever wondered how a commit and its content is stored in Git? Well, I have, and I had some spare time over the last rainy weekend, so I did a little research. Because I feel more at home with Java than with Bash, I used JGit and a couple of learning tests to explore the Git internals of ...

Read More »

Eclipse Extension Point Evaluation Made Easy

eclipse-logo

Coding Eclipse Extension Point evaluations comes in a bit verbose and sparsely self-explaining. As I got round to busy myself with this topic recently, I wrote a little helper with the intent to reduce boilerplate code for common programming steps, while increasing development guidance and readability at the same time. It turned out to be not that easy to find ...

Read More »

JUnit in a Nutshell: Yet Another JUnit Tutorial

junit-logo

Why Another JUnit Tutorial? JUnit seems to be the most popular testing tool for developers within the Java world. So it is no wonder that there have been written some good books about this topic. But I still meet quite often programmers, who at most have a vague understanding of the tool and its proper usage. Hence I had the ...

Read More »

How to Access a Git Repository with JGit

git-logo

A Git repository is represented in JGit through the Repository class that can be viewed as a handle to a repository. With a Repository instance, you can create JGit commands (through the Git factory class), gain access to configuration settings, resolve refs, etc. There are several ways to obtain a repository reference and because I have seen people having trouble ...

Read More »

How to Safely Use SWT’s Display asyncExec

java-logo

Most user interface (UI) toolkits are single-threaded and SWT is no exception. This means that UI objects must be accessed exclusively from a single thread, the so-called UI thread. On the other hand, long running tasks should be executed in background threads in order to keep the UI responsive. This makes it necessary for the background threads to enqueue updates ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.