#vulnerable code 
                             final protected void getFragments(String originalText,
			FragmentList fragments, int vectorOffset) {
		originalTextLength = originalText.length();
		if (splitPos == null)
			splitPos = new TreeSet<Integer>();
		splitPos.clear();
		check(originalText);
		Iterator<Integer> splitIterator = splitPos.iterator();
		int pos = 0;
		Fragment lastFragment = null;
		while (splitIterator.hasNext()) {
			int nextSplitPos = splitIterator.next();
			lastFragment = fragments.addOriginalText(originalText.substring(
					pos, nextSplitPos), vectorOffset, lastFragment == null);
			pos = nextSplitPos;
		}
		if (pos < originalText.length())
			lastFragment = fragments.addOriginalText(originalText
					.substring(pos), vectorOffset, lastFragment == null);
		lastFragment.setEdge(true);
	} 
                            #location 20 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             final protected void getFragments(String originalText,
			FragmentList fragments, int vectorOffset) {
		originalTextLength = originalText.length();
		if (splitPos == null)
			splitPos = new TreeSet<Integer>();
		splitPos.clear();
		check(originalText);
		Iterator<Integer> splitIterator = splitPos.iterator();
		int pos = 0;
		Fragment lastFragment = null;
		while (splitIterator.hasNext()) {
			int nextSplitPos = splitIterator.next();
			lastFragment = fragments.addOriginalText(originalText.substring(
					pos, nextSplitPos), vectorOffset, lastFragment == null);
			pos = nextSplitPos;
		}
		if (pos < originalText.length())
			lastFragment = fragments.addOriginalText(originalText
					.substring(pos), vectorOffset, lastFragment == null);
		if (lastFragment != null)
			lastFragment.setEdge(true);
	}