[openrtm-commit:02695] r971 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 7月 19日 (水) 12:00:03 JST
Author: t-katami
Date: 2017-07-19 12:00:03 +0900 (Wed, 19 Jul 2017)
New Revision: 971
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.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/BufferFactory.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java 2017-07-19 01:21:33 UTC (rev 970)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/BufferFactory.java 2017-07-19 03:00:03 UTC (rev 971)
@@ -20,16 +20,12 @@
* {@.ja BufferFactoryオブジェクト}
* {@.en BufferFactory object}
*/
- public static BufferFactory instance() {
+ synchronized public static BufferFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new BufferFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new BufferFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -36,10 +32,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static BufferFactory factory_global;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java 2017-07-19 01:21:33 UTC (rev 970)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java 2017-07-19 03:00:03 UTC (rev 971)
@@ -69,16 +69,12 @@
* {@.ja FactoryGlobal オブジェクト}
* {@.en FactoryGlobal object}
*/
- public static FactoryGlobal instance() {
+ synchronized public static FactoryGlobal instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new FactoryGlobal();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new FactoryGlobal();
+ } catch (Exception e) {
+ factory_global = null;
}
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java 2017-07-19 01:21:33 UTC (rev 970)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NumberingPolicyFactory.java 2017-07-19 03:00:03 UTC (rev 971)
@@ -27,16 +27,12 @@
* {@.en InPortProviderFactory object}
*
*/
- public static NumberingPolicyFactory instance() {
+ synchronized public static NumberingPolicyFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new NumberingPolicyFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new NumberingPolicyFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java 2017-07-19 01:21:33 UTC (rev 970)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PeriodicTask.java 2017-07-19 03:00:03 UTC (rev 971)
@@ -432,8 +432,8 @@
if (m_execCount > m_execCountMax) {
synchronized (m_execStat.mutex) {
m_execStat.stat = m_execTime.getStatistics();
- m_execCount = 0;
}
+ m_execCount = 0;
}
++m_execCount;
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java 2017-07-19 01:21:33 UTC (rev 970)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/PublisherBaseFactory.java 2017-07-19 03:00:03 UTC (rev 971)
@@ -22,16 +22,12 @@
* {@.en PublisherBaseFactory object}
*
*/
- public static PublisherBaseFactory instance() {
+ synchronized public static PublisherBaseFactory instance() {
if (factory_global == null) {
- synchronized (factory_global_mutex) {
- if (factory_global == null) {
- try {
- factory_global = new PublisherBaseFactory();
- } catch (Exception e) {
- factory_global = null;
- }
- }
+ try {
+ factory_global = new PublisherBaseFactory();
+ } catch (Exception e) {
+ factory_global = null;
}
}
@@ -38,10 +34,6 @@
return factory_global;
}
/**
- * <p> mutex </p>
- */
- private static String factory_global_mutex = new String();
- /**
* <p> object </p>
*/
private static PublisherBaseFactory factory_global;
More information about the openrtm-commit
mailing list