private Element getLocalAPI() throws Exception { Set<Element> result = new HashSet<>(); for (Map.Entry<PackageRef, List<Element>> entry : packages.entrySet()) { List<Element> set = entry.getValue(); set.removeIf(element -> notAccessible.contains(analyzer.getTypeRefFromFQN(element.getName()))); String version = exports.get(entry.getKey()) .get(Constants.VERSION_ATTRIBUTE); if (version != null) { Version v = new Version(version); set.add(new Element(VERSION, v.toStringWithoutQualifier(), null, IGNORED, IGNORED, null)); } Element pd = new Element(PACKAGE, entry.getKey() .getFQN(), set, MINOR, MAJOR, null); result.add(pd); } for (JAVA java : javas) { result.add(new Element(CLASS_VERSION, java.toString(), null, CHANGED, CHANGED, null)); } return new Element(API, "<api>", result, CHANGED, CHANGED, null); }
public PackageRef getPackageRef(String binaryPackName) { if (binaryPackName.indexOf('.') >= 0) { binaryPackName = binaryPackName.replace('.', '/'); } PackageRef ref = packageCache.get(binaryPackName); if (ref != null) return ref; // // Check here if a package is actually a nested class // com.example.Foo.Bar should have package com.example, // not com.example.Foo. // ref = new PackageRef(binaryPackName); packageCache.put(binaryPackName, ref); return ref; }
public boolean referred(PackageRef packageName) { // return true; for (Map.Entry<PackageRef,List<PackageRef>> contained : uses.entrySet()) { if (!contained.getKey().equals(packageName)) { if (contained.getValue().contains(packageName)) return true; } } return false; }
PackageRef packageRef = i.next(); if (packageRef.isMetaData()) { String packageName = packageRef.getFQN();
PackageRef packageRef = i.next(); if (packageRef.isMetaData()) { String packageName = packageRef.getFQN();
PackageRef packageRef = i.next(); if (packageRef.isMetaData()) { String packageName = packageRef.getFQN();
if (packageRef.isDefaultPackage()) registerActivatorErrorLocation( error("The Bundle Activator is not in the bundle and it is in the default package "), bactivator,
if (!packageRef.isMetaData() && !contained.containsKey(packageRef)) { contained.put(packageRef); if (!packageRef.isMetaData()) { Resource pinfo = jar.getResource(prefix + packageRef.getPath() + "/packageinfo"); getExportVersionsFromPackageInfo(packageRef, pinfo, classpathExports); if (!packageRef.isMetaData()) { Resource pinfo = jar.getResource(prefix + packageRef.getPath() + "/packageinfo"); getExportVersionsFromPackageInfo(packageRef, pinfo, classpathExports);
private void learnPackage(Jar jar, String prefix, PackageRef packageRef, Packages map) throws Exception { if (packageRef.isMetaData() || packageRef.isJava() || packageRef.isPrimitivePackage()) return; .get(prefix + packageRef.getBinary()); if (dir == null || dir.size() == 0) return; Resource resource = jar.getResource(prefix + packageRef.getBinary() + "/package-info.class"); if (resource != null) { Attrs info = parsePackageInfoClass(resource); String path = prefix + packageRef.getBinary() + "/packageinfo"; Resource resource = jar.getResource(path); if (resource != null) {
String packageName = packageRef.getFQN(); setProperty(CURRENT_PACKAGE, packageName); Attrs attributes = exports.get(packageRef); if (check(Check.EXPORTS)) { Map<String, Resource> map = dot.getDirectories() .get(packageRef.getBinary()); if ((map == null || map.isEmpty())) { error("Exporting an empty package '%s'", packageRef.getFQN());
PackageRef packageRef = typeRef.getPackageRef(); String sourcePath = typeRef.getSourcePath(); String packagePath = packageRef.getPath(); if (packageRef.isDefaultPackage()) System.err.println("Duh?"); dot.putResource("OSGI-OPT/src/" + sourcePath, new FileResource(f));
String packageName = packageRef.getFQN(); setProperty(CURRENT_PACKAGE, packageName); Attrs attributes = exports.get(packageRef); if (check(Check.EXPORTS)) { Map<String, Resource> map = dot.getDirectories() .get(packageRef.getBinary()); if ((map == null || map.isEmpty())) { error("Exporting an empty package '%s'", packageRef.getFQN());
if (packageRef.isMetaData() && instruction.isAny()) continue; if (!instruction.matches(packageRef.getFQN())) continue;
PackageRef packageRef = typeRef.getPackageRef(); String sourcePath = typeRef.getSourcePath(); String packagePath = packageRef.getPath(); if (packageRef.isDefaultPackage()) System.err.println("Duh?"); dot.putResource("OSGI-OPT/src/" + sourcePath, new FileResource(f));
private void learnPackage(Jar jar, String prefix, PackageRef packageRef, Packages map) throws Exception { if (packageRef.isMetaData() || packageRef.isJava() || packageRef.isPrimitivePackage()) return; .get(prefix + packageRef.getBinary()); if (dir == null || dir.size() == 0) return; Resource resource = jar.getResource(prefix + packageRef.getBinary() + "/package-info.class"); if (resource != null) { Attrs info = parsePackageInfoClass(resource); String path = prefix + packageRef.getBinary() + "/packageinfo"; Resource resource = jar.getResource(path); if (resource != null) {
if (packageRef.isDefaultPackage()) registerActivatorErrorLocation(error("The Bundle Activator is not in the bundle and it is in the default package "), bactivator, ActivatorErrorType.DEFAULT_PACKAGE);
PackageRef packageRef = typeRef.getPackageRef(); String sourcePath = typeRef.getSourcePath(); String packagePath = packageRef.getPath(); if (packageRef.isDefaultPackage()) System.err.println("Duh?"); dot.putResource("OSGI-OPT/src/" + sourcePath, new FileResource(f));
private void learnPackage(Jar jar, PackageRef packageRef, Packages map) throws Exception { if (packageRef.isMetaData() || packageRef.isJava() || packageRef.isPrimitivePackage()) return; Resource resource = jar.getResource(packageRef.getBinary() + "/package-info.class"); if (resource != null) { Attrs info = parsePackageInfoClass(resource); String path = packageRef.getBinary() + "/packageinfo"; Resource resource = jar.getResource(path); if (resource != null) {
if (packageRef.isMetaData() && instruction.isAny()) continue; if (!instruction.matches(packageRef.getFQN())) continue;
if (packageRef.isMetaData() && instruction.isAny()) continue; if (!instruction.matches(packageRef.getFQN())) continue;