[openrtm-commit:02746] r1007 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples: Fsm StaticFsm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 8月 16日 (水) 16:59:15 JST
Author: t-katami
Date: 2017-08-16 16:59:15 +0900 (Wed, 16 Aug 2017)
New Revision: 1007
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java
Log:
[bugfix,->FSM4RTC] Fixed the items pointed out by the static code analysis tool.
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java 2017-08-16 07:27:34 UTC (rev 1006)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java 2017-08-16 07:59:15 UTC (rev 1007)
@@ -66,6 +66,10 @@
} catch (Exception e) {
e.printStackTrace();
}
+ if( rtobj==null ) {
+ System.err.println("Cannot get the component's object reference.");
+ System.exit(0);
+ }
// Get the port list of the component
PortServiceListHolder ports = new PortServiceListHolder();
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java 2017-08-16 07:27:34 UTC (rev 1006)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java 2017-08-16 07:59:15 UTC (rev 1007)
@@ -111,7 +111,13 @@
@Override
public int getOutputData() {
- return m_que.poll();
+ Integer data = m_que.poll();
+ if(data == null) {
+ return 0;
+ }
+ else {
+ return data.intValue();
+ }
}
@Override
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java 2017-08-16 07:27:34 UTC (rev 1006)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java 2017-08-16 07:59:15 UTC (rev 1007)
@@ -177,6 +177,9 @@
BufferedReader buff = new BufferedReader(new InputStreamReader( System.in ));
try {
String cmd = buff.readLine();
+ if(cmd == null) {
+ return super.onExecute(ec_id);
+ }
String[] cmds = cmd.split(" ");
cmds[0] = cmds[0].trim();
More information about the openrtm-commit
mailing list