This is an automated email from the ASF dual-hosted git repository.
garyw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mnemonic.git
The following commit(s) were added to refs/heads/master by this push:
new 46766b3 MNEMONIC-793: Optimising performance of buildEntityMethodSpecs
46766b3 is described below
commit 46766b3e767d91887f1b63d6497b65f30724706a
Author: Katarina <[email protected]>
AuthorDate: Sun Aug 13 19:56:00 2023 +0000
MNEMONIC-793: Optimising performance of buildEntityMethodSpecs
---
.../java/org/apache/mnemonic/AnnotatedDurableEntityClass.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
b/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
index 15d27d6..680de55 100644
---
a/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
+++
b/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
@@ -895,13 +895,13 @@ public class AnnotatedDurableEntityClass {
String factoryproxyname = m_fieldsinfo.get("factoryproxy").name;
String genericfieldname = m_fieldsinfo.get("genericfield").name;
String reclaimctxname = m_fieldsinfo.get("reclaimcontext").name;
- for (String name : m_entitymtdinfo.keySet()) {
- methodinfo = m_entitymtdinfo.get(name);
+ for (Map.Entry<String, MethodInfo> entry : m_entitymtdinfo.entrySet()) {
+ methodinfo = entry.getValue();
code = CodeBlock.builder();
arg0 = methodinfo.elem.getParameters().get(0);
arg1 = methodinfo.elem.getParameters().get(1);
arg2 = methodinfo.elem.getParameters().get(2);
- switch (name) {
+ switch (entry.getKey()) {
case "initializeDurableEntity":
arg3 = methodinfo.elem.getParameters().get(3);
arg4 = methodinfo.elem.getParameters().get(4);
@@ -950,7 +950,7 @@ public class AnnotatedDurableEntityClass {
// code.endControlFlow();
code.addStatement("initializeDurableEntity($1L, $2L, $3L, $4L, $5L)",
arg0, arg1, arg2, arg4, arg5);
code.beginControlFlow("if (0L == $1L)", arg3);
- code.addStatement("throw new RestoreDurableEntityError(\"Input handler
is null on $1N.\")", name);
+ code.addStatement("throw new RestoreDurableEntityError(\"Input handler
is null on $1N.\")", entry.getKey());
code.endControlFlow();
code.addStatement("$1N = $2N.retrieveChunk($3L, $4N, $5N)",
holdername, allocname, arg3, autoreclaimname, reclaimctxname);
@@ -960,7 +960,7 @@ public class AnnotatedDurableEntityClass {
code.addStatement("initializeAfterRestore()");
break;
default:
- throw new AnnotationProcessingException(null, "Method %s is not
supported.", name);
+ throw new AnnotationProcessingException(null, "Method %s is not
supported.", entry.getKey());
}
typespecbuilder.addMethod(methodinfo.specbuilder.addCode(code.build()).build());
}