From: SourceForge.net <no...@so...> - 2006-12-31 19:19:22
|
Patches item #1611766, was opened at 2006-12-08 11:05 Message generated for change (Comment added) made by ezust You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=1611766&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kazutoshi Satoda (k_satoda) >Assigned to: Alan Ezust (ezust) Summary: avoid NPE from getIndentRules() Initial Comment: At jEdit trunk r8210, I saw a NPE from getIndentRulse(). I could reproduce it with [Record Temporary Macro] > [Stop Recording]. The attached patch will fix this problem. Though the patch is working fine, I don't know why lineMgr.getLineContext(line) returns null with the above operation. I made this patch to be the least change to avoid an actual problem. But the function seemed to rely on some unclear non-null assumptions. - tokenMarker.getMainRuleSet() - getMainRuleSet().getModeName() - jEdit.getMode(modeName) - getMode(modeName).getIndentRules() If these can be problems, I think the patch should be revised. ---------------------------------------------------------------------- >Comment By: Alan Ezust (ezust) Date: 2006-12-31 11:19 Message: Logged In: YES user_id=935841 Originator: NO I can reproduce the bug. I haven't investigated further as to why those conditions are not true, so if you have any additional information after i've applied the patch, please let us know. thanks again for your help! --alan ---------------------------------------------------------------------- Comment By: Kazutoshi Satoda (k_satoda) Date: 2006-12-08 12:19 Message: Logged In: YES user_id=1483238 Originator: YES Nothing else, I think. I can reproduce it with my 2 keyboard shortcuts (F11 > S+F11). There is nothing between them. It also can be reproduced by selecting menus. Here is the error messages from the case of shortcuts. java.lang.NullPointerException at org.gjt.sp.jedit.buffer.JEditBuffer.getIndentRules(JEditBuffer.java:2467) at org.gjt.sp.jedit.buffer.JEditBuffer.getIdealIndentForLine(JEditBuffer.java:989) at org.gjt.sp.jedit.buffer.JEditBuffer.indentLine(JEditBuffer.java:907) at org.gjt.sp.jedit.Macros$Recorder.dispose(Macros.java:872) at org.gjt.sp.jedit.Macros$Recorder.access$000(Macros.java:746) at org.gjt.sp.jedit.Macros.stopRecording(Macros.java:557) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at bsh.Reflect.invokeMethod(Reflect.java:134) at bsh.Reflect.invokeStaticMethod(Reflect.java:98) at bsh.Name.invokeMethod(Name.java:874) at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47) at bsh.BSHBlock.evalBlock(BSHBlock.java:130) at bsh.BSHBlock.eval(BSHBlock.java:80) at bsh.BshMethod.invokeImpl(BshMethod.java:362) at bsh.BshMethod.invoke(BshMethod.java:258) at bsh.BshMethod.invoke(BshMethod.java:186) at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:509) at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:76) at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:415) at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:381) at org.gjt.sp.jedit.gui.DefaultInputHandler.handleKey(DefaultInputHandler.java:373) at org.gjt.sp.jedit.input.AbstractInputHandler.processKeyEventKeyStrokeHandling(AbstractInputHandler.java:116) at org.gjt.sp.jedit.gui.InputHandler.processKeyEvent(InputHandler.java:184) at org.gjt.sp.jedit.textarea.TextArea.processKeyEvent(TextArea.java:4572) 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.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(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.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) ---------------------------------------------------------------------- Comment By: Matthieu Casanova (kpouer) Date: 2006-12-08 11:25 Message: Logged In: YES user_id=285591 Originator: NO Hi, I do not understand how do you reproduce your NPE ? Just record temporary macro and stop recording ? nothing else ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=1611766&group_id=588 |