[openrtm-commit:02761] r1021 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 8月 18日 (金) 16:10:19 JST
Author: t-katami
Date: 2017-08-18 16:10:19 +0900 (Fri, 18 Aug 2017)
New Revision: 1021
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/NamingManager.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/Manager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-08-18 06:19:00 UTC (rev 1020)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-08-18 07:10:19 UTC (rev 1021)
@@ -592,11 +592,14 @@
rtcout.println(Logbuf.PARANOID,
"getPortsOnNameServers("+nsname+","+kind+")");
ArrayList<PortService> ports = new ArrayList<PortService>();
- //PortService[] ports = new ;
+/*
Vector<NamingService> ns = m_namingManager.getNameServices();
Iterator<NamingService> it = ns.iterator();
+*/
+ ArrayList<CorbaNaming> ns = m_namingManager.getCorbaNamings();
+ Iterator<CorbaNaming> it = ns.iterator();
while (it.hasNext()) {
- //NamingOnCorba noc = it.next().ns;
+/*
NamingBase noc = it.next().ns;
if(noc == null){
continue;
@@ -605,6 +608,8 @@
if(cns == null){
continue;
}
+*/
+ CorbaNaming cns = it.next();
BindingListHolder bl = new BindingListHolder();
cns.listByKind(nsname,kind,bl);
for(int ic=0;ic<bl.value.length;++ic){
@@ -642,44 +647,6 @@
}
PortService[] ret = (PortService[])ports.toArray(new PortService[0]);
return ret;
-/*
- for n in ns{
- noc = n.ns;
- if noc is None{
- continue
- }
- cns = noc._cosnaming
- if cns is None{
- continue
- }
- bl = cns.listByKind(nsname,kind,bl);
-
- for b in bl{
- if b.binding_type != CosNaming.nobject{
- continue
- }
- tmp = b.binding_name[0].id + "." + b.binding_name[0].kind
-
- nspath = "/" + nsname + "/" + tmp
- nspath.replace("\\","")
-
- obj = cns.resolveStr(nspath)
- portsvc = obj
-
- if CORBA.is_nil(portsvc){
- continue
- }
- try{
- p = portsvc.get_port_profile()
- }
- except{
- continue
- }
- ports.append(portsvc)
- }
- }
- return ports
-*/
}
/**
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java 2017-08-18 06:19:00 UTC (rev 1020)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/NamingManager.java 2017-08-18 07:10:19 UTC (rev 1021)
@@ -2,6 +2,7 @@
import java.util.Vector;
import java.util.ArrayList;
+import java.util.Iterator;
import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.port.PortBase;
@@ -402,6 +403,33 @@
}
/**
*
+ * {@.ja 登録したネームサービスのCorbaNamingのリストを取得する}
+ * {@.en Get the list of registered CorbaNaming.}
+ *
+ * @return
+ * {@.ja CorbaNamingのリスト}
+ * {@.en List of CorbaNaming}
+ */
+ public ArrayList<CorbaNaming> getCorbaNamings() {
+ ArrayList<CorbaNaming> ret = new ArrayList<CorbaNaming>();
+ synchronized (m_names) {
+ Iterator<NamingService> it = m_names.iterator();
+ while (it.hasNext()) {
+ NamingBase noc = it.next().ns;
+ if(noc == null){
+ continue;
+ }
+ CorbaNaming cns = noc.getCorbaNaming();
+ if(cns == null){
+ continue;
+ }
+ ret.add(cns);
+ }
+ }
+ return ret;
+ }
+ /**
+ *
* {@.ja rtcloc形式でRTCのオブジェクトリファレンスを取得}
* {@.en Gets RTC objects by rtcloc form.}
*
More information about the openrtm-commit
mailing list