Search in sources :

Example 21 with Info

use of aQute.bnd.differ.Baseline.Info in project bndtools by bndtools.

the class BundleTree method getInitialSuggestedVersion.

protected Version getInitialSuggestedVersion(Object obj) {
    if (initialSuggested == null) {
        initialSuggested = new HashMap<Object, Version>();
    }
    Version version = initialSuggested.get(obj);
    if (version != null) {
        return version;
    }
    if (obj instanceof Info) {
        version = ((Info) obj).suggestedVersion;
    } else {
        version = ((Baseline) obj).getSuggestedVersion();
    }
    initialSuggested.put(obj, version);
    return version;
}
Also used : Version(aQute.bnd.version.Version) Info(aQute.bnd.differ.Baseline.Info)

Example 22 with Info

use of aQute.bnd.differ.Baseline.Info in project bndtools by bndtools.

the class InfoContentProvider method getChildren.

@Override
public Object[] getChildren(Object parent) {
    if (parent instanceof List) {
        return ((List<?>) parent).toArray();
    }
    if (parent instanceof Baseline) {
        if (isShowAll()) {
            return ((Baseline) parent).getPackageInfos().toArray();
        }
        Set<Info> infos = ((Baseline) parent).getPackageInfos();
        List<Info> filteredDiffs = new ArrayList<Info>();
        for (Info info : infos) {
            if (info.packageDiff.getDelta() == Delta.IGNORED || (info.packageDiff.getDelta() == Delta.UNCHANGED && info.olderVersion.equals(info.suggestedVersion))) {
                continue;
            }
            filteredDiffs.add(info);
        }
        return filteredDiffs.toArray(new Info[0]);
    }
    return new Object[0];
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Baseline(aQute.bnd.differ.Baseline) Info(aQute.bnd.differ.Baseline.Info)

Aggregations

Info (aQute.bnd.differ.Baseline.Info)22 Baseline (aQute.bnd.differ.Baseline)16 BundleInfo (aQute.bnd.differ.Baseline.BundleInfo)13 Jar (aQute.bnd.osgi.Jar)13 DiffPluginImpl (aQute.bnd.differ.DiffPluginImpl)10 Processor (aQute.bnd.osgi.Processor)8 Builder (aQute.bnd.osgi.Builder)5 ProjectBuilder (aQute.bnd.build.ProjectBuilder)4 Diff (aQute.bnd.service.diff.Diff)4 Version (aQute.bnd.version.Version)4 Instructions (aQute.bnd.osgi.Instructions)3 MultiMap (aQute.lib.collections.MultiMap)3 Parameters (aQute.bnd.header.Parameters)2 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)2 File (java.io.File)2 Formatter (java.util.Formatter)2 Map (java.util.Map)2 Manifest (java.util.jar.Manifest)2 Attrs (aQute.bnd.header.Attrs)1 Analyzer (aQute.bnd.osgi.Analyzer)1