diff --git a/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java b/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java index 90dc298b4..4d2fe7546 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java @@ -21,6 +21,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.List; import org.apache.poi.POIOLE2TextExtractor; import org.apache.poi.hdgf.HDGFDiagram; @@ -65,26 +66,25 @@ public final class VisioTextExtractor extends POIOLE2TextExtractor { * @return An array of each Text item in the document */ public String[] getAllText() { - ArrayList text = new ArrayList<>(); + List text = new ArrayList<>(); for(Stream stream : hdgf.getTopLevelStreams()) { findText(stream, text); } return text.toArray( new String[text.size()] ); } - private void findText(Stream stream, ArrayList text) { + private void findText(Stream stream, List text) { if(stream instanceof PointerContainingStream) { PointerContainingStream ps = (PointerContainingStream)stream; - for(int i=0; i 0) { // First command @@ -93,7 +93,7 @@ public final class VisioTextExtractor extends POIOLE2TextExtractor { // Capture the text, as long as it isn't // simply an empty string String str = cmd.getValue().toString(); - if(str.equals("") || str.equals("\n")) { + if(str.isEmpty() || "\n".equals(str)) { // Ignore empty strings } else { text.add( str );