It is:

pid.indexOf returns the index of the '-'.

If it's found (>0), the factoryPid is the string after the -.
The Pid is the string before the -.

So it looks good to me.

Regards
JB

On 07/02/2014 05:27 PM, Gareth wrote:
Hello Benjamin,

I think theproblem is that the names of the variables are
incorrect/confusing. Look at the parsePid method in the same file

     private String[] parsePid(String pid) {
         int n = pid.indexOf('-');
         if (n > 0) {
             String factoryPid = pid.substring(n + 1);
             pid = pid.substring(0, n);
             return new String[]{pid, factoryPid};
         } else {
             return new String[]{pid, null};
         }
     }

The factory pid is definitely not the string after the "-" as suggested
here.

Gareth

Gareth



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-With-Factory-Configurations-In-Karaf-3-0-1-tp4033921p4033954.html
Sent from the Karaf - User mailing list archive at Nabble.com.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to