diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java index 245ab7542966..5b50a19288fa 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java @@ -47,15 +47,6 @@ public abstract class BaseSplitter implements Splitter { } - protected static boolean isAllWordsAreUpperCased(String[] words) { - if (words == null) return false; - for (String word : words) { - if (!Strings.isUpperCase(word)) { - return false; - } - } - return true; - } protected static boolean isAllWordsAreUpperCased(@NotNull String text, @NotNull List words) { for (TextRange word : words) { diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/IdentifierSplitter.java b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/IdentifierSplitter.java index e9e459da1b7f..e04491b28905 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/IdentifierSplitter.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/IdentifierSplitter.java @@ -33,7 +33,7 @@ public class IdentifierSplitter extends BaseSplitter { private static final Pattern WORD = Pattern.compile("\\b\\p{L}*'?\\p{L}*"); @NonNls - private static final Pattern WORD_EXT = Pattern.compile("(\\p{L}*?)[-_$\\[\\]]"); + private static final Pattern WORD_EXT = Pattern.compile("(\\p{L}*?)[-_$\\[\\]0-9]"); @NonNls private static final Pattern WORD_IN_QUOTES = Pattern.compile("'([^']*)'"); diff --git a/plugins/spellchecker/testSrc/com/intellij/spellchecker/inspector/SplitterTest.java b/plugins/spellchecker/testSrc/com/intellij/spellchecker/inspector/SplitterTest.java index 720085d84353..1d1417ffac2e 100644 --- a/plugins/spellchecker/testSrc/com/intellij/spellchecker/inspector/SplitterTest.java +++ b/plugins/spellchecker/testSrc/com/intellij/spellchecker/inspector/SplitterTest.java @@ -120,6 +120,17 @@ public class SplitterTest extends TestCase { correctListToCheck(checkAreas, text, new String[]{}); } + public void testIdentifiersWithNumbers() { + String text = "result1"; + List checkAreas = SplitterFactory.getInstance().getIdentifierSplitter().split(text); + correctListToCheck(checkAreas, text, new String[]{"result"}); + } + + public void testIdentifiersWithNumbersInside() { + String text = "result1result"; + List checkAreas = SplitterFactory.getInstance().getIdentifierSplitter().split(text); + correctListToCheck(checkAreas, text, new String[]{"result","result"}); + } public void testWordWithApostrophe2() { String text = "customers'";