public void add(String key, Attrs attrs) { while (containsKey(key)) key += "~"; put(key, attrs); }
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
public void add(String key, Attrs attrs) { while (containsKey(key)) key += "~"; put(key, attrs); }
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
public void add(String key, Attrs attrs) { while (containsKey(key)) key += "~"; put(key, attrs); }
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
public void add(String key, Attrs attrs) { while (containsKey(key)) key += "~"; put(key, attrs); }
public void add(String key, Attrs attrs) { while ( containsKey(key)) key += Constants.DUPLICATE_MARKER; put(key,attrs); } public boolean containsKey(final String name) {
public void add(String key, Attrs attrs) { while ( containsKey(key)) key += Constants.DUPLICATE_MARKER; put(key,attrs); } public boolean containsKey(final String name) {
public void putAllIfAbsent(Map<String, ? extends Attrs> map) { for (Map.Entry<String, ? extends Attrs> entry : map.entrySet()) { if (!containsKey(entry.getKey())) put(entry.getKey(), entry.getValue()); } }
private void startPoll() { Workspace ws = registry.getPlugin(Workspace.class); if ((ws != null) && (ws.getGestalt() .containsKey(Constants.GESTALT_BATCH) || ws.getGestalt() .containsKey(Constants.GESTALT_CI) || ws.getGestalt() .containsKey(Constants.GESTALT_OFFLINE))) { return; } int polltime = configuration.poll_time(DEFAULT_POLL_TIME); if (polltime > 0) { AtomicBoolean inPoll = new AtomicBoolean(); pomPoller = Processor.getScheduledExecutor() .scheduleAtFixedRate(() -> { if (inPoll.getAndSet(true)) return; try { poll(); } catch (Exception e) { reporter.exception(e, "Error when polling for %s for change", this); } finally { inPoll.set(false); } }, polltime, polltime, TimeUnit.SECONDS); } }
public void verifyBundleClasspath() { Parameters bcp = main.getBundleClassPath(); if (bcp.isEmpty() || bcp.containsKey(".")) return; for (String path : bcp.keySet()) { if (path.endsWith("/")) error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path); if (dot.getDirectories().containsKey(path)) // We assume that any classes are in a directory // and therefore do not care when the bundle is included return; } for (String path : dot.getResources().keySet()) { if (path.endsWith(".class")) { warning("The " + Constants.BUNDLE_CLASSPATH + " does not contain the actual bundle JAR (as specified with '.' in the " + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?"); return; } } }
public void verifyBundleClasspath() { Parameters bcp = main.getBundleClassPath(); if (bcp.isEmpty() || bcp.containsKey(".")) return; for (String path : bcp.keySet()) { if (path.endsWith("/")) error("A Bundle-ClassPath entry must not end with '/': %s", path); if (dot.getDirectories().containsKey(path)) // We assume that any classes are in a directory // and therefore do not care when the bundle is included return; } for (String path : dot.getResources().keySet()) { if (path.endsWith(".class")) { warning("The Bundle-Classpath does not contain the actual bundle JAR (as specified with '.' in the Bundle-Classpath) but the JAR does contain classes. Is this intentional?"); return; } } }
/** * Called before we print the manifest. Should add any contracts that were * actually used to the requirements. * * @param requirements */ void addToRequirements(Parameters requirements) { for (Contract c : contracts) { Attrs attrs = new Attrs(c.decorators); attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name); String name = ContractNamespace.CONTRACT_NAMESPACE; while (requirements.containsKey(name)) name += "~"; try (Formatter f = new Formatter()) { f.format("(&(%s=%s)(version=%s))", ContractNamespace.CONTRACT_NAMESPACE, c.name, c.version); // TODO : shall we also assert the attributes? attrs.put("filter:", f.toString()); requirements.put(name, attrs); } } for (Entry<Collection<Contract>, List<PackageRef>> oc : overlappingContracts.entrySet()) { Location location = analyzer.error("Contracts %s declare the same packages in their uses: directive: %s. " + "Contracts are found in declaring bundles (see their 'from' field), it is possible to control the finding" + "with the -contract instruction", oc.getKey(), oc.getValue()) .location(); location.header = Constants.CONTRACT; } }
public void verifyBundleClasspath() { Parameters bcp = main.getBundleClassPath(); if (bcp.isEmpty() || bcp.containsKey(".")) return; for (String path : bcp.keySet()) { if (path.endsWith("/")) error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path); if (dot.getDirectories().containsKey(path)) // We assume that any classes are in a directory // and therefore do not care when the bundle is included return; } for (String path : dot.getResources().keySet()) { if (path.endsWith(".class")) { warning("The " + Constants.BUNDLE_CLASSPATH + " does not contain the actual bundle JAR (as specified with '.' in the " + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?"); return; } } }
public void verifyBundleClasspath() { Parameters bcp = main.getBundleClassPath(); if (bcp.isEmpty() || bcp.containsKey(".")) return; for (String path : bcp.keySet()) { if (path.endsWith("/")) error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path); if (dot.getDirectories() .containsKey(path)) // We assume that any classes are in a directory // and therefore do not care when the bundle is included return; } for (String path : dot.getResources() .keySet()) { if (path.endsWith(".class")) { warning("The " + Constants.BUNDLE_CLASSPATH + " does not contain the actual bundle JAR (as specified with '.' in the " + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?"); return; } } }
public void verifyBundleClasspath() { Parameters bcp = main.getBundleClassPath(); if (bcp.isEmpty() || bcp.containsKey(".")) return; for (String path : bcp.keySet()) { if (path.endsWith("/")) error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path); if (dot.getDirectories() .containsKey(path)) // We assume that any classes are in a directory // and therefore do not care when the bundle is included return; } for (String path : dot.getResources() .keySet()) { if (path.endsWith(".class")) { warning("The " + Constants.BUNDLE_CLASSPATH + " does not contain the actual bundle JAR (as specified with '.' in the " + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?"); return; } } }