[jitsi-dev] Spellcheck - Endless Loop


#1

Hey Purvesh

I ran into an endless loop when I typed just the letter "a" into a Chat-Dialog, right-clicked into the text-area and selected "Show Spelling and Grammar".

See the Threaddump below, but I guess it's the loop at SpellCheckerConfigDialog, Line 245.

Regards,
Ingo

2011-08-04 20:33:19

"AWT-EventQueue-0" - Thread t@42
   java.lang.Thread.State: RUNNABLE
  at java.text.RuleBasedBreakIterator.getCurrentCodePointCount(Unknown Source)
  at java.text.RuleBasedBreakIterator.getNextIndex(Unknown Source)
  at java.text.RuleBasedBreakIterator.handleNext(Unknown Source)
  at java.text.RuleBasedBreakIterator.previous(Unknown Source)
  at net.java.sip.communicator.plugin.spellcheck.Word.getWord(Word.java:52)
  - locked <d2d8c7> (a java.lang.Class)
  at net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog$2.getNextWord(SpellCheckerConfigDialog.java:224)
  at net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog$2.actionPerformed(SpellCheckerConfigDialog.java:248)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.AbstractButton.doClick(Unknown Source)
  at javax.swing.AbstractButton.doClick(Unknown Source)
  at net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog.<init>(SpellCheckerConfigDialog.java:107)
  at net.java.sip.communicator.plugin.spellcheck.ChatAttachments$4.actionPerformed(ChatAttachments.java:262)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.AbstractButton.doClick(Unknown Source)
  at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
  at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
  at java.awt.Component.processMouseEvent(Unknown Source)
  at javax.swing.JComponent.processMouseEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$000(Unknown Source)
  at java.awt.EventQueue$1.run(Unknown Source)
  at java.awt.EventQueue$1.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.awt.EventQueue$2.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)

   Locked ownable synchronizers:
  - None


#2

Hi Ingo,

Thanks for reporting this! I'm attaching a patch with the fix.

Thanks,
Purvesh

SpellCheckerConfigDialog.patch (1.29 KB)

···

On Fri, Aug 5, 2011 at 12:07 AM, Bauersachs Ingo <ingo.bauersachs@fhnw.ch>wrote:

Hey Purvesh

I ran into an endless loop when I typed just the letter "a" into a
Chat-Dialog, right-clicked into the text-area and selected "Show Spelling
and Grammar".

See the Threaddump below, but I guess it's the loop at
SpellCheckerConfigDialog, Line 245.

Regards,
Ingo

2011-08-04 20:33:19

"AWT-EventQueue-0" - Thread t@42
  java.lang.Thread.State: RUNNABLE
       at java.text.RuleBasedBreakIterator.getCurrentCodePointCount(Unknown
Source)
       at java.text.RuleBasedBreakIterator.getNextIndex(Unknown Source)
       at java.text.RuleBasedBreakIterator.handleNext(Unknown Source)
       at java.text.RuleBasedBreakIterator.previous(Unknown Source)
       at
net.java.sip.communicator.plugin.spellcheck.Word.getWord(Word.java:52)
       - locked <d2d8c7> (a java.lang.Class)
       at
net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog$2.getNextWord(SpellCheckerConfigDialog.java:224)
       at
net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog$2.actionPerformed(SpellCheckerConfigDialog.java:248)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at
net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog.<init>(SpellCheckerConfigDialog.java:107)
       at
net.java.sip.communicator.plugin.spellcheck.ChatAttachments$4.actionPerformed(ChatAttachments.java:262)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
       at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
       at java.awt.Component.processMouseEvent(Unknown Source)
       at javax.swing.JComponent.processMouseEvent(Unknown Source)
       at java.awt.Component.processEvent(Unknown Source)
       at java.awt.Container.processEvent(Unknown Source)
       at java.awt.Component.dispatchEventImpl(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Window.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
       at java.awt.EventQueue.access$000(Unknown Source)
       at java.awt.EventQueue$1.run(Unknown Source)
       at java.awt.EventQueue$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at
java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
       at
java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
       at java.awt.EventQueue$2.run(Unknown Source)
       at java.awt.EventQueue$2.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at
java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)

  Locked ownable synchronizers:
       - None


#3

Hi Ingo,

I've committed the patch. r8814 should fix this.

Thanks,
Purvesh

···

On Fri, Aug 5, 2011 at 1:16 PM, Purvesh Sahoo <jimpu2@gmail.com> wrote:

Hi Ingo,

Thanks for reporting this! I'm attaching a patch with the fix.

Thanks,
Purvesh

On Fri, Aug 5, 2011 at 12:07 AM, Bauersachs Ingo <ingo.bauersachs@fhnw.ch>wrote:

Hey Purvesh

I ran into an endless loop when I typed just the letter "a" into a
Chat-Dialog, right-clicked into the text-area and selected "Show Spelling
and Grammar".

See the Threaddump below, but I guess it's the loop at
SpellCheckerConfigDialog, Line 245.

Regards,
Ingo

2011-08-04 20:33:19

"AWT-EventQueue-0" - Thread t@42
  java.lang.Thread.State: RUNNABLE
       at
java.text.RuleBasedBreakIterator.getCurrentCodePointCount(Unknown Source)
       at java.text.RuleBasedBreakIterator.getNextIndex(Unknown Source)
       at java.text.RuleBasedBreakIterator.handleNext(Unknown Source)
       at java.text.RuleBasedBreakIterator.previous(Unknown Source)
       at
net.java.sip.communicator.plugin.spellcheck.Word.getWord(Word.java:52)
       - locked <d2d8c7> (a java.lang.Class)
       at
net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog$2.getNextWord(SpellCheckerConfigDialog.java:224)
       at
net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog$2.actionPerformed(SpellCheckerConfigDialog.java:248)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at
net.java.sip.communicator.plugin.spellcheck.SpellCheckerConfigDialog.<init>(SpellCheckerConfigDialog.java:107)
       at
net.java.sip.communicator.plugin.spellcheck.ChatAttachments$4.actionPerformed(ChatAttachments.java:262)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
       at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
       at java.awt.Component.processMouseEvent(Unknown Source)
       at javax.swing.JComponent.processMouseEvent(Unknown Source)
       at java.awt.Component.processEvent(Unknown Source)
       at java.awt.Container.processEvent(Unknown Source)
       at java.awt.Component.dispatchEventImpl(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
       at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Window.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
       at java.awt.EventQueue.access$000(Unknown Source)
       at java.awt.EventQueue$1.run(Unknown Source)
       at java.awt.EventQueue$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at
java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
       at
java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
       at java.awt.EventQueue$2.run(Unknown Source)
       at java.awt.EventQueue$2.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at
java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)

  Locked ownable synchronizers:
       - None