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

Bug 366813

Summary: [formatter]Formatter does not work after import
Product: [Eclipse Project] JDT Reporter: Lars Briem <briem.lars>
Component: CoreAssignee: Manoj N Palat <manoj.palat>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: manoj.palat, mateusz.matela, randomshelley, remy.suen, satyam.kandula
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Lars Briem CLA 2011-12-15 09:47:59 EST
Build Identifier: M20110210-1200

After the import of preferences containing a new formatter profile, the new formatter profile will be shown as "active". But the formattings will always be done by the old formatter. Even if the old formatter profile was removed during the import.

If another formatter is activated in the preferences an the new formatter will be reactivated, then it will work. (see workaround steps 11-15)


Reproducible: Always

Steps to Reproduce:
1. Open a new workspace
2. Create a new formatter profile
3. Edit the new formatter profile to see differences between the default formatter and the new one. (setting some line wrappings or something else)
4. Export the preferences via the File->Export Dialog
5. Switch the workspace to a new one
6. Import the preferences containing the new formatter profile
7. Create a new project (in my case Java)
8. Add a new class
9. Try to format the new class via shortcut: Ctrl+Shift+F or via menu: Source->Format
10. You will see, the new formatter will not be used

Workaround:
11. Go to formatter preferences: Window->Preferences->Java->Code Style->Formatter
12. Activate another formatter (Select another and press apply)
13. Activate the new formatter and close the preferences
14. Try to format the class via shortcut: Ctrl+Shift+F or via menu: Source->Format
15. The right formatter will be used
Comment 1 Satyam Kandula CLA 2011-12-21 02:22:04 EST
I am not able to reproduce this behaviour. Do you have any other plugins? Is there anything that I could be missing?
Comment 2 Lars Briem CLA 2011-12-21 05:12:30 EST
I have installed a bunch of plug ins for plug in development. But I am not able to reproduce a full list of the plug ins, because I am not in the office for some days. I will check it an try it also with a fresh eclipse without any plug ins. After this test I will write another comment.
Comment 3 Satyam Kandula CLA 2011-12-22 08:36:49 EST
(In reply to comment #2)
> I have installed a bunch of plug ins for plug in development. But I am not able
> to reproduce a full list of the plug ins, because I am not in the office for
> some days. I will check it an try it also with a fresh eclipse without any plug
> ins. After this test I will write another comment.
Thanks for your plans to try it out. I guess this is similar to bug 360711. If you could reproduce the problem always in your environment, I could give you a debug plugin for you which could print some helpful information. Is it always reproducible for you?
Comment 4 Lars Briem CLA 2011-12-25 06:33:47 EST
I have tested it with a clean version of eclipse ide with the build id: M20110218-0911.
The bug does not appear in this version of eclipse. I will try it again in the new year, when I am back at work. Maybe this bug was fixed and I just have to update. Then I will change the version we deliver with our plugins.

I thought I have the latest version of eclipse helios in use, because I use the autoupdate mechanism.
Comment 5 Lars Briem CLA 2012-01-17 03:12:48 EST
I tested it again with a blank version of the IDE. The bug does not appear in the blank version. So I think one of the plug-ins causes this problem. If I have the time I will test it further an install the plug-ins one by one. But at the moment for me it is ok to use the newer buildversion.
Comment 6 Eclipse Genie CLA 2019-03-16 16:27:10 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.

--
The automated Eclipse Genie.
Comment 7 Mateusz Matela CLA 2019-06-12 06:51:43 EDT
Look like another instance of bug 360711.

*** This bug has been marked as a duplicate of bug 360711 ***