cbuschka / beanshell2

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

Method size() not found on unmodifiable list #98

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Invoke a command-line interpreter as:
  java -cp bsh-2.1.7.jar bsh.Interpreter

Then, in the shell run the following:
  a = new ArrayList();
  print(a.size()); // prints 0
  b = Collections.unmodifiableList(a);
  print(b.size()); // fails

What is the expected output? What do you see instead?
Run the above script, and you should see 0 printed twice, once for the size of 
"a" and the other for the size of "b". You get the first zero and then this 
output:

// Error: EvalError: Error in method invocation: Method size() not found in 
class'java.util.Collections$UnmodifiableRandomAccessList' : at Line: 4 : in 
file: <unknown file> : b .size ( )

What version of the product are you using? On what operating system?
Version 2.1.7 on Linux

Please provide any additional information below.
This worked ok on 2.1.6.

Original issue reported on code.google.com by ukcue...@gmail.com on 10 Feb 2014 at 2:10

GoogleCodeExporter commented 8 years ago
Not reproducible with latest revision

Original comment by pejob...@gmail.com on 10 Feb 2014 at 2:58

GoogleCodeExporter commented 8 years ago

Original comment by pejob...@gmail.com on 10 Feb 2014 at 2:58