From acc931788cef1f3a1fbe18ee96532041f47502f4 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Thu, 12 Nov 2015 13:47:06 -0600 Subject: [PATCH] Omaha #4834 remove catch LocalizationOpFailedException replace catching LocalizationOpFailedException with LocalizationException Change-Id: Ib5ed69539474d798d04363106a5a2aaf47ac6e58 Former-commit-id: c465340cf3d5215c10409354b380ed76bbbca270 --- .../alertviz/ui/dialogs/FileSelectDlg.java | 20 +- .../uf/viz/alertviz/ConfigurationManager.java | 16 +- .../uf/viz/archive/ui/AbstractArchiveDlg.java | 7 +- .../d2d/ui/actions/DeleteAWIPSProcedure.java | 27 ++- .../perspective/view/FileTreeView.java | 6 +- .../view/LocalizationFileDragNDropSource.java | 5 +- .../view/actions/CopyToAction.java | 4 +- .../uf/viz/points/PointsDataManager.java | 13 +- .../text/SpellCheckTextViewer.java | 23 +-- .../climatology/WindRoseConfigDlg.java | 21 +- .../aviation/editor/TafViewerEditorDlg.java | 5 +- .../viz/avnconfig/AvnConfiguration.java | 11 +- .../viz/avnconfig/ITafSiteConfig.java | 11 +- .../viz/avnconfig/TafProductConfigDlg.java | 9 +- .../viz/avnconfig/TafSiteConfigIni.java | 9 +- .../viz/avnconfig/TextEditorSetupDlg.java | 4 +- .../gfe/core/internal/SampleSetManager.java | 11 +- .../viz/gfe/core/internal/WEGroupManager.java | 8 +- .../viz/gfe/dialogs/GFEConfigDialog.java | 10 +- .../viz/gfe/product/ProductFileUtil.java | 5 +- .../viz/gfe/smarttool/TextFileUtil.java | 7 +- .../textformatter/CombinationsFileUtil.java | 11 +- .../viz/ghg/monitor/data/GhgConfigData.java | 46 ++--- .../texteditor/TextWorkstationConstants.java | 9 +- .../dialogs/AlarmAlertSaveLoadDlg.java | 23 ++- .../alarmalert/util/AlarmAlertFunctions.java | 49 ++--- .../edex/plugin/gfe/watch/TPCWatchSrv.java | 13 +- .../archive/config/ArchiveConfigManager.java | 4 +- .../common/dataplugin/ffmp/FFMPTemplates.java | 181 +++++++++++------- .../ffmp/HucLevelGeometriesFactory.java | 9 +- .../uf/edex/menus/AbstractMenuUtil.java | 8 +- .../uf/edex/plugin/ffmp/FFMPGenerator.java | 85 ++++---- .../uf/edex/plugin/nwsauth/FileManager.java | 11 +- .../rest/RegistryFederationManager.java | 75 +++++--- 34 files changed, 391 insertions(+), 365 deletions(-) diff --git a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/FileSelectDlg.java b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/FileSelectDlg.java index d6ca0ce033..73de31a51b 100644 --- a/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/FileSelectDlg.java +++ b/cave/com.raytheon.uf.viz.alertviz.ui/src/com/raytheon/uf/viz/alertviz/ui/dialogs/FileSelectDlg.java @@ -34,7 +34,6 @@ import java.util.Vector; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -55,7 +54,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -73,6 +71,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * 07 Dec 2010 6531 cjeanbap Refactored class to be an Abstract class. * 02 Mar 2011 5632 cjeanbap Update Listbox title text * 06 May 2011 9101 cjeanbap Changed Constructor method signature. + * 12 Nov 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author lvenable @@ -268,7 +268,7 @@ public class FileSelectDlg extends Dialog { fileList.add(locFile.getFile(false).getName()); } fileList.select(getIndex()); - fileList.addSelectionListener(new SelectionListener() { + fileList.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { selectedIndex = fileList.getSelectionIndex(); @@ -287,10 +287,6 @@ public class FileSelectDlg extends Dialog { associatedTextBox.setText(name); } } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } }); } @@ -313,6 +309,7 @@ public class FileSelectDlg extends Dialog { okBtn.setText("OK"); okBtn.setLayoutData(gd); okBtn.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { returnObj = true; shell.dispose(); @@ -324,6 +321,7 @@ public class FileSelectDlg extends Dialog { cancelBtn.setText("Cancel"); cancelBtn.setLayoutData(gd); cancelBtn.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { if (isSelected()) { returnObj = false; @@ -339,6 +337,7 @@ public class FileSelectDlg extends Dialog { importNewBtn1.setText("Import"); importNewBtn1.setLayoutData(gd); importNewBtn1.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { FileDialog newFileDlg = new FileDialog(shell, SWT.OPEN | SWT.SINGLE); @@ -368,10 +367,7 @@ public class FileSelectDlg extends Dialog { } setSelectedFile(newFile.getName()); } - } catch (LocalizationOpFailedException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); - } catch (IOException e) { + } catch (LocalizationException | IOException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } @@ -382,7 +378,7 @@ public class FileSelectDlg extends Dialog { } private boolean saveToLocalizationFile(File file, LocalizationFile locFile) - throws IOException, LocalizationOpFailedException { + throws IOException, LocalizationException { File newFile = locFile.getFile(); InputStream in = new FileInputStream(file); OutputStream out = new FileOutputStream(newFile); diff --git a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java index c342b796a5..acc63a0786 100644 --- a/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java +++ b/cave/com.raytheon.uf.viz.alertviz/src/com/raytheon/uf/viz/alertviz/ConfigurationManager.java @@ -40,7 +40,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -58,14 +58,16 @@ import com.raytheon.uf.viz.alertviz.config.Source; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 7, 2010 mschenke Initial creation + * Apr 07, 2010 mschenke Initial creation * Mar 16, 2011 6531 rferrel Start up loads host dependent * configuration file. - * Aug 28 2012 13528 Xiaochuan Using setNewConfiguration() to + * Aug 28, 2012 13528 Xiaochuan Using setNewConfiguration() to * re-set configuration data and * run notifyListeners(). - * Apr 07 2015 4346 rferrel Created {@link #retrieveBaseConfiguration()}. + * Apr 07, 2015 4346 rferrel Created {@link #retrieveBaseConfiguration}. * May 20, 2015 4346 rjpeter Updated to also load from common_static. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author mschenke @@ -262,7 +264,7 @@ public class ConfigurationManager { /** * Delete the configuration passed in * - * @param name + * @param context */ public void deleteConfiguration(ConfigContext context) { if (context.isBaseOrConfiguredLevel() || isDefaultConfig(context)) { @@ -596,9 +598,7 @@ public class ConfigurationManager { } serializeToFile(customConfiguration, customFile); locFile.save(); - } catch (SerializationException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } catch (LocalizationOpFailedException e) { + } catch (SerializationException | LocalizationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java index 1b2c576996..a763217581 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java @@ -49,7 +49,7 @@ import com.raytheon.uf.common.archive.config.ArchiveConfigManager; import com.raytheon.uf.common.archive.config.ArchiveConstants; import com.raytheon.uf.common.archive.config.CategoryConfig; import com.raytheon.uf.common.archive.config.DisplayData; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.util.SizeUtil; import com.raytheon.uf.viz.archive.data.ArchiveInfo; import com.raytheon.uf.viz.archive.data.CategoryInfo; @@ -83,6 +83,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Apr 10, 2014 3023 rferrel Added setTotalSelectedSize method. * Apr 23, 2014 3045 rferrel Changes to prevent race condition while getting labels. * Aug 26, 2014 3553 rferrel Force redisplay of table after getting all display labels. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -473,7 +474,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements String fileName = ArchiveConstants.selectFileName(type, selectName); try { manager.deleteSelection(fileName); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { MessageDialog.openError(shell, "Case Error", "Unable to delete file: " + fileName); } @@ -819,6 +820,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements * * @param startTimeOffset */ + @Override public void setRetentionTimes(long startTimeOffset) { // do nothing override by sub-classes } @@ -858,6 +860,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements /** * Perform updates once all the display data is loaded. */ + @Override public void loadedAllDisplayData() { VizApp.runAsync(new Runnable() { diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java index 403923ecf8..477e9c6cf4 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java +++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/actions/DeleteAWIPSProcedure.java @@ -26,7 +26,7 @@ import org.eclipse.ui.handlers.HandlerUtil; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -36,22 +36,21 @@ import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg; import com.raytheon.viz.ui.dialogs.localization.VizLocalizationFileListDlg.Mode; /** - * DeleteAWIPSProcedure - * * Delete an AWIPS procedure * *
  * 
- *    SOFTWARE HISTORY
- *   
- *    Date         Ticket#     Engineer    Description
- *    ------------ ----------  ----------- --------------------------
- *    Sep 13, 2007             chammack    Initial Creation.
- *    Jul 8, 2008  #1183       chammack    Migrate to new localization
- *    Oct 16, 2012 #1229       rferrel     Changes for non-blocking VizLocalizationFileListDlg.
- *    Jun 02, 2015 #4401       bkowal      Updated to use {@link VizLocalizationFileListDlg}.
- *    Jun 30, 2015 #4401       bkowal      Specify the localization type when constructing a
- *                                         {@link VizLocalizationFileListDlg}.
+ * SOFTWARE HISTORY
+ *
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * Sep 13, 2007             chammack    Initial Creation.
+ * Jul 8, 2008  #1183       chammack    Migrate to new localization
+ * Oct 16, 2012 #1229       rferrel     Changes for non-blocking VizLocalizationFileListDlg.
+ * Jun 02, 2015 #4401       bkowal      Updated to use {@link VizLocalizationFileListDlg}.
+ * Jun 30, 2015 #4401       bkowal      Specify the localization type when constructing a
+ *                                      {@link VizLocalizationFileListDlg}.
+ * Nov 12, 2015  4834       njensen     Changed LocalizationOpFailedException to LocalizationException
  * 
  * 
* @@ -87,7 +86,7 @@ public class DeleteAWIPSProcedure extends AbstractHandler { LocalizationFile selectedFile = (LocalizationFile) returnValue; try { selectedFile.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle( Priority.PROBLEM, "Error deleting procedure: " diff --git a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/FileTreeView.java b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/FileTreeView.java index aa4c178961..98af927c4c 100644 --- a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/FileTreeView.java +++ b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/FileTreeView.java @@ -94,7 +94,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.LocalizationNotificationObserver; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -142,7 +142,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService; * Aug 24, 2015 4393 njensen Updates for observer changes * Oct 13, 2015 4410 bsteffen Allow localization perspective to mix * files for multiple Localization Types. - * + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -1574,7 +1574,7 @@ public class FileTreeView extends ViewPart implements IPartListener2, .isSystemLevel() == false) { input.getLocalizationFile().save(); } - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle( Priority.PROBLEM, "Error saving file: " diff --git a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/LocalizationFileDragNDropSource.java b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/LocalizationFileDragNDropSource.java index 2f727920c2..e632bbeb32 100644 --- a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/LocalizationFileDragNDropSource.java +++ b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/LocalizationFileDragNDropSource.java @@ -46,7 +46,6 @@ import com.raytheon.uf.common.localization.LocalizationUtil; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.SaveableOutputStream; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.localization.msgs.ListResponseEntry; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -69,7 +68,7 @@ import com.raytheon.uf.viz.localization.perspective.view.actions.ImportFileActio * Jul 1, 2011 mschenke Initial creation * Oct 13, 2015 4410 bsteffen Allow localization perspective to mix * files for multiple Localization Types. - * + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -120,7 +119,7 @@ public class LocalizationFileDragNDropSource extends ViewerDropAdapter if (toDelete != null) { try { toDelete.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { UFStatus.getHandler().handle(Priority.PROBLEM, "Error deleting old file", e); } diff --git a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/CopyToAction.java b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/CopyToAction.java index 05a173c3e5..9ba329f591 100644 --- a/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/CopyToAction.java +++ b/cave/com.raytheon.uf.viz.localization.perspective/src/com/raytheon/uf/viz/localization/perspective/view/actions/CopyToAction.java @@ -35,7 +35,6 @@ import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.SaveableOutputStream; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -57,6 +56,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService; * Nov 3, 2010 mschenke Initial creation * Oct 13, 2015 4410 bsteffen Allow localization perspective to mix * files for multiple Localization Types. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -138,7 +138,7 @@ public class CopyToAction extends AbstractToAction { if (altFile.exists()) { try { altFile.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Unable to delete existing " + type.name() + " " + level + " file.", e); diff --git a/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/PointsDataManager.java b/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/PointsDataManager.java index 8f10dd20a6..66aad18a98 100644 --- a/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/PointsDataManager.java +++ b/cave/com.raytheon.uf.viz.points/src/com/raytheon/uf/viz/points/PointsDataManager.java @@ -89,6 +89,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Dec 05, 2012 #1364 rferrel Replace File.Separator with IPathManager.SEPARATOR * to work correctly on all platforms. * Oct 20, 2014 #3418 dlovely Fixed a possible NPE in loadPoint. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -454,7 +455,7 @@ public class PointsDataManager implements ILocalizationFileObserver { if (!d2dDir.isDirectory()) { try { d2dDir.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Unable to create group: " + D2D_POINTS_GROUP); return points; @@ -960,7 +961,7 @@ public class PointsDataManager implements ILocalizationFileObserver { put(key, point); childrenKeyMap.get(newParentKey).add(key); } else { - Point newGroup = new GroupNode((Point) point); + Point newGroup = new GroupNode(point); String newGroupKey = newParentKey + IPathManager.SEPARATOR + point.getName(); newGroup.setGroup(newGroupKey); @@ -1364,7 +1365,7 @@ public class PointsDataManager implements ILocalizationFileObserver { deleteKey); try { lFile.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } @@ -1505,9 +1506,6 @@ public class PointsDataManager implements ILocalizationFileObserver { * ADDED if file was successfully created. * * @param point - * @return returns true if point was successfully added, false otherwise, - * for example when a duplicate point name exists and forceOverwrite - * was false */ private void storePoint(Point point) { LocalizationFile dir = getGroupDir(point); @@ -1522,7 +1520,6 @@ public class PointsDataManager implements ILocalizationFileObserver { * DELETE if file removal is successful. * * @param point - * @return */ public void deletePoint(final Point point) { IPointNode parentNode = getParent(point); @@ -1592,7 +1589,7 @@ public class PointsDataManager implements ILocalizationFileObserver { if (!lFile.delete()) { statusHandler.error("Unable to remove file: " + lFile); } - } catch (LocalizationOpFailedException e1) { + } catch (LocalizationException e1) { statusHandler.handle(Priority.PROBLEM, "Error deleting locatization file from server: " + lFile); } diff --git a/cave/com.raytheon.uf.viz.spellchecker/src/com/raytheon/uf/viz/spellchecker/text/SpellCheckTextViewer.java b/cave/com.raytheon.uf.viz.spellchecker/src/com/raytheon/uf/viz/spellchecker/text/SpellCheckTextViewer.java index c4045b7b7d..cbcda315f7 100644 --- a/cave/com.raytheon.uf.viz.spellchecker/src/com/raytheon/uf/viz/spellchecker/text/SpellCheckTextViewer.java +++ b/cave/com.raytheon.uf.viz.spellchecker/src/com/raytheon/uf/viz/spellchecker/text/SpellCheckTextViewer.java @@ -66,7 +66,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.viz.core.VizApp; @@ -81,15 +81,16 @@ import com.raytheon.uf.viz.spellchecker.jobs.EnhancedSpellCheckJob; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jun 18, 2014 3453 rblum Initial creation - * Aug 06, 2014 3453 rblum Refreshing all viewers on enable/ - * disable of spell checking. - * Aug 18, 2014 3453 rblum Added the spell check dictionary - * to site level localization. - * Oct 01, 2014 3453 rblum Allow MB3 click anywhere in the textbox - * to enable/disable spellcheck. - * Mar 27, 2015 4138 dhladky Guava name change. - * Apr 14, 2015 4362 mapeters Allow external contribution of menu items. + * Jun 18, 2014 3453 rblum Initial creation + * Aug 06, 2014 3453 rblum Refreshing all viewers on enable/ + * disable of spell checking. + * Aug 18, 2014 3453 rblum Added the spell check dictionary + * to site level localization. + * Oct 01, 2014 3453 rblum Allow MB3 click anywhere in the textbox + * to enable/disable spellcheck. + * Mar 27, 2015 4138 dhladky Guava name change. + * Apr 14, 2015 4362 mapeters Allow external contribution of menu items. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -387,7 +388,7 @@ public class SpellCheckTextViewer extends TextViewer implements if (lf != null) { lf.save(); } - } catch (LocalizationOpFailedException exception) { + } catch (LocalizationException exception) { statusHandler.error( "Unable to save dictionary into localization", exception); diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WindRoseConfigDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WindRoseConfigDlg.java index 818b7fca6b..2b0a6a0a72 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WindRoseConfigDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/WindRoseConfigDlg.java @@ -48,6 +48,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; @@ -62,6 +63,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * 28 FEB 2008 938 lvenable Initial creation * 18 JUN 2008 1119 lvenable Updated dialog to reflect user changes. * 04 OCT 2012 1229 rferrel Made non-blocking. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -574,13 +576,7 @@ public class WindRoseConfigDlg extends CaveSWTDialog { try { updateData(); - } catch (ConfigurationException e) { - // TODO Auto-generated catch block - System.err.println(e.getStackTrace()); - } catch (LocalizationOpFailedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { + } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -605,13 +601,7 @@ public class WindRoseConfigDlg extends CaveSWTDialog { try { updateData(); - } catch (ConfigurationException e) { - // TODO Auto-generated catch block - System.err.println(e.getStackTrace()); - } catch (LocalizationOpFailedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { + } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -692,10 +682,9 @@ public class WindRoseConfigDlg extends CaveSWTDialog { * @throws IOException * @throws ConfigurationException * @throws LocalizationOpFailedException - * @throws LocalizationCommunicationException */ private void updateData() throws IOException, ConfigurationException, - LocalizationOpFailedException { + LocalizationException { windRoseConfigData.setCalmRgb(calmColor.getRGB()); windRoseConfigData.setVariableRgb(variableColor.getRGB()); windRoseConfigData.setVar1Rgb(windSpeed1Color.getRGB()); diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java index 8d3edda713..75a127f95d 100644 --- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java +++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/editor/TafViewerEditorDlg.java @@ -96,7 +96,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.python.PyUtil; import com.raytheon.uf.common.python.PythonScript; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -247,6 +247,7 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations; * Sep 28, 2015 4898 rferrel Disable sending of TAF when CAVE not in real time. * Oct 05, 2015 4855 skorolev Fixed an unhandled event loop exception in createErrorStyleRange. * Oct 16, 2015 4645 skorolev Added updateWordWrap. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -2430,7 +2431,7 @@ public class TafViewerEditorDlg extends CaveSWTDialog implements ITafSettable, e.printStackTrace(); setMessageStatusError("An IOException occured while saving file " + filepath); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { e.printStackTrace(); setMessageStatusError("A LocalizationOpFailedException occured while saving file " + filepath); diff --git a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/AvnConfiguration.java b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/AvnConfiguration.java index 10a82b1999..8f8f0a01ea 100644 --- a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/AvnConfiguration.java +++ b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/AvnConfiguration.java @@ -33,6 +33,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -63,6 +64,8 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.RuleType; * Aug 07, 2014 3502 bclement changes to StringUtil.split() * Jun 02, 2015 17533 yteng changes to getRules() to retrieve * all rules + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author avarani @@ -255,7 +258,7 @@ public class AvnConfiguration { */ public void setRules(String site, DataSource source, ArrayList data) throws ConfigurationException, - IOException, LocalizationOpFailedException { + IOException, LocalizationException { String filepath = "aviation/config/tafs/" + site + "/" + source.getFilename(); IPathManager pm = PathManagerFactory.getPathManager(); @@ -355,13 +358,13 @@ public class AvnConfiguration { HierarchicalINIConfiguration config = new HierarchicalINIConfiguration( file); config.setDelimiterParsingDisabled(true); - + String[] activeRules = config.getStringArray("rules.active"); - if (activeRules == null || activeRules.length == 0) { + if (activeRules == null || activeRules.length == 0) { throw new ConfigurationException(file.getName() + ", no list of active rules"); } - + for (String activeRule : activeRules) { if (activeRule.trim().equals("")) { continue; diff --git a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/ITafSiteConfig.java b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/ITafSiteConfig.java index 5f30c11c81..7729c5131f 100644 --- a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/ITafSiteConfig.java +++ b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/ITafSiteConfig.java @@ -8,6 +8,7 @@ import java.util.Map; import org.apache.commons.configuration.ConfigurationException; import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType; @@ -24,6 +25,7 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType; * Oct 20, 2010 rferrel Initial creation * Dec 7, 2010 7621 rferrel Added getTemplateFile. * Feb 16, 2011 7878 rferrel Modifications to handle ids.cfg. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -60,11 +62,10 @@ public interface ITafSiteConfig { * @param defaultProduct * - New default product * @throws ConfigurationException - * @throws LocalizationCommunicationException * @throws LocalizationOpFailedException */ public void setDefault(String defaultProduct) - throws ConfigurationException, LocalizationOpFailedException; + throws ConfigurationException, LocalizationException; /** * @return defaultProduct @@ -107,7 +108,6 @@ public interface ITafSiteConfig { * @param collectivePil * - product's collective Pil value * @throws ConfigurationException - * @throws LocalizationCommunicationException * @throws LocalizationOpFailedException */ public void saveProduct(String newProduct, List siteList, @@ -120,11 +120,10 @@ public interface ITafSiteConfig { * @param product * - product name to delete * @throws ConfigurationException - * @throws LocalizationCommunicationException * @throws LocalizationOpFailedException */ public void deleteProduct(String product) throws ConfigurationException, - LocalizationOpFailedException; + LocalizationException; /** * Update a site's start Hour template and save the change. @@ -136,7 +135,6 @@ public interface ITafSiteConfig { * @param template * - new template * @throws ConfigurationException - * @throws LocalizationCommunicationException * @throws LocalizationOpFailedException */ public void saveTafTemplate(String siteId, String startHour, String template) @@ -172,7 +170,6 @@ public interface ITafSiteConfig { * - new taf site data * @throws IOException * @throws ConfigurationException - * @throws LocalizationCommunicationException * @throws LocalizationOpFailedException */ public void setSite(String siteId, TafSiteData site) throws IOException, diff --git a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafProductConfigDlg.java b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafProductConfigDlg.java index 989b4623fc..ad3b924fb6 100644 --- a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafProductConfigDlg.java +++ b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafProductConfigDlg.java @@ -47,6 +47,7 @@ import org.eclipse.swt.widgets.Text; import com.raytheon.uf.common.dataplugin.text.AfosWmoIdDataContainer; import com.raytheon.uf.common.dataplugin.text.db.AfosToAwips; import com.raytheon.uf.common.dataplugin.text.request.GetPartialAfosIdRequest; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -69,6 +70,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * 12 Oct 2012 1229 rferrel Convert to CaveSWTDialog subclass * and make non-blocking. * 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -328,7 +330,7 @@ public class TafProductConfigDlg extends CaveSWTDialog { .setMessageText( "An error occured while attempting to delete a product.", new RGB(255, 0, 0)); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { msgStatusComp .setMessageText( "An error occured while attempting to delete a product.", @@ -513,7 +515,7 @@ public class TafProductConfigDlg extends CaveSWTDialog { .setMessageText( "An error occured when attempting to set default product.", new RGB(255, 0, 0)); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { msgStatusComp .setMessageText( "An error occured when attempting to set default product.", @@ -546,8 +548,7 @@ public class TafProductConfigDlg extends CaveSWTDialog { String description = "TAF Product Configuration Help"; String helpText = "This dialog is used to define TAF/TWEB product (list of\nforecasts).\n\nThee products should be defined AFTER relevant site/route\nconfiguration files have been created.\n\nTo add a new product, enter product label in the \"Products\"\nentry field and press . Then enter all TAF ids or\nTWEB routes in the \"Idents\" entry field, press \nafter typing one item. Press \"Save\" button to save\nconfiguration file.\n\nTo remove a product, press \"Delede\" below \"Products\" list.\n\nTo remove an ident from the product definition, use\n\"Delete\" button in the \"Idents\" column. You must then save\nthe product. This will NOT delete TAF/TWEB configuration\nfiles, this can only be done from the command line.\n\nThe \"Verify\" button can be used to check for existence and\nproper syntax of all relevant files."; - usageDlg = new HelpUsageDlg(shell, description, - helpText); + usageDlg = new HelpUsageDlg(shell, description, helpText); usageDlg.open(); } else { usageDlg.bringToTop(); diff --git a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafSiteConfigIni.java b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafSiteConfigIni.java index b360759419..605c4e947e 100644 --- a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafSiteConfigIni.java +++ b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TafSiteConfigIni.java @@ -66,7 +66,8 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType; * Apr 08, 2011 8856 rferrel Can now make a new station's templates * May 24, 2011 9060 rferrel Limit downloading of localization files. * Aug 09, 2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR - * May 19, 2015 17417 yteng Get all sites from product + * May 19, 2015 17417 yteng Get all sites from product + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -452,7 +453,7 @@ public class TafSiteConfigIni implements ITafSiteConfig { */ @Override public void deleteProduct(String product) throws ConfigurationException, - LocalizationOpFailedException { + LocalizationException { HierarchicalINIConfiguration config = configMaps.get(product); @@ -486,10 +487,8 @@ public class TafSiteConfigIni implements ITafSiteConfig { File file = lFile.getFile(); if (file != null && file.exists()) { char[] c = new char[(int) file.length()]; - FileReader reader = new FileReader(file); - try { + try (FileReader reader = new FileReader(file)) { reader.read(c); - reader.close(); } catch (IOException ex) { throw new ConfigurationException(ex.getMessage()); } diff --git a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TextEditorSetupDlg.java b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TextEditorSetupDlg.java index 1ae42bfec2..6dd6e42dca 100644 --- a/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TextEditorSetupDlg.java +++ b/cave/com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig/TextEditorSetupDlg.java @@ -58,6 +58,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.viz.core.localization.LocalizationManager; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; @@ -78,6 +79,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * 11 OCT 2012 1229 rferrel Changes for non-blocking FindReplaceDlg. * 15 OCT 2012 1229 rferrel Made dialog non-blocking. * 15 OCT 2012 1229 rferrel Changes for non-blocking HelpUsageDlg. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -787,7 +789,7 @@ public class TextEditorSetupDlg extends CaveSWTDialog { msgStatusComp.setMessageText( "An error occured while saving file " + fn, new RGB( 255, 0, 0)); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { msgStatusComp.setMessageText( "An error occured while saving file " + fn, new RGB( 255, 0, 0)); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/SampleSetManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/SampleSetManager.java index 7a9af4c856..fcbb676a1c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/SampleSetManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/SampleSetManager.java @@ -46,7 +46,6 @@ import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.LocalizationUtil; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -65,9 +64,9 @@ import com.vividsolutions.jts.geom.Coordinate; * *
  * SOFTWARE HISTORY
- * Date			Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * Apr 14, 2008	879			rbell	    Initial creation
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * Apr 14, 2008 879         rbell       Initial creation
  * 11Jun2008    #1193       ebabin      Updates for toggling lat/lon for sample set.
  * Apr 9, 2009  1288        rjpeter     Added ISampleSetChangedListener handling.
  * Aug 6, 2013  1561        njensen     Use pm.listFiles() instead of pm.listStaticFiles()
@@ -75,6 +74,8 @@ import com.vividsolutions.jts.geom.Coordinate;
  * Sep 08, 2104 #3592       randerso    Changed to use new pm listStaticFiles().
  *                                      Reworked inventory to use a map to better handle
  *                                      files at multiple localization levels
+ * Nov 12, 2015 4834        njensen     Changed LocalizationOpFailedException to LocalizationException
+ * 
  * 
* * @author rbell @@ -426,7 +427,7 @@ public class SampleSetManager implements ISampleSetManager, SampleData.getJAXBManager().marshalToXmlFile(sd, file.getFile().getPath()); file.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Error saving to localization server", e); } catch (SerializationException e) { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/WEGroupManager.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/WEGroupManager.java index 97ad8cd333..3a9c584a0c 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/WEGroupManager.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/WEGroupManager.java @@ -44,7 +44,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -66,7 +65,8 @@ import com.raytheon.viz.gfe.core.IWEGroupManager; * ------------ ---------- ----------- -------------------------- * Jun 05, 2008 chammack Initial creation * Sep 30, 2013 2361 njensen Use JAXBManager for XML - * Aug 13, 2015 4749 njensen Implemented dispose() + * Aug 13, 2015 4749 njensen Implemented dispose() + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -365,7 +365,7 @@ public class WEGroupManager implements IWEGroupManager, file.delete(); inventory.get(context.getLocalizationLevel()).remove(object); return true; - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Error deleting from localization server", e); } @@ -386,7 +386,7 @@ public class WEGroupManager implements IWEGroupManager, try { jaxb.marshalToXmlFile(objectToSave, file.getFile().getPath()); file.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Error saving to localization server", e); } catch (SerializationException e) { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java index e4dff4822c..f48a4692b8 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java @@ -60,6 +60,7 @@ import org.eclipse.swt.widgets.List; import org.eclipse.swt.widgets.Monitor; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.plugin.AbstractUIPlugin; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; @@ -67,7 +68,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -83,12 +84,13 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; *
  * 
  * SOFTWARE HISTORY
- * Date         Ticket//    Engineer    Description
+ * Date         Ticket     Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Apr 30, 2009            randerso    Initial creation
  * Oct 30, 2012 1298       rferrel     Code cleanup for non-blocking dialog.
  * Oct 28, 2015 5054       randerso    Place GfeConfigDialog on current monitor if 
  *                                     parent shell is not visible.
+ * Nov 12, 2015 4834       njensen     Changed LocalizationOpFailedException to LocalizationException
  * 
  * 
* @@ -330,7 +332,7 @@ public class GFEConfigDialog extends CaveJFACEDialog { private Image nextImage() { int imageNumber = randomSplash(); String imageName = "SSa" + imageNumber + ".gif"; - ImageDescriptor id = Activator.imageDescriptorFromPlugin( + ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, FileUtil.join("images", imageName)); return id.createImage(); } @@ -431,7 +433,7 @@ public class GFEConfigDialog extends CaveJFACEDialog { try { lf.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Error saving config file selection", e); } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/product/ProductFileUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/product/ProductFileUtil.java index 00a3851eb4..ffa9569b3d 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/product/ProductFileUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/product/ProductFileUtil.java @@ -36,7 +36,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.util.FileUtil; import com.raytheon.viz.core.mode.CAVEMode; @@ -49,6 +49,7 @@ import com.raytheon.viz.core.mode.CAVEMode; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 11 Feb 2010 4132 ryu Initial creation + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -169,7 +170,7 @@ public class ProductFileUtil { } static public void writeFile(String text, LocalizationFile localizationFile) - throws IOException, LocalizationOpFailedException { + throws IOException, LocalizationException { File file = localizationFile.getFile(); writeFile(text, file); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java index cc08bd2b7b..742f40381e 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/TextFileUtil.java @@ -34,7 +34,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.python.PythonFileFilter; import com.raytheon.viz.gfe.GFEOperationFailedException; @@ -48,6 +47,7 @@ import com.raytheon.viz.gfe.GFEOperationFailedException; * ------------ ---------- ----------- -------------------------- * Apr 28, 2009 njensen Initial creation * Apr 20, 2015 4027 randerso Changes to support GFE formatter auto tests + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -124,8 +124,7 @@ public class TextFileUtil { } public static void makeWritableCopy(String source, String fileType, - String dest, boolean deleteFlag) throws IOException, - GFEOperationFailedException { + String dest, boolean deleteFlag) throws GFEOperationFailedException { LocalizationFile srcLf = getTextFile(source, fileType); if ((srcLf.getContext().getLocalizationLevel() == LocalizationLevel.BASE) || (srcLf.getContext().getLocalizationLevel() == LocalizationLevel.CONFIGURED) @@ -181,7 +180,7 @@ public class TextFileUtil { } public static void deleteTextFile(LocalizationFile lf) - throws LocalizationOpFailedException, IOException { + throws LocalizationException, IOException { if (lf.getContext().getLocalizationLevel() .equals(LocalizationLevel.USER) && lf.getContext().getContextName().equals("GFETEST")) { diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java index 911b63c269..f6943b74e8 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java @@ -47,8 +47,8 @@ import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.SaveableOutputStream; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.python.PyUtil; +import com.raytheon.uf.common.python.PythonIncludePathUtil; import com.raytheon.uf.common.python.PythonScript; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SingleTypeJAXBManager; @@ -78,6 +78,7 @@ import com.raytheon.viz.gfe.textformatter.CombinationsFileUtil.ComboData.Entry; * Sep 08, 2014 #3592 randerso Changed to use only list site level files as all * combo files are saved to the site level * Oct 07, 2015 #4695 dgilling Code cleanup to remove compile warnings. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -178,8 +179,7 @@ public class CombinationsFileUtil { } } - public static void deleteComboData(String id) - throws LocalizationOpFailedException { + public static void deleteComboData(String id) throws LocalizationException { LocalizationFile lf = idToFile(id); lf.delete(); } @@ -268,10 +268,11 @@ public class CombinationsFileUtil { HashMap map = new HashMap(); map.put("comboName", comboName); for (int retryCount = 0; retryCount < MAX_TRIES; retryCount++) { - try (PythonScript python = new PythonScript(scriptPath, + try (PythonScript python = new PythonScript( + scriptPath, PyUtil.buildJepIncludePath( GfePyIncludeUtil.getCombinationsIncludePath(), - GfePyIncludeUtil.getCommonPythonIncludePath()), + PythonIncludePathUtil.getCommonPythonIncludePath()), CombinationsFileUtil.class.getClassLoader())) { Object com = python.execute("getCombinations", map); combos = (List>) com; diff --git a/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java b/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java index 97102abcf5..e1a8f2ffb0 100644 --- a/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java +++ b/cave/com.raytheon.viz.ghg/src/com/raytheon/viz/ghg/monitor/data/GhgConfigData.java @@ -50,7 +50,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.python.PyUtil; import com.raytheon.uf.common.python.PythonScript; import com.raytheon.uf.common.site.SiteMap; @@ -84,7 +84,8 @@ import com.raytheon.viz.ui.statusline.StatusStore; * 28Nov2012 1353 rferrel Sort the list of filter names for dialog display. * 10Apr2014 15769 ryu Modified default config and GUI items to match A1. * Default config changed to hard coding instead of reading - * from config file. + * from config file. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @author lvenable @@ -106,8 +107,8 @@ public final class GhgConfigData { /** * The VTEC Action Names */ - public static final String[] vtecActionNames = { "CAN", "CON", - "EXA", "EXB", "EXP", "EXT", "NEW", "UPG"}; + public static final String[] vtecActionNames = { "CAN", "CON", "EXA", + "EXB", "EXP", "EXT", "NEW", "UPG" }; /** * The VTEC Afos Product (PIL) Names @@ -340,6 +341,7 @@ public final class GhgConfigData { // Fonts are system resources. We have to dispose of them // properly. display.addListener(SWT.Dispose, new Listener() { + @Override public void handleEvent(Event e) { Font font = fontMap.get(e.display); font.dispose(); @@ -387,11 +389,11 @@ public final class GhgConfigData { */ private void init() { loadDefault(); - + defaultFilter = currentFilter.clone(); defaultAlerts = currentAlerts.clone(); defaultColumns = new ArrayList(visibleColumns); - + // Get the VTECTable initializePython(); } @@ -769,10 +771,7 @@ public final class GhgConfigData { StatusStore.updateStatus(StatusConstants.SUBCATEGORY_GHG, "Saved configuration", StatusMessage.Importance.REGULAR); - } catch (JAXBException e) { - statusHandler.handle(Priority.PROBLEM, - "Error saving GHG Monitor configuration", e); - } catch (LocalizationOpFailedException e) { + } catch (JAXBException | LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Error saving GHG Monitor configuration", e); } @@ -798,14 +797,11 @@ public final class GhgConfigData { GhgAlertsConfigData alerts = new GhgAlertsConfigData(); alerts.setLocal(true); alerts.setTest(true); - alerts.addAlert(new GhgAlertData(true, true, 30, - AlertsEnum.AlertLvl1)); - alerts.addAlert(new GhgAlertData(true, true, 10, - AlertsEnum.AlertLvl2)); - alerts.addAlert(new GhgAlertData(true, true, 0, - AlertsEnum.ExpiredAlert)); - alerts.setActions(new String[] { "NEW", "CON", "COR", "EXT", - "EXA", "EXB" }); + alerts.addAlert(new GhgAlertData(true, true, 30, AlertsEnum.AlertLvl1)); + alerts.addAlert(new GhgAlertData(true, true, 10, AlertsEnum.AlertLvl2)); + alerts.addAlert(new GhgAlertData(true, true, 0, AlertsEnum.ExpiredAlert)); + alerts.setActions(new String[] { "NEW", "CON", "COR", "EXT", "EXA", + "EXB" }); alerts.setPhenSigs(new String[] {}); alerts.setPils(new String[] {}); currentAlerts = alerts; @@ -844,16 +840,16 @@ public final class GhgConfigData { visibleColumns = new ArrayList(DataEnum.values().length); // The initial columns visible. These need to match the ones set up by // GhgMonitorDlg. - visibleColumns.addAll(Arrays.asList(DataEnum.ACTION, DataEnum.ETN, - DataEnum.PHEN_SIG, DataEnum.START, DataEnum.END, - DataEnum.PURGE, DataEnum.ISSUE_TIME, DataEnum.PIL, - DataEnum.WFO)); + visibleColumns.addAll(Arrays + .asList(DataEnum.ACTION, DataEnum.ETN, DataEnum.PHEN_SIG, + DataEnum.START, DataEnum.END, DataEnum.PURGE, + DataEnum.ISSUE_TIME, DataEnum.PIL, DataEnum.WFO)); sortColumn = DataEnum.PURGE; - + descending = false; identifyTestEvents = true; - - //loadFrom(DEFAULT_PATH, true); + + // loadFrom(DEFAULT_PATH, true); } public void load(boolean reportMissing) { diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationConstants.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationConstants.java index 27afb4c536..d7670b5a4b 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationConstants.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationConstants.java @@ -35,21 +35,22 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.viz.core.mode.CAVEMode; /** - * TODO Add Description + * Constants for the text workstation * *
  * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Nov 11, 2009            mschenke     Initial creation
+ * Nov 11, 2009            mschenke    Initial creation
+ * Nov 12, 2015 4834       njensen     Changed LocalizationOpFailedException to LocalizationException
  * 
  * 
* @@ -158,7 +159,7 @@ public class TextWorkstationConstants { super.save(); try { file.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.PROBLEM, "Error saving text workstation preferences", e); } diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmAlertSaveLoadDlg.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmAlertSaveLoadDlg.java index 88c84712f2..06061eac97 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmAlertSaveLoadDlg.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/dialogs/AlarmAlertSaveLoadDlg.java @@ -38,7 +38,7 @@ import org.eclipse.swt.widgets.Text; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -53,13 +53,12 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Sep 17, 2009 mnash Initial creation - * ====================================== - * AWIPS2 DR Work - * 07/25/2012 953 jkorman Modified file "search" to return LocalizationFile - * instead of File so references are deleted in all locations. - * 09/20/2012 1196 rferrel Setup fileName now in return value for - * use with close callback. + * Sep 17, 2009 mnash Initial creation + * 07/25/2012 953 jkorman Modified file "search" to return LocalizationFile + * instead of File so references are deleted in all locations. + * 09/20/2012 1196 rferrel Setup fileName now in return value for + * use with close callback. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -189,6 +188,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog { // loads the loadButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { // Set the filename to be returned through getFileName() if (lists.getSelectionCount() > 0) { @@ -203,6 +203,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog { // delete the file from the display list and from the file system deleteButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { int num = lists.getSelectionIndex(); LocalizationFile f = fileList.get(num); @@ -213,7 +214,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog { .getFile().getPath()); statusHandler.handle(Priority.PROBLEM, msg); } - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { String msg = String.format( "ALARM/ALERT:Failed deleting file %s", f.getFile() .getPath()); @@ -225,6 +226,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog { // close the display without doing anything else cancelButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { shell.close(); } @@ -287,6 +289,7 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog { // get the file name saveButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { // Set the filename to be returned through getFileName() fileName = textBox.getText(); @@ -297,12 +300,14 @@ public class AlarmAlertSaveLoadDlg extends CaveSWTDialog { // close the display without doing anything else cancelButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { shell.close(); } }); lists.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { textBox.setText(lists.getSelection()[0]); } diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java index ef9190d1af..cbd2c3d6c9 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/alarmalert/util/AlarmAlertFunctions.java @@ -52,7 +52,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -77,26 +77,18 @@ import com.vividsolutions.jts.geom.GeometryFactory; * ------------ ---------- ----------- -------------------------- * Sep 18, 2009 mnash Initial creation * 03/19/2012 D. Friedman Fix determination of "Alarm" entries. - * 12/07/2012 15555 m.gamazaychikov Added methods and constants for - * the implementation of proximity alarm + * 12/07/2012 15555 mgamazay Added methods and constants for + * the implementation of proximity alarm * 07/24/2014 3423 randerso Ensure ringBell is called on UI thread * 09/09/2014 3580 mapeters Removed IQueryTransport usage (no longer exists). * 12/03/2014 ASM #16829 D. Friedman Lazy initialization of alarmAlertBell + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * * @author mnash * @version 1.0 */ - -/** - * @author michaelg - * - */ -/** - * @author michaelg - * - */ public class AlarmAlertFunctions { private static final AlarmAlertProduct.ProductType AA = AlarmAlertProduct.ProductType.Alarm_Alert; @@ -133,10 +125,6 @@ public class AlarmAlertFunctions { private static final double ONE_DEGREE_KM = 111.20; - protected void getGIS() { - - } - /** * Create the string for distance in the dialog * @@ -153,13 +141,14 @@ public class AlarmAlertFunctions { * DR15555 - check the text content, if it is not a valid number set * the text to default 3000 mi */ - Scanner scn = new Scanner(prod.getAorDistance()); - while (scn.hasNext()) { - if (!scn.hasNextInt()) { - prod.setAorDistance(DEFAULT_DISTANCE); - break; - } else { - scn.next(); + try (Scanner scn = new Scanner(prod.getAorDistance())) { + while (scn.hasNext()) { + if (!scn.hasNextInt()) { + prod.setAorDistance(DEFAULT_DISTANCE); + break; + } else { + scn.next(); + } } } string.append("AOR+" + prod.getAorDistance() + prod.getAorLabel()); @@ -169,10 +158,6 @@ public class AlarmAlertFunctions { return string.toString(); } - protected void print(String textToPrint) { - - } - protected static void ringBell(boolean sound) { getAlarmalertbell().open(sound); } @@ -522,7 +507,6 @@ public class AlarmAlertFunctions { double lonE = coords[i].x; if (coords[i].x < centerLon) { lonE = coords[i].x - deltaX; - ; } else if (coords[i].x > centerLon) { lonE = coords[i].x + deltaX; } else if (coords[i].x == centerLon) { @@ -754,7 +738,7 @@ public class AlarmAlertFunctions { JAXB.marshal(alarms, file.getFile()); try { file.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.SIGNIFICANT, e.getLocalizedMessage(), e); } @@ -804,7 +788,7 @@ public class AlarmAlertFunctions { lFile.getFile().createNewFile(); try { lFile.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.SIGNIFICANT, e.getLocalizedMessage(), e); } @@ -844,7 +828,7 @@ public class AlarmAlertFunctions { w.close(); try { lFile.save(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.SIGNIFICANT, e.getLocalizedMessage(), e); } @@ -868,7 +852,8 @@ public class AlarmAlertFunctions { */ public static AlarmAlertBell getAlarmalertbell() { if (alarmAlertBell == null) { - // No synchronize because this must be called on the UI thread anyway. + // No synchronize because this must be called on the UI thread + // anyway. alarmAlertBell = new AlarmAlertBell(new Shell()); } return alarmAlertBell; diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/TPCWatchSrv.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/TPCWatchSrv.java index 844e77ce63..7ccb41d014 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/TPCWatchSrv.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/watch/TPCWatchSrv.java @@ -49,8 +49,9 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.python.PyUtil; +import com.raytheon.uf.common.python.PythonIncludePathUtil; import com.raytheon.uf.common.python.PythonScript; import com.raytheon.uf.common.site.SiteMap; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -80,6 +81,8 @@ import com.raytheon.uf.edex.activetable.ActiveTablePyIncludeUtil; * Added call to nwrwavestcv.csh * Added support for sending TCVAdvisory files to * VTEC partners + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author njensen @@ -282,7 +285,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv { try { transmittedFile.save(); transmittedFileSaved = true; - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.error("Failed to save advisory " + transmittedFilename); } @@ -290,7 +293,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv { if (transmittedFileSaved) { try { pendingFile.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.error("Unable to delete " + pendingFile, e); } @@ -351,7 +354,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv { practiceMode); try { advisoryFile.delete(); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.error("Unable to delete " + advisoryFile, e); } @@ -378,7 +381,7 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv { .getPath(); String pythonIncludePath = PyUtil.buildJepIncludePath( - ActiveTablePyIncludeUtil.getCommonPythonIncludePath(), + PythonIncludePathUtil.getCommonPythonIncludePath(), ActiveTablePyIncludeUtil.getCommonGfeIncludePath(), ActiveTablePyIncludeUtil.getVtecIncludePath(siteId), ActiveTablePyIncludeUtil.getGfeConfigIncludePath(siteId), diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java index 6615fe44bf..d1cd25a866 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java @@ -100,6 +100,7 @@ import com.raytheon.uf.common.util.FileUtil; * Feb 24, 2015 3978 njensen Changed to use abstract InputStream * Jun 29, 2015 4583 rferrel Log detail error message when archive configuration is invalid. * Aug 18, 2015 3806 njensen Use SaveableOutputStream to save + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -923,8 +924,7 @@ public class ArchiveConfigManager { * @param fileName * @throws LocalizationOpFailedException */ - public void deleteSelection(String fileName) - throws LocalizationOpFailedException { + public void deleteSelection(String fileName) throws LocalizationException { LocalizationContext siteContext = pathMgr.getContext( LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); LocalizationFile lFile = pathMgr.getLocalizationFile(siteContext, diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java index 36099d1618..5f22b2ecff 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPTemplates.java @@ -46,7 +46,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPTemplateConfigurationManager; @@ -93,6 +93,8 @@ import com.vividsolutions.jts.io.WKBReader; * 07/15/13 2184 dhladky Remove all HUC's for storage except ALL * Nov 18, 2014 3831 dhladky StatusHandler logging. Proper list sizing. Geometry chunk sizing. * Aug 08, 2015 4722 dhladky Improved Grid support. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author dhladky @@ -163,7 +165,7 @@ public class FFMPTemplates { .getHandler(FFMPTemplates.class); private final IPathManager pathManager; - + /** * Single constructor * @@ -197,10 +199,8 @@ public class FFMPTemplates { /** * EDEX constructor * - * @param awipsShare - * DIR - * @param shareDir - * @param cwa + * @param primaryCWA + * @param mode */ public FFMPTemplates(DomainXML primaryCWA, MODE mode) { this.pathManager = PathManagerFactory.getPathManager(); @@ -222,7 +222,7 @@ public class FFMPTemplates { public String getMode() { return mode; } - }; + } /** * localization and such @@ -362,11 +362,12 @@ public class FFMPTemplates { */ private LinkedHashMap readVGBFile( String name, String cwa, String dataKey) { - + HashMap protoMap = readVGBDomainMap( dataKey, cwa); String[] list = readVGBDomainList(dataKey, cwa); - LinkedHashMap map = new LinkedHashMap(list.length, 1.0f); + LinkedHashMap map = new LinkedHashMap<>( + list.length, 1.0f); // construct ordered map for (String lid : list) { @@ -416,13 +417,17 @@ public class FFMPTemplates { list = null; } catch (SerializationException se) { - statusHandler.error("Serialization Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, se); + statusHandler.error("Serialization Exception: Write VGB: cwa: " + + cwa + " dataKey: " + dataKey, se); } catch (FileNotFoundException fnfe) { - statusHandler.error("File Not found Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, fnfe); + statusHandler.error("File Not found Exception: Write VGB: cwa: " + + cwa + " dataKey: " + dataKey, fnfe); } catch (IOException ioe) { - statusHandler.error("IO Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, ioe); - } catch (LocalizationOpFailedException e) { - statusHandler.error("Localization Exception: Write VGB: cwa: "+cwa+" dataKey: "+dataKey, e); + statusHandler.error("IO Exception: Write VGB: cwa: " + cwa + + " dataKey: " + dataKey, ioe); + } catch (LocalizationException e) { + statusHandler.error("Localization Exception: Write VGB: cwa: " + + cwa + " dataKey: " + dataKey, e); } } @@ -489,13 +494,19 @@ public class FFMPTemplates { list = null; } catch (SerializationException se) { - statusHandler.error("Serialization Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, se); + statusHandler.error( + "Serialization Exception: Write Template: cwa: " + cwa + + " dataKey:" + dataKey + " huc: " + huc, se); } catch (FileNotFoundException fnfe) { - statusHandler.error("File Not found Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, fnfe); + statusHandler.error( + "File Not found Exception: Write Template: cwa: " + cwa + + " dataKey:" + dataKey + " huc: " + huc, fnfe); } catch (IOException ioe) { - statusHandler.error("IO Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, ioe); - } catch (LocalizationOpFailedException e) { - statusHandler.error("Localization Exception: Write Template: cwa: "+cwa+" dataKey:"+dataKey+" huc: "+huc, e); + statusHandler.error("IO Exception: Write Template: cwa: " + cwa + + " dataKey:" + dataKey + " huc: " + huc, ioe); + } catch (LocalizationException e) { + statusHandler.error("Localization Exception: Write Template: cwa: " + + cwa + " dataKey:" + dataKey + " huc: " + huc, e); } } @@ -637,6 +648,10 @@ public class FFMPTemplates { try { rpfaf = getAggregatedPfaf(pfaf, dataKey, huc); } catch (NullPointerException npe) { + // FIXME + npe.printStackTrace(); + System.err.println("NPE for pfaf=" + pfaf + ", dataKey=" + dataKey + + ", huc=" + huc); } return rpfaf; } @@ -644,7 +659,9 @@ public class FFMPTemplates { /** * Finds the aggregated pfaf of a given VGB * - * @param pfaf + * @param lid + * @param dataKey + * @param huc * @return */ public Long findAggregatedVGB(String lid, String dataKey, String huc) { @@ -846,7 +863,8 @@ public class FFMPTemplates { } } } catch (Exception e) { - statusHandler.error("Find Basin by lon lat failed: dataKey: "+dataKey+ " coor:"+coor.toString(), e); + statusHandler.error("Find Basin by lon lat failed: dataKey: " + + dataKey + " coor:" + coor.toString(), e); } return null; @@ -877,7 +895,9 @@ public class FFMPTemplates { /** * Finds the center of an aggregation of basins (Roughly) * - * @param arrayList + * @param pfaf + * @param dataKey + * @param huc * @return */ public Coordinate findAggregationCenter(Long pfaf, String dataKey, @@ -967,9 +987,9 @@ public class FFMPTemplates { } /** - * Gets the starting index for searching + * Sets the starting index for searching * - * @return + * @param hucDepthStart */ public void setHucDepthStart(int hucDepthStart) { this.hucDepthStart = hucDepthStart; @@ -1010,7 +1030,8 @@ public class FFMPTemplates { } } catch (Exception e) { - statusHandler.error("Failed to lookup County: dataKey: "+dataKey, e); + statusHandler.error("Failed to lookup County: dataKey: " + dataKey, + e); } FFMPCounties counties = new FFMPCounties(countyList); @@ -1021,7 +1042,8 @@ public class FFMPTemplates { /** * Finds the parent aggregated pfaf of a given pfaf. * - * @param pfaf + * @param key + * @param dataKey * @param huc * @return */ @@ -1085,16 +1107,16 @@ public class FFMPTemplates { Rectangle rect = null; - rect = HRAPCoordinates.getHRAPCoordinates(); - rect.setBounds(rect.x * primeSource.getHrapGridFactor(), rect.y - * primeSource.getHrapGridFactor(), rect.width - * primeSource.getHrapGridFactor(), rect.height - * primeSource.getHrapGridFactor()); + rect = HRAPCoordinates.getHRAPCoordinates(); + rect.setBounds(rect.x * primeSource.getHrapGridFactor(), rect.y + * primeSource.getHrapGridFactor(), + rect.width * primeSource.getHrapGridFactor(), rect.height + * primeSource.getHrapGridFactor()); - HRAPSubGrid hrapgrid = new HRAPSubGrid(rect, - primeSource.getHrapGridFactor()); - Geometry geo = hrapgrid.getGeometry(); - siteExtents = FFMPUtils.getGeometryText(geo); + HRAPSubGrid hrapgrid = new HRAPSubGrid(rect, + primeSource.getHrapGridFactor()); + Geometry geo = hrapgrid.getGeometry(); + siteExtents = FFMPUtils.getGeometryText(geo); } else if (primeSource.getDataType().equals( FFMPSourceConfigurationManager.DATA_TYPE.RADAR.getDataType())) { @@ -1108,7 +1130,8 @@ public class FFMPTemplates { } else if (primeSource.getDataType().equals( FFMPSourceConfigurationManager.DATA_TYPE.GRID.getDataType())) { // extract the Grid Coverage for use in site extents creation - GridCoverage coverage = FFMPUtils.getGridCoverageRecord(primeSource.getDataPath()); + GridCoverage coverage = FFMPUtils.getGridCoverageRecord(primeSource + .getDataPath()); siteExtents = FFMPUtils.getGeometryText(coverage.getGeometry()); } else if (primeSource.getDataType().equals( FFMPSourceConfigurationManager.DATA_TYPE.PDO.getDataType())) { @@ -1127,7 +1150,7 @@ public class FFMPTemplates { /** * Sets the extents * - * @param extents + * @param maxExtent */ public void setExtents(double maxExtent) { this.maxExtent = maxExtent; @@ -1170,7 +1193,9 @@ public class FFMPTemplates { getMaxExtent(), getSiteExtents(dataKey), mode.getMode())); } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, "Unable to create FFMP Template for this dataKey: "+dataKey, e); + statusHandler.handle(Priority.PROBLEM, + "Unable to create FFMP Template for this dataKey: " + + dataKey, e); } } else if (huc.equals(FFMPRecord.COUNTY)) { list = getCountyFips(cwa, dataKey); @@ -1548,7 +1573,9 @@ public class FFMPTemplates { /** * Gets the Virtual Gage Basin MetaData * - * @param pfaf + * @param dataKey + * @param cwa + * @param parentPfaf * @return */ public synchronized ArrayList getVirtualGageBasinMetaData( @@ -1745,19 +1772,20 @@ public class FFMPTemplates { SoftReference> rawGeomRef = cwaRawGeometries .get(compositeKey); Map pfafGeometries = null; - + if (rawGeomRef != null) { pfafGeometries = rawGeomRef.get(); } if (results != null && results.length > 0) { - + if (pfafGeometries == null) { - pfafGeometries = new HashMap(results.length, 1.0f); + pfafGeometries = new HashMap(results.length, + 1.0f); cwaRawGeometries.put(compositeKey, new SoftReference>(pfafGeometries)); } - + for (int i = 0; i < results.length; i++) { Object[] row = (Object[]) results[i]; basin = FFMPUtils.getMetaDataBasin(row, mode.getMode()); @@ -1772,12 +1800,14 @@ public class FFMPTemplates { if ((row.length >= (upstreamDepth + 9)) && (row[upstreamDepth + 9] != null)) { try { - pfafGeometries.put(basin.getPfaf(), reader - .read((byte[]) row[upstreamDepth + 9]) - .buffer(0)); - + pfafGeometries.put(basin.getPfaf(), + reader.read((byte[]) row[upstreamDepth + 9]) + .buffer(0)); + } catch (Exception e) { - statusHandler.error("Failure to add rawGeometry in loadBasins: "+siteKey, e); + statusHandler.error( + "Failure to add rawGeometry in loadBasins: " + + siteKey, e); } } } @@ -1835,7 +1865,8 @@ public class FFMPTemplates { /** * Get the basin ID of the county * - * @param name + * @param dataKey + * @param nameState * @return */ @SuppressWarnings("unchecked") @@ -1995,9 +2026,11 @@ public class FFMPTemplates { list = SerializationUtil.transformFromThrift(long[].class, FileUtil.file2bytes(f.getFile(), true)); } catch (SerializationException se) { - statusHandler.error("Serialization Exception: Read Domain: cwa: "+cwa+" dataKey: "+dataKey+" huc: "+huc, se); + statusHandler.error("Serialization Exception: Read Domain: cwa: " + + cwa + " dataKey: " + dataKey + " huc: " + huc, se); } catch (IOException e) { - statusHandler.error("IO Exception: Read Domain: cwa: "+cwa+" dataKey: "+dataKey+" huc: "+huc, e); + statusHandler.error("IO Exception: Read Domain: cwa: " + cwa + + " dataKey: " + dataKey + " huc: " + huc, e); } return list; @@ -2023,18 +2056,18 @@ public class FFMPTemplates { try { if (huc.equals(FFMPRecord.ALL)) { - map = (HashMap) SerializationUtil - .transformFromThrift(HashMap.class, - FileUtil.file2bytes(f.getFile(), true)); + map = SerializationUtil.transformFromThrift(HashMap.class, + FileUtil.file2bytes(f.getFile(), true)); } else { - map = (HashMap) SerializationUtil - .transformFromThrift(HashMap.class, - FileUtil.file2bytes(f.getFile(), true)); + map = SerializationUtil.transformFromThrift(HashMap.class, + FileUtil.file2bytes(f.getFile(), true)); } } catch (SerializationException se) { - statusHandler.error("Serialization Exception: Domain Map: "+dataKey+" cwa:"+cwa+" huc: "+huc, se); + statusHandler.error("Serialization Exception: Domain Map: " + + dataKey + " cwa:" + cwa + " huc: " + huc, se); } catch (IOException e) { - statusHandler.error("IO Exception: Domain Map: "+dataKey+" cwa:"+cwa+" huc: "+huc, e); + statusHandler.error("IO Exception: Domain Map: " + dataKey + + " cwa:" + cwa + " huc: " + huc, e); } return map; @@ -2059,13 +2092,14 @@ public class FFMPTemplates { getAbsoluteFileName(dataKey, FFMPRecord.VIRTUAL, cwa, "map")); try { - map = (HashMap) SerializationUtil - .transformFromThrift(HashMap.class, - FileUtil.file2bytes(f.getFile(), true)); + map = SerializationUtil.transformFromThrift(HashMap.class, + FileUtil.file2bytes(f.getFile(), true)); } catch (SerializationException se) { - statusHandler.error("Serialization Exception: Virtual Basins: "+dataKey+" cwa: "+cwa, se); + statusHandler.error("Serialization Exception: Virtual Basins: " + + dataKey + " cwa: " + cwa, se); } catch (IOException e) { - statusHandler.error("IO Exception: Virtual Basins: "+dataKey+" cwa: "+cwa, e); + statusHandler.error("IO Exception: Virtual Basins: " + dataKey + + " cwa: " + cwa, e); } return map; @@ -2091,9 +2125,12 @@ public class FFMPTemplates { list = SerializationUtil.transformFromThrift(String[].class, FileUtil.file2bytes(f.getFile(), true)); } catch (SerializationException se) { - statusHandler.error("Serialization Exception: : Read Virtual Domain: cwa: "+cwa+" dataKey: "+dataKey, se); + statusHandler.error( + "Serialization Exception: : Read Virtual Domain: cwa: " + + cwa + " dataKey: " + dataKey, se); } catch (IOException e) { - statusHandler.error("IO Exception: : Read Virtual Domain: cwa: "+cwa+" dataKey: "+dataKey, e); + statusHandler.error("IO Exception: : Read Virtual Domain: cwa: " + + cwa + " dataKey: " + dataKey, e); } return list; @@ -2301,7 +2338,7 @@ public class FFMPTemplates { * Gets a metadata basin contained within the domain listed. * * @param dataKey - * @param domainName + * @param domains * @param pfafs * @return */ @@ -2362,10 +2399,14 @@ public class FFMPTemplates { if (res >= 0.004) { try { - list = FFMPUtils.getUniqueCountyFips(cwa, getMaxExtent(), - getSiteExtents(dataKey), mode.getMode(), resolution); + list = FFMPUtils + .getUniqueCountyFips(cwa, getMaxExtent(), + getSiteExtents(dataKey), mode.getMode(), + resolution); } catch (Exception e) { - statusHandler.handle(Priority.PROBLEM, "Unable to create FFMP Template for this dataKey: "+dataKey, e); + statusHandler.handle(Priority.PROBLEM, + "Unable to create FFMP Template for this dataKey: " + + dataKey, e); } if (list.size() > 0) { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/HucLevelGeometriesFactory.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/HucLevelGeometriesFactory.java index f55c00dcd3..3110998932 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/HucLevelGeometriesFactory.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/HucLevelGeometriesFactory.java @@ -40,6 +40,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -70,6 +71,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; * loading them. * Apr 25, 2013 1954 bsteffen Undo last commit to avoid invalid geoms. * Jul 03, 2013 2152 rjpeter Use streams for serialization + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -213,7 +215,7 @@ public class HucLevelGeometriesFactory { protected synchronized Map generateSimplifiedGeometry( FFMPTemplates template, String dataKey, String cwa, - Collection pfafs) throws Exception { + Collection pfafs) { Map rawGeometries = template.getRawGeometries(dataKey, cwa); Map simplifiedGeometries = new HashMap( @@ -422,8 +424,7 @@ public class HucLevelGeometriesFactory { } public synchronized Envelope getEnvelope(FFMPTemplates template, - String dataKey, String cwa, String huc, Long pfafId) - throws Exception { + String dataKey, String cwa, String huc, Long pfafId) { return getEnvelopes(template, dataKey, cwa, huc).get(pfafId); } @@ -492,7 +493,7 @@ public class HucLevelGeometriesFactory { if (deleteFile) { try { f.delete(); - } catch (LocalizationOpFailedException lope) { + } catch (LocalizationException lope) { statusHandler.handle(Priority.WARN, "Can't delete file."); } diff --git a/edexOsgi/com.raytheon.uf.edex.menus/src/com/raytheon/uf/edex/menus/AbstractMenuUtil.java b/edexOsgi/com.raytheon.uf.edex.menus/src/com/raytheon/uf/edex/menus/AbstractMenuUtil.java index 8629fa9bd7..317251f7bf 100644 --- a/edexOsgi/com.raytheon.uf.edex.menus/src/com/raytheon/uf/edex/menus/AbstractMenuUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.menus/src/com/raytheon/uf/edex/menus/AbstractMenuUtil.java @@ -33,7 +33,6 @@ import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManager; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.menus.MenuSerialization; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -50,7 +49,8 @@ import com.raytheon.uf.common.status.UFStatus; * ------------ ---------- ----------- -------------------------- * Nov 08, 2012 mschenke Initial javadoc creation * Mar 11, 2014 2858 mpduff javadoc updates - * Oct 15, 2015 4897 bkowal Made {@link #pm} protected. + * Oct 15, 2015 4897 bkowal Made PathManager pm protected. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -118,9 +118,7 @@ public abstract class AbstractMenuUtil { marshaller.marshal(object, pm.getFile(caveConfigured, path)); file.save(); - } catch (JAXBException e) { - statusHandler.error("Unable to process the menu: " + path, e); - } catch (LocalizationOpFailedException e) { + } catch (JAXBException | LocalizationException e) { statusHandler.error("Unable to process the menu: " + path, e); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java index 1010f2086b..63dcc2b6fd 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java @@ -65,7 +65,6 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager; import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.DATA_TYPE; @@ -142,6 +141,8 @@ import com.raytheon.uf.edex.plugin.ffmp.common.FFTIRatioDiff; * Aug 08, 2015 4722 dhladky Generalized the processing of FFMP data types. * Sep 09, 2015 4756 dhladky Further generalization of FFG processing. * Sep 21, 2015 4756 dhladky Allow ARCHIVE types to not be purged out. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author dhladky @@ -157,8 +158,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements /** * Public constructor for FFMPGenerator * - * @param name - * @param compositeProductType + * @param executor */ public FFMPGenerator(Executor executor) { @@ -397,7 +397,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements DomainXML domain = runner.getPrimaryDomain(); try { tmp.add(new FFMPURIFilter(getSiteString(runner) + ":" - + getGuidanceComparedString(runner) + ":" + domain.getCwa())); + + getGuidanceComparedString(runner) + ":" + + domain.getCwa())); statusHandler.handle(Priority.INFO, "Created FFMP Filter.." + " primary Domain: " + domain.getCwa()); @@ -560,7 +561,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements /** * Set list of CWA's * - * @param cwas + * @param domains */ public void setDomains(ArrayList domains) { this.domains = domains; @@ -619,7 +620,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements // process all of the dataKeys for this source for (String dataKey : dataHash.keySet()) { - + ArrayList sites = new ArrayList(); // is it a mosaic? @@ -695,12 +696,13 @@ public class FFMPGenerator extends CompositeProductGenerator implements // Go over all of the sites, if mosaic source, can be many. for (String siteKey : sites) { - - // No dataKey hash?, dataKey comes from primary source (siteKey) + + // No dataKey hash?, dataKey comes from primary source + // (siteKey) if (dataKey == null) { dataKey = siteKey; } - + FFMPRecord ffmpRec = new FFMPRecord(); ffmpRec.setSourceName(ffmpProduct.getSourceName()); ffmpRec.setDataKey(dataKey); @@ -709,7 +711,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements FFMPProcessor ffmp = new FFMPProcessor(config, generator, ffmpRec, template); ffmpRec = ffmp.processFFMP(ffmpProduct); - + if (ffmpRec != null) { persistRecord(ffmpRec); @@ -812,7 +814,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements /** * * @param domain - * @return */ public void createUnifiedGeometries(DomainXML domain) { ArrayList hucsToGen = new ArrayList(); @@ -895,7 +896,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements } /** - * Gets the string buffer for the Guidance sources you wish to compare in FFMP + * Gets the string buffer for the Guidance sources you wish to compare in + * FFMP * * @param run * @return @@ -918,7 +920,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements } break; } - // TODO: Implement other types when available + // TODO: Implement other types when available } return buf.toString(); } @@ -970,14 +972,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements statusHandler.handle(Priority.INFO, "Wrote FFMP source Bin File: " + sourceList.getSourceId()); - } catch (SerializationException se) { - se.printStackTrace(); - } catch (FileNotFoundException fnfe) { - fnfe.printStackTrace(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } catch (LocalizationOpFailedException e) { - e.printStackTrace(); + } catch (Exception e) { + statusHandler.error( + "Error writing FFMP source bin file for source " + + sourceList.getSourceId(), e); } } @@ -1056,8 +1054,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements } /** - * Do pull strategy on FFG data, currently works with - * Gridded FFG sources only. (There are only gridded sources so far) + * Do pull strategy on FFG data, currently works with Gridded FFG sources + * only. (There are only gridded sources so far) * * @param filter * @return @@ -1117,7 +1115,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements uriComps[3], uriComps[7], plugin)); } } catch (Exception e) { - statusHandler.error("Problem with extracting guidance source URI's. source: "+guidSource, e); + statusHandler.error( + "Problem with extracting guidance source URI's. source: " + + guidSource, e); } } } @@ -1146,10 +1146,10 @@ public class FFMPGenerator extends CompositeProductGenerator implements filter.getSources().put(matchKey, dataUri); } } catch (Exception e) { - statusHandler.handle( - Priority.ERROR, - "Unable to locate new FFG file. " - + dataUri, e); + statusHandler + .handle(Priority.ERROR, + "Unable to locate new FFG file. " + + dataUri, e); } } } @@ -1162,7 +1162,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements /** * get the FFMP data container for this source * - * @param sourceName + * @param siteSourceKey + * @param backDate * * @return */ @@ -1293,8 +1294,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements */ if (source.getGuidanceType().equals( GUIDANCE_TYPE.ARCHIVE.getGuidanceType())) { - /** ARCHIVE types have the refTime of when it was loaded. - * This will have it look back 1 day previous to the reftime + /** + * ARCHIVE types have the refTime of when it was loaded. + * This will have it look back 1 day previous to the reftime * and purge anything older than that. */ backDate = new Date( @@ -1435,9 +1437,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements * load existing container * * @param sourceSiteDataKey - * @param hucs * @param siteKey * @param wfo + * @param backDate * @return */ public FFMPDataContainer loadFFMPDataContainer(String sourceSiteDataKey, @@ -1549,8 +1551,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements /** * The actual work gets done here */ - public void write() throws Exception { - + public void write() { try { FFMPAggregateRecord aggRecord = null; @@ -1702,7 +1703,8 @@ public class FFMPGenerator extends CompositeProductGenerator implements /** * Write your FFTI Data files * - * @param sourceList + * @param ffti + * @param fftiName */ public void writeFFTIFile(FFTIData ffti, String fftiName) { @@ -1721,21 +1723,15 @@ public class FFMPGenerator extends CompositeProductGenerator implements statusHandler.handle(Priority.DEBUG, "Wrote FFMP FFTI file: " + fftiName); - } catch (SerializationException se) { - se.printStackTrace(); - } catch (FileNotFoundException fnfe) { - fnfe.printStackTrace(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } catch (LocalizationOpFailedException e) { - e.printStackTrace(); + } catch (Exception e) { + statusHandler.error("Error writing FFTI file " + fftiName, e); } } /** * Read out your FFTI Files * - * @param sourceId + * @param fftiName * @return */ public FFTIData readFFTIData(String fftiName) { @@ -2066,7 +2062,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements * surge being sent to pypies. * * @param record - * @return */ private synchronized void persistRecord(FFMPRecord record) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/src/com/raytheon/uf/edex/plugin/nwsauth/FileManager.java b/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/src/com/raytheon/uf/edex/plugin/nwsauth/FileManager.java index 2604f5f076..ea2fcfeacd 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/src/com/raytheon/uf/edex/plugin/nwsauth/FileManager.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/src/com/raytheon/uf/edex/plugin/nwsauth/FileManager.java @@ -34,7 +34,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData; import com.raytheon.uf.common.plugin.nwsauth.xml.PermissionXML; import com.raytheon.uf.common.plugin.nwsauth.xml.RoleXML; @@ -59,6 +59,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Jan 17, 2013 1412 djohnson Check files for having been modified each time data is requested, * in case they were written by another member of the cluster. * Mar 12, 2013 1646 mpduff Format the output. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException * * * @@ -104,9 +105,6 @@ class FileManager { return instance; } - /** - * {@inheritDoc} - */ public void save(String application) { NwsRoleData roleData = roleDataMap.get(application); LocalizationFile lf = roleFileMap.get(application); @@ -123,10 +121,7 @@ class FileManager { marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(roleData, locFile.getFile()); locFile.save(); - - } catch (JAXBException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); - } catch (LocalizationOpFailedException e) { + } catch (JAXBException | LocalizationException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryFederationManager.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryFederationManager.java index 04d4a08d1c..246d87e107 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryFederationManager.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryFederationManager.java @@ -76,7 +76,7 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; +import com.raytheon.uf.common.localization.exception.LocalizationException; import com.raytheon.uf.common.registry.constants.ActionTypes; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; import com.raytheon.uf.common.registry.constants.DeletionScope; @@ -174,6 +174,8 @@ import com.raytheon.uf.edex.security.SecurityConfiguration; * 5/11/2015 4448 bphillip Separated EBXML Registry from Data Delivery * 5/29/2015 4448 bphillip Added default user to registry on startup * 10/20/2015 4992 dhladky Improve error handling. + * Nov 12, 2015 4834 njensen Changed LocalizationOpFailedException to LocalizationException + * * * * @author bphillip @@ -204,19 +206,18 @@ public class RegistryFederationManager implements IRegistryFederationManager, /** The mode that EDEX was started in */ public static final boolean centralRegistry; - + /** registry user property **/ public static final String EDEX_SECURITY_AUTH_USER = "edex.security.auth.user"; - + /** registry user password **/ public static final String EDEX_SECURITY_AUTH_PASSWORD = "edex.security.auth.password"; - + /** Local (client) level adminstrator user **/ public static final String REGISTRY_LOCAL_ADMIN = "RegistryLocalAdministrator"; - + /** Registry adminstrator (central) **/ public static final String REGISTRY_ADMIN = "RegistryAdministrator"; - static { try { @@ -341,7 +342,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, "Unable to locate federation configuration file: " + FEDERATION_CONFIG_FILE); } else { - federationProperties = (FederationProperties) jaxbManager + federationProperties = jaxbManager .unmarshalFromXmlFile( FederationProperties.class, federationPropertiesFile); @@ -391,6 +392,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, } Runtime.getRuntime().addShutdownHook(new Thread() { + @Override public void run() { txTemplate.execute(new TransactionCallbackWithoutResult() { @@ -415,14 +417,17 @@ public class RegistryFederationManager implements IRegistryFederationManager, * The registry super user initially gets the default * password which *must* be changed immediately */ - statusHandler - .info(REGISTRY_ADMIN+" Not present in Central Registry! Adding user: "+REGISTRY_ADMIN); + statusHandler.info(REGISTRY_ADMIN + + " Not present in Central Registry! Adding user: " + + REGISTRY_ADMIN); registryUsers.addUser(RegistryUtil.registryUser, "password", REGISTRY_ADMIN); } else { statusHandler - .info(REGISTRY_ADMIN+ " present in Central Registry: "+REGISTRY_ADMIN); + .info(REGISTRY_ADMIN + + " present in Central Registry: " + + REGISTRY_ADMIN); } } else if (!centralRegistry) { @@ -450,8 +455,8 @@ public class RegistryFederationManager implements IRegistryFederationManager, } } } catch (MsgRegistryException e) { - throw new EbxmlRegistryException( - "Error Checking registry user! ", e); + throw new EbxmlRegistryException("Error Checking registry user! ", + e); } initialized.set(true); @@ -648,12 +653,13 @@ public class RegistryFederationManager implements IRegistryFederationManager, } + @Override @Transactional @GET @Path("updateRegistryEvents/{registryId}/{time}") - public void updateRegistryEvents(@PathParam("registryId") - String registryId, @PathParam("time") - String time) { + public void updateRegistryEvents( + @PathParam("registryId") String registryId, + @PathParam("time") String time) { for (ReplicationEvent event : replicationEventDao .getEventsBeforeTime(time)) { event.addReplicatedTo(registryId); @@ -664,17 +670,17 @@ public class RegistryFederationManager implements IRegistryFederationManager, /** * Synchronizes this registry's data with the registry at the specified URL * - * @param remoteRegistryUrl - * The URL of the registry to sync with + * @param registryId * @throws EbxmlRegistryException * If the thread executor fails to shut down properly * @throws MsgRegistryException */ + @Override @Transactional @GET @Path("synchronizeWithRegistry/{registryId}") - public void synchronizeWithRegistry(@PathParam("registryId") - String registryId) throws Exception { + public void synchronizeWithRegistry( + @PathParam("registryId") String registryId) throws Exception { if (SYNC_IN_PROGRESS.compareAndSet(false, true)) { try { @@ -833,6 +839,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, } } + @Override @GET @Path("isFederated") @Transactional @@ -840,18 +847,21 @@ public class RegistryFederationManager implements IRegistryFederationManager, return System.getProperty("ebxml.registry.federation.enabled"); } + @Override @GET @Path("clusterId") public String clusterId() { return RegistryIdUtil.getId(); } + @Override @GET @Path("siteId") public String siteId() { return EDEXUtil.getEdexSite(); } + @Override @GET @Path("getObjectTypesReplicated") public String getObjectTypesReplicated() { @@ -859,6 +869,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, .toArray()); } + @Override @GET @Path("getFederationMembers") @Transactional @@ -878,6 +889,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, return builder.toString(); } + @Override @GET @Path("getReplicatingTo") @Transactional @@ -886,6 +898,7 @@ public class RegistryFederationManager implements IRegistryFederationManager, .getRegistryReplicationServers().toArray()); } + @Override @GET @Path("getReplicatingFrom") @Transactional @@ -910,11 +923,12 @@ public class RegistryFederationManager implements IRegistryFederationManager, return RegistryQueryUtil.formatArrayString(registrySet.toArray()); } + @Override @GET @Path("subscribeToRegistry/{registryId}") @Transactional - public void subscribeToRegistry(@PathParam("registryId") - String registryId) throws Exception { + public void subscribeToRegistry(@PathParam("registryId") String registryId) + throws Exception { statusHandler.info("Establishing replication with [" + registryId + "]..."); RegistryType remoteRegistry = getRegistry(registryId); @@ -923,11 +937,12 @@ public class RegistryFederationManager implements IRegistryFederationManager, statusHandler.info("Established replication with [" + registryId + "]"); } + @Override @GET @Path("unsubscribeFromRegistry/{registryId}") @Transactional - public void unsubscribeFromRegistry(@PathParam("registryId") - String registryId) throws Exception { + public void unsubscribeFromRegistry( + @PathParam("registryId") String registryId) throws Exception { statusHandler.info("Disconnecting replication with [" + registryId + "]..."); RegistryType remoteRegistry = getRegistry(registryId); @@ -937,21 +952,23 @@ public class RegistryFederationManager implements IRegistryFederationManager, .info("Disconnected replication with [" + registryId + "]"); } + @Override @GET @Path("addReplicationServer/{registryId}") @Transactional - public void addReplicationServer(@PathParam("registryId") - String registryId) throws Exception { + public void addReplicationServer(@PathParam("registryId") String registryId) + throws Exception { getRegistry(registryId); servers.addReplicationServer(registryId); saveNotificationServers(); } + @Override @GET @Path("removeReplicationServer/{registryId}") @Transactional - public void removeReplicationServer(@PathParam("registryId") - String registryId) throws Exception { + public void removeReplicationServer( + @PathParam("registryId") String registryId) throws Exception { getRegistry(registryId); servers.removeReplicationServer(registryId); saveNotificationServers(); @@ -988,12 +1005,10 @@ public class RegistryFederationManager implements IRegistryFederationManager, try { jaxbManager.marshalToXmlFile(servers, file.getAbsolutePath()); - lf.save(); - } catch (SerializationException e) { statusHandler.error("Unable to update replication server file!", e); - } catch (LocalizationOpFailedException e) { + } catch (LocalizationException e) { statusHandler.handle(Priority.ERROR, e.getLocalizedMessage(), e); } }