if (replace != null) {
if (replace != null && !replace.equals(oldWord)) {
    public void spellingError(SpellCheckEvent event) {        noerrors = false;        int oldLength = event.getInvalidWord().length();        int start     = event.getWordContextPosition() + offset;        int end       = start + oldLength;        Selection s   = new Selection.Range(start, end);        area.setCaretPosition(start);        area.scrollToCaret(true);        area.setSelection(s);        dlg.show(event);        String replace = event.getReplaceWord();        if (replace != null) {            area.setSelectedText(replace);            if (caretPosn > start) {                int diff = replace.length() - oldLength;                caretPosn += diff;            }        }    }