*/
public Jws2Instance getPreferredServiceFor(String[] serviceURLs)
{
- HashSet<String> urls=new HashSet<String>();
+ HashSet<String> urls = new HashSet<String>();
urls.addAll(Arrays.asList(serviceURLs));
- Jws2Instance match=null;
- for (Jws2Instance svc:services)
+ Jws2Instance match = null;
+ if (services != null)
{
- if (urls.contains(svc.getServiceTypeURI()))
+ for (Jws2Instance svc : services)
{
- if (match==null) {
- // for moment we always pick service from server ordered first in user's preferences
- match=svc;
- }
- if (urls.contains(svc.getUri()))
+ if (urls.contains(svc.getServiceTypeURI()))
{
- // stop and return - we've matched type URI and URI for service endpoint
- return svc;
+ if (match == null)
+ {
+ // for moment we always pick service from server ordered first in
+ // user's preferences
+ match = svc;
+ }
+ if (urls.contains(svc.getUri()))
+ {
+ // stop and return - we've matched type URI and URI for service
+ // endpoint
+ return svc;
+ }
}
}
}