[Title] prevent issue fixed
authorjooyoul_lee <jy.exe.lee@samsung.com>
Wed, 13 Nov 2013 05:19:36 +0000 (14:19 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Wed, 13 Nov 2013 05:19:36 +0000 (14:19 +0900)
[Desc.]
[Issue]

56 files changed:
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/checkbox/DACheckBox.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/radio/DARadioButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomCombo.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/graph/bar/FourBarGraph.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/graph/bar/SingleBar.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/graph/circular/CircularGraph.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/Formatter.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timer/TimerClock.java
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/WorkbenchSingletonFocusManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerPlugin.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/AnalyzerPerspectiveListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogInserter.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/SWAPLogParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/BinarySettingManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/ImageViewer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/snapshot/SnapshotView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/DAPageComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ColumnGroupRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/FunctionUsageProfiler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/ProfilingChildData.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/AddChartMenuComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/AboutDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ConfigureManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/LicenseDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/SaveAsDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/BinarySettingsPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/WelcomeDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceInputReader.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/SaveFilesTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/TempFilesTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DADialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/FindDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/TabButtonRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableEmptyCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DefaultTableComparator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/TreeDataComparator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/uirecorder/UIRecorderPlayThread.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/DefaultComparator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/ImageListSortComparator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/InternalLogManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/UpdateViewTimer.java

index 560a859..a1e4b00 100644 (file)
@@ -372,7 +372,7 @@ public class DACustomButton extends Canvas {
         * @param font
         *            The font of the button text.
         */
-       public void setFont(Font font) {
+       public void setButtonFont(Font font) {
                attr.setFont(font);
        }
 
index b53bc39..ecbb839 100644 (file)
@@ -93,6 +93,7 @@ public class DACheckBox extends Canvas {
        }
 
        public void setEnabled(boolean enabled) {
+               super.setEnabled(enabled);
                setCheckboxEnabled(enabled);
        }
 
index a3eb0c6..0a701f2 100644 (file)
@@ -78,10 +78,12 @@ public class DARadioButton extends Canvas {
        }
 
        public void setForeground(Color color) {
+               super.setForeground(color);
                fgColor = color;
        }
 
        public void setBackground(Color color) {
+               super.setBackground(color);
                bgColor = color;
        }
 
index 708d24a..1fa75dc 100644 (file)
@@ -863,7 +863,7 @@ public class DACustomCombo extends Canvas {
                this.titleAlign = align;
        }
 
-       public void setFont(Font font) {
+       public void setComboFont(Font font) {
                this.font = font;
        }
 }
index faa60c1..a76fa0e 100644 (file)
@@ -111,6 +111,7 @@ public class FourBarGraph extends Composite {
        }
 
        public void setFont(Font font) {
+               super.setFont(font);
                label.setFont(font);
                this.labelFont = font;
        }
index 6d69bea..a0ae36b 100644 (file)
@@ -146,6 +146,7 @@ public class SingleBar extends Canvas {
        }
 
        public void setFont(Font font) {
+               super.setFont(font);
                this.font = font;
        }
 }
index 9bb2732..367eb16 100644 (file)
@@ -188,7 +188,7 @@ public class CircularGraph extends Composite {
                label.setText(text);
        }
 
-       public void setFont(Font font) {
+       public void setLabelFont(Font font) {
                label.setFont(font);
                this.labelFont = font;
        }
index 2ea7e0c..2097aad 100644 (file)
@@ -370,7 +370,8 @@ public class Formatter {
                }
                else{
                        remainder /= 100;
-                       remainder = Math.round((float)remainder);
+                       float fValue = remainder;
+                       remainder = Math.round(fValue);
                        ret = String.format("%d.%d%s", quotient,remainder,unit);
                }
                return ret;
index ec2f31d..57fc55a 100644 (file)
@@ -236,7 +236,7 @@ public class TimerClock extends Canvas {
                this.bgImage = bg;
        }
 
-       public void setFont(Font font) {
+       public void setClockFont(Font font) {
                this.clockFont = font;
        }
 
index 8f71b96..fa108fc 100755 (executable)
@@ -67,20 +67,26 @@ public class Application implements IApplication {
                if (STDOUT_TO_FILE) {
                        String logPath = WorkbenchUtils.getLogsPath();
                        File logs = new File(logPath);
+                       boolean success = true;
                        if (!logs.exists()) {
-                               logs.mkdirs();
+                               if (!logs.mkdirs()) {
+                                       System.out
+                                                       .println("Log directory create failed.. log file create failed...");
+                                       success = false;
+                               }
                        }
+                       if (success) {
+                               String logFileName = LOG_PREFIX + logPostFix;//$NON-NLS-1$
+                               logPath += File.separator + logFileName;
 
-                       String logFileName = LOG_PREFIX + logPostFix;//$NON-NLS-1$
-                       logPath += File.separator + logFileName;
-
-                       File file = new File(logPath);
-                       FileOutputStream fos = new FileOutputStream(file);
-                       PrintStream ps = new PrintStream(fos);
-                       System.setOut(ps);
-                       System.setErr(ps);
+                               File file = new File(logPath);
+                               FileOutputStream fos = new FileOutputStream(file);
+                               PrintStream ps = new PrintStream(fos);
+                               System.setOut(ps);
+                               System.setErr(ps);
 
-                       checkLogs(logs.getPath());
+                               checkLogs(logs.getPath());
+                       }
                }
 
                if (WorkbenchSingletonFocusManager.checkDASingleton()) {
@@ -90,7 +96,7 @@ public class Application implements IApplication {
                } else {
                        System.out.println("First DA Running");
                }
-               
+
                String[] argv = (String[]) context.getArguments().get(
                                "application.args");//$NON-NLS-1$
                if (argv.length > 0) {
@@ -128,7 +134,9 @@ public class Application implements IApplication {
 
        private void checkLogs(String path) {
                List<String> logFiles = WorkbenchUtils.getFiles(path);
-
+               if (null == logFiles) {
+                       return;
+               }
                List<String> daLogFiles = new ArrayList<String>();
                for (String name : logFiles) {
                        if (name.contains(LOG_PREFIX)) {
index 2119d02..f9422ee 100644 (file)
@@ -159,7 +159,10 @@ public class WorkbenchSingletonFocusManager {
 
                File daSaveFile = new File(saveFolderPath);
                if (!daSaveFile.isDirectory()) {
-                       daSaveFile.mkdirs();
+                       if (!daSaveFile.mkdirs()) {
+                               System.out.println("da save file create failed...");
+                               return false;
+                       }
                }
                String activeFilePath = saveFolderPath + File.separator + ACTIVE_DA;
 
index b73498b..7ab11d6 100755 (executable)
@@ -197,7 +197,7 @@ public class AnalyzerManager {
                funcNameMap.clear();
        }
 
-       public static List<ImageInfo> getImageList() {
+       public static synchronized List<ImageInfo> getImageList() {
                if (null == imageList) {
                        imageList = new ArrayList<ImageInfo>();
                        imageListSize = 0;
@@ -212,7 +212,7 @@ public class AnalyzerManager {
                return imageList;
        }
 
-       public static HashMap<String, ImageInfo> getImageSet() {
+       public static synchronized HashMap<String, ImageInfo> getImageSet() {
                if (null == imageSet) {
                        imageSet = new HashMap<String, ImageInfo>();
                        ImageInfo noImage = new ImageInfo();
index 65215b9..463c1ab 100644 (file)
@@ -125,7 +125,9 @@ public class AnalyzerPlugin extends AbstractUIPlugin {
                        }\r
                }\r
                if (!saveFolder.isDirectory()) {\r
-                       saveFolder.mkdirs();\r
+                       if (!saveFolder.mkdirs()) {\r
+                               System.out.println("save folder create failed...");\r
+                       }\r
                }\r
 \r
                IPartService partService = PlatformUI.getWorkbench()\r
index 61e7b7a..796eff1 100644 (file)
@@ -172,10 +172,9 @@ public class DACommunicator {
        }
 
        public static void loadDevices() {
-               IDevice[] devices = null;
                List<DeviceInfo> devs = new ArrayList<DeviceInfo>();
                if (null != sdbBridge) {
-                       devices = sdbBridge.getDevices();
+                       IDevice[] devices = sdbBridge.getDevices();
                        int size = devices.length;
                        if (size > 0) {
                                for (int i = 0; i < size; i++) {
@@ -598,13 +597,15 @@ public class DACommunicator {
        public static void setSelectedDeviceBySerial(String serial) {
                if (null == serial || serial.isEmpty()) {
                        setSelectedDevice(null);
-               }
-               int size = getDevices().size();
-               for (int i = 0; i < size; i++) {
-                       IDevice idev = devices.get(i).getIDevice();
-                       if (null != idev) {
-                               if (serial.equals(idev.getSerialNumber())) {
-                                       setSelectedDevice(devices.get(i));
+               } else {
+                       int size = getDevices().size();
+                       for (int i = 0; i < size; i++) {
+                               IDevice idev = devices.get(i).getIDevice();
+                               if (null != idev) {
+                                       if (serial.equals(idev.getSerialNumber())) {
+                                               setSelectedDevice(devices.get(i));
+                                               break;
+                                       }
                                }
                        }
                }
index 4386d78..e0b3b2c 100644 (file)
@@ -45,7 +45,6 @@ public class AnalyzerPerspectiveListener extends PerspectiveAdapter {
                        DACommunicator.addDeviceListener();
                        DACommunicator.loadDevices();
                        DACommunicator.updateToolbarDevice();
-//                     DACommunicator.setSelectedApp(DACommunicator.getSelectedApp());
                        init = true;
                }
        }
index 3280f21..61b66b1 100644 (file)
@@ -44,7 +44,7 @@ public class LogInserter implements Runnable {
        private static InsertLogQueue insertLogQueue = null;
        private static boolean isCompleted = false;
 
-       public static void startInsertLogThread() {
+       public static synchronized void startInsertLogThread() {
                if (null == insertLogThread || !insertLogThread.isAlive()) {
                        insertLogThread = new Thread(null, new LogInserter(),
                                        AnalyzerConstants.INSERT_LOG_THREAD);
@@ -65,7 +65,7 @@ public class LogInserter implements Runnable {
                }
        }
 
-       public static InsertLogQueue getInsertLogQueue() {
+       public static synchronized InsertLogQueue getInsertLogQueue() {
                if (null == insertLogQueue) {
                        insertLogQueue = new InsertLogQueue();
                }
index 0bd252a..25a315e 100755 (executable)
@@ -64,7 +64,7 @@ public class Project {
        private static final int INDEX_LOG_COUNT = 8;
        private static final int INDEX_SYSTEM_COUNT = 9;
        private static final int INDEX_PROFILE_COUNT = 10;
-       private static final int INDEX_SAVE_PATH = 11;
+//     private static final int INDEX_SAVE_PATH = 11;
        private static final int INDEX_MAIN_PID = 12;
 
        private final static int MAX_FILENAME_LENGTH = 50;
@@ -248,14 +248,19 @@ public class Project {
                File imgFolder = new File(savePath + File.separator
                                + AnalyzerConstants.IMAGE_FOLDER_NAME);
                if (!imgFolder.isDirectory()) {
-                       imgFolder.mkdirs();
-               }
-
-               File samallImage = new File(savePath + File.separator
-                               + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
-                               + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
-               if (!samallImage.isDirectory()) {
-                       samallImage.mkdirs();
+                       if (!imgFolder.mkdirs()) {
+                               System.out.println("image directory create failed...");
+                       } else {
+                               File samallImage = new File(savePath + File.separator
+                                               + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
+                                               + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
+                               if (!samallImage.isDirectory()) {
+                                       if (!samallImage.mkdirs()) {
+                                               System.out
+                                                               .println("small image directory create failed...");
+                                       }
+                               }
+                       }
                }
 
                AnalyzerManager.setProject(this);
@@ -304,7 +309,7 @@ public class Project {
                return true;
        }
 
-       public long getBaseAddress(int pid, long  time) {
+       public long getBaseAddress(int pid, long time) {
                ProcessInfoPackage pInfoPack = processInfoPackHash.get(pid);
                ProcessInfo processInfo = pInfoPack.getProcessInfo(time);
                return processInfo.getLowestAddress();
@@ -354,7 +359,7 @@ public class Project {
                lastLogNum = Long.parseLong(data.get(INDEX_LOG_COUNT));
                lastDeviceLogNum = Long.parseLong(data.get(INDEX_SYSTEM_COUNT));
                lastProfileLogNum = Long.parseLong(data.get(INDEX_PROFILE_COUNT));
-//             savePath = data.get(INDEX_SAVE_PATH);
+               // savePath = data.get(INDEX_SAVE_PATH);
                mainPid = Integer.parseInt(data.get(INDEX_MAIN_PID));
        }
 }
index 8ed8ef1..42dfa9c 100644 (file)
@@ -29,6 +29,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
@@ -54,7 +55,7 @@ public class ShortCutManager {
        private static ShortCutManager instance = null;
        private boolean enabled = true;
        private int CTRL_STATE_MASK = SWT.CTRL;
-       
+
        private static int KEY_1 = 49;
        private static int KEY_2 = 50;
        private static int KEY_3 = 51;
@@ -227,7 +228,7 @@ public class ShortCutManager {
                                DACustomButton button = (DACustomButton) ToolbarArea
                                                .getInstance().getButton(ToolbarArea.REPLAY_BUTTON);
                                if (button.isButtonEnabled()) {
-                                       if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != ReplayTraceHandler.FAILED) {
+                                       if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) == AnalyzerConstants.SUCCESS) {
                                                ToolbarArea.getInstance().startTrace();
                                        }
                                }
index 7a1e7f0..79b7a70 100755 (executable)
@@ -55,7 +55,6 @@ import org.tizen.dynamicanalyzer.swap.model.DATime;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
 import org.tizen.dynamicanalyzer.swap.model.data.LogDataUtils;
-import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
 import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
 import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
@@ -63,16 +62,16 @@ import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class MessageParser {
 
-       final int MSG_ID_INDEX = 0;
-       final int MSG_LENGTH_INDEX = 1;
-       final int MSG_PAYLOAD_INDEX = 2;
-       final int MSG_SPLIT_SIZE = 3;
+       static final int MSG_ID_INDEX = 0;
+       static final int MSG_LENGTH_INDEX = 1;
+       static final int MSG_PAYLOAD_INDEX = 2;
+       static final int MSG_SPLIT_SIZE = 3;
 
        /* Message Buffer max length */
-       final int MSG_BUFFER_MAX = 1000;
-       final int MSG_BUFFER_TIMER_DELAY = 5;
-       final int MSG_BUFFER_TIMER_PERIOD = 1000; // 1 second
-       final int WAITING_TIME = 100;
+       static final int MSG_BUFFER_MAX = 1000;
+       static final int MSG_BUFFER_TIMER_DELAY = 5;
+       static final int MSG_BUFFER_TIMER_PERIOD = 1000; // 1 second
+       static final int WAITING_TIME = 100;
 
        public static final int MSG_HEADER_SIZE = 20;
        final int MSG_PAYLOAD_SIZE_INDEX = 16;
@@ -125,9 +124,22 @@ public class MessageParser {
                        lock.unlock();
                        return;
                }
-               SWAPLogParser.getLogQueue().putLog(buffer);
-               buffer = new ArrayList<LogData>();
-               lock.unlock();
+               try {
+                       SWAPLogParser.getLogQueue().putLog(buffer);
+               } catch (UnsupportedOperationException e) {
+                       e.printStackTrace();
+               } catch (ClassCastException e) {
+                       e.printStackTrace();
+               } catch (NullPointerException e) {
+                       e.printStackTrace();
+               } catch (IllegalArgumentException e) {
+                       e.printStackTrace();
+               } catch (IllegalMonitorStateException e) {
+                       e.printStackTrace();
+               } finally {
+                       buffer = new ArrayList<LogData>();
+                       lock.unlock();
+               }
        }
 
        private void processProcessInfo(byte[] data) {
@@ -245,7 +257,7 @@ public class MessageParser {
                int index = 0;
                int id = ByteUtils.toInt(data, index);
                index += INT_SIZE;
-//             int seq = ByteUtils.toInt(data, index);
+               // int seq = ByteUtils.toInt(data, index);
                index += INT_SIZE;
                DATime changeTime = new DATime();
                int sec = ByteUtils.toInt(data, index);
@@ -255,7 +267,7 @@ public class MessageParser {
                changeTime.setSec(sec);
                changeTime.setNano(nano);
 
-//             int length = ByteUtils.toInt(data, index);
+               // int length = ByteUtils.toInt(data, index);
                index += INT_SIZE;
 
                int pid = ByteUtils.toInt(data, index);
index 72bd378..3f9bb2d 100755 (executable)
@@ -54,7 +54,7 @@ import org.tizen.dynamicanalyzer.utils.ImageUtil;
 import org.tizen.sdblib.service.SyncResult;
 
 public class SWAPLogParser implements Runnable {
-       private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
+       private static final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
        private static Thread logParser = null;
        // default false, turn on when Tizen C++ app
        // private static boolean dropCallTraceLog = true;
@@ -67,7 +67,7 @@ public class SWAPLogParser implements Runnable {
        private int DEFAULT_IMG_WIDTH = 480;
        private int DEFAULT_IMG_HEIGHT = 800;
 
-       public static LogQueue getLogQueue() {
+       public static synchronized LogQueue getLogQueue() {
                if (null == logQueue) {
                        logQueue = new LogQueue();
                }
@@ -82,7 +82,7 @@ public class SWAPLogParser implements Runnable {
                return dropCallTraceLog;
        }
 
-       public static void startLogParser() {
+       public static synchronized void startLogParser() {
                getLogQueue().clear();
                // why here?
                // dropCallTraceLog = true;
index 5f26c2f..209347a 100644 (file)
@@ -121,7 +121,10 @@ public class BinarySettingManager {
                                                + libFullName;
                                File rpms = new File(rpmPath);
                                if (!rpms.exists()) {
-                                       rpms.mkdirs();
+                                       if (!rpms.mkdirs()) {
+                                               System.out.println("rpm directory create failed...");
+                                               continue;
+                                       }
                                }
 
                                String from = debugPath;
@@ -136,7 +139,8 @@ public class BinarySettingManager {
 
                                if (null != debugInfoSourceRpmName
                                                && !debugInfoSourceRpmName.isEmpty()) {
-                                       from = debugInfoFile.getParent() + File.separator + debugInfoSourceRpmName;
+                                       from = debugInfoFile.getParent() + File.separator
+                                                       + debugInfoSourceRpmName;
                                        to = rpmPath + File.separator + debugInfoSourceRpmName;
                                        if (AnalyzerUtil.copyFile(from, to)) {
                                                debugRpmSourcePath = to;
@@ -170,8 +174,9 @@ public class BinarySettingManager {
                                                                        new InputStreamReader(
                                                                                        process.getErrorStream()));
                                                        String errorStr = error.readLine();
-                                                       System.out.println("debug info file extract failed... : "
-                                                                       + errorStr);
+                                                       System.out
+                                                                       .println("debug info file extract failed... : "
+                                                                                       + errorStr);
                                                        continue;
                                                }
                                        } catch (IOException e) {
@@ -203,8 +208,9 @@ public class BinarySettingManager {
                                                BufferedReader error = new BufferedReader(
                                                                new InputStreamReader(process.getErrorStream()));
                                                String errorStr = error.readLine();
-                                               System.out.println("debug source file extract failed... : "
-                                                               + errorStr);
+                                               System.out
+                                                               .println("debug source file extract failed... : "
+                                                                               + errorStr);
                                                continue;
                                        }
                                        debugFilePath = rpmPath + line.substring(1, line.length());
index b30ef7a..1bf7004 100644 (file)
@@ -136,18 +136,13 @@ public class FileApiListView extends DAView {
 
        @Override
        public void updateView(DASelectionData data) {
-               FileChartData pageData = (FileChartData) data.getData();
-
-               if (!(pageData instanceof FileChartData)) {
+               if (!(data.getData() instanceof FileChartData)) {
                        selectionStartTime = data.getStartTime();
                        selectionEndTime = data.getEndTime();
-               } else {
-                       this.data = pageData;
+                       tableComp.getTable().removeAll();
+                       tableComp.updateTable();
+                       tableComp.setSelectionByTime(selectionStartTime, selectionEndTime);
                }
-               tableComp.getTable().removeAll();
-               tableComp.updateTable();
-               tableComp.setSelectionByTime(selectionStartTime, selectionEndTime);
-
        }
 
        @Override
index 7f8fb65..3960ac1 100644 (file)
@@ -57,7 +57,7 @@ import org.tizen.dynamicanalyzer.resources.ImageResources;
 
 public class ImageViewer extends Composite {
 
-       class ImageData {
+       static class ImageData {
                public GC gc;
                public int imgWidth;
                public int imgHeight;
@@ -121,10 +121,10 @@ public class ImageViewer extends Composite {
        private boolean rightEnable = false;
 
        // +2 means outer offset
-       private final int defaultShellMaxWidth = 480 / 2 + 2;
-       private final int defaultShellMaxHeight = 800 / 2 + 2;
-       private final int defaultChildWidth = 69;
-       private final int defaultChildHeight = 108;
+       private static final int defaultShellMaxWidth = 480 / 2 + 2;
+       private static final int defaultShellMaxHeight = 800 / 2 + 2;
+       private static final int defaultChildWidth = 69;
+       private static final int defaultChildHeight = 108;
 
        private int shellMaxWidth = 0;
        private int shellMaxHeight = 0;
index 07774b0..d6aa777 100644 (file)
@@ -168,7 +168,7 @@ public class SnapshotView extends DAView {
                processGraph.setTextColor(ColorResources.PROCESS_GRAPH_COLOR);
                processGraph.setText(InformationViewLabels.SNAPSHOT_VIEW_PROCESS);
                processGraph.setLabelBg(ColorResources.VIEW_BG_COLOR);
-               processGraph.setFont(FontResources.CIRCULAR_LABEL_FONT);
+               processGraph.setLabelFont(FontResources.CIRCULAR_LABEL_FONT);
                processGraph.setMeasureFont(FontResources.CIRCULAR_GRAPH_MEASURE_FONT);
                processGraph.setValueFont(FontResources.CIRCULAR_GRAPH_VALUE_FONT);
 
index 15ff06f..c5bdd98 100644 (file)
@@ -47,8 +47,8 @@ public class DAPageComposite extends Composite implements ViewAction {
        private List<ViewAction> views = null;
        protected String name = null;
 
-       private final double DEFAULT_WIDTH = DesignConstants.SNAPSHOT_VIEW_WIDTH + 10;
-       private final double DEFAULT_HEIGHT = DesignConstants.SNAPSHOT_VIEW_HEIGHT
+       private static final double DEFAULT_WIDTH = DesignConstants.SNAPSHOT_VIEW_WIDTH + 10;
+       private static final double DEFAULT_HEIGHT = DesignConstants.SNAPSHOT_VIEW_HEIGHT
                        + 10 + DesignConstants.VIEW_TITLEBAR_HEIGHT;
 
        protected int wRate = 0;
index c14f779..1d41d14 100644 (file)
@@ -37,18 +37,8 @@ import org.tizen.dynamicanalyzer.resources.FontResources;
 
 public class ColumnGroupRenderer extends DefaultColumnGroupHeaderRenderer {
 
-       int leftMargin = 6;
-
-       int rightMargin = 6;
-
-       int topMargin = 3;
-
        int bottomMargin = 3;
 
-       int arrowMargin = 6;
-
-       int imageSpacing = 3;
-
        @Override
        public boolean notify(int arg0, Point arg1, Object arg2) {
                // TODO Auto-generated method stub
index 2fb4ae1..6ad49f5 100644 (file)
@@ -65,7 +65,7 @@ public class FunctionUsageProfiler implements Runnable {
                return profileDataMaker;
        }
 
-       public static FunctionUsageProfiler getInstance() {
+       public static synchronized FunctionUsageProfiler getInstance() {
                if (null == instance) {
                        instance = new FunctionUsageProfiler();
                }
@@ -121,7 +121,7 @@ public class FunctionUsageProfiler implements Runnable {
                notifyAll();
        }
 
-       public static void startProfiler() {
+       public static synchronized void startProfiler() {
                if (null == profiler || !profiler.isAlive()) {
                        profiler = new Thread(null, getInstance(),
                                        AnalyzerConstants.LOG_QUEUE_OBSERVING_THREAD);
index 4b0fda0..c8e100a 100644 (file)
@@ -48,7 +48,7 @@ public class ProfilingChildData {
                return children;
        }
 
-       public boolean equals(ProfilingChildData input) {
+       public boolean isEualsl(ProfilingChildData input) {
                if (!input.getSeq().equals(seq)) {
                        return false;
                }
index 2e6c538..37d4e7c 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
 
-
-
-
-//import java.util.ArrayList;
-//import java.util.List;
-//
-//import org.eclipse.nebula.widgets.grid.Grid;
-//import org.eclipse.nebula.widgets.grid.GridItem;
-//import org.eclipse.swt.events.SelectionEvent;
-//import org.eclipse.swt.events.SelectionListener;
-//import org.eclipse.swt.widgets.Composite;
-//import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-//import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-//import org.tizen.dynamicanalyzer.common.DASelectionData;
-//import org.tizen.dynamicanalyzer.model.TableInput;
-//import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-//import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
-//import org.tizen.dynamicanalyzer.swap.model.data.UserFunctionData;
-//import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
-//import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-//import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
-//import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
-//import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-//import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-//import org.tizen.dynamicanalyzer.utils.Formatter;
-//import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
-//import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
-//
-//public class CallTraceTable extends DATableComposite {
-//     private DAChartBoard chartBoard = null;
-//
-//     public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
-//             super(parent, compStyle, tableStyle);
-//             setRangePopup();
-//
-//             table.addSelectionListener(new SelectionListener() {
-//
-//                     @Override
-//                     public void widgetSelected(SelectionEvent e) {
-//                             GridItem[] ti = ((Grid) e.widget).getSelection();
-//                             if (null == ti || ti.length == 0) {
-//                                     return;
-//                             }
-//                             int size = ti.length;
-//                             LogData startData = ((DATableDataFormat) ti[0].getData())
-//                                             .getLogData();
-//                             LogData endData = ((DATableDataFormat) ti[size - 1].getData())
-//                                             .getLogData();
-//                             long startTime = startData.getTime();
-//                             long endTime = endData.getTime();
-//
-//                             DASelectionData data = new DASelectionData(CallTraceView.ID,
-//                                             startTime, endTime, ti, table);
-//                             AnalyzerManager.getCurrentPage().updatePage(data);
-//                     }
-//
-//                     @Override
-//                     public void widgetDefaultSelected(SelectionEvent e) {
-//                     }
-//             });
-//
-//     }
-//
-//     protected List<TableInput> makeTableInput() {
-//             List<LogData> userLog = UserFunctionManager.getInstance().getLog();
-//             List<TableInput> input = new ArrayList<TableInput>();
-//             int size = userLog.size();
-//             for (int i = 0; i < size; i++) {
-//                     LogData logData = userLog.get(i);
-//                     List<String> text = new ArrayList<String>();
-//                     if (logData instanceof UserFunctionData) {
-//                             // create text
-//                             UserFunctionData data = (UserFunctionData) logData;
-//                             String time = Formatter.toTimeFormat(data.getTime());
-//                             text.add(time);
-//                             text.add(Integer.toString(data.getTid()));
-//                             text.add(Integer.toString(data.getPid()));
-//                             text.add(data.getApiName());
-//                             text.add(data.getArgs());
-//                             text.add(data.getReturn());
-//                             text.add(data.getLibName());
-//                     } else if (logData instanceof ProfileData) {
-//                             ProfileData data = (ProfileData) logData;
-//                             String time = Formatter.toTimeFormat(data.getTime());
-//                             text.add(time);
-//                             text.add(Integer.toString(data.getTid()));
-//                             text.add(Integer.toString(data.getPid()));
-//                             text.add(data.getApiName());
-//                             text.add(data.getArgs());
-//                             text.add(data.getHexReturn());
-//                             text.add(data.getLibName());
-//                     } else {
-//                             System.out.println("wrong log data in calltrace view");
-//                             continue;
-//                     }
-//                     // create images
-//
-//                     // create DATableDataFormat
-//                     DATableDataFormat tableData = new DATableDataFormat(
-//                                     logData.getSeq());
-//                     tableData.setLogData(logData);
-//                     tableData.setType(AnalyzerConstants.TYPE_TABLE_CALLTRACE);
-//
-//                     TableInput tableInput = new TableInput();
-//                     tableInput.setText(text);
-//                     tableInput.setData(tableData);
-//                     input.add(tableInput);
-//
-//                     if (RangeDataManager.getInstance().isBeingAnalyzed()) {
-//                             long logTime = logData.getTime();
-//                             long analysisStartTime = RangeDataManager.getInstance()
-//                                             .getAnalysisStartTime();
-//                             long analysisEndTime = RangeDataManager.getInstance()
-//                                             .getAnalysisEndTime();
-//                             if (logTime >= analysisStartTime && logTime <= analysisEndTime) {
-//                                     tableInput.setInRange(true);
-//                             }
-//                     }
-//             }
-//             return input;
-//     }
-//
-//     private DAChartBoard getChartBoard() {
-//             if (chartBoard == null) {
-//                     return (DAChartBoard) (AnalyzerManager.getCurrentPage().getView(
-//                                     TimelineView.ID).getControl());
-//             }
-//             return chartBoard;
-//     }
-//
-//     protected void actionSetStartEnd(int type) {
-//             GridItem item = table.getItem(mousePoint);
-//             if (null != item) {
-//                     LogData data = ((DATableDataFormat) item.getData()).getLogData();
-//                     long inputTime = data.getTime();
-//                     double startTime = -1;
-//                     double endTime = -1;
-//                     DAChartBoard board = getChartBoard();
-//
-//                     if (type == START_TIME) {
-//                             rangeDataManager.setMarkerStartTime(inputTime);
-//                             startTime = inputTime / TimelineConstants.MEGA_DOUBLE;
-//                             endTime = rangeDataManager.getMarkerEndTime()
-//                                             / TimelineConstants.MEGA_DOUBLE;
-//
-//                     } else if (type == END_TIME) {
-//                             rangeDataManager.setMarkerEndTime(inputTime);
-//                             endTime = inputTime / TimelineConstants.MEGA_DOUBLE;
-//                             startTime = rangeDataManager.getMarkerStartTime()
-//                                             / TimelineConstants.MEGA_DOUBLE;
-//                     }
-//
-//                     board.setTimelineMarkerStartTime(startTime);
-//                     board.setTimelineMarkerEndTime(endTime);
-//
-//                     ((DAChartPlotIntervalMarker) board.getMarkers().get(
-//                                     UICommonConstants.RANGE_MARKER_INDEX))
-//                                     .setStartVal(startTime);
-//                     ((DAChartPlotIntervalMarker) board.getMarkers().get(
-//                                     UICommonConstants.RANGE_MARKER_INDEX)).setEndVal(endTime);
-//                     //
-//                     //
-//                     //
-//                     //
-//                     // if (type == START_TIME) {
-//                     // rangeDataManager.setMarkerStartTime(inputTime);
-//                     // getChartBoard().setTimelineMarkerStartTime(
-//                     // inputTime / TimelineConstants.MEGA);
-//                     // } else if (type == END_TIME) {
-//                     // rangeDataManager.setMarkerEndTime(inputTime);
-//                     // getChartBoard().setTimelineMarkerEndTime(
-//                     // inputTime / TimelineConstants.MEGA);
-//                     // }
-//             }
-//     }
-//
-//     public void setSelectionByTime(long startTime, long endTime) {
-//             GridItem[] items = table.getItems();
-//             int size = items.length;
-//             List<Integer> selectionArray = new ArrayList<Integer>();
-//             int topIndex = 0;
-//             long topIndexTime = 0;
-//
-//             for (int i = 0; i < size; i++) {
-//                     DATableDataFormat dataFormat = (DATableDataFormat) items[i]
-//                                     .getData();
-//                     long time = dataFormat.getLogData().getTime();
-//
-//                     if (time < startTime) {
-//                             if (time > topIndexTime) {
-//                                     topIndexTime = time;
-//                                     topIndex = i;
-//                             }
-//                     } else if (time <= endTime) {
-//                             if (topIndexTime < startTime) {
-//                                     topIndexTime = time;
-//                                     topIndex = i;
-//                             } else {
-//                                     if (topIndexTime > time) {
-//                                             topIndexTime = time;
-//                                             topIndex = i;
-//                                     }
-//                             }
-//                             selectionArray.add(i);
-//                     } else {
-//                             break;
-//                     }
-//             }
-//
-//             int[] sel = new int[selectionArray.size()];
-//             for (int i = 0; i < sel.length; i++) {
-//                     sel[i] = selectionArray.get(i).intValue();
-//             }
-//             table.setSelection(sel);
-//             table.setTopIndex(topIndex);
-//     }
-//}
-
-
 import java.util.ArrayList;
 import java.util.List;
 
index d33dba8..7fe4f8b 100644 (file)
@@ -93,7 +93,7 @@ public class AddChartMenuComposite extends Composite {
                                ColorResources.DEFAULT_FONT_COLOR,
                                ColorResources.DEFAULT_FONT_COLOR,
                                ColorResources.DEFAULT_FONT_COLOR);
-               addItems.setFont(FontResources.ADDITEM_BUTTON_FONT);
+               addItems.setButtonFont(FontResources.ADDITEM_BUTTON_FONT);
 
                GridData gDataAddBtn = new GridData();
                gDataAddBtn.horizontalAlignment = GridData.FILL;
index d531d47..a68a4b7 100644 (file)
@@ -213,7 +213,7 @@ public class AboutDialog extends DAMessageBox {
                okButton = new DAButton(buttonComp, SWT.NONE);
                okButton.addClickListener(okButtonListener);
                okButton.setText(AnalyzerLabels.OK);
-               okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
 
                FormData okData = new FormData();
                okData.top = new FormAttachment(0, 9);
@@ -225,7 +225,7 @@ public class AboutDialog extends DAMessageBox {
                licenseButton = new DAButton(buttonComp, SWT.NONE);
                licenseButton.addClickListener(licenseButtonListener);
                licenseButton.setText(AnalyzerLabels.ABOUT_DIALOG_LICENSE);
-               licenseButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               licenseButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
 
                FormData licenceData = new FormData();
                licenceData.top = new FormAttachment(0, 9);
index 87f73cb..708d495 100644 (file)
@@ -247,7 +247,10 @@ public class ConfigureManager {
 
                File configFolder = new File(AnalyzerPaths.CONFIG_FOLDER_PATH);
                if (!configFolder.isDirectory()) {
-                       configFolder.mkdirs();
+                       if (!configFolder.mkdirs()) {
+                               System.out.println("config directory create failed...");
+                               return;
+                       }
                }
 
                File configFile = new File(configFolder,
@@ -373,22 +376,22 @@ public class ConfigureManager {
                if (DACommunicator.isSWAPVersion(devInfo)) {
                        state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL);
                        // state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_FILE);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_IPC);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_PROCESS);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_SIGNAL);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_NETWORK);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_DESC);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_IPC);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_PROCESS);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_SIGNAL);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_NETWORK);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSCALL_DESC);
                        state |= getValueInt(ConfigureLabels.FEATURE_CONTEXT_SWITCH);
                        state |= getValueInt(ConfigureLabels.FEATURE_NETWORK);
                        state |= getValueInt(ConfigureLabels.FEATURE_OPENGL);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_FUNCTION_SAMPLING);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_FUNCTION_SAMPLING);
                        state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM);
                        // state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_CPU);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_PROCESSES);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_MEMORY);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_DISK);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_NETWORK);
-//                     state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_DEVICE);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_PROCESSES);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_MEMORY);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_DISK);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_NETWORK);
+                       // state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_DEVICE);
                        state |= getValueInt(ConfigureLabels.FEATURE_SYSTEM_ENERGY);
                }
 
index bb6c2c6..7dcfee2 100644 (file)
@@ -31,7 +31,6 @@ import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 
-import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
@@ -56,13 +55,12 @@ import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
-public class LicenseDialog extends Window {
+public class LicenseDialog {
        private Shell parent = null;
        private Shell shell = null;
        private DACustomButton okButton = null;
 
        public LicenseDialog(Shell parent, int style) {
-               super(parent);
                this.parent = parent;
        }
 
@@ -105,7 +103,6 @@ public class LicenseDialog extends Window {
                return ret.toString();
        }
 
-       @Override
        public int open() {
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
                shell.setSize(608, 476 + 22);
index cbb94ea..a43649b 100755 (executable)
@@ -103,8 +103,10 @@ public class SaveAsDialog extends DAMessageBox {
                                e.gc.setForeground(ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR);
                                Text text = (Text) e.widget;
                                Rectangle rect = text.getClientArea();
-                               e.gc.drawRectangle(rect.x, rect.y, rect.width -1, rect.height - 1);
-//                             e.gc.drawRectangle(rect.x+1, rect.y+1, rect.width -3, rect.height - 3);
+                               e.gc.drawRectangle(rect.x, rect.y, rect.width - 1,
+                                               rect.height - 1);
+                               // e.gc.drawRectangle(rect.x+1, rect.y+1, rect.width -3,
+                               // rect.height - 3);
                        }
                });
 
@@ -250,12 +252,18 @@ public class SaveAsDialog extends DAMessageBox {
 
                File sourceFolder = new File(sourcePath);
                if (!sourceFolder.isDirectory()) {
-                       sourceFolder.mkdirs();
+                       if (!sourceFolder.mkdirs()) {
+                               System.out.println("source directory create failed...");
+                               return false;
+                       }
                }
 
                File targetFolder = new File(targetPath);
                if (!targetFolder.isDirectory()) {
-                       targetFolder.mkdirs();
+                       if (!targetFolder.mkdirs()) {
+                               System.out.println("target directory create failed...");
+                               return false;
+                       }
                }
                AnalyzerUtil.copyDirectory(sourceFolder, targetFolder);
 
index fbec8ff..feafbfa 100755 (executable)
@@ -46,6 +46,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DesignConstants;
@@ -399,7 +400,7 @@ public class ToolbarArea {
                        @Override
                        public void handleClickEvent(DACustomButton button) {
                                if (!AnalyzerManager.isRunning()) {
-                                       if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != ReplayTraceHandler.FAILED) {
+                                       if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != AnalyzerConstants.FAIL) {
                                                startTrace();
                                        }
                                }
@@ -575,7 +576,7 @@ public class ToolbarArea {
                // Creates TimerClock widget.
                timerClock = new TimerClock(parent, SWT.NONE);
                timerClock.setBgImage(ImageResources.TIMER);
-               timerClock.setFont(FontResources.TIMER);
+               timerClock.setClockFont(FontResources.TIMER);
 
                // // Creates save trace button.
                saveTraceButton = new DACustomButton(parent, ImageResources.SAVE,
@@ -1114,6 +1115,7 @@ public class ToolbarArea {
        private boolean checkValidApplication() {
                List<DeviceInfo> devices = DACommunicator.getDevices();
                if (null == devices || devices.isEmpty()) {
+                       System.out.println("Device is empty");
                        return false;
                }
                String selectedDevice = deviceCombo.getText();
index ab3137a..f923c8f 100644 (file)
@@ -252,7 +252,9 @@ public class BinarySettingsPage extends DAPageComposite {
                String settingPath = AnalyzerPaths.DYNAMIC_ANALYZER_SETTING_PATH;
                File settingFolder = new File(settingPath);
                if (!settingFolder.exists() || !settingFolder.isDirectory()) {
-                       settingFolder.mkdirs();
+                       if (!settingFolder.mkdirs()) {
+                               System.out.println("setting directory create failed...");
+                       }
                }
 
                this.setLayout(new FormLayout());
index 09225f0..6781482 100644 (file)
@@ -190,7 +190,7 @@ public class ConfigurationDialog extends DAMessageBox {
                cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
                cancelButton.addClickListener(cancelButtonListener);
                cancelButton.setText(AnalyzerLabels.CLOSE);
-               cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                FormData buttonData = new FormData();
                buttonData.left = new FormAttachment(50, 4);
                buttonData.top = new FormAttachment(0, 11);
@@ -201,7 +201,7 @@ public class ConfigurationDialog extends DAMessageBox {
                applyButton = new DAButton(buttonContentsComp, SWT.NONE);
                applyButton.addClickListener(applyButtonListener);
                applyButton.setText(AnalyzerLabels.APPLY);
-               applyButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               applyButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                buttonData = new FormData();
                buttonData.right = new FormAttachment(50, -4);
                buttonData.top = new FormAttachment(0, 11);
index 4aa4e8b..135738d 100644 (file)
@@ -173,7 +173,7 @@ public class WelcomeDialog extends DAMessageBox {
                cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
                cancelButton.addClickListener(cancelButtonListener);
                cancelButton.setText(AnalyzerLabels.CANCEL);
-               cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                FormData buttonData = new FormData();
                buttonData.right = new FormAttachment(100, -9);
                buttonData.top = new FormAttachment(0, 11);
@@ -184,7 +184,7 @@ public class WelcomeDialog extends DAMessageBox {
                okButton = new DAButton(buttonContentsComp, SWT.NONE);
                okButton.addClickListener(okButtonListener);
                okButton.setText(AnalyzerLabels.OK);
-               okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                buttonData = new FormData();
                buttonData.right = new FormAttachment(cancelButton, -8);
                buttonData.top = new FormAttachment(0, 11);
index 50b6528..a1e8ae8 100644 (file)
@@ -270,7 +270,7 @@ public class OpenTraceDialog extends DAMessageBox {
                okButton = new DAButton(buttonComp, SWT.NONE);
                okButton.addClickListener(okButtonListener);
                okButton.setText(AnalyzerLabels.OPEN);
-               okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                FormData okData = new FormData();
                okData.top = new FormAttachment(0, 7);
                okData.left = new FormAttachment(50,
@@ -282,7 +282,7 @@ public class OpenTraceDialog extends DAMessageBox {
                cancelButton = new DAButton(buttonComp, SWT.NONE);
                cancelButton.addClickListener(cancelButtonListener);
                cancelButton.setText(AnalyzerLabels.CLOSE);
-               cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                FormData cancelData = new FormData();
                cancelData.top = new FormAttachment(0, 7);
                cancelData.left = new FormAttachment(50, 4);
index 46ea246..d128422 100644 (file)
@@ -44,7 +44,7 @@ public class OpenTraceInputReader implements Runnable {
 
        private static Thread openTraceInputThread = null;
 
-       public static void startOpenTraceInputReader() {
+       public static synchronized void startOpenTraceInputReader() {
                if (null == openTraceInputThread || !openTraceInputThread.isAlive()) {
                        openTraceInputThread = new Thread(null, new OpenTraceInputReader(),
                                        AnalyzerConstants.OPEN_TRACE_THREAD);
index e2e3831..9ece416 100644 (file)
@@ -46,10 +46,10 @@ import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class SaveFilesTable extends DATableComposite {
        private boolean isVaildVersion = true;
-       private final int TRACE_NAME_INDEX = 0;
-       private final int DATE_INDEX = 1;
-       private final int VALIDATE_INDEX = 2;
-       private final int COLUMN_COUNT = 2;
+       private static final int TRACE_NAME_INDEX = 0;
+       private static final int DATE_INDEX = 1;
+       private static final int VALIDATE_INDEX = 2;
+       private static final int COLUMN_COUNT = 2;
 
        public SaveFilesTable(Composite parent, int style) {
                super(parent, style);
index 9feedf8..0e6b9c5 100644 (file)
@@ -46,8 +46,8 @@ import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
 public class TempFilesTable extends DATableComposite {
-       private final int TRACE_NAME_INDEX = 0;
-       private final int DATE_INDEX = 1;
+       private static final int TRACE_NAME_INDEX = 0;
+       private static final int DATE_INDEX = 1;
 
        public TempFilesTable(Composite parent, int style) {
                super(parent, style);
index b305dc5..1fd9397 100644 (file)
@@ -143,7 +143,7 @@ public class DADialog {
                okButton = new DAButton(buttonComp, SWT.NONE);
                okButton.addClickListener(okButtonListener);
                okButton.setText(AnalyzerLabels.OK);
-               okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+               okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
 
                FormData okData = new FormData();
                okData.top = new FormAttachment(0, 12);
index 7cd900a..ccdff53 100644 (file)
@@ -129,7 +129,7 @@ public class DATabComposite extends DAView {
                                ColorResources.TAB_OUTLINE_SELECTED_COLOR);
                tabButton.setRenderer(new TabButtonRenderer());
                tabButton.setButtonEnabled(true);
-               tabButton.setFont(FontResources.TAB_BUTTON_FONT);
+               tabButton.setButtonFont(FontResources.TAB_BUTTON_FONT);
                tabButton.setText(title);
                tabButton.setToolTipText((String) child.getData("tooltip"));
                tabButton.setClosable(closeable);
index 8dce7ca..655dd6c 100644 (file)
@@ -55,7 +55,7 @@ import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioSelectionListener;
 
 public class FindDialog extends DAMessageBox {
 
-       private final int ENTER_KEY_CODE = 13;
+       private static final int ENTER_KEY_CODE = 13;
 
        private Text textBox = null;
        private DAButton findButton = null;
index 71a0fc3..c1e8268 100644 (file)
@@ -172,15 +172,19 @@ public class TabButtonRenderer implements IDACustomButtonRenderer {
        public void draw(GC gc, Canvas canvas, int state,
                        DACustomButtonAttribute attr) {
                Rectangle rect = canvas.getClientArea();
-
-               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       drawImageButton(gc, rect, state, attr, (DATabButton) canvas);
-               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
-                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
-                       drawButton(gc, rect, state, attr, (DATabButton) canvas);
+               DATabButton tab = null;
+               if (canvas instanceof DATabButton) {
+                       tab = (DATabButton) canvas;
+
+                       if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
+                               drawImageButton(gc, rect, state, attr, tab);
+                       } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
+                                       || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
+                               drawButton(gc, rect, state, attr, tab);
+                       }
+                       // drawButtonImage(gc, rect, attr);
+                       drawIcon(gc, rect, attr);
                }
-               // drawButtonImage(gc, rect, attr);
-               drawIcon(gc, rect, attr);
        }
 
        protected void drawIcon(GC gc, Rectangle parentRect,
index d05dacd..c360052 100644 (file)
@@ -175,11 +175,11 @@ public class DATableCellRenderer extends DefaultCellRenderer {
                }
 
                if (item.getParent().getLinesVisible()) {
-                       if (isCellSelected()) {
+//                     if (isCellSelected()) {
                                gc.setForeground(ColorResources.TABLE_LINE);
-                       } else {
-                               gc.setForeground(ColorResources.TABLE_LINE);
-                       }
+//                     } else {
+//                             gc.setForeground(ColorResources.TABLE_LINE);
+//                     }
                        gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
                                        getBounds().x + getBounds().width - 1, getBounds().y
                                                        + getBounds().height);
index e5dd077..ab7672f 100644 (file)
@@ -68,11 +68,11 @@ public class DATableEmptyCellRenderer extends GridCellRenderer {
                }
 
                if (table.getLinesVisible()) {
-                       if (isCellSelected()) {
+//                     if (isCellSelected()) {
                                gc.setForeground(ColorResources.TABLE_LINE);
-                       } else {
-                               gc.setForeground(ColorResources.TABLE_LINE);
-                       }
+//                     } else {
+//                             gc.setForeground(ColorResources.TABLE_LINE);
+//                     }
                        gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
                                        getBounds().x + getBounds().width - 1, getBounds().y
                                                        + getBounds().height);
index 19f51e0..78544d6 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.widgets.table;
 
+import java.io.Serializable;
 import java.util.Comparator;
 import java.util.List;
 
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.model.TableInput;
 
-public class DefaultTableComparator implements Comparator<Object> {
+public class DefaultTableComparator implements Comparator<Object>, Serializable {
 
+       private static final long serialVersionUID = 1L;
        protected int type = AnalyzerConstants.SORT_TYPE_GRID;
        protected int column = 0;
        protected int oldColumn = 0;
index 28d87d5..f4cca09 100644 (file)
 
 package org.tizen.dynamicanalyzer.ui.widgets.table;
 
+import java.io.Serializable;
+
 import org.tizen.dynamicanalyzer.model.TreeInput;
 
-public class TreeDataComparator extends DefaultTableComparator {
+public class TreeDataComparator extends DefaultTableComparator implements
+               Serializable {
+
+       private static final long serialVersionUID = 1L;
 
        @Override
        public int userCompare(Object obj1, Object obj2) {
index b12f610..457ace9 100644 (file)
@@ -37,10 +37,9 @@ import org.tizen.dynamicanalyzer.common.HostResult;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 
 public class UIRecorderPlayThread extends Thread {
-       private final String FILTER_STRING = "ls:";//$NON-NLS-1$ 
+       private static final String FILTER_STRING = "ls:";//$NON-NLS-1$ 
        private long readyTime = 100000;
 
-       long pauseTime;
        private static UIRecorderPlayThread instance = null;
        private String xmlFileName = null;
 
@@ -55,7 +54,6 @@ public class UIRecorderPlayThread extends Thread {
        public void run() {
                long preTime = 0;
                long nowTime = 0;
-               pauseTime = 0;
                RecorderXml xml = new RecorderXml();
                XmlData oldData = new XmlData();
                oldData.event_code = CommonConstants.ZERO;
index f06bb58..b6d2c73 100755 (executable)
@@ -142,7 +142,11 @@ public class AnalyzerUtil {
        public static void copyDirectory(File sourceLocation, File targetLocation) {
                if (sourceLocation.isDirectory()) {
                        if (!targetLocation.exists()) {
-                               targetLocation.mkdir();
+                               if (!targetLocation.mkdir()) {
+                                       System.out
+                                                       .println("Copy Failed : target directory create failed..");
+                                       return;
+                               }
                        }
                        String[] children = sourceLocation.list();
                        for (int i = 0; i < children.length; i++) {
@@ -161,16 +165,12 @@ public class AnalyzerUtil {
                                while ((len = in.read(buf)) > 0) {
                                        out.write(buf, 0, len);
                                }
-                               if (null != in) {
-                                       in.close();
-                               }
-                               if (null != out) {
-                                       out.close();
-                               }
                        } catch (FileNotFoundException e) {
                                e.printStackTrace();
                        } catch (IOException e) {
                                e.printStackTrace();
+                       } finally {
+                               tryClose(in, out);
                        }
                }
        }
@@ -188,8 +188,9 @@ public class AnalyzerUtil {
                IHandlerService handlerService = (IHandlerService) PlatformUI
                                .getWorkbench().getService(IHandlerService.class);
                try {
-                       return (Integer) handlerService.executeCommand(commandId,
-                                       new Event());
+
+                       handlerService.executeCommand(commandId, new Event());
+                       return AnalyzerConstants.SUCCESS;
                } catch (ExecutionException e) {
                        e.printStackTrace();
                } catch (NotEnabledException e) {
@@ -199,7 +200,7 @@ public class AnalyzerUtil {
                } catch (NotDefinedException e) {
                        e.printStackTrace();
                }
-               return -1;
+               return AnalyzerConstants.FAIL;
        }
 
        public static List<String> getDirs(String path) {
@@ -543,7 +544,9 @@ public class AnalyzerUtil {
 
        public static void checkLogs(String path, String prefix, int limitCount) {
                List<String> logFiles = getFiles(path);
-
+               if (null == logFiles) {
+                       return;
+               }
                List<String> daLogFiles = new ArrayList<String>();
                for (String name : logFiles) {
                        if (name.contains(prefix)) {
@@ -1110,23 +1113,22 @@ public class AnalyzerUtil {
                return false;
        }
 
-       public static boolean isAddrInBinaryRange(int pid, long time, long addr)
-       {
-               ProcessInfoPackage processInfoPkg = AnalyzerManager
-                               .getProject().getProcessInfo(pid);
-               ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);          
+       public static boolean isAddrInBinaryRange(int pid, long time, long addr) {
+               ProcessInfoPackage processInfoPkg = AnalyzerManager.getProject()
+                               .getProcessInfo(pid);
+               ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);
                if (null == processInfo) {
                        return false;
-               }               
-               
+               }
+
                if (addr >= processInfo.getLowestAddress()
-                               && addr <= processInfo.getHighestAddress()) { 
+                               && addr <= processInfo.getHighestAddress()) {
                        return true;
                } else {
                        return false;
                }
        }
-       
+
        public static boolean getBinaryBuildType(String localBinaryPath) {
                HashMap<String, BinaryInfo> binMap = DACommunicator.getSelectedApp()
                                .getBinaryInfoMap();
index e97a40f..e2fb586 100644 (file)
  */
 package org.tizen.dynamicanalyzer.utils;
 
+import java.io.Serializable;
 import java.util.Comparator;
 import java.util.List;
 
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 
+public class DefaultComparator implements Comparator<List<String>>,
+               Serializable {
 
-public class DefaultComparator implements Comparator<List<String>> {
+       private static final long serialVersionUID = 1L;
 
        @Override
        public int compare(List<String> arg0, List<String> arg1) {
index 1b3effb..0c1f812 100644 (file)
 
 package org.tizen.dynamicanalyzer.utils;
 
+import java.io.Serializable;
 import java.util.Comparator;
 
 import org.tizen.dynamicanalyzer.model.ImageInfo;
 
+public class ImageListSortComparator implements Comparator<ImageInfo>,
+               Serializable {
 
-public class ImageListSortComparator implements Comparator<ImageInfo> {
+       private static final long serialVersionUID = 1L;
 
        @Override
        public int compare(ImageInfo one, ImageInfo two) {
index 23637c2..5c664c3 100644 (file)
@@ -249,7 +249,8 @@ public class InternalLogManager {
                                msg.append("\" name=\"");
                                msg.append(name);
                                msg.append("\" time=\"");
-                               msg.append(String.format("%.3f", (double)spendTime / 1000000000.0));
+                               msg.append(String.format("%.3f",
+                                               (double) spendTime / 1000000000.0));
                                msg.append("\"/>\n");
                                printOutput(msg);
                        }
@@ -492,11 +493,15 @@ public class InternalLogManager {
        }
 
        private void openWriter() {
-//             Date time = Calendar.getInstance().getTime();
-               
-               File autotestPath = new File(AnalyzerPaths.DYNAMIC_ANALYZER_AUTOTEST_PATH);
-               if(!autotestPath.exists()) {
-                       autotestPath.mkdirs();
+               // Date time = Calendar.getInstance().getTime();
+
+               File autotestPath = new File(
+                               AnalyzerPaths.DYNAMIC_ANALYZER_AUTOTEST_PATH);
+               if (!autotestPath.exists()) {
+                       if (!autotestPath.mkdirs()) {
+                               System.out.println("auto test path file create failed...");
+                               return;
+                       }
                }
 
                StringBuilder savePath = new StringBuilder();
index 56f58a8..b24c842 100644 (file)
@@ -53,11 +53,9 @@ public class UpdateViewTimer {
                bStartRecord = state;
        }
 
-       public static void start() {
-               if (null != timer) {
-                       timer.cancel();
-                       timer = null;
-               }
+       public static synchronized void start() {
+               stop();
+
                timer = new Timer();
                timer.schedule(new UpdateTimerTask(),
                                AnalyzerConstants.TIMER_START_TIME_DEFAULT,