Class Analyzer

java.lang.Object
de.uni_hildesheim.sse.easy.loader.AbstractLoader
de.uni_hildesheim.sse.easy.loader.Analyzer

public class Analyzer extends AbstractLoader
Provides a bundle analysis on top of the EASy loader.
Author:
Holger Eichelberger
  • Constructor Details

    • Analyzer

      public Analyzer()
      Creates a new analyzer with default base ".".
    • Analyzer

      public Analyzer(File base)
      Creates a new analyzer.
      Parameters:
      base - the base folder where the plugins are located in
  • Method Details

    • main

      public static void main(String[] args)
      Starts the analyzer.
      Parameters:
      args - ignored
    • analyze

      public void analyze()
      Performs a default analysis of the bundles such as cyclic dependencies, overlapping files, missing bundles.
    • printDuplicateFiles

      protected boolean printDuplicateFiles(List<BundleInfo> infos)
      Prints duplicate files in JARs.
      Parameters:
      infos - the bundle information objects to be analyzed
      Returns:
      true if duplicates were found, false else
    • analyzeJarForDuplicates

      private boolean analyzeJarForDuplicates(BundleInfo info, Map<String,BundleInfo> names)
      Analyzes the resolved Jar of info for duplicate files.
      Parameters:
      info - the bundle information object (must have a resolved jar)
      names - already known name-bundle mappings (modified as a side effect)
      Returns:
      true if duplicates were found, false else
    • printBundles

      private boolean printBundles(List<BundleInfo> infos, String indent, String headline, String stopMessage, boolean negate)
      Analyzes bundles and prints them in case of failure (i.e., infos is not empty).
      Parameters:
      infos - the information objects to be analyzed
      indent - indentation of the data
      headline - headline to be printed
      stopMessage - the message to be printed in case that a failure is detected
      negate - negate the failure test, i.e., test for empty infos
      Returns:
      true in case of failure, false else
    • print

      private void print(List<?> data, String indent)
      Prints a list of data with indent.
      Parameters:
      data - the data to be printed
      indent - the indentation