Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353276 - Exception from invoked method not diagnosed
Summary: Exception from invoked method not diagnosed
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows Vista
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-28 01:31 EDT by Ed Willink CLA
Modified: 2016-04-04 05:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-07-28 01:31:29 EDT
If an invoked Java Method trips over for instance

if (genPackage.eIsProxy()) {
	throw new IllegalStateException("Unresolved proxy : '" + ((InternalEObject)genPackage).eProxyURI());
}

no ISE appears in the console stack trace because EvaluationVisitorImpl absorbs the exception when returning getInvalid().

This is an Eclipse OCL 'feature'. Please raise a Bug if you are able to exploit an ability to override getInvalid(Exception) to throw the exception rather than a compatibility default of getInvalid(). The new pivot evaluator has stateful invalid values that can carry messages, exceptions and environments.


This problem occurs even for an EvaluationHaltedException since it too is converted to an InvocationTargetException, so there is no workaround. I think the InvocationTargetException should be unwrapped.
Comment 1 Laurent Goubet CLA 2011-07-28 03:29:31 EDT
Ed,

I recall there was another bug on this, but I can't find it back.

This problem is "known" as I remember investigating that a little ... but It has neither been fixed or worked around for now. We'll raise a bug against OCL if necessary when we come back to investigating it :).
Comment 2 Ed Willink CLA 2011-07-28 04:12:06 EDT
(In reply to comment #1)
> I recall there was another bug on this, but I can't find it back.

I thought so too and found it eventually. It's similar but not the same as bug 348478, which isn't an OCL problem.
Comment 3 Laurent Goubet CLA 2011-07-28 04:42:47 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > I recall there was another bug on this, but I can't find it back.
> 
> I thought so too and found it eventually. It's similar but not the same as bug
> 348478, which isn't an OCL problem.

Yes, not really the same. The bug I was looking for was an exact duplicate of this, but it may not have been raised as a bug ... maybe a discussion on bugzilla or mail. Anyways, thanks for reporting it, that'll prevent me from losing track of that limitation once again :p.
Comment 4 Laurent Goubet CLA 2016-04-04 05:19:47 EDT
Exceptions thrown from within java services are now properly logged in the console.