Bug 566814 - EvaluationReference.evaluate(IEvaluationContext) floods the log
Summary: EvaluationReference.evaluate(IEvaluationContext) floods the log
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.18 M1   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-09 06:45 EDT by Wim Jongman CLA
Modified: 2020-11-16 11:25 EST (History)
1 user (show)

See Also:


Attachments
Project with handler enablement and property tester (4.44 KB, application/x-zip-compressed)
2020-09-09 06:47 EDT, Wim Jongman CLA
no flags Details
Visualization of issue (4.78 MB, video/mp4)
2020-09-09 06:48 EDT, Wim Jongman CLA
no flags Details
Before the patch (4.88 MB, video/mp4)
2020-09-17 07:39 EDT, Wim Jongman CLA
no flags Details
After the patch (4.10 MB, video/mp4)
2020-09-17 07:39 EDT, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Jongman CLA 2020-09-09 06:45:40 EDT
In some circumstances, the expression evaluation throws a CoreException. Sometimes this is done because there is an error but sometimes also because an expression does not resolve for the current selection.

With "expression", I mean for example a handler activation expression.

This exception is thrown in
TypeExtensionManager#getProperty(Object, String, String, boolean) and caught in EvaluationReference.evaluate(IEvaluationContext). 

With the fix of bug 545270, it was decided to log all cases of this core exception. Previously, it used to be logged only in trace mode [1].

However, there seem to be cases where a valid expression is evaluated to a CoreException. This causes log flooding that cannot be solved by the plugin developer.

Attached is a project with a seemingly valid handler activation expression that results in throwing the CoreException.  The issue seems to be in the evaluation of the expression. This process should be looked at but until this time, the logging should revert back to the behavior before bug 545270.

[1] https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=64d6e13fbf08b37e6b5072c15f8543c3d50511fc
Comment 1 Wim Jongman CLA 2020-09-09 06:47:35 EDT
Created attachment 284093 [details]
Project with handler enablement and property tester

An example project that exposes the flooding of the error log. The coding in the plugin is valid (I hope). 

It contains a handler for a command with a enablement using a property tester.

I have seen flooding in different plugins and RCP applications, including our plugins.

The exception is thrown in 

TypeExtensionManager#getProperty(Object, String, String, boolean)


Instructions:

1. Start Eclipse SDK
2. Import existing project into ws 
3. Open manifest.mf
4. Press "Launch an eclipse application" (green button in manifest toolbar)

In the started eclipse:
5. Open the error log and dock it in the editor area
6. Open the console, open the OSGi console
7. Find the bundle for the project and start it
8. Switch between views and see the flooding of the error log 

See instruction in the attached movie.
Comment 2 Wim Jongman CLA 2020-09-09 06:48:35 EDT
Created attachment 284094 [details]
Visualization of issue
Comment 3 Eclipse Genie CLA 2020-09-09 06:54:16 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/169074
Comment 4 Eclipse Genie CLA 2020-09-15 18:07:09 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/169413
Comment 6 Wim Jongman CLA 2020-09-17 07:39:25 EDT
Created attachment 284148 [details]
Before the patch
Comment 7 Wim Jongman CLA 2020-09-17 07:39:52 EDT
Created attachment 284149 [details]
After the patch
Comment 9 Wim Jongman CLA 2020-09-17 09:15:22 EDT
Thanks for reviewing, Karsten.