Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-rc-2
-
None
-
None
Description
Both transformations do not add a method with the following signature
public PropertyChangeListener[] getPropertyChangeListeners( String propName )
The following code will remedy that situation
// add method: // PropertyChangeSupport[] getPropertyChangeListeners(String name) { // return this$propertyChangeSupport.getPropertyChangeListeners(name) // } declaringClass.addMethod( new MethodNode( "getPropertyChangeListeners", ACC_PUBLIC | ACC_SYNTHETIC, pclClassNode.makeArray(), new Parameter[]{new Parameter(ClassHelper.STRING_TYPE, "name")}, ClassNode.EMPTY_ARRAY, new ReturnStatement( new ExpressionStatement( new MethodCallExpression( new FieldExpression(pcsField), "getPropertyChangeListeners", new ArgumentListExpression( new Expression[]{ new VariableExpression("name")}))))));