Home » Author Archives: Rudiger Herrmann

Author Archives: Rudiger Herrmann

Getting Started with JGit

git-logo

If you ever wondered how basic Git commands like git init, git checkout and so on are executed in JGit, read on. This tutorial gives an overview of the most commonly used git commands and their counterparts in JGit. It walks through the steps to create a repository, fetch contents from a remote, add and remove files to/from the history, ...

Read More »

Gonsole 1.2: Open Git Consoles from Everywhere

git-logo

We have added a little feature to the Git Console for the Eclipse IDE that may be helpful here and there.                       In the Show In menu (Alt+Shift+W) there is now an entry for the Git Console. The entry is available if a single a file, folder or project is ...

Read More »

How to Clone Git Repositories with JGit

git-logo

Whatever you plan to do with an existing repository, first a clone has to be created. Whether you plan to contribute or just want to peek at its history, a local copy of the repository is needed. While cloning a repository with JGit isn’t particularly difficult, there are a few details that might be worth noting. And because there are ...

Read More »

From Arrays to Streams and Back with Java 8

java-logo

Not long ago we upgraded some Eclipse plug-in projects to Java 8. And never looked back since. Among many other things, filtering, mapping, and finding elements in collections has become so much easier and more concise with lambdas and the streams API. Nothing new so far for the most of you, I guess. But many existing APIs use arrays in ...

Read More »

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 »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials