public void cleanupVersion(Map<String, Map<String, String>> mapOfMap, String defaultVersion) { for (Iterator<Map.Entry<String, Map<String, String>>> e = mapOfMap.entrySet().iterator(); e .hasNext();) { Map.Entry<String, Map<String, String>> entry = e.next(); Map<String, String> attributes = entry.getValue(); String v = attributes.get(Constants.VERSION_ATTRIBUTE); if (v == null && defaultVersion != null) { if (!isTrue(getProperty(Constants.NODEFAULTVERSION))) { v = defaultVersion; if (isPedantic()) warning("Used bundle version %s for exported package %s", v, entry.getKey()); } else { if (isPedantic()) warning("No export version for exported package %s", entry.getKey()); } } if (v != null) attributes.put(Constants.VERSION_ATTRIBUTE, cleanupVersion(v)); } }
/** * * @param jar * @param name * @param instructions */ private void doExpand(Jar jar, String name, Map<Instruction, Map<String, String>> instructions, boolean mandatory) { Set<Instruction> superfluous = removeMarkedDuplicates(instructions.keySet()); for (Iterator<Jar> c = getClasspath().iterator(); c.hasNext();) { Jar now = c.next(); doExpand(jar, instructions, now, superfluous); } if (mandatory && superfluous.size() > 0) { StringBuilder sb = new StringBuilder(); String del = "Instructions in " + name + " that are never used: "; for (Iterator<Instruction> i = superfluous.iterator(); i.hasNext();) { Instruction p = i.next(); sb.append(del); sb.append(p.toString()); del = "\n "; } sb.append("\nClasspath: "); sb.append(Processor.join(getClasspath())); sb.append("\n"); warning("%s",sb.toString()); if (isPedantic()) diagnostics = true; } }
private void doVerify(Jar dot) throws Exception { Verifier verifier = new Verifier(dot, getProperties()); verifier.setPedantic(isPedantic()); // Give the verifier the benefit of our analysis // prevents parsing the files twice verifier.setClassSpace(classspace, contained, referred, uses); verifier.verify(); getInfo(verifier); }
private void doVerify(Jar dot) throws Exception { Verifier verifier = new Verifier(dot, getProperties()); verifier.setPedantic(isPedantic()); // Give the verifier the benefit of our analysis // prevents parsing the files twice verifier.setClassSpace(classspace, contained, referred, uses); verifier.verify(); getInfo(verifier); }