Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-04-23 16:04:47 -0400
committeratikhomirov2010-04-23 16:04:47 -0400
commitacc2cb8417e68e032de2f51fc91d2569dba81bf3 (patch)
tree7983224882aadb2c89efdb9fd9eca858920c5ef7
parent6cb12110e8000b61720b00d5a9ba4226280a6e9c (diff)
downloadorg.eclipse.gmf-tooling-acc2cb8417e68e032de2f51fc91d2569dba81bf3.tar.gz
org.eclipse.gmf-tooling-acc2cb8417e68e032de2f51fc91d2569dba81bf3.tar.xz
org.eclipse.gmf-tooling-acc2cb8417e68e032de2f51fc91d2569dba81bf3.zip
[188329] Java5-friendly code
-rwxr-xr-xplugins/org.eclipse.gmf.codegen/templates/xpt/expressions/AbstractExpression.xpt12
-rwxr-xr-xplugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OCLExpressionFactory.xpt2
2 files changed, 8 insertions, 6 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/AbstractExpression.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/AbstractExpression.xpt
index 9abf5c29f..843def10e 100755
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/AbstractExpression.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/AbstractExpression.xpt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009 Borland Software Corporation
+ * Copyright (c) 2007, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -88,6 +88,7 @@ public abstract class «editorGen.expressionProviders.abstractExpressionClassNam
«DEFINE evaluate FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND CodeStyle::SuppressWarnings('"rawtypes"')-»
protected abstract Object doEvaluate(Object context, java.util.Map env);
«EXPAND xpt::Common::generatedMemberComment»
@@ -95,7 +96,8 @@ public abstract class «editorGen.expressionProviders.abstractExpressionClassNam
return evaluate(context, java.util.Collections.EMPTY_MAP);
}
-«EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND CodeStyle::SuppressWarnings('"rawtypes"')-»
public Object evaluate(Object context, java.util.Map env) {
if(context().isInstance(context)) {
try {
@@ -120,10 +122,10 @@ public abstract class «editorGen.expressionProviders.abstractExpressionClassNam
if (false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
return value;
}
- Class targetClass = targetType.getInstanceClass();
+ Class«EXPAND CodeStyle::G('?')» targetClass = targetType.getInstanceClass();
Number num = (Number) value;
- Class valClass = value.getClass();
- Class targetWrapperClass = targetClass;
+ Class«EXPAND CodeStyle::G('?')» valClass = value.getClass();
+ Class«EXPAND CodeStyle::G('?')» targetWrapperClass = targetClass;
if (targetClass.isPrimitive()) {
targetWrapperClass = org.eclipse.emf.ecore.util.EcoreUtil.wrapperClassFor(targetClass);
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OCLExpressionFactory.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OCLExpressionFactory.xpt
index 4938eaa7c..384c50b1b 100755
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OCLExpressionFactory.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/expressions/OCLExpressionFactory.xpt
@@ -63,7 +63,7 @@ public class «className» {
}
«EXPAND xpt::Common::generatedMemberComment»
- «EXPAND CodeStyle::SuppressWarnings('"rawtypes"') FOR container.editorGen.diagram-»
+ «EXPAND CodeStyle::SuppressWarnings('{ "rawtypes", "unchecked" }' /*unchecked needed only until I have .iterator() below. Once I use Java5 for notation there, unchecked is not needed */) FOR container.editorGen.diagram-»
protected Object doEvaluate(Object context, java.util.Map env) {
if (oclExpression == null) {
return null;

Back to the top