Program: 28716
Project: 28716
Buggy source:
@Override public HandlerProcessingResult processAnnotation(AnnotationInfo annInfo) throws AnnotationProcessorException {
  AnnotatedElementHandler annCtx=annInfo.getProcessingContext().getHandler();
  AnnotatedElement annElem=annInfo.getAnnotatedElement();
  AnnotatedElement origAnnElem=annElem;
  boolean ejbInWar=ignoreWebserviceAnnotations(annElem,annCtx);
  if (ejbInWar) {
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
  }
  if (!(annElem instanceof Class)) {
    AnnotationProcessorException ape=new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"),annInfo);
    annInfo.getProcessingContext().getErrorHandler().error(ape);
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.FAILED);
  }
  if (((Class)annElem).isInterface()) {
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
  }
  if (isJaxwsRIDeployment(annInfo)) {
    conLogger.log(Level.INFO,LogUtils.DEPLOYMENT_DISABLED,new Object[]{annInfo.getProcessingContext().getArchive().getName(),"String_Node_Str"});
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
  }
  javax.jws.WebService ann=(javax.jws.WebService)annInfo.getAnnotation();
  BundleDescriptor bundleDesc=null;
  try {
    if ((ejbProvider != null) && ejbProvider.getType("String_Node_Str") != null && (annCtx instanceof EjbContext)) {
      EjbContext ctx=(EjbContext)annCtx;
      bundleDesc=ctx.getDescriptor().getEjbBundleDescriptor();
      bundleDesc.setSpecVersion("String_Node_Str");
    }
 else {
      if (annCtx instanceof WebComponentContext) {
        bundleDesc=((WebComponentContext)annCtx).getDescriptor().getWebBundleDescriptor();
      }
 else       if (!(annCtx instanceof WebBundleContext)) {
        return getInvalidAnnotatedElementHandlerResult(annInfo.getProcessingContext().getHandler(),annInfo);
      }
      bundleDesc=((WebBundleContext)annCtx).getDescriptor();
      bundleDesc.setSpecVersion("String_Node_Str");
    }
  }
 catch (  Exception e) {
    throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str",e.getMessage()));
  }
  String portComponentName=ann.name();
  String svcNameFromImplClass=ann.serviceName();
  String implClassName=((Class)annElem).getSimpleName();
  String implClassFullName=((Class)annElem).getName();
  String targetNameSpace=ann.targetNamespace();
  String portNameFromImplClass=ann.portName();
  if ((portNameFromImplClass == null) || (portNameFromImplClass.length() == 0)) {
    if ((portComponentName != null) && (portComponentName.length() != 0)) {
      portNameFromImplClass=portComponentName + "String_Node_Str";
    }
 else {
      portNameFromImplClass=implClassName + "String_Node_Str";
    }
  }
  String userSpecifiedBinding=null;
  javax.xml.ws.BindingType bindingAnn=(javax.xml.ws.BindingType)((Class)annElem).getAnnotation(javax.xml.ws.BindingType.class);
  if (bindingAnn != null) {
    userSpecifiedBinding=bindingAnn.value();
  }
  String wsdlLocation=null;
  if (ann.wsdlLocation() != null && ann.wsdlLocation().length() != 0) {
    wsdlLocation=ann.wsdlLocation();
  }
  if (ann.endpointInterface() != null && ann.endpointInterface().length() > 0) {
    Class endpointIntf;
    try {
      endpointIntf=((Class)annElem).getClassLoader().loadClass(ann.endpointInterface());
    }
 catch (    java.lang.ClassNotFoundException cfne) {
      throw new AnnotationProcessorException(localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{ann.endpointInterface()}),annInfo);
    }
    annElem=endpointIntf;
    ann=annElem.getAnnotation(javax.jws.WebService.class);
    if (ann == null) {
      throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str",((javax.jws.WebService)annInfo.getAnnotation()).endpointInterface(),((Class)annElem).getName()));
    }
    if (annElem.getAnnotation(javax.xml.ws.BindingType.class) != null) {
      throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str",((javax.jws.WebService)annInfo.getAnnotation()).endpointInterface()));
    }
  }
  WebServicesDescriptor wsDesc=bundleDesc.getWebServices();
  if (portComponentName == null || portComponentName.length() == 0) {
    portComponentName=implClassName;
  }
  WebServiceEndpoint wep=wsDesc.getEndpointByName(portComponentName);
  if (wep != null) {
    if ((wep.getServiceEndpointInterface() != null) && (wep.getServiceEndpointInterface().length() != 0) && (!((Class)annElem).getName().equals(wep.getServiceEndpointInterface()))) {
      portComponentName=implClassFullName;
    }
  }
  WebServiceEndpoint endpoint=wsDesc.getEndpointByName(portComponentName);
  WebService newWS;
  if (endpoint == null) {
    if (DOLUtils.warType().equals(bundleDesc.getModuleType())) {
      WebComponentDescriptor[] wcByImplName=((WebBundleDescriptor)bundleDesc).getWebComponentByImplName(implClassFullName);
      for (      WebComponentDescriptor wc : wcByImplName) {
        for (        WebServiceEndpoint wse : wsDesc.getEndpointsImplementedBy(wc)) {
          logger.log(Level.SEVERE,LogUtils.WS_URLMAPPING_EXISTS,new Object[]{implClassFullName});
          break;
        }
      }
    }
    if (svcNameFromImplClass != null && svcNameFromImplClass.length() != 0) {
      newWS=wsDesc.getWebServiceByName(svcNameFromImplClass);
    }
 else {
      newWS=wsDesc.getWebServiceByName(implClassName + "String_Node_Str");
    }
    if (newWS == null) {
      newWS=new WebService();
      if (svcNameFromImplClass != null && svcNameFromImplClass.length() != 0) {
        newWS.setName(svcNameFromImplClass);
      }
 else {
        newWS.setName(implClassName + "String_Node_Str");
      }
      wsDesc.addWebService(newWS);
    }
    endpoint=new WebServiceEndpoint();
    if (portComponentName != null && portComponentName.length() != 0) {
      endpoint.setEndpointName(portComponentName);
    }
 else {
      endpoint.setEndpointName(((Class)annElem).getName());
    }
    newWS.addEndpoint(endpoint);
    wsDesc.setSpecVersion(WebServicesDescriptorNode.SPEC_VERSION);
  }
 else {
    newWS=endpoint.getWebService();
  }
  if (endpoint.getWsdlService() != null) {
    if ((targetNameSpace != null) && (targetNameSpace.length() != 0) && (!endpoint.getWsdlService().getNamespaceURI().equals(targetNameSpace))) {
      AnnotationProcessorException ape=new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"),annInfo);
      annInfo.getProcessingContext().getErrorHandler().error(ape);
      return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.FAILED);
    }
    targetNameSpace=endpoint.getWsdlService().getNamespaceURI();
  }
  if ((endpoint.getWsdlService() != null) && (endpoint.getWsdlPort() != null)) {
    if (!endpoint.getWsdlService().getNamespaceURI().equals(endpoint.getWsdlPort().getNamespaceURI())) {
      AnnotationProcessorException ape=new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"),annInfo);
      annInfo.getProcessingContext().getErrorHandler().error(ape);
      return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.FAILED);
    }
  }
  if (newWS.getWsdlFileUri() == null) {
    if (wsdlLocation != null) {
      newWS.setWsdlFileUri(wsdlLocation);
    }
 else {
      if (ann.wsdlLocation() != null && ann.wsdlLocation().length() != 0) {
        newWS.setWsdlFileUri(ann.wsdlLocation());
      }
    }
  }
  if ((!endpoint.hasUserSpecifiedProtocolBinding()) && (userSpecifiedBinding != null) && (userSpecifiedBinding.length() != 0)) {
    endpoint.setProtocolBinding(userSpecifiedBinding);
  }
  if (endpoint.getServiceEndpointInterface() == null) {
    if (ann.endpointInterface() != null && ann.endpointInterface().length() != 0) {
      endpoint.setServiceEndpointInterface(ann.endpointInterface());
    }
 else {
      endpoint.setServiceEndpointInterface(((Class)annElem).getName());
    }
  }
  annElem=annInfo.getAnnotatedElement();
  if (DOLUtils.warType().equals(bundleDesc.getModuleType())) {
    if (endpoint.getServletImplClass() == null) {
      endpoint.setServletImplClass(((Class)annElem).getName());
    }
    WebBundleDescriptor webBundle=(WebBundleDescriptor)bundleDesc;
    if (endpoint.getWebComponentLink() == null) {
      endpoint.setWebComponentLink(implClassFullName);
    }
    if (endpoint.getWebComponentImpl() == null) {
      WebComponentDescriptor webComponent=(WebComponentDescriptor)webBundle.getWebComponentByCanonicalName(endpoint.getWebComponentLink());
      if (webComponent == null) {
        webComponent=new WebComponentDescriptorImpl();
        webComponent.setServlet(true);
        webComponent.setWebComponentImplementation(((Class)annElem).getCanonicalName());
        webComponent.setName(endpoint.getEndpointName());
        webComponent.addUrlPattern("String_Node_Str" + newWS.getName());
        webBundle.addWebComponentDescriptor(webComponent);
      }
      endpoint.setWebComponentImpl(webComponent);
    }
  }
 else {
    Stateless stateless=null;
    try {
      stateless=annElem.getAnnotation(javax.ejb.Stateless.class);
    }
 catch (    Exception e) {
      if (logger.isLoggable(Level.FINE)) {
        conLogger.log(Level.FINE,LogUtils.EXCEPTION_THROWN,e);
      }
    }
    Singleton singleton=null;
    try {
      singleton=annElem.getAnnotation(javax.ejb.Singleton.class);
    }
 catch (    Exception e) {
      if (logger.isLoggable(Level.FINE)) {
        conLogger.log(Level.FINE,LogUtils.EXCEPTION_THROWN,e);
      }
    }
    String name;
    if ((stateless != null) && ((stateless).name() == null || stateless.name().length() > 0)) {
      name=stateless.name();
    }
 else     if ((singleton != null) && ((singleton).name() == null || singleton.name().length() > 0)) {
      name=singleton.name();
    }
 else {
      name=((Class)annElem).getSimpleName();
    }
    EjbDescriptor ejb=((EjbBundleDescriptor)bundleDesc).getEjbByName(name);
    endpoint.setEjbComponentImpl(ejb);
    ejb.setWebServiceEndpointInterfaceName(endpoint.getServiceEndpointInterface());
    if (endpoint.getEjbLink() == null)     endpoint.setEjbLink(ejb.getName());
  }
  if (endpoint.getWsdlPort() == null) {
    if (targetNameSpace == null || targetNameSpace.length() == 0) {
      if (((Class)annElem).getPackage() != null) {
        StringTokenizer tokens=new StringTokenizer(((Class)annElem).getPackage().getName(),"String_Node_Str",false);
        if (tokens.hasMoreElements()) {
          while (tokens.hasMoreElements()) {
            if (targetNameSpace == null || targetNameSpace.length() == 0) {
              targetNameSpace=tokens.nextElement().toString();
            }
 else {
              targetNameSpace=tokens.nextElement().toString() + "String_Node_Str" + targetNameSpace;
            }
          }
        }
 else {
          targetNameSpace=((Class)annElem).getPackage().getName();
        }
      }
 else {
        throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"));
      }
      targetNameSpace="String_Node_Str" + (targetNameSpace == null ? "String_Node_Str" : targetNameSpace + "String_Node_Str");
    }
    endpoint.setWsdlPort(new QName(targetNameSpace,portNameFromImplClass,"String_Node_Str"));
  }
  if (endpoint.getWsdlService() == null) {
    String serviceNameSpace=endpoint.getWsdlPort().getNamespaceURI();
    String serviceName=null;
    if ((svcNameFromImplClass != null) && (svcNameFromImplClass.length() != 0)) {
      serviceName=svcNameFromImplClass;
    }
 else {
      serviceName=newWS.getName();
    }
    endpoint.setWsdlService(new QName(serviceNameSpace,serviceName,"String_Node_Str"));
  }
  if ((((Class)origAnnElem).getAnnotation(javax.jws.HandlerChain.class)) == null) {
    return (new HandlerChainHandler()).processHandlerChainAnnotation(annInfo,annCtx,origAnnElem,(Class)origAnnElem,true);
  }
  return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
}

Fixed version (ground truth):
@Override public HandlerProcessingResult processAnnotation(AnnotationInfo annInfo) throws AnnotationProcessorException {
  AnnotatedElementHandler annCtx=annInfo.getProcessingContext().getHandler();
  AnnotatedElement annElem=annInfo.getAnnotatedElement();
  AnnotatedElement origAnnElem=annElem;
  boolean ejbInWar=ignoreWebserviceAnnotations(annElem,annCtx);
  if (ejbInWar) {
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
  }
  if (!(annElem instanceof Class)) {
    AnnotationProcessorException ape=new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"),annInfo);
    annInfo.getProcessingContext().getErrorHandler().error(ape);
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.FAILED);
  }
  if (((Class)annElem).isInterface()) {
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
  }
  if (isJaxwsRIDeployment(annInfo)) {
    conLogger.log(Level.INFO,LogUtils.DEPLOYMENT_DISABLED,new Object[]{annInfo.getProcessingContext().getArchive().getName(),"String_Node_Str"});
    return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
  }
  javax.jws.WebService ann=(javax.jws.WebService)annInfo.getAnnotation();
  BundleDescriptor bundleDesc=null;
  try {
    if ((ejbProvider != null) && ejbProvider.getType("String_Node_Str") != null && (annCtx instanceof EjbContext)) {
      EjbContext ctx=(EjbContext)annCtx;
      bundleDesc=ctx.getDescriptor().getEjbBundleDescriptor();
      bundleDesc.setSpecVersion("String_Node_Str");
    }
 else {
      if (annCtx instanceof WebComponentContext) {
        bundleDesc=((WebComponentContext)annCtx).getDescriptor().getWebBundleDescriptor();
      }
 else       if (!(annCtx instanceof WebBundleContext)) {
        return getInvalidAnnotatedElementHandlerResult(annInfo.getProcessingContext().getHandler(),annInfo);
      }
      bundleDesc=((WebBundleContext)annCtx).getDescriptor();
      bundleDesc.setSpecVersion("String_Node_Str");
    }
  }
 catch (  Exception e) {
    throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str",e.getMessage()));
  }
  String portComponentName=ann.name();
  String svcNameFromImplClass=ann.serviceName();
  String implClassName=((Class)annElem).getSimpleName();
  String implClassFullName=((Class)annElem).getName();
  String targetNameSpace=ann.targetNamespace();
  String portNameFromImplClass=ann.portName();
  if ((portNameFromImplClass == null) || (portNameFromImplClass.length() == 0)) {
    if ((portComponentName != null) && (portComponentName.length() != 0)) {
      portNameFromImplClass=portComponentName + "String_Node_Str";
    }
 else {
      portNameFromImplClass=implClassName + "String_Node_Str";
    }
  }
  String userSpecifiedBinding=null;
  javax.xml.ws.BindingType bindingAnn=(javax.xml.ws.BindingType)((Class)annElem).getAnnotation(javax.xml.ws.BindingType.class);
  if (bindingAnn != null) {
    userSpecifiedBinding=bindingAnn.value();
  }
  String wsdlLocation=null;
  if (ann.wsdlLocation() != null && ann.wsdlLocation().length() != 0) {
    wsdlLocation=ann.wsdlLocation();
  }
  if (ann.endpointInterface() != null && ann.endpointInterface().length() > 0) {
    Class endpointIntf;
    try {
      endpointIntf=((Class)annElem).getClassLoader().loadClass(ann.endpointInterface());
    }
 catch (    java.lang.ClassNotFoundException cfne) {
      throw new AnnotationProcessorException(localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{ann.endpointInterface()}),annInfo);
    }
    annElem=endpointIntf;
    ann=annElem.getAnnotation(javax.jws.WebService.class);
    if (ann == null) {
      throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str",((javax.jws.WebService)annInfo.getAnnotation()).endpointInterface(),((Class)annElem).getName()));
    }
    if (annElem.getAnnotation(javax.xml.ws.BindingType.class) != null) {
      throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str",((javax.jws.WebService)annInfo.getAnnotation()).endpointInterface()));
    }
  }
  WebServicesDescriptor wsDesc=bundleDesc.getWebServices();
  if (portComponentName == null || portComponentName.length() == 0) {
    portComponentName=implClassName;
  }
  WebServiceEndpoint wep=wsDesc.getEndpointByName(portComponentName);
  if (wep != null) {
    if ((wep.getServiceEndpointInterface() != null) && (wep.getServiceEndpointInterface().length() != 0) && (!((Class)annElem).getName().equals(wep.getServiceEndpointInterface()))) {
      portComponentName=implClassFullName;
    }
  }
  WebServiceEndpoint endpoint=wsDesc.getEndpointByName(portComponentName);
  WebService newWS;
  if (endpoint == null) {
    if (DOLUtils.warType().equals(bundleDesc.getModuleType())) {
      WebComponentDescriptor[] wcByImplName=((WebBundleDescriptor)bundleDesc).getWebComponentByImplName(implClassFullName);
      for (      WebComponentDescriptor wc : wcByImplName) {
        if (!wsDesc.getEndpointsImplementedBy(wc).isEmpty()) {
          logger.log(Level.SEVERE,LogUtils.WS_URLMAPPING_EXISTS,new Object[]{implClassFullName});
          break;
        }
      }
    }
    if (svcNameFromImplClass != null && svcNameFromImplClass.length() != 0) {
      newWS=wsDesc.getWebServiceByName(svcNameFromImplClass);
    }
 else {
      newWS=wsDesc.getWebServiceByName(implClassName + "String_Node_Str");
    }
    if (newWS == null) {
      newWS=new WebService();
      if (svcNameFromImplClass != null && svcNameFromImplClass.length() != 0) {
        newWS.setName(svcNameFromImplClass);
      }
 else {
        newWS.setName(implClassName + "String_Node_Str");
      }
      wsDesc.addWebService(newWS);
    }
    endpoint=new WebServiceEndpoint();
    if (portComponentName != null && portComponentName.length() != 0) {
      endpoint.setEndpointName(portComponentName);
    }
 else {
      endpoint.setEndpointName(((Class)annElem).getName());
    }
    newWS.addEndpoint(endpoint);
    wsDesc.setSpecVersion(WebServicesDescriptorNode.SPEC_VERSION);
  }
 else {
    newWS=endpoint.getWebService();
  }
  if (endpoint.getWsdlService() != null) {
    if ((targetNameSpace != null) && (targetNameSpace.length() != 0) && (!endpoint.getWsdlService().getNamespaceURI().equals(targetNameSpace))) {
      AnnotationProcessorException ape=new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"),annInfo);
      annInfo.getProcessingContext().getErrorHandler().error(ape);
      return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.FAILED);
    }
    targetNameSpace=endpoint.getWsdlService().getNamespaceURI();
  }
  if ((endpoint.getWsdlService() != null) && (endpoint.getWsdlPort() != null)) {
    if (!endpoint.getWsdlService().getNamespaceURI().equals(endpoint.getWsdlPort().getNamespaceURI())) {
      AnnotationProcessorException ape=new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"),annInfo);
      annInfo.getProcessingContext().getErrorHandler().error(ape);
      return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.FAILED);
    }
  }
  if (newWS.getWsdlFileUri() == null) {
    if (wsdlLocation != null) {
      newWS.setWsdlFileUri(wsdlLocation);
    }
 else {
      if (ann.wsdlLocation() != null && ann.wsdlLocation().length() != 0) {
        newWS.setWsdlFileUri(ann.wsdlLocation());
      }
    }
  }
  if ((!endpoint.hasUserSpecifiedProtocolBinding()) && (userSpecifiedBinding != null) && (userSpecifiedBinding.length() != 0)) {
    endpoint.setProtocolBinding(userSpecifiedBinding);
  }
  if (endpoint.getServiceEndpointInterface() == null) {
    if (ann.endpointInterface() != null && ann.endpointInterface().length() != 0) {
      endpoint.setServiceEndpointInterface(ann.endpointInterface());
    }
 else {
      endpoint.setServiceEndpointInterface(((Class)annElem).getName());
    }
  }
  annElem=annInfo.getAnnotatedElement();
  if (DOLUtils.warType().equals(bundleDesc.getModuleType())) {
    if (endpoint.getServletImplClass() == null) {
      endpoint.setServletImplClass(((Class)annElem).getName());
    }
    WebBundleDescriptor webBundle=(WebBundleDescriptor)bundleDesc;
    if (endpoint.getWebComponentLink() == null) {
      endpoint.setWebComponentLink(implClassFullName);
    }
    if (endpoint.getWebComponentImpl() == null) {
      WebComponentDescriptor webComponent=(WebComponentDescriptor)webBundle.getWebComponentByCanonicalName(endpoint.getWebComponentLink());
      if (webComponent == null) {
        webComponent=new WebComponentDescriptorImpl();
        webComponent.setServlet(true);
        webComponent.setWebComponentImplementation(((Class)annElem).getCanonicalName());
        webComponent.setName(endpoint.getEndpointName());
        webComponent.addUrlPattern("String_Node_Str" + newWS.getName());
        webBundle.addWebComponentDescriptor(webComponent);
      }
      endpoint.setWebComponentImpl(webComponent);
    }
  }
 else {
    Stateless stateless=null;
    try {
      stateless=annElem.getAnnotation(javax.ejb.Stateless.class);
    }
 catch (    Exception e) {
      if (logger.isLoggable(Level.FINE)) {
        conLogger.log(Level.FINE,LogUtils.EXCEPTION_THROWN,e);
      }
    }
    Singleton singleton=null;
    try {
      singleton=annElem.getAnnotation(javax.ejb.Singleton.class);
    }
 catch (    Exception e) {
      if (logger.isLoggable(Level.FINE)) {
        conLogger.log(Level.FINE,LogUtils.EXCEPTION_THROWN,e);
      }
    }
    String name;
    if ((stateless != null) && ((stateless).name() == null || stateless.name().length() > 0)) {
      name=stateless.name();
    }
 else     if ((singleton != null) && ((singleton).name() == null || singleton.name().length() > 0)) {
      name=singleton.name();
    }
 else {
      name=((Class)annElem).getSimpleName();
    }
    EjbDescriptor ejb=((EjbBundleDescriptor)bundleDesc).getEjbByName(name);
    endpoint.setEjbComponentImpl(ejb);
    ejb.setWebServiceEndpointInterfaceName(endpoint.getServiceEndpointInterface());
    if (endpoint.getEjbLink() == null)     endpoint.setEjbLink(ejb.getName());
  }
  if (endpoint.getWsdlPort() == null) {
    if (targetNameSpace == null || targetNameSpace.length() == 0) {
      if (((Class)annElem).getPackage() != null) {
        StringTokenizer tokens=new StringTokenizer(((Class)annElem).getPackage().getName(),"String_Node_Str",false);
        if (tokens.hasMoreElements()) {
          while (tokens.hasMoreElements()) {
            if (targetNameSpace == null || targetNameSpace.length() == 0) {
              targetNameSpace=tokens.nextElement().toString();
            }
 else {
              targetNameSpace=tokens.nextElement().toString() + "String_Node_Str" + targetNameSpace;
            }
          }
        }
 else {
          targetNameSpace=((Class)annElem).getPackage().getName();
        }
      }
 else {
        throw new AnnotationProcessorException(wsLocalStrings.getLocalString("String_Node_Str","String_Node_Str"));
      }
      targetNameSpace="String_Node_Str" + (targetNameSpace == null ? "String_Node_Str" : targetNameSpace + "String_Node_Str");
    }
    endpoint.setWsdlPort(new QName(targetNameSpace,portNameFromImplClass,"String_Node_Str"));
  }
  if (endpoint.getWsdlService() == null) {
    String serviceNameSpace=endpoint.getWsdlPort().getNamespaceURI();
    String serviceName=null;
    if ((svcNameFromImplClass != null) && (svcNameFromImplClass.length() != 0)) {
      serviceName=svcNameFromImplClass;
    }
 else {
      serviceName=newWS.getName();
    }
    endpoint.setWsdlService(new QName(serviceNameSpace,serviceName,"String_Node_Str"));
  }
  if ((((Class)origAnnElem).getAnnotation(javax.jws.HandlerChain.class)) == null) {
    return (new HandlerChainHandler()).processHandlerChainAnnotation(annInfo,annCtx,origAnnElem,(Class)origAnnElem,true);
  }
  return HandlerProcessingResultImpl.getDefaultResult(getAnnotationType(),ResultType.PROCESSED);
}