groovy

Calling intValue on a bound variable fails with java.lang.IncompatibleClassChangeError

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-JSR-6
  • Component/s: None
  • Labels:
    None
  • Environment:
    any java platform
  • Number of attachments :
    1

Description

How does one call methods on variables passed via a Binding object? The following simple example where y is a variable passed in Binding object and is an Integer object fails to run in the script line "foo"

//-----------------------------java code-----------------------------
package groovytest;

import groovy.lang.Binding;
import groovy.lang.GroovyShell;
import groovy.lang.Script;
import java.util.HashMap;

public class GroovyJavaInterOpTest {
final static int NUMRUNNERS = 2;
static String scrStr1 =
"def foo\n" +
"{\n" + " println x;\n" + "}\n" +
"foo\n" +
"";
public static void main(String[] args) throws Exception { GroovyShell gr = new GroovyShell(); Script sc = gr.parse(scrStr1); HashMap map = new HashMap(); map.put("y", new Integer(4)); sc.setBinding(new Binding(map)); sc.run(); }
}
//----------------------------end-java-code---------------------------------

Activity

Hide
S Vinayaka added a comment -

test java file

Show
S Vinayaka added a comment - test java file
Hide
S Vinayaka added a comment -

This bug is not reproducible with 1.0-JSR-6.

Show
S Vinayaka added a comment - This bug is not reproducible with 1.0-JSR-6.
Hide
S Vinayaka added a comment -

Closed this issue as this is not reproducible in version 6.

Show
S Vinayaka added a comment - Closed this issue as this is not reproducible in version 6.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: