|
From: <no...@so...> - 2001-06-21 18:23:53
|
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: 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 |