Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.6.4, 1.7-beta-1
-
Fix Version/s: None
-
Component/s: groovy-jdk
-
Labels:None
-
Environment:Windows XP, Java 1.6
-
Number of attachments :
Description
I compile GroovyBean with @Bindable and/or @Vetoable annotations to Java bytecode. I want to use this class in a Java application. But when I compile the Java class I get the following error:
CarApp.java:11: cannot find symbol
symbol : method addPropertyChangeListener(<anonymous java.beans.PropertyChangeListener>)
location: class CarBean
car.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
^
The strange thing is that when I look with javap in the generated Groovy class I see the method is available.
Groovy class:
import groovy.beans.*
class Car {
int numberOfDoors
@Vetoable String model
@Vetoable String brand
boolean automatic
@Bindable double price
String toString() {
"[Car details => brand: '$
', model: '$
{model}', #doors: '$
{numberOfDoors}', automatic: '$
{automatic}', price: '$
{price}']"
}
}
Java class:
import java.beans.*;
public class CarApp {
public static void main(String[] args) throws Exception {
Car car = new Car();
car.setNumberOfDoors(3);
car.setModel("A3");
car.setBrand("AUDI");
car.setPrice(32010);
car.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt)
});
}
}