Finds the annotated classes in the specified search directory or below and writes a configuration file.

@param sortClasses
Set to true to sort the classes by name before the file is generated.
18069
public static void writeConfigFile(File configFile, File searchDir, boolean sortClasses)
			throws SQLException, IOException {
		List<Class<?>> classList = new ArrayList<Class<?>>();
		findAnnotatedClasses(classList, searchDir, 0);
		writeConfigFile(configFile, classList.toArray(new Class[classList.size()]), sortClasses);
	}
1111174
private void sortMethodList() {

        // order of execution is base classes first, then the order of
        // processorClasses, reversed for tear downs

        // build up the order:
        final List<Class<?>> hierarchy = new ArrayList<Class<?>>();

        if (initialisationClasses != null) {
            for (int i = initialisationClasses.length; i > 0; i--) {

                hierarchy.addAll(classHierarchyFor(initialisationClasses[i - 1]));
            }
        }
        sortMethodLists(hierarchy);
    }
810464
public void addClassesToCheck(File basedir, Iterable<String> relativeNames) throws IOException {
    logger.info("Loading classes to check...");
    for (final String f : relativeNames) {
      addClassToCheck(new File(basedir, f));
    }
  }
743243
private void addClasses(Class<?>[] classes, HashSet<Class<?>> result, String fieldName){
		
		if(classes == null || classes.length==0)	
			Error.classesAbsent(fieldName, configuredClass);
		
		for (Class<?> classe : classes)	result.add(classe);
	}
364369
public void runClasses(List<TestClass> testClasses) {
        CitrusAppConfiguration citrusAppConfiguration = new CitrusAppConfiguration();

        citrusAppConfiguration.setTestClasses(testClasses);
        citrusAppConfiguration.setConfigClass(configuration.getConfigClass());
        citrusAppConfiguration.addDefaultProperties(configuration.getDefaultProperties());
        citrusAppConfiguration.addDefaultProperties(defaultProperties);

        run(citrusAppConfiguration);
    }
1343492
protected Map<Method, Class<? extends Annotation>> discoverMethods(Collection<Class<?>> classes) {
        // collect the allowed annotated methods
        Map<Method, Class<? extends Annotation>> discoveredMethods = new LinkedHashMap<>();

        // discover all annotated controllers and methods
        for (Class<?> controllerClass : classes) {
            for (Method method : controllerClass.getDeclaredMethods()) {
                if (RequireUtil.allowMethod(settings, method)) {
                    for (Annotation annotation : method.getAnnotations()) {
                        Class<? extends Annotation> annotationClass = annotation.annotationType();
                        if (httpMethodAnnotationClasses.contains(annotationClass)) {
                            discoveredMethods.put(method, annotationClass);
                            break;
                        }
                    }
                }
            }
        }

        return discoveredMethods;
    }
485074
@Override
	public void writeLoaderClasses(String loaderJarResourceName) throws IOException {
		URL loaderJar = getClass().getClassLoader().getResource(loaderJarResourceName);
		try (JarInputStream inputStream = new JarInputStream(
				new BufferedInputStream(loaderJar.openStream()))) {
			JarEntry entry;
			while ((entry = inputStream.getNextJarEntry()) != null) {
				if (entry.getName().endsWith(".class")) {
					writeEntry(new JarArchiveEntry(entry),
							new InputStreamEntryWriter(inputStream, false));
				}
			}
		}
	}
1055822
function _fnSortingClasses( settings )
	{
		var oldSort = settings.aLastSort;
		var sortClass = settings.oClasses.sSortColumn;
		var sort = _fnSortFlatten( settings );
		var features = settings.oFeatures;
		var i, ien, colIdx;
	
		if ( features.bSort && features.bSortClasses ) {
			// Remove old sorting classes
			for ( i=0, ien=oldSort.length ; i<ien ; i++ ) {
				colIdx = oldSort[i].src;
	
				// Remove column sorting
				$( _pluck( settings.aoData, 'anCells', colIdx ) )
					.removeClass( sortClass + (i<2 ? i+1 : 3) );
			}
	
			// Add new column sorting
			for ( i=0, ien=sort.length ; i<ien ; i++ ) {
				colIdx = sort[i].src;
	
				$( _pluck( settings.aoData, 'anCells', colIdx ) )
					.addClass( sortClass + (i<2 ? i+1 : 3) );
			}
		}
	
		settings.aLastSort = sort;
	}
548075
private Set<ClassInfo> findClassByPackage(final String packageName, final String packagePath,
                                              final Class<?> parent, final Class<? extends Annotation> annotation,
                                              final boolean recursive, Set<ClassInfo> classes) throws ClassNotFoundException {

        // Get the directory of this package to create a File
        File dir = new File(packagePath);
        // If not exist or is not a direct return to the directory
        if ((!dir.exists()) || (!dir.isDirectory())) {
            log.warn("The package [{}] not found.", packageName);
        }
        // If present, get all the files under the package include the directory
        File[] dirFiles = accept(dir, recursive);
        // Loop all files
        if (null != dirFiles && dirFiles.length > 0) {
            for (File file : dirFiles) {
                // If it is a directory, continue scanning
                if (file.isDirectory()) {
                    findClassByPackage(packageName + '.' + file.getName(), file.getAbsolutePath(), parent, annotation, recursive, classes);
                } else {
                    // If the java class file is removed later. Class only leave the class name
                    String   className = file.getName().substring(0, file.getName().length() - 6);
                    Class<?> clazz     = Class.forName(packageName + '.' + className);
                    if (null != parent && null != annotation) {
                        if (null != clazz.getSuperclass() && clazz.getSuperclass().equals(parent) &&
                                null != clazz.getAnnotation(annotation)) {
                            classes.add(new ClassInfo(clazz));
                        }
                        continue;
                    }
                    if (null != parent) {
                        if (null != clazz.getSuperclass() && clazz.getSuperclass().equals(parent)) {
                            classes.add(new ClassInfo(clazz));
                        } else {
                            if (null != clazz.getInterfaces() && clazz.getInterfaces().length > 0 && clazz.getInterfaces()[0].equals(parent)) {
                                classes.add(new ClassInfo(clazz));
                            }
                        }
                        continue;
                    }
                    if (null != annotation) {
                        if (null != clazz.getAnnotation(annotation)) {
                            classes.add(new ClassInfo(clazz));
                        }
                        continue;
                    }
                    classes.add(new ClassInfo(clazz));
                }
            }
        }
        return classes;
    }
489459
private Set<ClassOutline> sortClasses(Outline outline) {
        Set<ClassOutline> sorted = new TreeSet<>((aOne, aTwo) -> {
            String one = aOne.implClass.fullName();
            String two = aTwo.implClass.fullName();
            return one.compareTo(two);
        });
        sorted.addAll(outline.getClasses());
        return sorted;
    }
254887
protected final void indexSubclasses(Class<?>... classes) {
		for (Class<?> klass : classes) {
			indexedSuperclasses.add(klass.getCanonicalName());
		}
		annotationDriven = false;
	}
1301450
protected Collection<Method> sortMethods(Collection<Method> methods) {
        List<Method> list = new ArrayList<>(methods);
        Collections.sort(list, (m1, m2) -> {
            int o1 = Integer.MAX_VALUE;
            Order order1 = ClassUtil.getAnnotation(m1, Order.class);
            if (order1 != null) {
                o1 = order1.value();
            }

            int o2 = Integer.MAX_VALUE;
            Order order2 = ClassUtil.getAnnotation(m2, Order.class);
            if (order2 != null) {
                o2 = order2.value();
            }

            if (o1 == o2) {
                // same or unsorted, compare controller+method
                String s1 = Util.toString(m1);
                String s2 = Util.toString(m2);
                return s1.compareTo(s2);
            }

            if (o1 < o2) {
                return -1;
            } else {
                return 1;
            }
        });

        return list;
    }
321870
def classes(p: ecore.EPackage):
        """"""
        classes = (c for c in p.eClassifiers if isinstance(c, ecore.EClass))
        return sorted(classes, key=lambda c: len(set(c.eAllSuperTypes())))
842214
@SuppressWarnings("checkstyle:rightCurly")
  static <T> ImmutableList<T> sortMostSpecificFirst(final Iterable<T> classes,
      final Function<T, Class<?>> toClass) {
    final List<T> working = Lists.newArrayList();
    // strip duplicates
    for (final T t : classes) {
      if (!working.contains(t)) {
        working.add(t);
      }
    }
    final List<T> sorted = Lists.newArrayList();
    final Predicate<T> mostSpecific = createMostSpecificMatchPredicate(working, toClass);
    boolean changed = false;
    do {
      changed = false;
      for (final Iterator<T> iterator = working.iterator(); iterator.hasNext();) {
        final T t = iterator.next();
        if (mostSpecific.apply(t)) {
          sorted.add(t);
          iterator.remove();
          changed = true;
        }
      }
    } while (changed);
    if (!working.isEmpty()) {
      throw new IllegalStateException(
          "Unable to find a element that does not have a more specific element in the set "
              + working);
    }
    return ImmutableList.copyOf(sorted);
  }
1336766
public void scan(String classNamePattern, final Map<String, Class<?>> scannedClasses) throws IOException {
        scan(classNamePattern, scannedClasses::put);
    }
220313
public void addClasses(Set<Class<?>> classes) {
        for (Class<?> classToAdd: classes) {
            localClassCache.put(classToAdd.getName(), classToAdd);
        }
    }
1294112
private function writeClassTrailer(): void
  {
    $this->codeStore->appendSeparator();
    $this->codeStore->append('}');
    $this->codeStore->append('');
    $this->codeStore->appendSeparator();
  }