Bug 105926 [Formatter] Exporting Unnamed profile fails silently
When attempting to export an "Unnamed Profile" from the Project Preferences > Java Code Style > Formatter it will fail silently when it gets to ProfileStore.writeProfilesToStream(): for(final Iterator iter= profiles.iterator(); iter.hasNext();) { final Profile profile= (Profile)iter.next(); if (profile.isProfileToSave()) { final Element profileElement= createProfileElement(profile, document); rootElement.appendChild(profileElement); } } Since the unnamed profile is considered a shared profile and will write an xml file with the content. <?xml version="1.0" encoding="UTF-8"?> <profiles version="8"/> Instead of silently generating an xml file with no content it should rather throw up an error/warning or force a rename dialog. I'll try working on a patch to this respect.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/CodeFormatterConfigurationBlock.java
public ButtonController() {
			fProfileManager.addObserver(this);
			fNewButton.addSelectionListener(this);
			fRenameButton.addSelectionListener(this);
			fEditButton.addSelectionListener(this);
			fDeleteButton.addSelectionListener(this);
			fSaveButton.addSelectionListener(this);
			fLoadButton.addSelectionListener(this);
			update(fProfileManager, null);
		}
		public void update(Observable o, Object arg) {
			Profile selected= ((ProfileManager)o).getSelected();
			final boolean notBuiltIn= !selected.isBuiltInProfile();
			fEditButton.setText(notBuiltIn ? FormatterMessages.CodingStyleConfigurationBlock_edit_button_desc
			    : FormatterMessages.CodingStyleConfigurationBlock_show_button_desc); 
			fDeleteButton.setEnabled(notBuiltIn);
			fSaveButton.setEnabled(notBuiltIn && !selected.isSharedProfile());
			fRenameButton.setEnabled(notBuiltIn);
		}
		public void widgetSelected(SelectionEvent e) {
			final Button button= (Button)e.widget;
			if (button == fSaveButton)
				saveButtonPressed();
			else if (button == fEditButton)
				modifyButtonPressed();
			else if (button == fDeleteButton) 
				deleteButtonPressed();