@Override
public void visit(ClassOrInterfaceDeclaration node, Void arg) {
super.visit(node, arg);
replaceParentClassesForAtomics(node);
node.setName(translateQueueName(node.getNameAsString()));
if (isCommentPresent(node, GEN_DIRECTIVE_CLASS_CONTAINS_ORDERED_FIELD_ACCESSORS)) {
node.setComment(null);
removeStaticFieldsAndInitialisers(node);
patchAtomicFieldUpdaterAccessorMethods(node);
}
for (MethodDeclaration method : node.getMethods()) {
if (isCommentPresent(method, GEN_DIRECTIVE_METHOD_IGNORE)) {
method.remove();
}
}
if (!node.getMethodsByName("failFastOffer").isEmpty()) {
MethodDeclaration deprecatedMethodRedirect = node.addMethod("weakOffer", Modifier.PUBLIC);
patchMethodAsDepreciatedRedirector(deprecatedMethodRedirect, "failFastOffer", PrimitiveType.intType(),
new Parameter(classType("E"), "e"));
}
node.setJavadocComment(formatMultilineJavadoc(0,
"NOTE: This class was automatically generated by "
+ JavaParsingAtomicArrayQueueGenerator.class.getName(),
"which can found in the jctools-build module. The original source file is " + sourceFileName + ".")
+ node.getJavadocComment().orElse(new JavadocComment("")).getContent());
}