/** * Creates a new method on the generated class that overrides the given methods, unless a method with the same signature has * already been overridden. * * @param method The method to override * @param identifier The identifier of the method to override * @param creator The {@link MethodBodyCreator} used to create the method body * @return {@code false} if the method has already been overridden */ protected boolean overrideMethod(ClassMethod method, MethodIdentifier identifier, MethodBodyCreator creator) { if (!overriddenMethods.contains(identifier)) { overriddenMethods.add(identifier); creator.overrideMethod(method, null); return true; } return false; }
/** * Creates a new method on the generated class that overrides the given methods, unless a method with the same signature has * already been overridden. * * @param method The method to override * @param identifier The identifier of the method to override * @param creator The {@link MethodBodyCreator} used to create the method body * @return {@code true} if the method was successfully overridden, {@code false} otherwise */ protected boolean overrideMethod(Method method, MethodIdentifier identifier, MethodBodyCreator creator) { if (!overriddenMethods.contains(identifier)) { overriddenMethods.add(identifier); creator.overrideMethod(classFile.addMethod(method), method); return true; } return false; }