Returns the ClassHandle objects matching the specified criteria.

@param kind the kind of the handles
@return a list containing the requested handles
172438
@Requires("kind != null")
  @Ensures({
    "result != null",
    "!result.contains(null)"
  })
  List<ClassContractHandle> getClassHandles(ContractKind kind) {
    ArrayList<ClassContractHandle> matched =
        new ArrayList<ClassContractHandle>();
    for (ClassContractHandle h : classHandles) {
      if (kind.equals(h.getKind())) {
        matched.add(h);
      }
    }
    return matched;
  }
278594
@Override
	protected Class<?>[] getHandlerInterfaces(String serviceName) {
		Class<?> remoteInterface = interfaceMap.get(serviceName);
		if (remoteInterface != null) {
			return new Class<?>[]{remoteInterface};
		} else if (Proxy.isProxyClass(getHandler(serviceName).getClass())) {
			return getHandler(serviceName).getClass().getInterfaces();
		} else {
			return new Class<?>[]{getHandler(serviceName).getClass()};
		}
	}
941014
public List<MessageHandler> getHandlers(IPredicate<MessageHandler> filter) {
        List<MessageHandler> matching = new ArrayList<MessageHandler>();
        for (MessageHandler handler : handlers) {
            if (filter.apply(handler)) {
                matching.add(handler);
            }
        }
        return matching;
    }
5956
private JClassType getHandlerForEvent(JClassType eventType) {

		// All handlers event must have an overrided method getAssociatedType().
		// We take advantage of this information to get the associated handler.
		// Ex:
		// com.google.gwt.event.dom.client.ClickEvent
		// ---> com.google.gwt.event.dom.client.ClickHandler
		//
		// com.google.gwt.event.dom.client.BlurEvent
		// ---> com.google.gwt.event.dom.client.BlurHandler

		if (eventType == null) {
			return null;
		}

		JMethod method = eventType
				.findMethod("getAssociatedType", new JType[0]);
		if (method == null) {
			logger.warn(
					"Method 'getAssociatedType()' could not be found in the event '%s'.",
					eventType.getName());
			return null;
		}

		JType returnType = method.getReturnType();
		if (returnType == null) {
			logger.warn(
					"The method 'getAssociatedType()' in the event '%s' returns void.",
					eventType.getName());
			return null;
		}

		JParameterizedType isParameterized = returnType.isParameterized();
		if (isParameterized == null) {
			logger.warn(
					"The method 'getAssociatedType()' in '%s' does not return Type<? extends EventHandler>.",
					eventType.getName());
			return null;
		}

		JClassType[] argTypes = isParameterized.getTypeArgs();
		if ((argTypes.length != 1)
				&& !argTypes[0].isAssignableTo(eventHandlerJClass)) {
			logger.warn(
					"The method 'getAssociatedType()' in '%s' does not return Type<? extends EventHandler>.",
					eventType.getName());
			return null;
		}

		return argTypes[0];
	}
732463
private List<ClassDocImpl> getClasses(boolean filtered) {
        if (allClasses != null && !filtered) {
            return allClasses;
        }
        if (allClassesFiltered != null && filtered) {
            return allClassesFiltered;
        }
        ListBuffer<ClassDocImpl> classes = new ListBuffer<ClassDocImpl>();
        for (Scope.Entry e = sym.members().elems; e != null; e = e.sibling) {
            if (e.sym != null) {
                ClassSymbol s = (ClassSymbol)e.sym;
                ClassDocImpl c = env.getClassDoc(s);
                if (c != null && !c.isSynthetic())
                    c.addAllClasses(classes, filtered);
            }
        }
        if (filtered)
            return allClassesFiltered = classes.toList();
        else
            return allClasses = classes.toList();
    }
52609
public HashMap<String, Class> discoverHandlerClasses(List<String> basePackages) {
        //always include the Chorus handlers package
        HashMap<String, Class> handlerNameToHandlerClass = new HashMap<>();

        HandlerAnnotationFilter handlerAnnotationFilter = new HandlerAnnotationFilter();
        ClassFilter filter = new ClassFilterDecorator().decorateWithPackageNameFilters(handlerAnnotationFilter, basePackages);

        Set<Class> classes = ClasspathScanner.doScan(filter, log);
        for (Class handlerClass : classes) {
            Handler f = (Handler) handlerClass.getAnnotation(Handler.class);
            String handlerName = f.value();
            if (handlerNameToHandlerClass.containsKey(handlerName)) {
                String currentHandler = handlerNameToHandlerClass.get(handlerName).getName();
                String newHandler = handlerClass.getName();

                //since we test the log output, inconsistencies in the order can break the test
                String handlerTxt = currentHandler.compareTo(newHandler) < 0 ?
                        newHandler + " and " + currentHandler :
                        currentHandler + " and " + newHandler;

                if ( log.isDebugEnabled()) {
                    log.debug("More than one handler class is defined with the name [" + handlerName + "]");
                    log.debug("The value of the @Handler annotation is [" + handlerName + "] for both " + handlerTxt);
                    log.debug("Any features which attempt to use handler [" + handlerName + "] will fail");
                }

                //put a special class into the map which tells the interpreter to fail any features
                handlerNameToHandlerClass.put(handlerName, DuplicateHandlers.class);
                duplicateNameToDescription.put(handlerName, handlerTxt);
            } else {
                handlerNameToHandlerClass.put(handlerName, handlerClass);
            }
        }
        
        if ( log.isTraceEnabled()) {
            log.trace("These were the handler classes discovered by handler class scanning " + handlerNameToHandlerClass);
        }
        return handlerNameToHandlerClass;
    }
433633
public List<Class<?>> getRawTypes(List<DomainObjectType> types) {
		List<Class<?>> resultList = new ArrayList<Class<?>>();
		for (DomainObjectType type : types) {
			resultList.add(type.getType());
		}
		return resultList;
	}
767105
def get_data_array(handles)
      return [] unless handles && handles.any?

      entity_class_name_for_soap_request = entity_class.name.split("::").last
      response = request(:get_data_array, "entityHandles" => {"#{entity_class_name_for_soap_request}Handle" => handles.collect(&:to_hash)})
      [response["#{entity_class.key}_data".intern]].flatten
    end
1280829
private static <T> List<Method> getMethods(Class<T> type, String... names) {

		Assert.notNull(type, "Missing class to search for methods!");
		Assert.notNullOrEmpty(names, "Missing method names to search for!");

		Map<String, Method> candidates = new HashMap<>();
		for (Method method : type.getMethods()) {

			if (Modifier.isStatic(method.getModifiers()) &&
			    method.getReturnType().equals(type) &&
			    method.getParameterTypes().length == 1 &&
			    method.getParameterTypes()[0].isAssignableFrom(String.class)) {

				candidates.put(method.getName(), method);
			}
		}

		List<Method> output = new ArrayList<>();

		// go in order desired
		for (String name : names) {
			if (candidates.containsKey(name)) {
				output.add(candidates.get(name));
			}
		}

		return output;
	}
802720
@Override
  public boolean getUseParentHandlers()
  {
    Boolean value = _useParentHandlers.get();

    if (value != null)
      return Boolean.TRUE.equals(value);
    else
      return true;
  }
998595
@Override
  public Handler []getHandlers()
  {
    Handler []handlers = _localHandlers.get();
    
    if (handlers != null)
      return handlers;
    else
      return EMPTY_HANDLERS;
  }
733912
public Set<String> getKeys(Class<?> type) {
        return data.entrySet().stream().filter(val -> type.isAssignableFrom(val.getValue()
                .getClass())).map(Map.Entry::getKey).collect(Collectors
                .toSet());
    }
619421
public Set<Handler> getHandlers() {
        modificationLock.readLock().lock();
        try {
            return new HashSet<>(handlers);
        } finally {
            modificationLock.readLock().unlock();
        }
    }
1270127
@Override
  public <T> Iterable<Binding<T>> bindings(Class<T> type)
  {
    BindingSet<T> set = (BindingSet) _bindingSetMap.get(type);

    if (set != null) {
      return (Iterable) set;
    }
    else {
      return Collections.EMPTY_LIST;
    }
  }
415023
protected List<HandlerWrapper> createHandlerWrappers(Class<?> type, MessageHandler handler, boolean partialHandler) {
        //check the encodings first
        Encoding encoding = session.getEncoding();
        List<HandlerWrapper> ret = new ArrayList<>(2);
        if (encoding.canDecodeText(type)) {
            ret.add(new HandlerWrapper(FrameType.TEXT, handler, type, true, false));
        }
        if (encoding.canDecodeBinary(type)) {
            ret.add(new HandlerWrapper(FrameType.BYTE, handler, type, true, false));
        }
        if(!ret.isEmpty()) {
            return ret;
        }
        if (partialHandler) {
            // Partial message handler supports only String, byte[] and ByteBuffer.
            // See JavaDocs of the MessageHandler.Partial interface.
            if (type == String.class) {
                return Collections.singletonList(new HandlerWrapper(FrameType.TEXT, handler, type, false, true));
            }
            if (type == byte[].class || type == ByteBuffer.class) {
                return Collections.singletonList(new HandlerWrapper(FrameType.BYTE, handler, type, false, true));
            }
            throw JsrWebSocketMessages.MESSAGES.unsupportedFrameType(type);
        }
        if (type == byte[].class || type == ByteBuffer.class || type == InputStream.class) {
            return Collections.singletonList(new HandlerWrapper(FrameType.BYTE, handler, type, false, false));
        }
        if (type == String.class || type == Reader.class) {
            return Collections.singletonList(new HandlerWrapper(FrameType.TEXT, handler, type, false, false));
        }
        if (type == PongMessage.class) {
            return Collections.singletonList(new HandlerWrapper(FrameType.PONG, handler, type, false, false));
        }
        throw JsrWebSocketMessages.MESSAGES.unsupportedFrameType(type);
    }
1029441
private static <T extends Bean> MethodHandle findConstructorHandle(
            Class<T> beanType,
            MethodHandles.Lookup lookup,
            Constructor<?> constructor) {

        try {
            // spreader allows an Object[] to invoke the positional arguments
            MethodType constructorType = MethodType.methodType(Void.TYPE, constructor.getParameterTypes());
            MethodHandle baseHandle = lookup.findConstructor(beanType, constructorType)
                    .asSpreader(Object[].class, constructor.getParameterTypes().length);
            // change the return type so caller can use invokeExact()
            return baseHandle.asType(baseHandle.type().changeReturnType(Bean.class));
        } catch (NoSuchMethodException ex) {
            throw new IllegalArgumentException("Unable to find constructor: " + beanType.getSimpleName());
        } catch (IllegalAccessException ex) {
            throw new IllegalArgumentException("Unable to access constructor: " + beanType.getSimpleName());
        }
    }
394344
public List<HandlerType<ServiceRefType<T>>> getAllHandler()
   {
      List<HandlerType<ServiceRefType<T>>> list = new ArrayList<HandlerType<ServiceRefType<T>>>();
      List<Node> nodeList = childNode.get("handler");
      for(Node node: nodeList)
      {
         HandlerType<ServiceRefType<T>>  type = new HandlerTypeImpl<ServiceRefType<T>>(this, "handler", childNode, node);
         list.add(type);
      }
      return list;
   }