This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When Exporting Options, if single category is checked, other categories may be exported. For example if I export only Formatting, Editor:General is exported too. Another example is if I export PHP, General:All other unspecified is exported too. Product Version: NetBeans IDE 7.3 (Build 201302132200) Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
What do you mean by "exported too"? Do you see the respective checkboxes checked in the export dialog?
See screenshot A. I have PHP Checked, it is the only thing I checked and nothing else is checked, except "All" which is another bug [1], it should not check when I check PHP. See screenshot B. I go to import the settings and it shows that "General:All other unspecified" was exported to the file too, although never checked it. [1] https://netbeans.org/bugzilla/show_bug.cgi?id=227903
Created attachment 134192 [details] Screenshot A
Created attachment 134193 [details] Screenshot B
Created attachment 135079 [details] proposed fix I think this is caused by false positive. A problem with the include regular expressions. Could you check that in the created zip after exporting the options only the desired files are present? This is happening for me at least. I am attaching a fix that fixes the issue. Jiri, as I am not 100% sure what you meant to include or not, could you comment on the proposed changes in the regular expressions?
"General:All other unspecified" is meant to include all from config/Preferences which were not specified elsewhere. It is for the case when you want to export everything (like after installation of new IDE version). Your patch breaks that assumption and I don't recommend it. On the other hand I must admit that current state is not ideal and there is no straightforward solution for this bug. I think we have to write a notice to exported zip file (build.info or some empty flag file) that "All other unspecified" was not selected for export and then while importing set the status of the "All other unspecified" item according to that flag.
(In reply to comment #6) > "General:All other unspecified" is meant to include all from config/Preferences > which were not specified elsewhere. It is for the case when you want to export > everything (like after installation of new IDE version). Your patch breaks that > assumption and I don't recommend it. Thank you for making this clear > On the other hand I must admit that current state is not ideal and there is no > straightforward solution for this bug. I think we have to write a notice to > exported zip file (build.info or some empty flag file) that "All other > unspecified" was not selected for export and then while importing set the > status of the "All other unspecified" item according to that flag. This could work for the "General:All other unspecified" case. What would you propose for the "Editor:General" case from comment 1? Or the part of the patch for the latter case is accepted? Thank you
> This could work for the "General:All other unspecified" case. What would you > propose for the "Editor:General" case from comment 1? Or the part of the patch > for the latter case is accepted? No, I think it is similar case. But it is question whether fix of bug 143494 is correct. It introduces "Formatting|Indentation" and "Formatting|Java" but ignores formatting settings of other languages. Also it is question whether org-netbeans-modules-editor-settings-CustomPreferences.xml contains only formatting/indentation properties. If yes, then better seems to me to export formatting settings together for all languages. Just to collect .*CustomPreferences.xml. <file name="Other"> <attr name="include" stringvalue="config/Editors/(?!.*(Macros|CodeTemplates|FontsColors)).+|config/.nbattrs"/> - <attr name="exclude" stringvalue="config/Editors/.*/(macros.xml|Popup.*|Settings\.settings|.*\.instance)"/> + <attr name="exclude" stringvalue="config/Editors/.*/(macros.xml|Popup.*|Settings\.settings|.*\.instance|org-netbeans-modules-editor-settings-CustomPreferences.xml)"/> <attr name="displayName" bundlevalue="org.netbeans.modules.options.editor.Bundle#Editor.Options.Export.Other.displayName"/> </file> - </folder> - <folder name="Formatting"> - <attr name="position" intvalue="250"/> + <file name="Formatting"> + <attr name="include" stringvalue="config/Editors/.*/org-netbeans-modules-editor-settings-CustomPreferences.xml"/> <attr name="displayName" bundlevalue="org.netbeans.modules.options.editor.Bundle#Editor.Options.Export.Formatting.displayName"/> - <file name="Indentation"> - <attr name="include" stringvalue="config/Editors/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml"/> - <attr name="displayName" bundlevalue="org.netbeans.modules.options.editor.Bundle#Editor.Options.Export.Indentation.displayName"/> </file> </folder> <folder name="FontsAndColors">
Created attachment 135121 [details] options.editor diff.
CustomPreferences.xml has many information - old folding, code templates, bracematching, breadcrumbs, search-type, etc. Infrastructure for import/export can restrict files, not a value in files.
(In reply to comment #10) > Infrastructure for import/export > can restrict files, not a value in files. This is not true. you can include/exclude key-value pairs inside a properties file. have a look in etc/netbeans.import file for examples, e.g. exclude build[.]properties#nbplatform[.]default[.]netbeans[.]dest[.]dir but include build[.]properties#nbplatform[.].+[.].+|var[.].*
Oh, thanks, I honestly didn't know. Then this should be clean up in each module.
(In reply to comment #11) > This is not true. you can include/exclude key-value pairs inside a properties > file. have a look in etc/netbeans.import file for examples, e.g. Yes, but it is not applicable to xml files like CustomPreferences.xml.
(In reply to comment #13) > (In reply to comment #11) > > This is not true. you can include/exclude key-value pairs inside a properties > > file. have a look in etc/netbeans.import file for examples, e.g. > > Yes, but it is not applicable to xml files like CustomPreferences.xml. true. sorry for that. I will go ahead and follow your suggestion from comment 6 at least for these two cases. Thank you for the input.
Fixed: http://hg.netbeans.org/core-main/rev/0b7d46a1f732
Integrated into 'main-golden', will be available in build *201306212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/0b7d46a1f732 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: #227906 - Export Options: Some settings not checked get exported too
Verified Fixed in: Product Version: NetBeans IDE 7.3.1 (Build 201306052037) Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)