[openrtm-commit:02715] r984 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . port util
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 7月 27日 (木) 14:40:30 JST
Author: t-katami
Date: 2017-07-27 14:40:30 +0900 (Thu, 27 Jul 2017)
New Revision: 984
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/CORBA_SeqUtil.java
Log:
[compat,bugfix,->RELENG_1_2] Fixed the item pointed out by the static code analysis tool.
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-07-27 02:50:45 UTC (rev 983)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-07-27 05:40:30 UTC (rev 984)
@@ -1155,15 +1155,16 @@
private void initPreActivation() {
String preactivation
= m_config.getProperty("manager.components.preactivation");
- rtcout.println(Logbuf.TRACE,
- "Components pre-activation: "
- + Arrays.toString(preactivation.split(",")));
String[] comps = new String[0];
if ( preactivation == null || preactivation.length() == 0 ) {
+ rtcout.println(Logbuf.TRACE,
+ "There are no pre-activation components." );
+ return;
}
- else {
- comps = preactivation.split(",");
- }
+ rtcout.println(Logbuf.TRACE,
+ "Components pre-activation: "
+ + Arrays.toString(preactivation.split(",")));
+ comps = preactivation.split(",");
for (int ic=0; ic < comps.length; ++ic) {
comps[ic] = comps[ic].trim();
@@ -1188,17 +1189,11 @@
ReturnCode_t ret = CORBA_RTCUtil.activate(comp_ref);
if (ret != ReturnCode_t.RTC_OK) {
rtcout.println(Logbuf.ERROR, comps[ic] + " activation filed.");
+ continue;
}
else {
rtcout.println(Logbuf.INFO, comps[ic] + " activated.");
}
-/*
- ExecutionContextListHolder eclistholder
- = new ExecutionContextListHolder();
- eclistholder.value = new ExecutionContext[0];
- eclistholder.value = comp.get_owned_contexts();
- eclistholder.value[0].activate_component(comp_ref);
-*/
}
}
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2017-07-27 02:50:45 UTC (rev 983)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2017-07-27 05:40:30 UTC (rev 984)
@@ -1017,6 +1017,7 @@
*/
public ReturnCode_t remove_slave_manager(RTM.Manager mgr) {
if(mgr == null){
+ return ReturnCode_t.BAD_PARAMETER;
}
synchronized(m_masterMutex) {
rtcout.println(Logbuf.TRACE,
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java 2017-07-27 02:50:45 UTC (rev 983)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingOnCorba.java 2017-07-27 05:40:30 UTC (rev 984)
@@ -295,9 +295,11 @@
else{
Manager mgr = Manager.instance();
if(mgr==null){
+ return null;
}
ORB orb = mgr.getORB();
if(orb==null){
+ return null;
}
cns = new CorbaNaming(orb,host);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java 2017-07-27 02:50:45 UTC (rev 983)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java 2017-07-27 05:40:30 UTC (rev 984)
@@ -681,12 +681,16 @@
CdrDataHolder cdr_data = new CdrDataHolder();
cdr_data.value = new byte[0];
read(cdr_data);
+ if(m_connector==null){
+ return OpenRTM.PortStatus.PORT_ERROR;
+ }
+
+ EncapsOutputStreamExt cdr
+ = new EncapsOutputStreamExt(m_orb,m_connector.isLittleEndian());
+ cdr.write_octet_array(cdr_data.value, 0, cdr_data.value.length);
+
if (m_buffer == null) {
- EncapsOutputStreamExt cdr
- = new EncapsOutputStreamExt(m_orb,m_connector.isLittleEndian());
- cdr.write_octet_array(cdr_data.value, 0, cdr_data.value.length);
DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
- //onReceiverError(cdr);
onReceiverError(dataref);
cdr = (EncapsOutputStreamExt)dataref.v;
return OpenRTM.PortStatus.PORT_ERROR;
@@ -693,27 +697,18 @@
}
- rtcout.println(Logbuf.PARANOID, "received data size: "+cdr_data.value.length);
+ rtcout.println(Logbuf.PARANOID,
+ "received data size: "+cdr_data.value.length);
- EncapsOutputStreamExt cdr
- = new EncapsOutputStreamExt(m_orb,m_connector.isLittleEndian());
- cdr.write_octet_array(cdr_data.value, 0, cdr_data.value.length);
-
int len = cdr.getByteArray().length;
rtcout.println(Logbuf.PARANOID, "converted CDR data size: "+len);
DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
- //onReceived(cdr);
onReceived(dataref);
cdr = (EncapsOutputStreamExt)dataref.v;
- if(m_connector==null){
- return OpenRTM.PortStatus.PORT_ERROR;
- }
jp.go.aist.rtm.RTC.buffer.ReturnCode ret = m_buffer.write(cdr);
- //jp.go.aist.rtm.RTC.buffer.ReturnCode ret = m_connector.write(cdr);
- //return convertReturn(ret,cdr);
dataref.v = cdr;
OpenRTM.PortStatus stat = convertReturn(ret,dataref);
cdr = (EncapsOutputStreamExt)dataref.v;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/CORBA_SeqUtil.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/CORBA_SeqUtil.java 2017-07-27 02:50:45 UTC (rev 983)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/CORBA_SeqUtil.java 2017-07-27 05:40:30 UTC (rev 984)
@@ -997,7 +997,7 @@
} else {
len = seq.value.length;
}
- if (index > len) {
+ if((index > len)||(len == 0)) {
push_back(seq, elem);
return;
}
More information about the openrtm-commit
mailing list