PreviousNextTracker indexSee it online !

(177/231) 3598588 - Parser Exception with invalid BeanShell Expression

The following steps throw a Parser Exception in JEdit 5.0.0

1. Start jEdit with an empty file
2. Flow menu Utilities/BeanShell/Evaluate BeanShell Expression
3. Enter "/" as an expression
4. Click OK


Parse error at line 1, column 1. Encountered: /
at org.gjt.sp.jedit.bsh.Parser.generateParseException(Parser.java:5806)
at org.gjt.sp.jedit.bsh.Parser.jj_consume_token(Parser.java:5758)
at org.gjt.sp.jedit.bsh.Parser.Line(Parser.java:148)
at org.gjt.sp.jedit.bsh.Interpreter.Line(Interpreter.java:998)
at org.gjt.sp.jedit.bsh.Interpreter.eval(Interpreter.java:634)
at org.gjt.sp.jedit.bsh.Interpreter.eval(Interpreter.java:738)
at org.gjt.sp.jedit.bsh.Interpreter.eval(Interpreter.java:727)
at org.gjt.sp.jedit.BeanShellFacade._eval(BeanShellFacade.java:148)
at org.gjt.sp.jedit.BeanShell.showEvaluateDialog(BeanShell.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gjt.sp.jedit.bsh.Reflect.invokeMethod(Reflect.java:134)
at org.gjt.sp.jedit.bsh.Reflect.invokeStaticMethod(Reflect.java:98)
at org.gjt.sp.jedit.bsh.Name.invokeMethod(Name.java:871)
at org.gjt.sp.jedit.bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
at org.gjt.sp.jedit.bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
at org.gjt.sp.jedit.bsh.BSHBlock.evalBlock(BSHBlock.java:130)
at org.gjt.sp.jedit.bsh.BSHBlock.eval(BSHBlock.java:80)
at org.gjt.sp.jedit.bsh.BshMethod.invokeImpl(BshMethod.java:362)
at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:258)
at org.gjt.sp.jedit.bsh.BshMethod.invoke(BshMethod.java:186)
at org.gjt.sp.jedit.BeanShellFacade.runCachedBlock(BeanShellFacade.java:225)
at org.gjt.sp.jedit.BeanShell.runCachedBlock(BeanShell.java:431)
at org.gjt.sp.jedit.BeanShellAction.invoke(BeanShellAction.java:73)
at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:342)
at org.gjt.sp.jedit.jEdit$4.invokeAction(jEdit.java:3386)
at org.gjt.sp.jedit.jEdit$4.invokeAction(jEdit.java:3368)
at org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditAction.java:212)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

Submitted baonn - 2012-12-27 - 03:47:02z Assigned nobody
Priority 5 Category None
Status Open Group None
Resolution Works For Me Visibility No

Comments

2012-12-27 - 04:19:23z
ezust
That's exactly what the console beanshell does too. So if it is a bug, what is the proper behavior in response to an invalid beanshell expression? An error message ?
2012-12-27 - 04:37:44z
ezust
Is the error the fact that you *also* see a stack trace which might help people for debugging?
2012-12-27 - 15:15:05z
baonn
Actually this bug (and some others reported by myself here) was reported by our automated model-based GUI testing tool called GUITAR (http://guitar.sourceforge.net). The tool automatically generates and executes a large number of test cases o GUI application and report any uncaught exception. This exception was thrown when the tool navigated to the Evaluate BeanShell Expression window, entered a text containing a "/" and clicked "OK".

We are currently use jEdit as one of our subject applications for our experiments. Here is the testing status for jEdit.
http://samwise.cs.umd.edu:8080/view/JE-ca/

Attachments