Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 223543

Summary: [implementation] AnnotationPainter in jface should not depend on Platform
Product: [Eclipse Project] Platform Reporter: John Huss <johnthuss>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: caniszczyk, daniel_megert, remy.suen, thatnitind
Version: 3.4Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
org.eclipse.jface.text.patch daniel_megert: review-

Description John Huss CLA 2008-03-22 00:52:06 EDT
Build ID: 3.4 head

In class org.eclipse.jface.text.source.AnnotationPainter there is:

import org.eclipse.core.runtime.Platform;
...
private static boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/AnnotationPainter"));  //$NON-NLS-1$//$NON-NLS-2$

This is the only line that depends on Platform.  Because of this line I have to add 2 megs of code to my stand-alone swt/jface app (add core.runtime and osgi) if I want to use AnnotationPainter.  There has to be a way to remove this dependency.  The jface jars shouldn't require the rest of the eclipse platform to run.
Comment 1 Dani Megert CLA 2008-03-24 10:59:04 EDT
Platform and especially required bundles of org.eclipse.core.runtime are used at various other places in JFace Text for years now. Can you explain how you get 2MB given that core.runtime is 67KB and its required plug-ins also not that big.
Comment 2 John Huss CLA 2008-03-24 19:17:28 EDT
These are the file sizes I have (on linux gtk):

org.eclipse.core.runtime_3.3.100.v20070530
716k

org.eclipse.osgi_3.3.0.v20070530
906k

Total: about 1.6 meg

My whole app is about 4.5 meg right now, so adding these would be a 36% increase in the footprint.

If these dependencies were really needed then I wouldn't even bother saying anything, but since these jars will add nothing to the app (with the functionality I'm currently using anyway) it seems like a waste.  The dependency surprised me because I was already using other annotations in a vertical ruler and it didn't require these jars.
Comment 3 Dani Megert CLA 2008-03-25 07:32:21 EDT
>org.eclipse.core.runtime_3.3.100.v20070530
>716k
Either you looked up the wrong plug-in or you do not use the official build where org.eclipse.core.runtime_3.3.100.v20070530.jar is 72KB and in latest 3.4 it is even smaller (68KB).

But anyway, the osgi plug-in is really big. We should change the DEBUG and the logging code to not use core.runtime and only depend on org.eclipse.equinox.common  and org.eclipse.core.jobs.
Comment 4 Dani Megert CLA 2008-04-23 09:18:01 EDT
Will rework logging during 3.5.
Comment 5 Dani Megert CLA 2008-08-18 11:56:35 EDT
Low prio for 3.5. Patch would be welcome.
Comment 6 Chris Aniszczyk CLA 2008-08-18 14:20:30 EDT
Created attachment 110274 [details]
org.eclipse.jface.text.patch

Here is a shot at the patch.

1) created a bundle activator (JFaceTextActivator)
2) acquired the debug options service if available and use it

The only issue I came across was a place where JFace Text was accessing the Platform.log(...), I replaced it with using the osgi log service... not sure if this is what we want to do.
Comment 7 Dani Megert CLA 2008-08-19 05:40:20 EDT
Comment on attachment 110274 [details]
org.eclipse.jface.text.patch

JFace Text is like SWT. It should not have a bundle activator. This is overkill. We could rewrite the code to make the runtime plug-in optional. Also, I want to reduce the package imports to a minimum. So far we only do this for ICU packages.
Comment 8 Eclipse Webmaster CLA 2019-09-06 16:10:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 9 Eclipse Genie CLA 2021-12-11 09:09:46 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.