Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-04-22 17:32:28 -0400
committeratikhomirov2010-04-22 17:32:28 -0400
commit2516414685f57fd8758c5bb26c73ec8d69e84c03 (patch)
tree2c894e98a402155b1f573042d8c89b7426a51685
parent76101de1e508b18d62319a71dc56b60848f30330 (diff)
downloadorg.eclipse.gmf-tooling-2516414685f57fd8758c5bb26c73ec8d69e84c03.tar.gz
org.eclipse.gmf-tooling-2516414685f57fd8758c5bb26c73ec8d69e84c03.tar.xz
org.eclipse.gmf-tooling-2516414685f57fd8758c5bb26c73ec8d69e84c03.zip
no extra indirection to call Integer.toString; explanation why we don't optimize herev20100422-2359
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/VisualIDRegistry.xpt8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/VisualIDRegistry.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/VisualIDRegistry.xpt
index 1b662e24e..a73432be0 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/VisualIDRegistry.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/VisualIDRegistry.xpt
@@ -142,10 +142,14 @@ public static int «EXPAND getVisualIdMethodName»(String type) {
}
«ENDDEFINE»
+«REM»
+ XXX getType may be optimized not to return new string each time, instead, cache known visual ids, e.g. with LinkedHashMap with removeEldestEntry?
+ However, even intern() seems too much, as in most usecases returned value is not kept, and unlikely to survive Eden (or whatever name it has) heap space
+«ENDREM»
«DEFINE getType FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
+«EXPAND xpt::Common::generatedMemberComment»
public static String «EXPAND getTypeMethodName»(int visualID) {
- return String.valueOf(visualID);
+ return Integer.toString(visualID);
}
«ENDDEFINE»

Back to the top