From a2010599233f377e7d18350115a7e8884bde868a Mon Sep 17 00:00:00 2001 From: "Hyunjong.park" Date: Fri, 4 Jul 2014 11:48:31 +0900 Subject: [PATCH] common : check null pointer for disable features Signed-off-by: Hyunjong.park Change-Id: I63c10a15a4689f041e8444d422826ae01e050d47 --- .../dynamicanalyzer/ui/network/data/NetworkDataManager.java | 11 ++++++++++- .../tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java | 10 +++++++--- .../ui/opengl/data/GLStateProgramDBTableManager.java | 3 +++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataManager.java index 83c3dba..8f5a823 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/data/NetworkDataManager.java @@ -55,7 +55,10 @@ public class NetworkDataManager extends PageDataManager { public final static double NETWORK_SERIES_TYPE_HEAP_MEMORY_KB = 0.3; public final static double CHART_TYPE_HEAP_MEMORY_KB = 4.6 * 5; - public final static double MAX_NETWORK_HEAP_MEMORY_KB = 5000; // possible to make approximately 200 chart + public final static double MAX_NETWORK_HEAP_MEMORY_KB = 5000; // possible to + // make + // approximately + // 200 chart public final static double ONE_CHART_HEAP_MEMORY_KB = NETWORK_SERIES_TYPE_HEAP_MEMORY_KB; public final static double ONE_ACCESS_SERIES_HEAP_MEMORY_KB = NETWORK_SERIES_TYPE_HEAP_MEMORY_KB; @@ -149,12 +152,18 @@ public class NetworkDataManager extends PageDataManager { public void openProcess() { // set series list from DB + if (null == seriesList) { + return; + } if (seriesList.size() == 0) { seriesList = seriesDBManager.select(0, MAX_CHART_TIME); } } public void stopProcess() { + if (null == seriesList || null == seriesDBManager) { + return; + } for (int i = 0; i < seriesList.size(); i++) { NetworkSeriesType seriesType = seriesList.get(i); if (seriesType.getEndTime() < 0) { diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java index 2616388..f6b1d74 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLDataManager.java @@ -111,12 +111,16 @@ public class GLDataManager extends PageDataManager { } public void openProcess() { - updateFrameTimeChartEndTimeAtOpen(); - stateProgramDBTable.initProgramData(); + if (null != stateDataMaker) { + updateFrameTimeChartEndTimeAtOpen(); + stateProgramDBTable.initProgramData(); + } } public void stopProcess() { - stateProgramDBTable.insertData(); + if (null != stateDataMaker) { + stateProgramDBTable.insertData(); + } } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java index 8c02423..18be946 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/data/GLStateProgramDBTableManager.java @@ -99,6 +99,9 @@ public class GLStateProgramDBTableManager extends DBTable { public void insertData() { List programList = GLDataManager.getInstance() .getStateDataMake().getProgramList(); + if (null == programList) { + return; + } List> insertObjectList = new ArrayList>(); for (int i = 0; i < programList.size(); i++) { -- 2.7.4