From 2a045bb59c3c6d9f8fc9e653b4d23133b4bae7c9 Mon Sep 17 00:00:00 2001 From: Bingfan Yin Date: Mon, 22 Dec 2014 14:02:20 -0500 Subject: [PATCH] VLab Issue #5749 - Removed try/catch for ContinuingWatch when querying database. Change-Id: I73e4644f810c0d649a7bed61135989a9c15c1981 Former-commit-id: e42212a7e072e377d19b129bbafe60790efd3fe2 [formerly 75971fafd69e6a19a9cfd120d1a70f76f3c5fee1] Former-commit-id: 3f38e3c88df40d8d99d5c22c19195ae83df21b9e --- .../staticdataprovider/ContinuingWatch.java | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/ncep/gov.noaa.nws.ncep.staticdataprovider/src/gov/noaa/nws/ncep/staticdataprovider/ContinuingWatch.java b/ncep/gov.noaa.nws.ncep.staticdataprovider/src/gov/noaa/nws/ncep/staticdataprovider/ContinuingWatch.java index a883e9fc44..73f06d571f 100644 --- a/ncep/gov.noaa.nws.ncep.staticdataprovider/src/gov/noaa/nws/ncep/staticdataprovider/ContinuingWatch.java +++ b/ncep/gov.noaa.nws.ncep.staticdataprovider/src/gov/noaa/nws/ncep/staticdataprovider/ContinuingWatch.java @@ -43,7 +43,8 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; * 08/12 #770 Q. Zhou Initial Creation. * 09/12 #770 Q. Zhou Clean up and change selectedWatch to a collection * 08/13 #1028 G. Hull rm dependency on viz.rsc.wtch project - * 12/14 ? B. Yin Remove ScriptCreator, use Thrift Client. + * 12/14 R5749 B. Yin Remove ScriptCreator, use Thrift Client. + * 12/14 R5749 B. Yin Removed try/catch block when querying. * * * @author Q. Zhou @@ -51,9 +52,6 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; public class ContinuingWatch { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(ContinuingWatch.class); - /* * WtchRscDataObj class */ @@ -156,25 +154,19 @@ public class ContinuingWatch { DbQueryRequest request = new DbQueryRequest(); request.setConstraints(metadataMap); - - try { - DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request); - for (Map result : response.getResults()) { + DbQueryResponse response = (DbQueryResponse) ThriftClient.sendRequest(request); - for (Object pdo : result.values()) { - awwRecord = (AwwRecord) pdo; - Collection num = getAwwRecord( awwRecord ); - if (num != null && !num.isEmpty()) - contWatch.addAll( num ); - } + for (Map result : response.getResults()) { + + for (Object pdo : result.values()) { + awwRecord = (AwwRecord) pdo; + Collection num = getAwwRecord( awwRecord ); + if (num != null && !num.isEmpty()) + contWatch.addAll( num ); } } - catch (VizException e) { - statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), - e); - } - + //Retrieving unique items from the list Set set = new HashSet(contWatch); contWatch = new ArrayList(set);