Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-552

OSGI check broken - try to load class BundleEvent always fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.20
    • Fix Version/s: None
    • Component/s: Compressors
    • Labels:
      None

      Description

      There is a check for running in OSGI env. in ZstdUtils, BrotliUtils, LZMAUtils and XZUtils like this:

      static {
          cachedZstdAvailability = CachedAvailability.DONT_CACHE;
          try {
              Class.forName("org.osgi.framework.BundleEvent");
          } catch (final Exception ex) { // NOSONAR
              setCacheZstdAvailablity(true);
          }
      }
      

      Loading the class org.osgi.framework.BundleEvent always fails because Import-Package directive for org.osgi.framework is missing in MANIFEST.MF. Or it requires another more sophisticated approach (https://stackoverflow.com/q/5879040/1061929).

      Tested with Eclipse 4.14 (org.eclipse.osgi_3.15.100.v20191114-1701.jar)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mtomcat_daobi Björn Michael
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: