static Artifacts getArtifactsToCompare()

in src/main/java/org/apache/sling/feature/analyser/task/impl/CheckCompareFeatures.java [132:150]


    static Artifacts getArtifactsToCompare(Feature feat, String ext) throws Exception {
        Artifacts artifacts;
        if (ext == null) {
            // compare bundles
            artifacts = feat.getBundles();
        } else {
            // compare extensions
            Extension extension = feat.getExtensions().getByName(ext);
            if (extension == null) {
                throw new Exception("Extension " + ext + " not found in feature " + feat.getId());
            }
            if (ExtensionType.ARTIFACTS != extension.getType()) {
                throw new Exception("Extension " + extension + " is not of type ARTIFACTS.");
            }

            artifacts = extension.getArtifacts();
        }
        return artifacts;
    }