[openrtm-commit:02733] r998 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src: RTMExamples/SeqIO jp/go/aist/rtm/RTC/executionContext
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 8月 9日 (水) 11:59:20 JST
Author: t-katami
Date: 2017-08-09 11:59:20 +0900 (Wed, 09 Aug 2017)
New Revision: 998
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SeqIO/SeqOutImpl.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java
Log:
[compat,bugfix,->RELENG_1_2] Fixed the items pointed out by the static code analysis tool.
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SeqIO/SeqOutImpl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SeqIO/SeqOutImpl.java 2017-08-09 01:12:49 UTC (rev 997)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/SeqIO/SeqOutImpl.java 2017-08-09 02:59:20 UTC (rev 998)
@@ -204,9 +204,9 @@
// former rtc_active_do()
@Override
protected ReturnCode_t onExecute(int ec_id) {
- m_Octet.v.data = (byte)(Math.random() * Byte.MAX_VALUE - Byte.MAX_VALUE/2);
- m_Short.v.data = (short)(Math.random() * Short.MAX_VALUE - Short.MAX_VALUE/2);
- m_Long.v.data = (int)(Math.random() * Integer.MAX_VALUE - Integer.MAX_VALUE/2);
+ m_Octet.v.data = (byte)(Math.random() * (double)Byte.MAX_VALUE - (double)Byte.MAX_VALUE/2);
+ m_Short.v.data = (short)(Math.random() * (double)Short.MAX_VALUE - (double)Short.MAX_VALUE/2);
+ m_Long.v.data = (int)(Math.random() * (double)Integer.MAX_VALUE - (double)Integer.MAX_VALUE/2);
m_Float.v.data = (float)(Math.random() * Float.MAX_VALUE) - Float.MAX_VALUE/2;
m_Double.v.data = Math.random() * Double.MAX_VALUE - Double.MAX_VALUE/2;
@@ -213,9 +213,9 @@
for( int intIdx=0;intIdx<10;++intIdx ) {
m_DoubleSeq.v.data[intIdx] = Math.random() * Double.MAX_VALUE - Double.MAX_VALUE/2;
m_FloatSeq.v.data[intIdx] = (float)(Math.random() * Float.MAX_VALUE) - Float.MAX_VALUE/2;
- m_LongSeq.v.data[intIdx] = (int)(Math.random() * Integer.MAX_VALUE - Integer.MAX_VALUE/2);
- m_ShortSeq.v.data[intIdx] = (short)(Math.random() * Short.MAX_VALUE - Short.MAX_VALUE/2);
- m_OctetSeq.v.data[intIdx] = (byte)(Math.random() * Byte.MAX_VALUE - Byte.MAX_VALUE/2);
+ m_LongSeq.v.data[intIdx] = (int)(Math.random() * (double)Integer.MAX_VALUE - (double)Integer.MAX_VALUE/2);
+ m_ShortSeq.v.data[intIdx] = (short)(Math.random() * (double)Short.MAX_VALUE - (double)Short.MAX_VALUE/2);
+ m_OctetSeq.v.data[intIdx] = (byte)(Math.random() * (double)Byte.MAX_VALUE - (double)Byte.MAX_VALUE/2);
}
m_DoubleOut.write();
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2017-08-09 01:12:49 UTC (rev 997)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2017-08-09 02:59:20 UTC (rev 998)
@@ -639,7 +639,7 @@
RTObjectStateMachine rtobj = m_removedComps.get(ic);
LightweightRTObject lwrtobj = rtobj.getRTObject();
lwrtobj.detach_context(rtobj.getExecutionContextHandle());
- Iterator it = m_comps.iterator();
+ Iterator<RTObjectStateMachine> it = m_comps.iterator();
while (it.hasNext()) {
if(rtobj == (RTObjectStateMachine)it.next()){
m_comps.remove(it);
More information about the openrtm-commit
mailing list