package org.tizen.dynamicanalyzer.common;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
return;
}
- DAResult result = DAResult.ERR_OUT_OF_MEMORY;
+ DAResult result = new DAResult(ErrorCode.ERR_OUT_OF_MEMORY);
result.setDetailMessage(AnalyzerLabels.HEAP_MEMORY_WARNING_PRE
+ PathManager.DA_INSTALL_PATH + AnalyzerLabels.HEAP_MEMORY_WARNING_POST);
CommandAction.stopTrace(result, false);
import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
import org.tizen.dynamicanalyzer.util.Logger;
-public enum DAResult {
- SUCCESS(0, "Success!"),
- ERR_EXCEPTION_OCCURRED(-1, "Excpetion is occurred "),
-
- // error that is not shown to the user (3 digits) ( -100 ~ -999 )
- ERR_INVALID_VERSION(-100, "not supported version"),
- ERR_REMOTE_PORT_GET_FAILED(-101, "remote port get failed!!"),
- ERR_CONTROL_SOCKET_CREATION_FAIL(-102, "control socket creation is failed"),
- ERR_DATA_SOCKET_CREATION_FAIL(-103, "data socket creation is failed"),
- ERR_CONTROL_SOCKET_CONNECTION_CLOSED(-104, "connection closed"),
- ERR_PROTOCOL_NOT_SUPPORTED(-105, "procotol is not supported"),
- ERR_FILE_IS_NOT_EXISTS(-201, "File is not exist!"),
- ERR_UPLOAD_FILE_FAILED(-202, "file upload is failed!"),
- ERR_SDB_PUSH_FAILED(-203, "sdb push returns null"),
- ERR_READELF_SIZE_GET_FAILED(-204, "readelf size get failed"),
- ERR_READELF_UPLOAD_FAILED(-205, "readelf file size is different!!"),
- ERR_MSG_STOP_FAIL(-502, "stop message is not ok"),
- ERR_MSG_RUNTIME_FAIL(-503, "runtime message is not ok"),
- ERR_TARGET_INFO_GET_FAIL(-505, "target info get fail..."),
- ERR_KEEP_ALIVE(-506, "keep alive message ack fail..."),
- ERR_RECEIVE_ACK_FAIL(-508, "receiving ack message fail..."),
- ERR_PROCESS_ADD_INFO_GET_FAIL(-509, "failed to get process add info..."),
- ERR_SWAP_INSTRUMENTATION_FAIL(-510, "failed to instrument..."),
- ERR_DA_IS_EXIT(-901, "Dynamic Analyzer is closing"),
-
- // error that is shown to the user (4 digits) ( -1000 ~ -9999 )
- ERR_OUT_OF_MEMORY(-1001, UserErrorWarningLabels.ERROR_OUT_OF_MEMORY),
- ERR_NO_DEVICE(-1010, UserErrorWarningLabels.ERROR_DEVICE_NOT_FOUND),
- ERR_DISCONNECTED(-1011, UserErrorWarningLabels.ERROR_DEVICE_CONNECTION),
- ERR_NO_APP(-1020, UserErrorWarningLabels.ERROR_NONEXIST_APPLICATION),
- ERR_INVALID_APP(-1021, UserErrorWarningLabels.ERROR_UNSUPPORTED_APPLICATION),
- ERR_BY_SECURITY(-1030, UserErrorWarningLabels.ERROR_BY_SECURITY_REASON),
- ERR_BY_USER_CANCEL(-1031, UserErrorWarningLabels.WARNING_USER_CANCEL),
- ERR_CONFIG_FAILED(-1100, UserErrorWarningLabels.ERROR_CONFIGURATION_FAILED),
- ERR_LIB_NOTFOUND_INRPM(-1101, UserErrorWarningLabels.ERROR_LIB_NOT_FOUND_INRPM),
- ERR_RPM_NOTFOUND(-1102, UserErrorWarningLabels.ERROR_RPM_NOT_FOUND),
- ERR_START_DATA_CHANNEL(-2001, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_START_MESSAGE_PARSER(-2002, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_START_LOG_PARSER(-2003, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_STOP_DATA_CHANNEL(-2004, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_STOP_MESSAGE_PARSER(-2005, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_STOP_LOG_PARSER(-2006, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_CONTINUITY_BROKEN(-2010, UserErrorWarningLabels.WARNING_OVERHEAD_EXPLODE),
- ERR_WRONG_MESSAGE_FORMAT(-2011, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_DATA_SOCKET_CLOSED(-2012, UserErrorWarningLabels.ERROR_CONNECTION_CLOSED),
- ERR_DOWNLOAD_FILE_FAILED(-2013, UserErrorWarningLabels.ERROR_DOWNLOAD_FILE_FAILED),
-
- ERR_MSG_START_FAIL(-2101, UserErrorWarningLabels.ERROR_START_TRACE_FAILED),
- ERR_MSG_SEND_FAIL(-2102, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
- ERR_BIN_INFO_GET_FAIL(-2103, UserErrorWarningLabels.ERROR_FAILED_OPERATION),
- ERR_SCREENSHOT_GET_FAIL(-2104, UserErrorWarningLabels.ERROR_SCREENSHOT_FAILED),
-
- ERR_UNKNOWN(-9999, UserErrorWarningLabels.ERROR_BY_UNKNOWN_REASON);
-
- private final int errNo;
- private final String errMsg;
+public class DAResult {
+ public enum ErrorCode {
+ SUCCESS(0, "Success!"),
+ ERR_EXCEPTION_OCCURRED(-1, "Excpetion is occurred "),
+
+ // error that is not shown to the user (3 digits) ( -100 ~ -999 )
+ ERR_INVALID_VERSION(-100, "not supported version"),
+ ERR_REMOTE_PORT_GET_FAILED(-101, "remote port get failed!!"),
+ ERR_CONTROL_SOCKET_CREATION_FAIL(-102, "control socket creation is failed"),
+ ERR_DATA_SOCKET_CREATION_FAIL(-103, "data socket creation is failed"),
+ ERR_CONTROL_SOCKET_CONNECTION_CLOSED(-104, "connection closed"),
+ ERR_PROTOCOL_NOT_SUPPORTED(-105, "procotol is not supported"),
+ ERR_FILE_IS_NOT_EXISTS(-201, "File is not exist!"),
+ ERR_UPLOAD_FILE_FAILED(-202, "file upload is failed!"),
+ ERR_SDB_PUSH_FAILED(-203, "sdb push returns null"),
+ ERR_READELF_SIZE_GET_FAILED(-204, "readelf size get failed"),
+ ERR_READELF_UPLOAD_FAILED(-205, "readelf file size is different!!"),
+ ERR_MSG_STOP_FAIL(-502, "stop message is not ok"),
+ ERR_MSG_RUNTIME_FAIL(-503, "runtime message is not ok"),
+ ERR_TARGET_INFO_GET_FAIL(-505, "target info get fail..."),
+ ERR_KEEP_ALIVE(-506, "keep alive message ack fail..."),
+ ERR_RECEIVE_ACK_FAIL(-508, "receiving ack message fail..."),
+ ERR_PROCESS_ADD_INFO_GET_FAIL(-509, "failed to get process add info..."),
+ ERR_SWAP_INSTRUMENTATION_FAIL(-510, "failed to instrument..."),
+ ERR_DA_IS_EXIT(-901, "Dynamic Analyzer is closing"),
+
+ // error that is shown to the user (4 digits) ( -1000 ~ -9999 )
+ ERR_OUT_OF_MEMORY(-1001, UserErrorWarningLabels.ERROR_OUT_OF_MEMORY),
+ ERR_NO_DEVICE(-1010, UserErrorWarningLabels.ERROR_DEVICE_NOT_FOUND),
+ ERR_DISCONNECTED(-1011, UserErrorWarningLabels.ERROR_DEVICE_CONNECTION),
+ ERR_NO_APP(-1020, UserErrorWarningLabels.ERROR_NONEXIST_APPLICATION),
+ ERR_INVALID_APP(-1021, UserErrorWarningLabels.ERROR_UNSUPPORTED_APPLICATION),
+ ERR_BY_SECURITY(-1030, UserErrorWarningLabels.ERROR_BY_SECURITY_REASON),
+ ERR_BY_USER_CANCEL(-1031, UserErrorWarningLabels.WARNING_USER_CANCEL),
+ ERR_CONFIG_FAILED(-1100, UserErrorWarningLabels.ERROR_CONFIGURATION_FAILED),
+ ERR_LIB_NOTFOUND_INRPM(-1101, UserErrorWarningLabels.ERROR_LIB_NOT_FOUND_INRPM),
+ ERR_RPM_NOTFOUND(-1102, UserErrorWarningLabels.ERROR_RPM_NOT_FOUND),
+ ERR_START_DATA_CHANNEL(-2001, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_START_MESSAGE_PARSER(-2002, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_START_LOG_PARSER(-2003, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_STOP_DATA_CHANNEL(-2004, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_STOP_MESSAGE_PARSER(-2005, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_STOP_LOG_PARSER(-2006, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_CONTINUITY_BROKEN(-2010, UserErrorWarningLabels.WARNING_OVERHEAD_EXPLODE),
+ ERR_WRONG_MESSAGE_FORMAT(-2011, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_DATA_SOCKET_CLOSED(-2012, UserErrorWarningLabels.ERROR_CONNECTION_CLOSED),
+ ERR_DOWNLOAD_FILE_FAILED(-2013, UserErrorWarningLabels.ERROR_DOWNLOAD_FILE_FAILED),
+
+ ERR_MSG_START_FAIL(-2101, UserErrorWarningLabels.ERROR_START_TRACE_FAILED),
+ ERR_MSG_SEND_FAIL(-2102, UserErrorWarningLabels.ERROR_INTERNAL_REASON),
+ ERR_BIN_INFO_GET_FAIL(-2103, UserErrorWarningLabels.ERROR_FAILED_OPERATION),
+ ERR_SCREENSHOT_GET_FAIL(-2104, UserErrorWarningLabels.ERROR_SCREENSHOT_FAILED),
+
+ ERR_UNKNOWN(-9999, UserErrorWarningLabels.ERROR_BY_UNKNOWN_REASON);
+
+ private final int errNumber;
+ private final String errMessage;
+
+ private ErrorCode(int num, String msg) {
+ this.errNumber = num;
+ this.errMessage = msg;
+ }
+
+ public int getErrorNumber() {
+ return this.errNumber;
+ }
+
+ public String getErrorMessage() {
+ return this.errMessage;
+ }
+ }
+
+ private ErrorCode errCode;
private String detailMsg;
- private DAResult(int num, String msg) {
- errNo = num;
- errMsg = msg;
- detailMsg = null;
+ public DAResult(ErrorCode code) {
+ this.errCode = code;
+ this.detailMsg = null;
}
- public DAResult reset() {
- detailMsg = null;
- return this;
+ public DAResult(ErrorCode code, String msg) {
+ this.errCode = code;
+ this.detailMsg = msg;
}
public int getErrorNumber() {
- return errNo;
+ return errCode.getErrorNumber();
+ }
+
+ public void setDetailMessage(String message) {
+ this.detailMsg = message;
}
public String getMessage() {
- StringBuffer message = new StringBuffer(errMsg);
+ StringBuffer message = new StringBuffer(errCode.getErrorMessage());
if (null != detailMsg) {
message.append("\n");
message.append(detailMsg);
return message.toString();
}
- public static DAResult getDAResult(int num) {
- DAResult[] errors = values();
- for (int i = 0; i < errors.length; i++) {
- if (errors[i].getErrorNumber() == num) {
- return errors[i];
- }
- }
- return DAResult.ERR_UNKNOWN;
- }
-
@Override
public String toString() {
StringBuffer str = new StringBuffer();
- if (0 != errNo) {
+ if (errCode != ErrorCode.SUCCESS) {
str.append("[ERROR : ");
} else {
str.append("[SUCCESS : ");
}
- str.append(errMsg + "]");
+ str.append(errCode.errMessage + "]");
if (null != detailMsg) {
str.append("\n[DETAIL : ");
str.append(detailMsg + "]");
return str.toString();
}
- /**
- * Set detail error message for give error code.<br/>
- * Do not set detail message for DAResult.SUCCESS
- *
- * @param message
- * detail message for error code
- */
- public void setDetailMessage(String message) {
- this.detailMsg = message;
- }
-
- public boolean equals(DAResult target) {
- if (target.getErrorNumber() != errNo) {
- return false;
+ @Override
+ public boolean equals(Object target) {
+ if (target instanceof DAResult) {
+ DAResult res = (DAResult) target;
+ if (res.errCode == this.errCode) {
+ return true;
+ } else {
+ return false;
+ }
+ } else if (target instanceof ErrorCode) {
+ ErrorCode code = (ErrorCode) target;
+ if (code == this.errCode) {
+ return true;
+ } else {
+ return false;
+ }
} else {
- return true;
+ return false;
}
}
public boolean isSuccess() {
- if (this.errNo == SUCCESS.errNo) {
+ if (this.errCode == ErrorCode.SUCCESS) {
return true;
} else {
return false;
public void printDebug() {
String method = getMethodName(2) + "()";
StringBuffer str = new StringBuffer();
- if (0 != errNo) {
+ if (errCode != ErrorCode.SUCCESS) {
str.append("[ERROR : ");
} else {
str.append("[SUCCESS : ");
}
- str.append(errMsg + " ");
+ str.append(errCode.errMessage + " ");
if (null != method) {
str.append("METHOD : " + method + " ]");
}
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.protocol.DebugLog;
import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
}
public DAResult connect() {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
try {
// open debug writer
result = createControlSocket();
if (!result.isSuccess()) {
Logger.warning(result.toString());
- result = DAResult.ERR_CONTROL_SOCKET_CREATION_FAIL;
+ result = new DAResult(ErrorCode.ERR_CONTROL_SOCKET_CREATION_FAIL);
return result;
}
protocolVersion = checkVersion();
if (protocolVersion == null || protocolVersion.isEmpty()) {
Logger.error("Failed to get version of protocol");
- result = DAResult.ERR_INVALID_VERSION;
+ result = new DAResult(ErrorCode.ERR_INVALID_VERSION);
return result;
}
// close debug writer
DebugLog.closeControlChannelWriter();
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
}
private DAResult getRemotePort() {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
final List<String> portLines = new ArrayList<String>();
long start = System.currentTimeMillis();
if (remotePort < 0) {
Logger.error("!!failed to get port number of da manager!!");
- result = DAResult.ERR_REMOTE_PORT_GET_FAILED;
+ result = new DAResult(ErrorCode.ERR_REMOTE_PORT_GET_FAILED);
} else {
Logger.debug("!!port number is obtained successfully!! : " + remotePort);
}
}
private DAResult createControlSocket() {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
Socket sock = null;
try {
sock = new Socket(CommonConstants.LOCAL_HOST, localPort);
sock.setReuseAddress(true);
sock.setTcpNoDelay(true);
} catch (UnknownHostException e) {
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
Logger.exception(e);
} catch (SocketException e) {
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
Logger.exception(e);
} catch (IOException e) {
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
Logger.exception(e);
}
}
private DAResult makeSubCommunicator() {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
if (VERSION40.equals(protocolVersion)) {
subCommunicator = new Communicator40(this);
subCommunicator = new Communicator30(this);
} else {
// unknown version
- result = DAResult.ERR_INVALID_VERSION;
+ result = new DAResult(ErrorCode.ERR_INVALID_VERSION);
}
return result;
import org.tizen.common.sdb.command.SdbCommand;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.IShellOutputReceiver;
}
public static DAResult forward(IDevice device, int local, int remote) {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
if (null != device && isOnline(device)) {
try {
device.createForward(local, remote);
Thread.sleep(AnalyzerConstants.SOCKET_FORWARD_INTERVAL);
} catch (TimeoutException e) {
Logger.exception(e);
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
} catch (SdbCommandRejectedException e) {
Logger.exception(e);
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
} catch (IOException e) {
Logger.exception(e);
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
} catch (InterruptedException e) {
Logger.exception(e);
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
} catch (NullPointerException e) {
Logger.exception(e);
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
}
} else if (null == device) {
- result = DAResult.ERR_NO_DEVICE;
+ result = new DAResult(ErrorCode.ERR_NO_DEVICE);
} else if (!isOnline(device)) {
- result = DAResult.ERR_DISCONNECTED;
+ result = new DAResult(ErrorCode.ERR_DISCONNECTED);
} else {
- result = DAResult.ERR_UNKNOWN;
+ result = new DAResult(ErrorCode.ERR_UNKNOWN);
}
return result;
}
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
import org.tizen.dynamicanalyzer.common.DALimit;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.path.PathConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
if (device != null) {
CommunicatorUtils.execShellCommand(device.getIDevice(),
AnalyzerShellCommands.CMD_REMOVE + CommonConstants.SPACE + path);
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
if (device != null) {
SyncResult res = CommunicatorUtils.pull(device.getIDevice(), from, to);
if (null != res && res.isOk()) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_DOWNLOAD_FILE_FAILED;
+ return new DAResult(ErrorCode.ERR_DOWNLOAD_FILE_FAILED);
}
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
} catch (UnsupportedProtocolException e) {
// never happened currently
Logger.error("It is not supported to send start trace message by communicator");
- return DAResult.ERR_PROTOCOL_NOT_SUPPORTED;
+ return new DAResult(ErrorCode.ERR_PROTOCOL_NOT_SUPPORTED);
}
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
} catch (UnsupportedProtocolException e) {
// never happened currently
Logger.error("It is not supported to send stop trace message by communicator");
- return DAResult.ERR_PROTOCOL_NOT_SUPPORTED;
+ return new DAResult(ErrorCode.ERR_PROTOCOL_NOT_SUPPORTED);
}
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
} catch (UnsupportedProtocolException e) {
// never happened currently
Logger.error("It is not supported to send configuration message by communicator");
- return DAResult.ERR_PROTOCOL_NOT_SUPPORTED;
+ return new DAResult(ErrorCode.ERR_PROTOCOL_NOT_SUPPORTED);
}
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
if (curDev != null) {
return curDev.getCommunicator().getSubCommunicator().sendBinaryInfoMessage(null, paths);
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
return curDev.getCommunicator().getSubCommunicator()
.sendInstrumentAddMessage(null, paths);
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
return curDev.getCommunicator().getSubCommunicator()
.sendInstrumentRemoveMessage(null, paths);
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
return curDev.getCommunicator().getSubCommunicator()
.sendProcessAddInfoMessage(null, pids, infoMap);
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
if (curDev != null) {
return curDev.getCommunicator().getSubCommunicator().sendScreenshotMessage(null);
} else {
- return DAResult.ERR_NO_DEVICE;
+ return new DAResult(ErrorCode.ERR_NO_DEVICE);
}
}
}
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.DAState;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
BinarySettingManager.getInstance().addBinarySettingData(addBinData);
BinarySettingManager.getInstance().checkSourcePath(addBinData);
- DAResult result = DAResult.ERR_BIN_INFO_GET_FAIL;
+ DAResult result = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
try {
result = DACommunicator.getBinaryInformation(addBinPath);
DACommunicator.addInstrumentation(addBinPath);
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
@Override
public void run() {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
try {
startThread = Thread.currentThread();
if (!CommonAction.checkDeviceValidness()) {
- result = DAResult.ERR_DISCONNECTED;
+ result = new DAResult(ErrorCode.ERR_DISCONNECTED);
return;
}
setStageComplete(STAGE.CHECK_DEV);
if (!CommonAction.checkApplicationValidness()) {
- result = DAResult.ERR_INVALID_APP;
+ result = new DAResult(ErrorCode.ERR_INVALID_APP);
return;
}
setStageComplete(STAGE.CHECK_APP);
if (!CommonAction.checkConfiguration()) {
- result = DAResult.ERR_CONFIG_FAILED;
+ result = new DAResult(ErrorCode.ERR_CONFIG_FAILED);
return;
}
setStageComplete(STAGE.CHECK_CONFIG);
// start data receive thread
if (!DataChannelThread.getInstance().start()) {
// failed to start data channel thread
- result = DAResult.ERR_START_DATA_CHANNEL;
+ result = new DAResult(ErrorCode.ERR_START_DATA_CHANNEL);
return;
}
setStageComplete(STAGE.CREATE_DATATHREAD);
// start message parser thread
if (!MessageParser.getInstance().start()) {
// failed to start message parser
- result = DAResult.ERR_START_MESSAGE_PARSER;
+ result = new DAResult(ErrorCode.ERR_START_MESSAGE_PARSER);
return;
}
setStageComplete(STAGE.CREATE_MESSAGEPARSER);
// start log parser thread
if (!LogParser.getInstance().start()) {
// failed to start log parser
- result = DAResult.ERR_START_LOG_PARSER;
+ result = new DAResult(ErrorCode.ERR_START_LOG_PARSER);
return;
}
setStageComplete(STAGE.CREATE_LOGPARSER);
// Thread.currentThread().interrupt();
// set DA state to canceling
- result = DAResult.ERR_BY_USER_CANCEL;
+ result = new DAResult(ErrorCode.ERR_BY_USER_CANCEL);
} finally {
// set DA state as result of start progress
if (lastStage != STAGE.FINAL) {
setStageComplete(STAGE.STOP_UPDATE_TIMER);
// if error code equals with canceling then stop threads by force
- if (error.equals(DAResult.ERR_BY_USER_CANCEL)) {
+ if (error.equals(DAResult.ErrorCode.ERR_BY_USER_CANCEL)) {
// stop data channel
DataChannelThread.getInstance().stopForced();
setStageComplete(STAGE.STOP_DATATHREAD);
// close progress dialog if not error case
if (progressDlg != null) {
- if (error.isSuccess() || error.equals(DAResult.ERR_BY_USER_CANCEL)) {
+ if (error.isSuccess() || error.equals(DAResult.ErrorCode.ERR_BY_USER_CANCEL)) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
import org.tizen.dynamicanalyzer.communicator.DeviceManager;
result = DACommunicator.configure();
} catch (InterruptedException e) {
Logger.error("Interrupted during send configuration message");
- result = DAResult.ERR_CONFIG_FAILED;
+ result = new DAResult(ErrorCode.ERR_CONFIG_FAILED);
}
// check result
import org.eclipse.core.commands.ExecutionException;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.DeviceManager;
import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
public Object execute(ExecutionEvent event) throws ExecutionException {
AnalyzerManager.setExit(true);
- CommandAction.stopTrace(DAResult.ERR_BY_USER_CANCEL, false);
+ CommandAction.stopTrace(new DAResult(ErrorCode.ERR_BY_USER_CANCEL), false);
SideWorker.stop();
IDECommunicator.stopIDEcommunicatorThread();
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.model.DATime;
import org.tizen.dynamicanalyzer.setting.Feature;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
}
public static void setStopAlarm() {
- if (isReplay
- && SettingDataManager.INSTANCE.isOptionsSelectedFeature(Feature.AUTO_STOP)) {
+ if (isReplay && SettingDataManager.INSTANCE.isOptionsSelectedFeature(Feature.AUTO_STOP)) {
Toolbar.INSTANCE.setTimerAlarm(stopTime, new IAlarm() {
@Override
public void action() {
- CommandAction.stopTrace(DAResult.SUCCESS, false);
+ CommandAction.stopTrace(new DAResult(ErrorCode.SUCCESS), false);
reset();
}
});
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.ProcessAdditionalInfo;
import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
pids.add(Integer.valueOf(pid));
Map<Integer, ProcessAdditionalInfo> infoMap = new HashMap<Integer, ProcessAdditionalInfo>();
- DAResult result = DAResult.ERR_PROCESS_ADD_INFO_GET_FAIL;
+ DAResult result = new DAResult(ErrorCode.ERR_PROCESS_ADD_INFO_GET_FAIL);
try {
result = DACommunicator.getProcessAdditionalInfo(pids, infoMap);
} catch (InterruptedException e) {
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.ElfSymbolExtractor;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.path.PathManager;
result = createDataSocket(localPort);
if (!result.isSuccess()) {
Logger.warning(result.toString());
- return DAResult.ERR_DATA_SOCKET_CREATION_FAIL;
+ return new DAResult(ErrorCode.ERR_DATA_SOCKET_CREATION_FAIL);
}
// get target information
}
}
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
}
protected DAResult createDataSocket(int localPort) {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
Socket dataSock = null;
try {
dataSock = new Socket(CommonConstants.LOCAL_HOST, localPort);
dataSock.setReuseAddress(true);
dataSock.setTcpNoDelay(true);
} catch (UnknownHostException e) {
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
Logger.exception(e);
} catch (SocketException e) {
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
Logger.exception(e);
} catch (IOException e) {
- result = DAResult.ERR_EXCEPTION_OCCURRED;
+ result = new DAResult(ErrorCode.ERR_EXCEPTION_OCCURRED);
result.setDetailMessage(e.getMessage());
Logger.exception(e);
}
}
tInfo.setDevices(deviceList);
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
}
}
- return DAResult.ERR_TARGET_INFO_GET_FAIL;
+ return new DAResult(ErrorCode.ERR_TARGET_INFO_GET_FAIL);
}
protected Map<Integer, String> getApiMap() {
if (result != null && result.isSuccess()
&& result.isCorrectID(ProtocolConstant30.MSG_CONFIG_ACK)) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_CONFIG_FAILED;
+ return new DAResult(ErrorCode.ERR_CONFIG_FAILED);
}
}
// serialize application inst.
if (!serializeApplicationInst(ps)) {
Logger.error("cannot get application inst");
- return DAResult.ERR_MSG_START_FAIL;
+ return new DAResult(ErrorCode.ERR_MSG_START_FAIL);
}
// serialize the replay data
AnalyzerManager.waitStartAck.notifyAll();
}
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_MSG_START_FAIL;
+ return new DAResult(ErrorCode.ERR_MSG_START_FAIL);
}
}
AckMessage result = parent.handleControlMessage(msg);
if (result != null && result.isSuccess()
&& result.isCorrectID(ProtocolConstant30.MSG_STOP_ACK)) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_MSG_STOP_FAIL;
+ return new DAResult(ErrorCode.ERR_MSG_STOP_FAIL);
}
}
if (libInstList.isEmpty()) {
Logger.warning("Failed to send instrumentation : there is no available binary");
- return DAResult.ERR_SWAP_INSTRUMENTATION_FAIL;
+ return new DAResult(ErrorCode.ERR_SWAP_INSTRUMENTATION_FAIL);
}
// serialize library inst. count
}
if (result != null && result.isCorrectID(ackMsg) && result.isSuccess()) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_SWAP_INSTRUMENTATION_FAIL;
+ return new DAResult(ErrorCode.ERR_SWAP_INSTRUMENTATION_FAIL);
}
}
}
}
- return DAResult.ERR_BIN_INFO_GET_FAIL.reset();
+ return new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
}
protected DAResult parseBinaryInfo(byte[] payload, List<String> targetPaths) {
- DAResult ret = DAResult.SUCCESS;
+ DAResult ret = new DAResult(ErrorCode.SUCCESS);
StringBuffer detailErrorMsg = new StringBuffer();
ProtocolParser parser = new ProtocolParser(payload);
+ targetPath + ")");
}
- ret = DAResult.ERR_BIN_INFO_GET_FAIL;
+ ret = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
continue;
}
}
detailErrorMsg.append(result.getMessage());
- ret = DAResult.ERR_BIN_INFO_GET_FAIL;
+ ret = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
}
}
}
protected DAResult checkDirtyOfBinary(BinaryInfo binInfo, String localBinaryPath) {
- DAResult result = DAResult.SUCCESS;
+ DAResult result = new DAResult(ErrorCode.SUCCESS);
String targetPath = binInfo.getTargetBinaryPath();
String[] splitLocalBinaryPath = localBinaryPath.split(Pattern.quote(File.separator));
DeviceInfo curDev = parent.getDevice();
if (!CommunicatorUtils.becomeSuperUser(curDev.getIDevice())) {
- return DAResult.ERR_BY_SECURITY;
+ return new DAResult(ErrorCode.ERR_BY_SECURITY);
}
SyncResult res = CommunicatorUtils.pull(curDev.getIDevice(), from, to);
if (null != res && res.isOk()) {
Logger.debug("binary copy success : " + from);//$NON-NLS-1$
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
Logger.debug("Failed to get " + from); //$NON-NLS-1$
- return DAResult.ERR_DOWNLOAD_FILE_FAILED;
+ return new DAResult(ErrorCode.ERR_DOWNLOAD_FILE_FAILED);
}
}
AckMessage result = parent.handleControlMessage(msg);
if (result != null && result.isCorrectID(ProtocolConstant30.MSG_KEEP_ALIVE_ACK)
&& result.isSuccess()) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_KEEP_ALIVE;
+ return new DAResult(ErrorCode.ERR_KEEP_ALIVE);
}
}
AckMessage result = parent.handleControlMessage(msg, 0, false);
if (result != null && result.isSuccess()) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_SCREENSHOT_GET_FAIL;
+ return new DAResult(ErrorCode.ERR_SCREENSHOT_GET_FAIL);
}
}
}
if (infoMap.isEmpty()) {
- return DAResult.ERR_PROCESS_ADD_INFO_GET_FAIL;
+ return new DAResult(ErrorCode.ERR_PROCESS_ADD_INFO_GET_FAIL);
} else {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
}
}
import java.util.TreeMap;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.communicator.AckMessage;
import org.tizen.dynamicanalyzer.communicator.BaseCommunicator;
result = createDataSocket(localPort);
if (!result.isSuccess()) {
Logger.warning(result.toString());
- return DAResult.ERR_DATA_SOCKET_CREATION_FAIL;
+ return new DAResult(ErrorCode.ERR_DATA_SOCKET_CREATION_FAIL);
}
// get target information
if (result != null && result.isSuccess()
&& result.isCorrectID(ProtocolConstant40.MSG_CONFIG_ACK)) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_CONFIG_FAILED;
+ return new DAResult(ErrorCode.ERR_CONFIG_FAILED);
}
}
AckMessage result = parent.handleControlMessage(msg);
if (result != null && result.isCorrectID(ProtocolConstant40.MSG_KEEP_ALIVE_ACK)
&& result.isSuccess()) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_KEEP_ALIVE;
+ return new DAResult(ErrorCode.ERR_KEEP_ALIVE);
}
}
AckMessage result = parent.handleControlMessage(msg, 0);
if (result != null && result.isSuccess()
&& result.isCorrectID(ProtocolConstant40.MSG_GET_SCREENSHOT_ACK)) {
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_SCREENSHOT_GET_FAIL;
+ return new DAResult(ErrorCode.ERR_SCREENSHOT_GET_FAIL);
}
}
}
}
- return DAResult.SUCCESS;
+ return new DAResult(ErrorCode.SUCCESS);
} else {
- return DAResult.ERR_MSG_SEND_FAIL;
+ return new DAResult(ErrorCode.ERR_MSG_SEND_FAIL);
}
}
}
}
- return DAResult.ERR_BIN_INFO_GET_FAIL.reset();
+ return new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
}
protected DAResult parseBinaryInfo(byte[] payload) {
- DAResult ret = DAResult.SUCCESS;
+ DAResult ret = new DAResult(ErrorCode.SUCCESS);
StringBuffer detailErrorMsg = new StringBuffer();
ProtocolParser parser = new ProtocolParser(payload);
+ targetPath + ")");
}
- ret = DAResult.ERR_BIN_INFO_GET_FAIL;
+ ret = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
continue;
}
}
detailErrorMsg.append(result.getMessage());
- ret = DAResult.ERR_BIN_INFO_GET_FAIL;
+ ret = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
}
}
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.DAState;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.ui.file.FilePage;
if (DAState.isStartable()) {
CommandAction.startTrace();
} else if (DAState.isRunning()) {
- CommandAction.stopTrace(DAResult.SUCCESS, false);
+ CommandAction.stopTrace(new DAResult(ErrorCode.SUCCESS), false);
} else {
Logger.error("Wrong shortcut action for starting trace");
}
import org.tizen.dynamicanalyzer.common.DALimit;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.control.DataThread;
import org.tizen.dynamicanalyzer.control.SideWorker;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
private int protocolVersion = -1;
private enum STATE {
- INITIALIZED, ACTIVATED, TERMINATED;
+ INITIALIZED,
+ ACTIVATED,
+ TERMINATED;
}
private STATE state = STATE.INITIALIZED;
// set data socket variable
dataSocket = Global.getCurrentDeviceInfo().getCommunicator().getSubCommunicator()
.getDataSocket(0);
- protocolVersion = Protocol.getVersionValue(Global.getCurrentDeviceInfo()
- .getCommunicator().getProtocolVersion());
+ protocolVersion = Protocol.getVersionValue(Global.getCurrentDeviceInfo().getCommunicator()
+ .getProtocolVersion());
clearSocketReceiveBuffer();
}
if (!continuity) {
// if sequence continuity is broken, then send stop work to side worker
- notifyStopWork(DAResult.ERR_CONTINUITY_BROKEN);
+ notifyStopWork(new DAResult(ErrorCode.ERR_CONTINUITY_BROKEN));
}
// check for payload size
int payloadsize = log.getPayloadSize();
if (payloadsize < 0 || payloadsize > DALimit.MAX_PAYLOAD_SIZE) {
// wrong message format, stop profiling
- notifyStopWork(DAResult.ERR_WRONG_MESSAGE_FORMAT);
+ notifyStopWork(new DAResult(ErrorCode.ERR_WRONG_MESSAGE_FORMAT));
changeToDropMode();
// this means there is no more data to parse, so push EOQ
pushEOQ();
if (AnalyzerManager.isDataSocketClosed()) {
- notifyStopWork(DAResult.ERR_DATA_SOCKET_CLOSED);
+ notifyStopWork(new DAResult(ErrorCode.ERR_DATA_SOCKET_CLOSED));
}
synchronized (waitObject) {
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
import org.tizen.dynamicanalyzer.communicator.DeviceManager;
import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
result = device.getCommunicator().getSubCommunicator()
.sendKeepAliveMessage(null);
} catch (UnsupportedProtocolException e) {
- result = DAResult.ERR_PROTOCOL_NOT_SUPPORTED;
+ result = new DAResult(ErrorCode.ERR_PROTOCOL_NOT_SUPPORTED);
}
if (!result.isSuccess()) {
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.DAResult;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
BinarySettingProgressManager.getInstance().setValue(5);
// get binary info
- DAResult result = DAResult.ERR_BIN_INFO_GET_FAIL;
+ DAResult result = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
if (binPaths.size() > 0) {
try {
result = DACommunicator.getBinaryInformation(binPaths);
}
if (paths.size() > 0) {
- DAResult result = DAResult.ERR_BIN_INFO_GET_FAIL;
+ DAResult result = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
try {
result = DACommunicator.getBinaryInformation(paths);
} catch (InterruptedException e) {
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.DAState;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
import org.tizen.dynamicanalyzer.communicator.DeviceManager;
if (DAState.isStartable()) {
CommandAction.startTrace();
} else if (DAState.isRunning()) {
- CommandAction.stopTrace(DAResult.SUCCESS, false);
+ CommandAction.stopTrace(new DAResult(ErrorCode.SUCCESS), false);
} else {
Logger.error("Wrong action for start button");
}
}
if (!binPaths.isEmpty()) {
- DAResult hr = DAResult.ERR_BIN_INFO_GET_FAIL;
+ DAResult hr = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
try {
hr = DACommunicator.getBinaryInformation(binPaths);
} catch (InterruptedException e) {
import org.eclipse.swt.widgets.Listener;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
public void handleClickEvent(DACustomButton button) {
DeviceInfo curDev = Global.getCurrentDeviceInfo();
if (curDev == null) {
- UIAction.showWarning(DAResult.ERR_NO_DEVICE, 400, 150);
+ UIAction.showWarning(new DAResult(ErrorCode.ERR_NO_DEVICE), 400, 150);
} else {
DeviceExplorerDialog dialog = new DeviceExplorerDialog(getShell(), true);
// dialog.setFilter(".so");
public void handleClickEvent(DACustomButton button) {
DeviceInfo curDev = Global.getCurrentDeviceInfo();
if (curDev == null) {
- UIAction.showWarning(DAResult.ERR_NO_DEVICE, 400, 150);
+ UIAction.showWarning(new DAResult(ErrorCode.ERR_NO_DEVICE), 400, 150);
return;
}