[Git][java-team/felix-resolver][master] 6 commits: Standards-Version updated to 4.5.0
Emmanuel Bourg
gitlab at salsa.debian.org
Sun Aug 2 23:16:57 BST 2020
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / felix-resolver
Commits:
ff3c3933 by Emmanuel Bourg at 2020-08-02T23:59:50+02:00
Standards-Version updated to 4.5.0
- - - - -
7a63f61b by Emmanuel Bourg at 2020-08-03T00:00:01+02:00
Switch to debhelper level 13
- - - - -
aa45d6aa by Emmanuel Bourg at 2020-08-03T00:00:08+02:00
Use salsa.debian.org Vcs-* URLs
- - - - -
07152408 by Emmanuel Bourg at 2020-08-03T00:00:47+02:00
New upstream version 1.16.0
- - - - -
a6b196b7 by Emmanuel Bourg at 2020-08-03T00:00:47+02:00
Update upstream source from tag 'upstream/1.16.0'
Update to upstream version '1.16.0'
with Debian dir b3ef7e57be22d2d5539de0c75652c00eca28bfa8
- - - - -
d4eee37a by Emmanuel Bourg at 2020-08-03T00:15:24+02:00
New upstream release (1.16.0)
- - - - -
12 changed files:
- NOTICE
- debian/changelog
- − debian/compat
- debian/control
- debian/rules
- doc/changelog.txt
- pom.xml
- src/main/java/org/apache/felix/resolver/Candidates.java
- src/main/java/org/apache/felix/resolver/ResolutionError.java
- src/main/java/org/apache/felix/resolver/ResolverImpl.java
- + src/main/java/org/apache/felix/resolver/reason/ReasonException.java
- + src/main/resources/org/apache/felix/resolver/reason/packageinfo
Changes:
=====================================
NOTICE
=====================================
@@ -1,6 +1,6 @@
Apache Felix Resolver
-Copyright 2006-2017 The Apache Software Foundation
+Copyright 2006-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+felix-resolver (1.16.0-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream release
+ * Standards-Version updated to 4.5.0
+ * Switch to debhelper level 13
+ * Use salsa.debian.org Vcs-* URLs
+
+ -- Emmanuel Bourg <ebourg at apache.org> Mon, 03 Aug 2020 00:15:04 +0200
+
felix-resolver (1.14.0-1) unstable; urgency=medium
* Initial release. (Closes: #892268)
=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-11
\ No newline at end of file
=====================================
debian/control
=====================================
@@ -4,15 +4,15 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Kai-Chung Yan (殷啟聰) <seamlikok at gmail.com>
Build-Depends:
- debhelper (>= 11),
+ debhelper-compat (= 13),
default-jdk-headless,
libmaven-bundle-plugin-java,
libmockito-java,
libosgi-core-java (>= 6.0.0),
maven-debian-helper (>= 2.0)
-Standards-Version: 4.1.3
-Vcs-Git: https://anonscm.debian.org/git/pkg-java/felix-resolver.git
-Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/felix-resolver.git
+Standards-Version: 4.5.0
+Vcs-Git: https://salsa.debian.org/java-team/felix-resolver.git
+Vcs-Browser: https://salsa.debian.org/java-team/felix-resolver
Homepage: https://felix.apache.org
Package: libfelix-resolver-java
=====================================
debian/rules
=====================================
@@ -1,7 +1,4 @@
#!/usr/bin/make -f
%:
- dh $@ --buildsystem=maven
-
-get-orig-source:
- uscan --download-current-version --force-download --repack --compression xz
\ No newline at end of file
+ dh $@
=====================================
doc/changelog.txt
=====================================
@@ -1,3 +1,9 @@
+1.16.0
+------
+
+** Improvement
+ * [FELIX-5782] - allow resolver errors to be introspected
+
1.14.0
------
=====================================
pom.xml
=====================================
@@ -29,12 +29,12 @@
<description>
Provide OSGi resolver service.
</description>
- <version>1.14.0</version>
+ <version>1.16.0</version>
<artifactId>org.apache.felix.resolver</artifactId>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.resolver-1.14.0</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.resolver-1.14.0</developerConnection>
- <url>scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.resolver-1.14.0</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.resolver-1.16.0</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.resolver-1.16.0</developerConnection>
+ <url>scm:svn:https://svn.apache.org/repos/asf/felix/releases/org.apache.felix.resolver-1.16.0</url>
</scm>
<dependencies>
<dependency>
@@ -68,13 +68,14 @@
<configuration>
<instructions>
<_sources>true</_sources>
- <_sourcepath>${build.sourceDirectory}</_sourcepath>
- <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <_sourcepath>${project.build.sourceDirectory}</_sourcepath>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>
org.apache.felix.resolver.Activator
</Bundle-Activator>
<Private-Package>org.apache.*</Private-Package>
<Export-Package>
+ org.apache.felix.resolver.reason,
org.osgi.service.resolver.*;provide:=true
</Export-Package>
<Import-Package>
=====================================
src/main/java/org/apache/felix/resolver/Candidates.java
=====================================
@@ -24,11 +24,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.felix.resolver.ResolverImpl.PermutationType;
import org.apache.felix.resolver.ResolverImpl.ResolveSession;
+import org.apache.felix.resolver.reason.ReasonException;
import org.apache.felix.resolver.util.*;
import org.osgi.framework.Version;
import org.osgi.framework.namespace.*;
import org.osgi.resource.*;
import org.osgi.service.resolver.HostedCapability;
+import org.osgi.service.resolver.ResolutionException;
import org.osgi.service.resolver.ResolveContext;
class Candidates
@@ -1276,6 +1278,11 @@ class Candidates
return Collections.singleton(requirement);
}
+ @Override
+ public ResolutionException toException() {
+ return new ReasonException(ReasonException.Reason.DynamicImport, getMessage(), null, getUnresolvedRequirements());
+ }
+
}
static class FragmentNotSelectedError extends ResolutionError {
@@ -1290,6 +1297,16 @@ class Candidates
return "Fragment was not selected for attachment: " + resource;
}
+ @Override
+ public Collection<Requirement> getUnresolvedRequirements() {
+ return resource.getRequirements(HostNamespace.HOST_NAMESPACE);
+ }
+
+ @Override
+ public ResolutionException toException() {
+ return new ReasonException(ReasonException.Reason.FragmentNotSelected, getMessage(), null, getUnresolvedRequirements());
+ }
+
}
static class MissingRequirementError extends ResolutionError {
@@ -1320,6 +1337,12 @@ class Candidates
return Collections.singleton(requirement);
}
+ @Override
+ public ResolutionException toException() {
+ return new ReasonException(
+ ReasonException.Reason.MissingRequirement, getMessage(), cause != null ? cause.toException() : null, getUnresolvedRequirements());
+ }
+
}
}
=====================================
src/main/java/org/apache/felix/resolver/ResolutionError.java
=====================================
@@ -38,9 +38,7 @@ public abstract class ResolutionError {
return Collections.emptyList();
}
- public ResolutionException toException() {
- return new ResolutionException(getMessage(), null, getUnresolvedRequirements());
- }
+ public abstract ResolutionException toException();
@Override
public String toString() {
=====================================
src/main/java/org/apache/felix/resolver/ResolverImpl.java
=====================================
@@ -25,6 +25,7 @@ import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.felix.resolver.reason.ReasonException;
import org.apache.felix.resolver.util.ArrayMap;
import org.apache.felix.resolver.util.CandidateSelector;
import org.apache.felix.resolver.util.OpenHashMap;
@@ -2464,6 +2465,11 @@ public class ResolverImpl implements Resolver
return cap;
}
+
+ @Override
+ public ResolutionException toException() {
+ return new ReasonException(ReasonException.Reason.UseConstraint, getMessage(), null, getUnresolvedRequirements());
+ }
}
private static class EnhancedExecutor
=====================================
src/main/java/org/apache/felix/resolver/reason/ReasonException.java
=====================================
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.resolver.reason;
+
+import java.util.Collection;
+
+import org.osgi.resource.Requirement;
+import org.osgi.service.resolver.ResolutionException;
+
+/**
+ * An exception that holds the reason for a resolution failure.
+ *
+ * @see {@link ResolutionException}
+ */
+public class ReasonException extends ResolutionException {
+
+ /**
+ * The reasons for resolution failure.
+ */
+ public static enum Reason {
+ /**
+ * Represents an unresolved package referenced by {@code Dynamic-ImportPackage}.
+ * <p>
+ * {@link ReasonException#getUnresolvedRequirements()} will return a
+ * collection containing the single {@code osgi.wiring.package;resolution:=dynamic}
+ * requirement which failed to resolve.
+ * <p>
+ * This reason has no a transitive cause.
+ */
+ DynamicImport,
+
+ /**
+ * Represents the scenario where a fragment matches a host but is not
+ * selected because another fragment with the same {@code Bundle-SymbolicName}
+ * already matched, usually a fragment of a higher version.
+ * <p>
+ * {@link ReasonException#getUnresolvedRequirements()} will return
+ * a collection containing the single {@code osgi.wiring.host} requirement of
+ * the fragment.
+ * <p>
+ * This reason has no a transitive cause.
+ */
+ FragmentNotSelected,
+
+ /**
+ * Represents the scenario where a requirement could not be resolved.
+ * <p>
+ * {@link ReasonException#getUnresolvedRequirements()} will return
+ * a collection containing a single requirement that didn't resolve.
+ * <p>
+ * This reason may have a transitive cause.
+ */
+ MissingRequirement,
+
+ /**
+ * Represents a failure in the <em>use constraints</em> of a bundle.
+ * <p>
+ * {@link ReasonException#getUnresolvedRequirements()} will return
+ * a collection containing a single requirement to blame for the use constraint
+ * violation.
+ * <p>
+ * This reason has no a transitive cause.
+ */
+ UseConstraint
+ }
+
+ private static final long serialVersionUID = -5276675175114379539L;
+
+ public ReasonException(Reason reason, String message, Throwable cause, Collection<Requirement> unresolvedRequirements) {
+ super(message, cause, unresolvedRequirements);
+ this.reason = reason;
+ }
+
+ public Reason getReason() {
+ return reason;
+ }
+
+ private final Reason reason;
+
+}
=====================================
src/main/resources/org/apache/felix/resolver/reason/packageinfo
=====================================
@@ -0,0 +1 @@
+version 1.0.0
\ No newline at end of file
View it on GitLab: https://salsa.debian.org/java-team/felix-resolver/-/compare/67267c8abe7460025b69ed85518e9a64a0916940...d4eee37ae0804b165df40add90e5deebf1cf91f6
--
View it on GitLab: https://salsa.debian.org/java-team/felix-resolver/-/compare/67267c8abe7460025b69ed85518e9a64a0916940...d4eee37ae0804b165df40add90e5deebf1cf91f6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20200802/e65994f5/attachment.html>
More information about the pkg-java-commits
mailing list