NotLebedev opened a new issue, #2564: URL: https://github.com/apache/fory/issues/2564
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/fory/issues) and found no similar issues. ### Version 0.12.1 ### Component(s) Java ### Minimal reproduce step When java class has a field named `buffer` and codegen is triggered `org.apache.fory.codegen.CodegenException` happens. ### What did you expect to see? No exception ### What did you see instead? The reason is the write method where the folowing code is generated: ```java /* 0054 */ @Override public final void write(MemoryBuffer buffer, Object obj) { /* 0055 */ SomeClass someClass = (SomeClass)obj; /* 0056 */ Object object1 = Platform.getObject(someClass, 12L); /* 0057 */ FieldType buffer = (FieldType) object1; /* 0058 */ if ((!refResolver.writeRefOrNull(buffer, buffer))) { /* 0059 */ this.writeClassAndObject(buffer, buffer); /* 0060 */ } /* 0061 */ } ``` ### Anything Else? The reason seems to be `BaseObjectCodecBuilder` where ` public static final String BUFFER_NAME = "buffer";` hardcodes variable name. I'd like to provide small project as repro, but it's not clear to me when this codegen is triggered ### Are you willing to submit a PR? - [x] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
