public void addProperty(PropertyNode node) { node.setDeclaringClass(redirect()); FieldNode field = node.getField(); addField(field); final ClassNode r = redirect(); if (r.properties == null) r.properties = new ArrayList<PropertyNode>(); r.properties.add(node); }
private Variable findClassMember(ClassNode cn, String name) { if (cn == null) return null; if (cn.isScript()) { return new DynamicVariable(name, false); } for (FieldNode fn : cn.getFields()) { if (fn.getName().equals(name)) return fn; } for (MethodNode mn : cn.getMethods()) { String pName = getPropertyName(mn); // GRECLIPSE: start // must set the declaringClass /*old{ if (pName != null && pName.equals(name)) return new PropertyNode(pName, mn.getModifiers(), getPropertyType(mn), cn, null, null, null); */ // newcode if (pName != null && pName.equals(name)) { PropertyNode property = new PropertyNode(pName, mn.getModifiers(), getPropertyType(mn), cn, null, null, null); property.setDeclaringClass(cn); property.getField().setDeclaringClass(cn); return property; } // GRECLIPSE: end } for (PropertyNode pn : cn.getProperties()) { if (pn.getName().equals(name)) return pn; } Variable ret = findClassMember(cn.getSuperClass(), name); if (ret != null) return ret; return findClassMember(cn.getOuterClass(), name); }