diff --git a/examples/spellcheckscr/src/main/java/org/apache/felix/examples/spellcheckscr/SpellCheckServiceImpl.java b/examples/spellcheckscr/src/main/java/org/apache/felix/examples/spellcheckscr/SpellCheckServiceImpl.java index 099795df135..42d174a9f83 100644 --- a/examples/spellcheckscr/src/main/java/org/apache/felix/examples/spellcheckscr/SpellCheckServiceImpl.java +++ b/examples/spellcheckscr/src/main/java/org/apache/felix/examples/spellcheckscr/SpellCheckServiceImpl.java @@ -93,6 +93,7 @@ public String[] check( String passage ) if ( dictionary.checkWord( word ) ) { correct = true; + break; } } @@ -105,7 +106,7 @@ public String[] check( String passage ) } // Return null if no words are incorrect. - if ( errorList.size() == 0 ) + if ( errorList.isEmpty() ) { return null; }