public String getVersion(Class<?> api) { log.trace("getVersion for {}", api); Package pkg = api.getPackage(); log.trace(" -> {}/{}", pkg.getImplementationVersion(), pkg.getSpecificationVersion()); String version = pkg.getSpecificationVersion(); if (version == null) version = pkg.getImplementationVersion(); if (version == null) { try { version = readVersionFromManifest(api); } catch (IOException e) { log.error("Could not extract version for " + api, e); return null; } } return version; }