/** * Return true if the given instruction accesses a field that is a backing * field of another property in this property-access class. */ private boolean isBackingFieldOfAnotherProperty(String name, Code code) { String methName = code.getMethod().getName(); return !"<init>".equals(methName) && _backingFields != null && !name.equals(_backingFields.get(methName)) && _backingFields.containsValue(name); }
public void enterBCMethod(BCMethod obj) { openBlock("Method"); println("access=" + obj.getAccessFlags()); println("name=" + obj.getNameIndex() + " <" + obj.getName() + ">"); println("descriptor=" + obj.getDescriptorIndex()); println("return=" + obj.getReturnName()); String[] params = obj.getParamNames(); for (int i = 0; i < params.length; i++) println("param=" + params[i]); }
/** * Return true if the given instruction accesses a field that is a backing * field of another property in this property-access class. */ private boolean isBackingFieldOfAnotherProperty(String name, Code code) { String methName = code.getMethod().getName(); return !"<init>".equals(methName) && _backingFields != null && !name.equals(_backingFields.get(methName)) && _backingFields.containsValue(name); }
public void enterBCMethod(BCMethod obj) { openBlock("Method"); println("access=" + obj.getAccessFlags()); println("name=" + obj.getNameIndex() + " <" + obj.getName() + ">"); println("descriptor=" + obj.getDescriptorIndex()); println("return=" + obj.getReturnName()); String[] params = obj.getParamNames(); for (int i = 0; i < params.length; i++) println("param=" + params[i]); }
/** * Return true if the given instruction accesses a field that is a backing * field of another property in this property-access class. */ private boolean isBackingFieldOfAnotherProperty(String name, Code code) { String methName = code.getMethod().getName(); return !"<init>".equals(methName) && _backingFields != null && !name.equals(_backingFields.get(methName)) && _backingFields.containsValue(name); }
/** * Return true if the given instruction accesses a field that is a backing * field of another property in this property-access class. */ private boolean isBackingFieldOfAnotherProperty(String name, Code code) { String methName = code.getMethod().getName(); return !"<init>".equals(methName) && _backingFields != null && !name.equals(_backingFields.get(methName)) && _backingFields.containsValue(name); }
/** * Return true if the given instruction accesses a field that is a backing * field of another property in this property-access class. */ private boolean isBackingFieldOfAnotherProperty(String name, Code code) { String methName = code.getMethod().getName(); return !"<init>".equals(methName) && _backingFields != null && !name.equals(_backingFields.get(methName)) && _backingFields.containsValue(name); }
/** * Return the declared method with the given name, or null if none. * If multiple methods are declared with the given name, which is returned * is undefined. * Note that in bytecode, constructors are named <code><init></code> * and static initializers are named <code><clinit></code>. */ public BCMethod getDeclaredMethod(String name) { BCMethod[] methods = getDeclaredMethods(); for (int i = 0; i < methods.length; i++) if (methods[i].getName().equals(name)) return methods[i]; return null; }
/** * Return the declared method with the given name, or null if none. * If multiple methods are declared with the given name, which is returned * is undefined. * Note that in bytecode, constructors are named <code><init></code> * and static initializers are named <code><clinit></code>. */ public BCMethod getDeclaredMethod(String name) { BCMethod[] methods = getDeclaredMethods(); for (int i = 0; i < methods.length; i++) if (methods[i].getName().equals(name)) return methods[i]; return null; }
/** * Removes a method from this class. After this method, the removed method * will be invalid, and the result of any operations on it is undefined. * * @return true if this class contained the method, false otherwise */ public boolean removeDeclaredMethod(BCMethod method) { if (method == null) return false; return removeDeclaredMethod(method.getName(), method.getParamNames()); }
/** * Removes a method from this class. After this method, the removed method * will be invalid, and the result of any operations on it is undefined. * * @return true if this class contained the method, false otherwise */ public boolean removeDeclaredMethod(BCMethod method) { if (method == null) return false; return removeDeclaredMethod(method.getName(), method.getParamNames()); }
private void registerBackingFieldInfo(FieldMetaData fmd, BCMethod method, BCField field) { if (_backingFields == null) _backingFields = new HashMap(); _backingFields.put(method.getName(), field.getName()); if (_attrsToFields == null) _attrsToFields = new HashMap(); _attrsToFields.put(fmd.getName(), field.getName()); if (_fieldsToAttrs == null) _fieldsToAttrs = new HashMap(); _fieldsToAttrs.put(field.getName(), fmd.getName()); }
private void registerBackingFieldInfo(FieldMetaData fmd, BCMethod method, BCField field) { if (_backingFields == null) _backingFields = new HashMap(); _backingFields.put(method.getName(), field.getName()); if (_attrsToFields == null) _attrsToFields = new HashMap(); _attrsToFields.put(fmd.getName(), field.getName()); if (_fieldsToAttrs == null) _fieldsToAttrs = new HashMap(); _fieldsToAttrs.put(field.getName(), fmd.getName()); }
private void registerBackingFieldInfo(FieldMetaData fmd, BCMethod method, BCField field) { if (_backingFields == null) _backingFields = new HashMap(); _backingFields.put(method.getName(), field.getName()); if (_attrsToFields == null) _attrsToFields = new HashMap(); _attrsToFields.put(fmd.getName(), field.getName()); if (_fieldsToAttrs == null) _fieldsToAttrs = new HashMap(); _fieldsToAttrs.put(field.getName(), fmd.getName()); }
private void registerBackingFieldInfo(FieldMetaData fmd, BCMethod method, BCField field) { if (_backingFields == null) _backingFields = new HashMap(); _backingFields.put(method.getName(), field.getName()); if (_attrsToFields == null) _attrsToFields = new HashMap(); _attrsToFields.put(fmd.getName(), field.getName()); if (_fieldsToAttrs == null) _fieldsToAttrs = new HashMap(); _fieldsToAttrs.put(field.getName(), fmd.getName()); }
private void registerBackingFieldInfo(FieldMetaData fmd, BCMethod method, BCField field) { if (_backingFields == null) _backingFields = new HashMap(); _backingFields.put(method.getName(), field.getName()); if (_attrsToFields == null) _attrsToFields = new HashMap(); _attrsToFields.put(fmd.getName(), field.getName()); if (_fieldsToAttrs == null) _fieldsToAttrs = new HashMap(); _fieldsToAttrs.put(field.getName(), fmd.getName()); }
/** * Set the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethod(BCMethod method) { if (method == null) return setMethodIndex(0); return setMethod(method.getDeclarer().getName(), method.getName(), method.getReturnName(), method.getParamNames(), false); }
/** * Set the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethod(BCMethod method) { if (method == null) return setMethodIndex(0); return setMethod(method.getDeclarer().getName(), method.getName(), method.getReturnName(), method.getParamNames(), false); }
/** * Import the information in the given method as a new method of this class. * * @return the added method */ public BCMethod declareMethod(BCMethod method) { BCMethod newMethod = declareMethod(method.getName(), method.getReturnName(), method.getParamNames()); newMethod.setAccessFlags(method.getAccessFlags()); newMethod.setAttributes(method.getAttributes()); return newMethod; }
/** * Import the information in the given method as a new method of this class. * * @return the added method */ public BCMethod declareMethod(BCMethod method) { BCMethod newMethod = declareMethod(method.getName(), method.getReturnName(), method.getParamNames()); newMethod.setAccessFlags(method.getAccessFlags()); newMethod.setAttributes(method.getAttributes()); return newMethod; }