Are strSet1and strSet2initialized before that? If they are zero, you will get NullPointerException.
* EDIT *
You cannot call .append()(or any other method) for a variable null. Initialize them as:
StringBuffer strSet1 = new StringBuffer();
StringBuffer strSet2 = new StringBuffer();
source
share