You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2012/07/05 19:17:45 UTC
svn commit: r1357744 - in
/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl:
ConfigurationManager.java helper/TargetedPID.java
Author: fmeschbe
Date: Thu Jul 5 17:17:45 2012
New Revision: 1357744
URL: http://svn.apache.org/viewvc?rev=1357744&view=rev
Log:
FELIX-3481 - Targeted PID support:
- bindsStronger applies wrong logic thus resulting in
false negatives
- provideReplacement reassigns the deleted configuration
instead of the replacement configuration
Modified:
felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/helper/TargetedPID.java
Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java?rev=1357744&r1=1357743&r2=1357744&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java (original)
+++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/ConfigurationManager.java Thu Jul 5 17:17:45 2012
@@ -510,7 +510,7 @@ public class ConfigurationManager implem
for ( String candidate : names )
{
ConfigurationImpl config = getConfiguration( candidate );
- if ( config != null )
+ if ( config != null && !config.isDeleted() )
{
// check visibility to use and dynamically bind
if ( canReceive( serviceBundle, config.getBundleLocation() ) )
@@ -1612,14 +1612,14 @@ public class ConfigurationManager implem
final TargetedPID configPid;
final Dictionary properties;
final long revision;
- synchronized ( config )
+ synchronized ( rc )
{
- configPid = config.getPid();
- properties = config.getProperties( true );
- revision = config.getRevision();
+ configPid = rc.getPid();
+ properties = rc.getProperties( true );
+ revision = rc.getRevision();
}
- helper.provideConfiguration( sr, configPid, null, properties, revision );
+ helper.provideConfiguration( sr, configPid, null, properties, -revision );
return true;
}
Modified: felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/helper/TargetedPID.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/helper/TargetedPID.java?rev=1357744&r1=1357743&r2=1357744&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/helper/TargetedPID.java (original)
+++ felix/trunk/configadmin/src/main/java/org/apache/felix/cm/impl/helper/TargetedPID.java Thu Jul 5 17:17:45 2012
@@ -208,8 +208,8 @@ public class TargetedPID
/**
- * Returns <code>true</code> if the <code>other</code> {@link TargetedPID}
- * binds stronger than this.
+ * Returns <code>true</code> if this targeted PID binds stronger than
+ * the <code>other</code> {@link TargetedPID}.
* <p>
* This method assumes both targeted PIDs have already been checked for
* suitability for the bundle encoded in the targetting.
@@ -221,7 +221,7 @@ public class TargetedPID
*/
boolean bindsStronger( final TargetedPID other )
{
- return other.bindingLevel > this.bindingLevel;
+ return this.bindingLevel > other.bindingLevel;
}