Convert the dot notation entity bean packages to slash notation.

@param packages entity bean packages
333275
static DetectQueryBean convert(Collection<String> packages) {

    String[] asArray = packages.toArray(new String[packages.size()]);
    for (int i = 0; i < asArray.length; i++) {
      asArray[i] = convert(asArray[i]);
    }
    return new DetectQueryBean(asArray);
  }
881659
public void scan(final String[] packages) {
        LOGGER.info("Scanning packages {}:", ArrayUtils.toString(packages));
        for (final String pkg : packages) {
            try {
                final String pkgFile = pkg.replace('.', '/');
                final Enumeration<URL> urls = getRootClassloader().getResources(pkgFile);
                while (urls.hasMoreElements()) {
                    final URL url = urls.nextElement();
                    try {
                        final URI uri = getURI(url);
                        LOGGER.debug("Scanning {}", uri);
                        scan(uri, pkgFile);
                    } catch (final URISyntaxException e) {
                        LOGGER.debug("URL {} cannot be converted to a URI", url, e);
                    }
                }
            } catch (final IOException ex) {
                throw new RuntimeException("The resources for the package" + pkg + ", could not be obtained",
                        ex);
            }
        }
        LOGGER.info(
                "Found {} matching classes and {} matching files",
                matchingClasses.size(),
                matchingFiles.size());
    }
1228439
private void decryptEndpointProperties(ApiVersionBean versionBean) {
        Map<String, String> endpointProperties = versionBean.getEndpointProperties();
        if (endpointProperties != null) {
            for (Entry<String, String> entry : endpointProperties.entrySet()) {
                DataEncryptionContext ctx = new DataEncryptionContext(
                        versionBean.getApi().getOrganization().getId(), 
                        versionBean.getApi().getId(),
                        versionBean.getVersion(), 
                        EntityType.Api);
                entry.setValue(encrypter.decrypt(entry.getValue(), ctx));
            }
        }
    }
196236
public void setPackager( final CharSequence packager) {
		if ( packager != null) format.getHeader().createEntry( PACKAGER, packager);
	}
1167662
def apt_mark(packages, mark, fatal=False):
    """"""
    log("Marking {} as {}".format(packages, mark))
    cmd = ['apt-mark', mark]
    if isinstance(packages, six.string_types):
        cmd.append(packages)
    else:
        cmd.extend(packages)

    if fatal:
        subprocess.check_call(cmd, universal_newlines=True)
    else:
        subprocess.call(cmd, universal_newlines=True)
610371
public String getCauseStackTraceAsString(final List<String> packages, final String suffix) {
        return getCauseStackTraceAsString(packages, PlainTextRenderer.getInstance(), suffix);
    }
1300098
private function publish_packages($packages)
    {
        if (empty($packages)) {
            return;
        }

        foreach ($packages as $package => $directories_to_publish) {
            if (empty($directories_to_publish)) {
                $this->output->writeln("<comment>$package has no files to publish!</comment>");
                continue;
            }

            $this->publish_directories($directories_to_publish);
        }
    }
270189
public void scan(List<? extends JCTree> trees) {
        if (trees != null)
        for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
            scan(l.head);
    }


/* ***************************************************************************
 * Visitor methods
 ****************************************************************************/

    public void visitTopLevel(JCCompilationUnit tree) {
        scan(tree.packageAnnotations);
        scan(tree.pid);
        scan(tree.defs);
    }

    public void visitImport(JCImport tree) {
        scan(tree.qualid);
    }

    public void visitClassDef(JCClassDecl tree) {
        scan(tree.mods);
        scan(tree.typarams);
        scan(tree.extending);
        scan(tree.implementing);
        scan(tree.defs);
    }

    public void visitMethodDef(JCMethodDecl tree) {
        scan(tree.mods);
        scan(tree.restype);
        scan(tree.typarams);
        scan(tree.recvparam);
        scan(tree.params);
        scan(tree.thrown);
        scan(tree.defaultValue);
        scan(tree.body);
    }

    public void visitVarDef(JCVariableDecl tree) {
        scan(tree.mods);
        scan(tree.vartype);
        scan(tree.nameexpr);
        scan(tree.init);
    }

    public void visitSkip(JCSkip tree) {
    }
17520
List<EntityType> putEntitiesInDefaultPackage(
      IntermediateParseResults intermediateResults, String defaultPackageId) {
    Package p = getPackage(intermediateResults, defaultPackageId);
    if (p == null) {
      throw new UnknownPackageException(defaultPackageId);
    }

    List<EntityType> entities = newArrayList();
    for (EntityType entityType : intermediateResults.getEntityTypes()) {
      if (entityType.getPackage() == null) {
        entityType.setId(defaultPackageId + PACKAGE_SEPARATOR + entityType.getId());
        entityType.setPackage(p);
      }
      entities.add(entityType);
    }
    return entities;
  }
512896
@Override
    public T addPackages(boolean recursive, Package... packages) throws IllegalArgumentException {
        Validate.notNull(packages, "Packages must be specified");

        return addPackages(recursive, Filters.includeAll(), packages);
    }
209040
public static <T> List<T> getWithAnnotatedClass(Class annotationClass, String packages) {
        return new ArrayList<T>() {{
            addAll(ClassGraphUtil.getWithAnnotatedClass(annotationClass, packages));
        }};
    }
1332365
private static void getClassPackageNames(Class<?> clazz, Map<String, Class<?>> packageNames) {
    if (isPrivate(clazz)) {
      throw new IllegalArgumentException(PrettyPrinter.format(
          "Unable to inject an instance of %s because it is a private class.", clazz));
    } else if (!isPublic(clazz)) {
      packageNames.put(clazz.getPackage().getName(), clazz);
    }

    Class<?> enclosingClass = clazz.getEnclosingClass();
    if (enclosingClass != null) {
      getClassPackageNames(enclosingClass, packageNames);
    }
  }
294643
public final void init(String[] packageNames) {
		if(ArrayUtil.isEmpty(packageNames)){
			return;
		}
		
		final Set<Class<?>> actionClasses = new HashSet<Class<?>>();
		final Filter<Class<?>> actionClassFilter = createActionClassFilter();	//Action类的过滤器，剔除不符合过滤条件的类
		for (String packageName : packageNames) {
			if(StrUtil.isNotBlank(packageName)) {
				actionClasses.addAll(ClassUtil.scanPackage(packageName.trim(), actionClassFilter));
			}
		}
		
		if (HuluSetting.isDevMode) {
			for (Class<?> clazz : actionClasses) {
				log.debug("Finded Action class: [{}]", clazz.getName());
			}
		}
		
		//Object里的那些方法不能被识别成Action方法
		final Set<String> forbiddenMethods = ClassUtil.getPublicMethodNames(Object.class);
		
		Object actionInstance = null;
		Method[] methods = null;
		for (Class<?> actionClass : actionClasses) {
			try {
				// 每个Action单独捕获异常，这样不会影响其它Action
				actionInstance = actionClass.newInstance();
				methods = actionClass.getMethods();
			} catch (Exception e) {
				log.error(e, String.format("Init Action [%s] error!", actionClass.getName()));
				continue;
			}
			
			final Interceptor[] actionInterceptors = InterceptorBuilder.build(actionClass);
			for (Method method : methods) {
				
				//过滤掉Object中的一些特殊方法(toString(), hash等等)
				if (forbiddenMethods.contains(method.getName())) {
					continue;
				}
				
				//设置方法的拦截器（Action对象和方法的拦截器都对此方法有效）
				final Interceptor[] interceptors = ArrayUtil.addAll(actionInterceptors, InterceptorBuilder.build(method));
				final ActionMethod actionMethod = new ActionMethod(actionInstance, method, interceptors);
				
				final String key = actionMethod.getRequestPath();
				if(this.containsKey(key)) {
					//当有同一个请求路径对应不同的ActionMethod时，给出Log ERROR， 并不阻断初始化
					log.warn(new ActionException(StrUtil.format("Duplicate request path [{}]", key)));
				}else{
					this.put(key, actionMethod);
					if(HuluSetting.isDevMode) {
						log.debug("Added action mapping: [{}]", key);
					}
				}
			}
		}
	}
955227
public void flattenPackagesSourcesAndArtifacts(Map<String,Module> m) {
        modules = m;
        // Extract all the found packages.
        for (Module i : modules.values()) {
            for (Map.Entry<String,Package> j : i.packages().entrySet()) {
                Package p = packages.get(j.getKey());
                // Check that no two different packages are stored under same name.
                assert(p == null || p == j.getValue());
                if (p == null) {
                    p = j.getValue();
                    packages.put(j.getKey(),j.getValue());
                }
                for (Map.Entry<String,Source> k : p.sources().entrySet()) {
                    Source s = sources.get(k.getKey());
                    // Check that no two different sources are stored under same name.
                    assert(s == null || s == k.getValue());
                    if (s == null) {
                        s = k.getValue();
                        sources.put(k.getKey(), k.getValue());
                    }
                }
                for (Map.Entry<String,File> g : p.artifacts().entrySet()) {
                    File f = artifacts.get(g.getKey());
                    // Check that no two artifacts are stored under the same file.
                    assert(f == null || f == g.getValue());
                    if (f == null) {
                        f = g.getValue();
                        artifacts.put(g.getKey(), g.getValue());
                    }
                }
            }
        }
    }
953831
public static void register(BeanDefinitionRegistry registry,
			Collection<String> packageNames) {
		Assert.notNull(registry, "Registry must not be null");
		Assert.notNull(packageNames, "PackageNames must not be null");
		if (registry.containsBeanDefinition(BEAN)) {
			BeanDefinition beanDefinition = registry.getBeanDefinition(BEAN);
			ConstructorArgumentValues constructorArguments = beanDefinition
					.getConstructorArgumentValues();
			constructorArguments.addIndexedArgumentValue(0,
					addPackageNames(constructorArguments, packageNames));
		}
		else {
			GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
			beanDefinition.setBeanClass(EntityScanPackages.class);
			beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0,
					StringUtils.toStringArray(packageNames));
			beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
			registry.registerBeanDefinition(BEAN, beanDefinition);
		}
	}
292727
public void setRulesPackages(java.util.Collection<RulesPackage> rulesPackages) {
        if (rulesPackages == null) {
            this.rulesPackages = null;
            return;
        }

        this.rulesPackages = new java.util.ArrayList<RulesPackage>(rulesPackages);
    }
1190462
private static void getWildcardTypePackageNames(WildcardType type,
      Map<String, Class<?>> packageNames) {
    for (Type boundType : type.getUpperBounds()) {
      getTypePackageNames(boundType, packageNames);
    }

    for (Type boundType : type.getLowerBounds()) {
      getTypePackageNames(boundType, packageNames);
    }
  }