Eclipse JDT Tutorial: Find All References of a Method

When using JDT, you may want to find all references of a given method and then do something with the references. This can be done by using method JDTSearchProvider.searchMethodReference(). The following is sample code: // First of all, get all the type declaration of the class. IType [] typeDeclarationList = unit.getTypes();   for (IType typeDeclaration … Read more

Java Design Pattern: Decorator – Decorate your girlfriend

Decorator pattern adds additional features to an existing object dynamically. In this post, I will use a simple example – decorate your girlfriend – to illustrate how decorator pattern works. 1. Decorator Pattern Story Let’s assume you are looking for a girlfriend. There are girls from different countries such as America, China, Japan, France, etc. … Read more

java io class hierarchy diagram

The large number of classes in the Java IO package is overwhelming and annoying. However, if we use Java, we still need to understand those classes. In fact, the classes in Java IO package is not very complex, but we need a good way to learn those. There are two important factors for understanding the … Read more

Parse HTML in Java

This code example shows how to parse HTML in Java by using jsoup. As there are many libraries for various purposes, there are a lot of html parser in Java. A lot of developers wonder which one is the best before they made a decision on an HTML parser. Jsoup is a very good start. … Read more

OpenNLP Tutorial

The Apache OpenNLP library is a machine learning based toolkit for processing of natural language text. It includes a sentence detector, a tokenizer, a name finder, a parts-of-speech (POS) tagger, a chunker, and a parser. It has very good APIs that can be easily integrated with a Java program. However, the documentation contains unupdated information. … Read more

Research in Software Engineering – Available Data/Artifacts

For software engineering research, there are various kinds of data available for analysis. Those are called software artifacts and they can be generated during any stage of software lifecycle, such as design, development, testing, maintenance, etc. This is the directory of artifacts available and their download addresses. I have done investigation on different kinds of … Read more