diff options
3 files changed, 34 insertions, 33 deletions
diff --git a/admin/findbugs-exclude.xml b/admin/findbugs-exclude.xml index c3e2f53f2..42d66cde0 100644 --- a/admin/findbugs-exclude.xml +++ b/admin/findbugs-exclude.xml @@ -99,7 +99,7 @@ <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/> <Package name="~org\.eclipse\.tcf\.te\..*"/> </Match> - + <!-- Ignore LI_LAZY_INIT_UPDATE_STATIC in Model.java --> <Match> <Bug pattern="LI_LAZY_INIT_UPDATE_STATIC"/> diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java index dfc0d5e26..aea4fba1c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java @@ -192,7 +192,7 @@ public class PeerExportWizardPage extends WizardPage { GridData buttonData = new GridData(GridData.FILL_HORIZONTAL); button.setLayoutData(buttonData); - button.setData(new Integer(id)); + button.setData(Integer.valueOf(id)); button.setText(label); button.setFont(parent.getFont()); @@ -305,41 +305,42 @@ public class PeerExportWizardPage extends WizardPage { } IPath destpath = new Path(path); File destfolder = destpath.toFile(); - if(!destfolder.exists()) { - destfolder.mkdirs(); - } - monitor.beginTask(Messages.PeerExportWizard_title, configs.length); - boolean toggleState = false; - int toggleResult = -1; - for (Object config : configs) { - IURIPersistenceService service = ServiceManager.getInstance().getService(config, IURIPersistenceService.class); - if (service != null) { - try { - URI uri = service.getURI(config); - File defaultFile = new File(uri.normalize()); - defaultFile = new Path(defaultFile.toString()).removeFileExtension().toFile(); - File file = destpath.append(defaultFile.getName()).addFileExtension("peer").toFile(); //$NON-NLS-1$ - if (file.exists() && !overwrite) { - if (!toggleState || toggleResult < 0) { - MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion( - getShell(), null, - NLS.bind(Messages.PeerExportWizardPage_overwriteDialog_message, file.toString()), - Messages.PeerExportWizardPage_overwriteDialogToggle_message, toggleState, null, null); - toggleState = dialog.getToggleState(); - toggleResult = dialog.getReturnCode(); - } - if (toggleResult != IDialogConstants.YES_ID) { - continue; + boolean exist = destfolder.exists(); + if(!exist) exist = destfolder.mkdirs(); + if (exist) { + monitor.beginTask(Messages.PeerExportWizard_title, configs.length); + boolean toggleState = false; + int toggleResult = -1; + for (Object config : configs) { + IURIPersistenceService service = ServiceManager.getInstance().getService(config, IURIPersistenceService.class); + if (service != null) { + try { + URI uri = service.getURI(config); + File defaultFile = new File(uri.normalize()); + defaultFile = new Path(defaultFile.toString()).removeFileExtension().toFile(); + File file = destpath.append(defaultFile.getName()).addFileExtension("peer").toFile(); //$NON-NLS-1$ + if (file.exists() && !overwrite) { + if (!toggleState || toggleResult < 0) { + MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion( + getShell(), null, + NLS.bind(Messages.PeerExportWizardPage_overwriteDialog_message, file.toString()), + Messages.PeerExportWizardPage_overwriteDialogToggle_message, toggleState, null, null); + toggleState = dialog.getToggleState(); + toggleResult = dialog.getReturnCode(); + } + if (toggleResult != IDialogConstants.YES_ID) { + continue; + } } + service.write(config, file.toURI()); + } + catch (Exception e) { } - service.write(config, file.toURI()); - } - catch (Exception e) { } + monitor.worked(1); } - monitor.worked(1); + monitor.done(); } - monitor.done(); return Status.OK_STATUS; } }; diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java index ff125e5ed..da35b8c74 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java @@ -229,7 +229,7 @@ public class PeerImportWizardPage extends WizardPage { GridData buttonData = new GridData(GridData.FILL_HORIZONTAL); button.setLayoutData(buttonData); - button.setData(new Integer(id)); + button.setData(Integer.valueOf(id)); button.setText(label); button.setFont(parent.getFont()); |