You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2011/09/06 15:32:02 UTC
svn commit: r1165664 - in
/felix/trunk/framework/src/main/java/org/apache/felix/framework:
BundleRevisionImpl.java resolver/Candidates.java
Author: rickhall
Date: Tue Sep 6 13:32:02 2011
New Revision: 1165664
URL: http://svn.apache.org/viewvc?rev=1165664&view=rev
Log:
No longer need impl-specific API to determine removal pending. (FELIX-2950)
Modified:
felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java
felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java
Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java?rev=1165664&r1=1165663&r2=1165664&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleRevisionImpl.java Tue Sep 6 13:32:02 2011
@@ -310,16 +310,6 @@ public class BundleRevisionImpl implemen
return m_protectionDomain;
}
- // TODO: FRAGMENT RESOLVER - Technically, this is only necessary for fragments.
- // When we refactoring for the new R4.3 framework API, we'll have to see
- // if this is still necessary, since the new BundleWirings API will give
- // us another way to detect it.
- public boolean isRemovalPending()
- {
- return (m_bundle.getState() == Bundle.UNINSTALLED)
- || (this != m_bundle.adapt(BundleRevision.class));
- }
-
//
// Content access methods.
//
Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java?rev=1165664&r1=1165663&r2=1165664&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Candidates.java Tue Sep 6 13:32:02 2011
@@ -741,9 +741,13 @@ class Candidates
for (BundleRequirement hostReq : versionEntry.getValue())
{
// Select the highest version of the fragment that
- // is not removal pending.
- if (isFirst
- && !((BundleRevisionImpl) hostReq.getRevision()).isRemovalPending())
+ // is not removal pending. If the fragment revision
+ // is removal pending, then its current revision will
+ // be null or won't match the existing revision.
+ BundleRevision currentFragmentRevision =
+ hostReq.getRevision().getBundle()
+ .adapt(BundleRevision.class);
+ if (isFirst && (currentFragmentRevision == hostReq.getRevision()))
{
selectedFragments.add(hostReq.getRevision());
isFirst = false;