[openrtm-commit:02905] r1072 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . executionContext
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 11月 7日 (火) 16:57:25 JST
Author: t-katami
Date: 2017-11-07 16:57:25 +0900 (Tue, 07 Nov 2017)
New Revision: 1072
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/ModuleManager.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/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-10-27 05:47:36 UTC (rev 1071)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2017-11-07 07:57:25 UTC (rev 1072)
@@ -1817,29 +1817,31 @@
= (RTM.Manager[])masters.toArray(new RTM.Manager[0]);
}
}
- if (m_masters.length == 0){
- try{
- Properties config = m_mgr.getConfig();
- RTM.Manager owner = findManager(
+ synchronized(m_masterMutex) {
+ if (m_masters.length == 0){
+ try{
+ Properties config = m_mgr.getConfig();
+ RTM.Manager owner = findManager(
config.getProperty("corba.master_manager"));
- if(owner == null){
- rtcout.println(Logbuf.INFO,
+ if(owner == null){
+ rtcout.println(Logbuf.INFO,
"Master manager not found");
+ return;
+ }
+ add_master_manager(owner);
+ owner.add_slave_manager(m_objref);
+
return;
}
- add_master_manager(owner);
- owner.add_slave_manager(m_objref);
-
- return;
- }
- catch(Exception ex){
- String crlf = System.getProperty("line.separator");
- rtcout.println(Logbuf.ERROR,
+ catch(Exception ex){
+ String crlf = System.getProperty("line.separator");
+ rtcout.println(Logbuf.ERROR,
"Unknown exception cought."
+ crlf
+ ex.toString());
- }
- }
+ }
+ }
+ }
}
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ModuleManager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ModuleManager.java 2017-10-27 05:47:36 UTC (rev 1071)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ModuleManager.java 2017-11-07 07:57:25 UTC (rev 1072)
@@ -189,6 +189,8 @@
Class target = null;
File file = new File(moduleName);
+ rtcout.println(Logbuf.PARANOID, "Is moduleName AbsolutePath ? "
+ + file.exists());
if(file.exists()){ // When moduleName is AbsolutePath.
if(!m_absoluteAllowed) {
throw new IllegalArgumentException(
@@ -251,10 +253,14 @@
}
}
}
+ rtcout.println(Logbuf.PARANOID, "target:"+ target);
if( target==null ) {
throw new ClassNotFoundException(
"Not implemented." + moduleName);
}
+ rtcout.println(Logbuf.PARANOID, "module_path:"+ module_path);
+ rtcout.println(Logbuf.PARANOID, "module_path.length():"
+ + module_path.length());
if(module_path==null || module_path.length()==0) {
throw new IllegalArgumentException("Invalid file name.");
}
@@ -720,6 +726,9 @@
glob += suffix.trim();
rtcout.println(Logbuf.PARANOID,"glob: "+glob);
String[] files = dir.list(new FilePathFilter(glob));
+ if(files == null) {
+ continue;
+ }
rtcout.println(Logbuf.PARANOID,"files.length:"+files.length);
ArrayList<String> tmp
= new ArrayList<String>(Arrays.asList(files));
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-10-27 05:47:36 UTC (rev 1071)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2017-11-07 07:57:25 UTC (rev 1072)
@@ -469,8 +469,10 @@
return ReturnCode_t.RTC_ERROR;
}
rtcout.println(Logbuf.DEBUG, "addComponent() succeeded.");
- if (m_running==false) {
- updateComponentList();
+ synchronized (m_mutex){
+ if (m_running==false) {
+ updateComponentList();
+ }
}
return ReturnCode_t.RTC_OK;
}
@@ -560,8 +562,10 @@
//return ReturnCode_t.RTC_OK;
}
}
- if (m_running==false) {
- updateComponentList();
+ synchronized (m_mutex){
+ if (m_running==false) {
+ updateComponentList();
+ }
}
return ReturnCode_t.RTC_OK;
}
More information about the openrtm-commit
mailing list