anton-vinogradov commented on code in PR #12852:
URL: https://github.com/apache/ignite/pull/12852#discussion_r2912087390
##########
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java:
##########
@@ -177,10 +200,33 @@ private String generateSerializerCode(TypeElement type)
throws IOException {
}
}
+ /** */
+ private void writeConstructor(Writer writer, String serClsName) throws
IOException {
+ if (!marshallableMessage())
+ return;
+
+ writer.write(identedLine(METHOD_JAVADOC));
+ writer.write(NL);
+ writer.write(identedLine("public " + serClsName + "(Marshaller
marshaller, ClassLoader clsLdr) {"));
+
+ writer.write(NL);
+ ++indent;
+
+ writer.write(identedLine("this.marshaller = marshaller;"));
+ writer.write(NL);
+ writer.write(identedLine("this.clsLdr = clsLdr;"));
+
+ --indent;
Review Comment:
Should be separated by empty lines both before and after
##########
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java:
##########
@@ -151,12 +165,21 @@ void generate(TypeElement type, List<VariableElement>
fields) throws Exception {
}
/** Generates full code for a serializer class. */
- private String generateSerializerCode(TypeElement type) throws IOException
{
+ private String generateSerializerCode(String serClsName) throws
IOException {
+ if (marshallableMessage()) {
+ fields.add("private final Marshaller marshaller;");
+ fields.add("private final ClassLoader clsLdr;");
+ }
+
try (Writer writer = new StringWriter()) {
- writeClassHeader(writer,
env.getElementUtils().getPackageOf(type).toString(), type.getSimpleName() +
"Serializer");
+ writeClassHeader(writer,
env.getElementUtils().getPackageOf(type).toString(), serClsName);
writeClassFields(writer);
+ ++indent;
Review Comment:
Should be incapsulated
##########
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java:
##########
@@ -177,10 +200,33 @@ private String generateSerializerCode(TypeElement type)
throws IOException {
}
}
+ /** */
+ private void writeConstructor(Writer writer, String serClsName) throws
IOException {
+ if (!marshallableMessage())
+ return;
+
+ writer.write(identedLine(METHOD_JAVADOC));
+ writer.write(NL);
+ writer.write(identedLine("public " + serClsName + "(Marshaller
marshaller, ClassLoader clsLdr) {"));
+
+ writer.write(NL);
+ ++indent;
Review Comment:
Should be separated by empty lines both before and after
--
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]