M201370367 / beanshell2

Automatically exported from code.google.com/p/beanshell2
0 stars 1 forks source link

Pattern and Matcher not imported automatically #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.BeanShell 2.1b5 - http://code.google.com/p/beanshell2
bsh % Pattern.compile("");
// Error: EvalError: Attempt to resolve method: compile() on undefined variable 
or class name: Pattern : at Line: 1 : in file: <unknown file> : Pattern 
.compile ( "" )

What version of the product are you using? On what operating system?
2.1b5, running on Windows 7.

>java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

Please provide any additional information below.

I am a bit new to BeanShell, so there is a good chance I am missing something, 
however I would have thought that if most of Java's standard library was 
included automatically, then it is a little strange to not include 
Pattern/Matcher.

Original issue reported on code.google.com by GencoreO...@gmail.com on 6 Feb 2012 at 4:09

GoogleCodeExporter commented 9 years ago
Package "java.util.regex" was never included in the 'standard import' packages. 
Doing so now could break existing scripts, so I doubt it would be a good idea 
to change this.

Original comment by pejob...@gmail.com on 7 Feb 2012 at 7:54

GoogleCodeExporter commented 9 years ago
Fair enough, I just thought it was a little odd that the regex packages were 
not included automatically as they are powerful. Happy for the issue to be 
closed.

Original comment by GencoreO...@gmail.com on 7 Feb 2012 at 8:20