Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-10-11 15:38:30 +0000
committerUwe Stieber2012-10-11 15:38:30 +0000
commit8262804baba03972c73338ebcecdd423b874fd8b (patch)
tree21e44a3a81f97f28a40c43567714cb13204bb249 /target_explorer
parentb9f3ad90ae22655966ff87e6b9dda63913862d79 (diff)
downloadorg.eclipse.tcf-8262804baba03972c73338ebcecdd423b874fd8b.tar.gz
org.eclipse.tcf-8262804baba03972c73338ebcecdd423b874fd8b.tar.xz
org.eclipse.tcf-8262804baba03972c73338ebcecdd423b874fd8b.zip
Target Explorer: Fix findbugs warnings
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerExportWizardPage.java63
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/PeerImportWizardPage.java2
2 files changed, 33 insertions, 32 deletions
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());

Back to the top