[73006] Unresolved compilation errors are now caught and logged as
errors and show on beans list view.
diff --git a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java
index 88a9fde..420ca01 100644
--- a/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java
+++ b/plugins/org.eclipse.jem.proxy/initParser/org/eclipse/jem/internal/proxy/initParser/tree/ExpressionProcesser.java
@@ -10,7 +10,7 @@
*******************************************************************************/
/*
* $RCSfile: ExpressionProcesser.java,v $
- * $Revision: 1.19 $ $Date: 2005/08/10 15:47:18 $
+ * $Revision: 1.20 $ $Date: 2005/08/11 21:00:31 $
*/
package org.eclipse.jem.internal.proxy.initParser.tree;
@@ -19,8 +19,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jem.internal.proxy.common.AmbiguousMethodException;
-import org.eclipse.jem.internal.proxy.common.MethodHelper;
+import org.eclipse.jem.internal.proxy.common.*;
import org.eclipse.jem.internal.proxy.initParser.InitializationStringEvaluationException;
import org.eclipse.jem.internal.proxy.initParser.InitializationStringParser;
@@ -2483,6 +2482,12 @@
processException(e);
} catch (LinkageError e) {
processException(e);
+ } catch (Error e) {
+ if (e.getClass() == Error.class) {
+ // If exactly Error.class, then process it. This is hopefully just a "unresolved compilation error".
+ processException(new UnresolvedCompilationError(e));
+ } else
+ throw e; // All subclasses we throw on out.
}
} finally {
if (traceOn)
diff --git a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java
index 10bc2c4..efb01b5 100644
--- a/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java
+++ b/plugins/org.eclipse.jem.proxy/proxy/org/eclipse/jem/internal/proxy/core/IExpression.java
@@ -10,7 +10,7 @@
*******************************************************************************/
/*
* $RCSfile: IExpression.java,v $
- * $Revision: 1.6 $ $Date: 2005/08/10 15:47:18 $
+ * $Revision: 1.7 $ $Date: 2005/08/11 21:00:31 $
*/
package org.eclipse.jem.internal.proxy.core;
@@ -251,6 +251,10 @@
* This must be followed by createExpressions for:
* argumentCount times an: <code>CLASSINSTANCECREATION_ARGUMENT</code>
*
+ * <p>
+ * <b>Note:</b> This method can throw {@link org.eclipse.jem.internal.proxy.common.UnresolvedCompilationError} while processing
+ * and can be caught by an Expression try/catch. This is not thrown such that it can be caught by a real java try/catch.
+ *
* @param forExpression
* @param type This is the type. It must be fully-qualified and if an inner class, it must have the "$" format.
* @param argumentCount
@@ -266,6 +270,10 @@
* This must be followed by createExpressions for:
* argumentCount times an: <code>CLASSINSTANCECREATION_ARGUMENT</code>
*
+ * <p>
+ * <b>Note:</b> This method can throw {@link org.eclipse.jem.internal.proxy.common.UnresolvedCompilationError} while processing
+ * and can be caught by an Expression try/catch. This is not thrown such that it can be caught by a real java try/catch.
+ *
* @param forExpression
* @param type This is the type.
* @param argumentCount
diff --git a/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java
new file mode 100644
index 0000000..687dd6f
--- /dev/null
+++ b/plugins/org.eclipse.jem.proxy/proxyCommon/org/eclipse/jem/internal/proxy/common/UnresolvedCompilationError.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM 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
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/*
+ * $RCSfile$
+ * $Revision$ $Date$
+ */
+package org.eclipse.jem.internal.proxy.common;
+
+/**
+ * Used by the the registries to indicate "UnresolvedCompilationError". This is because the
+ * normal java throws just an Error with a message. To make it easier in processing, it will
+ * be turned into this error instead so that it can be explicitly caught.
+ * <p>
+ * This will only be used in certain explicit parts of the code. It will be detailed where
+ * it can be thrown.
+ *
+ * @since 1.1.0.1
+ */
+public class UnresolvedCompilationError extends Error {
+
+ /**
+ * Comment for <code>serialVersionUID</code>
+ *
+ * @since 1.1.0.1
+ */
+ private static final long serialVersionUID = 7778842211073592790L;
+
+ /**
+ * Construct from an Error.
+ * @param error The error that is the actual one. <b>This will not be the cause, the message and stacktrace will be copied into this new error.</b>
+ *
+ * @since 1.1.0.1
+ */
+ public UnresolvedCompilationError(Error error) {
+ super(error.getMessage());
+ setStackTrace(error.getStackTrace());
+ }
+
+}