Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2009-01-14 19:00:56 +0000
committerashatalin2009-01-14 19:00:56 +0000
commitd871232edb00293582bf599e4e1ad96d472edbca (patch)
tree02c64dcd0ac5d8ee6ce7805b2eff4a2fb81f9f24 /plugins/org.eclipse.gmf.graphdef.codegen
parentdafe503cc7df9537512fb185c686253e4907f13e (diff)
downloadorg.eclipse.gmf-tooling-d871232edb00293582bf599e4e1ad96d472edbca.tar.gz
org.eclipse.gmf-tooling-d871232edb00293582bf599e4e1ad96d472edbca.tar.xz
org.eclipse.gmf-tooling-d871232edb00293582bf599e4e1ad96d472edbca.zip
Throwing specific exception in case of ambiguous xpand definitions to report this problem as compilation error (to the ProblemsView) instead of runtime .log file.v20090114-1925
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java
index 5fc00acda..3a328b0bf 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java
@@ -25,6 +25,8 @@ import org.eclipse.gmf.internal.graphdef.codegen.Activator;
import org.eclipse.gmf.internal.xpand.BufferOutput;
import org.eclipse.gmf.internal.xpand.ResourceManager;
import org.eclipse.gmf.internal.xpand.XpandFacade;
+import org.eclipse.gmf.internal.xpand.model.AmbiguousDefinitionException;
+import org.eclipse.gmf.internal.xpand.model.EvaluationException;
import org.eclipse.gmf.internal.xpand.model.Variable;
import org.eclipse.gmf.internal.xpand.util.ContextFactory;
@@ -79,7 +81,11 @@ public class FigureGenerator implements TextEmitter {
}
public String fqnSwitch(Figure figure) {
- xpandFacade().evaluate("Runtime::fqn", figure, null);
+ try {
+ xpandFacade().evaluate("Runtime::fqn", figure, null);
+ } catch (AmbiguousDefinitionException e) {
+ throw new EvaluationException(e);
+ }
return result.toString();
}
@@ -88,10 +94,14 @@ public class FigureGenerator implements TextEmitter {
* @param figure
*/
public String go(FigureDescriptor figure) {
- if (myIsInnerClassCode) {
- xpandFacade().evaluate("top::Descriptor::Inner", figure, null);
- } else {
- xpandFacade().evaluate("top::Descriptor::Top", figure, new Object[] { packageStatement });
+ try {
+ if (myIsInnerClassCode) {
+ xpandFacade().evaluate("top::Descriptor::Inner", figure, null);
+ } else {
+ xpandFacade().evaluate("top::Descriptor::Top", figure, new Object[] { packageStatement });
+ }
+ } catch (AmbiguousDefinitionException e) {
+ throw new EvaluationException(e);
}
return result.toString();
}

Back to the top