From: <no...@so...> - 2001-06-22 10:56:38
|
Bugs item #434939, was updated on 2001-06-20 14:43 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100588&aid=434939&group_id=588 Category: editor core Group: normal bug Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Mysterios BeanShell Macro error Initial Comment: These Macro crashes the BeanShell: import java.io.*; File f = new File("c:\windows"); if (f.exists()) Macros.message(view, "Wow! file c:\windows exists!"); And these version of the Macros works(only variable name f changed against u): import java.io.*; File u = new File("c:\windows"); if (u.exists()) Macros.message(view, "Wow! file c:\windows exists!"); It's very mysterious. ---------------------------------------------------------------------- >Comment By: Slava Pestov (spestov) Date: 2001-06-22 03:56 Message: Logged In: YES user_id=2280 Do you have a class named 'f' in your classpath? What does entering 'f.class' (without the quotes) in Utilities->Evaluate BeanShell Expression give you? Slava ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-06-21 14:10 Message: Logged In: NO Hallo John, many thanks for your help and your interrest for my problem. I'd changed my test script because that will demonstrate that any access to the 'f' variable will crash the BeanShell. I now believe that is not a jEdit problem, because i tested these script on new BeanShell version 1.1a16 an it runs without any problems. I send you now my(or better your) test script. This is the script from your latest mail. I also append the jEdit's activity log. I hope, you can find any usable debugging information on it. With best wishes, Heiko The test script "test.bsh": f = new java.io.File("C:\windows"); if(f == null) { Macros.error(view, "Could not create File object"); } else { if(f.exists()) { Macros.message(view, "f exists"); } else { Macros.error(view, "f does not exist"); } } And here follows the activity log: [message] Log: When reporting bugs, please include the following information: [message] Log: java.version=1.3.0_01 [message] Log: java.vendor=Sun Microsystems Inc. [message] Log: java.compiler=null [message] Log: os.name=Windows 95 [message] Log: os.version=4.0 [message] Log: os.arch=x86 [message] Log: user.home=C:\WINDOWS\Profiles\heiko [notice] jEdit: jEdit version 3.1final [message] jEdit: Settings directory is C:\WINDOWS\Profiles\heiko\.jedit [debug] EditServer: jEdit server started on port 1033 [debug] EditServer: Authorization key is 1344570032 [debug] BeanShell: Initializing BeanShell interpreter [debug] jEdit: Loading site snippet: D:\java\JEdit\site-props\example.props [debug] jEdit: Loading actions from actions.xml [notice] jEdit: Loading plugins from D:\java\JEdit\jars [debug] jEdit: Scanning JAR file: D:\java\JEdit\jars\Firewall.jar [debug] jEdit: Scanning JAR file: D:\java\JEdit\jars\LatestVersion.jar [debug] jEdit: Loading actions from D:\java\JEdit\jars\LatestVersion.jar!actions.xml [debug] jEdit: Scanning JAR file: D:\java\JEdit\jars\PluginManager.jar [debug] jEdit: Loading actions from D:\java\JEdit\jars\PluginManager.jar!actions.xml [notice] jEdit: Loading plugins from C:\WINDOWS\Profiles\heiko\.jedit\jars [message] jEdit: Loading mode catalog file D:\java\JEdit\modes\catalog [debug] jEdit: Adding edit mode ada95 [debug] jEdit: Adding edit mode asp [debug] jEdit: Adding edit mode assembly-x86 [debug] jEdit: Adding edit mode awk [debug] jEdit: Adding edit mode b [debug] jEdit: Adding edit mode batch [debug] jEdit: Adding edit mode beanshell [debug] jEdit: Adding edit mode bcel [debug] jEdit: Adding edit mode c [debug] jEdit: Adding edit mode cobol [debug] jEdit: Adding edit mode coldfusion [debug] jEdit: Adding edit mode c++ [debug] jEdit: Adding edit mode c# [debug] jEdit: Adding edit mode css [debug] jEdit: Adding edit mode dsssl [debug] jEdit: Adding edit mode eiffel [debug] jEdit: Adding edit mode haskell [debug] jEdit: Adding edit mode html [debug] jEdit: Adding edit mode idl [debug] jEdit: Adding edit mode ini [debug] jEdit: Adding edit mode java [debug] jEdit: Adding edit mode javascript [debug] jEdit: Adding edit mode jmk [debug] jEdit: Adding edit mode jsp [debug] jEdit: Adding edit mode lisp [debug] jEdit: Adding edit mode makefile [debug] jEdit: Adding edit mode ml [debug] jEdit: Adding edit mode netrexx [debug] jEdit: Adding edit mode pascal [debug] jEdit: Adding edit mode patch [debug] jEdit: Adding edit mode perl [debug] jEdit: Adding edit mode php [debug] jEdit: Adding edit mode postscript [debug] jEdit: Adding edit mode povray [debug] jEdit: Adding edit mode properties [debug] jEdit: Adding edit mode python [debug] jEdit: Adding edit mode rpm-spec [debug] jEdit: Adding edit mode ruby [debug] jEdit: Adding edit mode scheme [debug] jEdit: Adding edit mode sgml [debug] jEdit: Adding edit mode shellscript [debug] jEdit: Adding edit mode shtml [debug] jEdit: Adding edit mode tcl [debug] jEdit: Adding edit mode tex [debug] jEdit: Adding edit mode texinfo [debug] jEdit: Adding edit mode text [debug] jEdit: Adding edit mode transact-sql [debug] jEdit: Adding edit mode vbscript [debug] jEdit: Adding edit mode vhdl [debug] jEdit: Adding edit mode xsl [debug] jEdit: Adding edit mode xml [message] jEdit: Loading mode catalog file C:\WINDOWS\Profiles\heiko\.jedit\modes\catalog [notice] JARClassLoader: Starting plugin FirewallPlugin (version 0.2.3) [debug] FirewallPlugin: Firewall disabled [notice] JARClassLoader: Starting plugin LatestVersionPlugin (version 1.3.7) [notice] JARClassLoader: Starting plugin PluginManagerPlugin (version 0.6.3) [debug] EditBus: org.gjt.sp.jedit.msg.MacrosChanged[source=null] [debug] EditBus: org.gjt.sp.jedit.msg.PropertiesChanged[source=null] [debug] FirewallPlugin: Firewall disabled [notice] jEdit: Loading edit mode D:\java\JEdit\modes\text.xml [debug] FileVFS: Unix operating system not detected; will not use permission-preserving code [debug] VFSManager: Registered favorites filesystem for favorites protocol [debug] VFSManager: Registered roots filesystem for roots protocol [debug] EditBus: org.gjt.sp.jedit.msg.BufferUpdate[source=Untitled-1 (D:\java\JEdit\),what=LOAD_STARTED,view=null] [debug] EditBus: org.gjt.sp.jedit.msg.BufferUpdate[source=Untitled-1 (D:\java\JEdit\),what=CREATED,view=null] [debug] EditBus: org.gjt.sp.jedit.msg.BufferUpdate[source=Untitled-1 (D:\java\JEdit\),what=LOADED,view=null] [debug] EditBus: org.gjt.sp.jedit.msg.BufferUpdate[source=Untitled-1 (D:\java\JEdit\),what=MARKERS_CHANGED,view=null] [debug] EditBus: org.gjt.sp.jedit.msg.EditorStarted[source=null] [debug] SyntaxStyle: deriveFont() available [debug] EditBus: org.gjt.sp.jedit.msg.EditPaneUpdate[source=org.gjt.sp.jedit.EditPane[,0,0,0x0,invalid,layout=java.awt.Border Layout,alignmentX=null,alignmentY=null,border=,flags=34,maximumSize=,minimumSize=,preferredSize=,defaul tLayout=java.awt.FlowLayout[hgap=5,vgap=5,align=center]],what=CREATED] [debug] EditBus: org.gjt.sp.jedit.msg.ViewUpdate[source=org.gjt.sp.jedit.View[frame0,-4,-4,808x608,invalid,hidden,layout=ja va.awt.BorderLayout,resizable,title=jEdit - Untitled-1,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23,612x546,l ayout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=1538,maximumSize =,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true],what=CREATED] [message] jEdit: Startup complete [debug] WorkThread: Work request thread starting [jEdit I/O #1] [debug] WorkThread: Work request thread starting [jEdit I/O #3] [debug] WorkThread: Work request thread starting [jEdit I/O #4] [debug] WorkThread: Work request thread starting [jEdit I/O #2] [debug] EditBus: org.gjt.sp.jedit.msg.RegistersChanged[source=null] [error] BeanShell: bsh.EvalError: Line 8 : sourced file: C:\WINDOWS\Profiles\heiko\.jedit\macros\test.bsh [error] BeanShell: bsh.EvalError: Error in method invocation: No args method exists() not found in class'f' : f .exists ( ) : [error] BeanShell: at bsh.Interpreter.eval(Interpreter.java:458) [error] BeanShell: at org.gjt.sp.jedit.BeanShell.runScript(BeanShell.java:180) [error] BeanShell: at org.gjt.sp.jedit.Macros$3.invoke(Macros.java:240) [error] BeanShell: at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:175) [error] BeanShell: at org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditAction.java:254) [error] BeanShell: at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450) [error] BeanShell: at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504) [error] BeanShell: at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378) [error] BeanShell: at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250) [error] BeanShell: at javax.swing.AbstractButton.doClick(AbstractButton.java:279) [error] BeanShell: at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:886) [error] BeanShell: at java.awt.Component.processMouseEvent(Component.java:3717) [error] BeanShell: at java.awt.Component.processEvent(Component.java:3546) [error] BeanShell: at java.awt.Container.processEvent(Container.java:1164) [error] BeanShell: at java.awt.Component.dispatchEventImpl(Component.java:2595) [error] BeanShell: at java.awt.Container.dispatchEventImpl(Container.java:1213) [error] BeanShell: at java.awt.Component.dispatchEvent(Component.java:2499) [error] BeanShell: at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451) [error] BeanShell: at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216) [error] BeanShell: at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125) [error] BeanShell: at java.awt.Container.dispatchEventImpl(Container.java:1200) [error] BeanShell: at java.awt.Window.dispatchEventImpl(Window.java:912) [error] BeanShell: at java.awt.Component.dispatchEvent(Component.java:2499) [error] BeanShell: at java.awt.EventQueue.dispatchEvent(EventQueue.java:319) [error] BeanShell: at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103) [error] BeanShell: at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [error] BeanShell: at java.awt.EventDispatchThread.run(EventDispatchThread.java:84) [debug] EditBus: org.gjt.sp.jedit.msg.EditorExitRequested[source=org.gjt.sp.jedit.View[frame0,-4,-4,808x608,invalid,layout=ja va.awt.BorderLayout,resizable,title=jEdit - Untitled-1,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,4,23,800x581,i nvalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=3586,maxim umSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]] [debug] EditBus: org.gjt.sp.jedit.msg.EditPaneUpdate[source=org.gjt.sp.jedit.EditPane[,0,0,800x502,layout=java.awt.BorderLa yout,alignmentX=null,alignmentY=null,border=,flags=34,maximumSize=,minimumSize=,preferredSize=,defaultL ayout=java.awt.FlowLayout[hgap=5,vgap=5,align=center]],what=DESTROYED] [debug] EditBus: org.gjt.sp.jedit.msg.EditorExiting[source=null] ---------------------------------------------------------------------- Comment By: John Gellene (jgellene) Date: 2001-06-21 11:23 Message: Logged In: YES user_id=117073 I'm sorry for your frustration, but it is hard to help if you change the test script. Your latest script fails because the BeanShell parser has difficulty with the blank line ending in a ';'. I duplicated the condition and it is not related to the problem you originally mentioned. Please try the following macro without modification. If it fails, post any messages written to the Activity Log. Note that the backslash in the file path must be escaped, that is, typed as two backslash characters. I mention this because the version of your message posted to the mailing list only has a single slash. f = new java.io.File("C:\windows"); if(f == null) { Macros.error(view, "Could not create File object"); } else { if(f.exists()) { Macros.message(view, "f exists"); } else { Macros.error(view, "f does not exist"); } } // Note: add an extra blank line to the end of the script I hope this is helpful. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-06-21 10:41 Message: Logged In: NO Today i tested another various things: All my personal installed Plugins was removed from jEdit. Then i started freshly up my system and of course jEdit. I type these lines in the "Untitled-1" Buffer: import java.io.*; File f = new File("C:\windows"); if (f != null) ; //do nothing here ...and save this under test.bsh. The execution of these Macro crashes the BeanShell again and again and ...... After remove all jEdit files from my directory an the new Installation of jEdit i have the same problem. BTW: I have no startup Macros or other things and the Console/BeanShell crashes also. All my tests have no results and now i have no more ideas for the solution. What's wrong? ---------------------------------------------------------------------- Comment By: John Gellene (jgellene) Date: 2001-06-20 15:34 Message: Logged In: YES user_id=117073 The 'f' macro runs correctly on my installation. You may have an 'f' variable or object sitting in your BeanShell namespace from an earlier macro invocation. Check the following: (1) Does your startup macro (if you have one) define a variable or object 'f'? (2) Does the bug occur if you run the 'f' macro immediately after startup? Does it occur if you leave 'f' untyped in your macro (which BeanShell permits)? (3) The next time the 'f' macro (or something like it) causes a BeanShell crash, evaluate this in Console/BeanShell: f != null ? "f is null" : f.toString(); ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100588&aid=434939&group_id=588 |