This is an automated email from the ASF dual-hosted git repository. tjwatson pushed a commit to branch scrR8 in repository https://gitbox.apache.org/repos/asf/felix-dev.git
commit 4f2f15e000eb1adf70984c64f27791da4ee98b51 Merge: b503f5d b50b6af Author: Thomas Watson <[email protected]> AuthorDate: Fri Sep 3 09:19:47 2021 -0500 Merge branch 'master' into scrR8 cm.json/pom.xml | 2 +- configadmin-plugins/interpolation/README.md | 7 +- configadmin-plugins/interpolation/pom.xml | 2 +- .../plugin/interpolation/Activator.java | 2 +- .../InterpolationConfigurationPlugin.java | 11 +- .../interpolation/StandaloneInterpolator.java | 83 ++ .../InterpolationConfigurationPluginTest.java | 12 +- .../interpolation/StandaloneInterpolatorTest.java | 124 +++ .../interpolation/src/test/resources/res1/my.db | 1 + converter/converter/pom.xml | 2 +- .../interpolation => features}/pom.xml | 110 ++- .../org/apache/felix/feature/impl/Activator.java | 34 + .../felix/feature/impl/ArtifactBuilderImpl.java | 116 +++ .../felix/feature/impl/BuilderFactoryImpl.java | 59 ++ .../felix/feature/impl/BundleBuilderImpl.java | 116 +++ .../feature/impl/ConfigurationBuilderImpl.java | 112 +++ .../felix/feature/impl/ExtensionBuilderImpl.java | 151 ++++ .../felix/feature/impl/FeatureBuilderImpl.java | 275 ++++++ .../felix/feature/impl/FeatureServiceImpl.java | 460 ++++++++++ .../java/org/apache/felix/feature/impl/IDImpl.java | 221 +++++ .../org.osgi.service.feature.FeatureService | 1 + .../felix/feature/impl/BundleBuilderImplTest.java | 105 +++ .../felix/feature/impl/FeatureServiceImplTest.java | 314 +++++++ .../src/test/resources/features/test-exfeat1.json | 26 + .../src/test/resources/features/test-exfeat2.json | 9 + .../src/test/resources/features/test-feature.json | 38 + .../src/test/resources/features/test-feature2.json | 19 + framework.security/doc/changelog.txt | 6 + framework.security/pom.xml | 4 +- framework/doc/changelog.txt | 11 + framework/pom.xml | 3 + .../org/apache/felix/framework/BundleImpl.java | 3 +- .../apache/felix/framework/BundleRevisionImpl.java | 17 +- .../org/apache/felix/framework/DTOFactory.java | 20 +- .../org/apache/felix/framework/URLHandlers.java | 34 +- .../framework/URLHandlersStreamHandlerProxy.java | 77 +- .../apache/felix/framework/util/SecureAction.java | 60 +- healthcheck/core/pom.xml | 23 +- .../core/impl/executor/HealthCheckResultCache.java | 9 +- healthcheck/generalchecks/pom.xml | 54 +- .../hc/generalchecks/BundlesStartedCheck.java | 20 +- .../apache/felix/hc/generalchecks/CpuCheck.java | 2 +- .../felix/hc/generalchecks/DiskSpaceCheck.java | 2 +- .../felix/hc/generalchecks/DsComponentsCheck.java | 152 ++-- .../hc/generalchecks/FrameworkStartCheck.java | 4 +- .../felix/hc/generalchecks/HttpRequestsCheck.java | 174 ++-- .../felix/hc/generalchecks/JmxAttributeCheck.java | 30 +- .../apache/felix/hc/generalchecks/MemoryCheck.java | 4 +- .../hc/generalchecks/ScriptedHealthCheck.java | 14 +- .../felix/hc/generalchecks/ServicesCheck.java | 34 +- .../felix/hc/generalchecks/ThreadUsageCheck.java | 6 +- .../generalchecks/scrutil/DsRootCauseAdapter.java | 9 +- .../generalchecks/scrutil/DsRootCauseAnalyzer.java | 11 +- http/base/pom.xml | 2 +- .../http/base/internal/dispatch/Dispatcher.java | 15 +- http/bridge/pom.xml | 4 +- http/itest/pom.xml | 2 +- http/jetty/pom.xml | 12 +- .../jetty/internal/ConfigMetaTypeProvider.java | 22 +- http/servlet-api/pom.xml | 8 +- inventory/pom.xml | 5 +- main.distribution/doc/changelog.txt | 6 + main.distribution/doc/changelog_framework.txt | 11 + main.distribution/doc/changelog_main.txt | 6 + main.distribution/doc/changelog_resolver.txt | 6 + main.distribution/pom.xml | 2 +- main/doc/changelog.txt | 6 + main/pom.xml | 3 + resolver/doc/changelog.txt | 6 + rootcause/bnd.bnd | 0 rootcause/pom.xml | 35 +- .../java/org/apache/felix/rootcause/DSComp.java | 6 + .../java/org/apache/felix/rootcause/DSRef.java | 7 + .../org/apache/felix/rootcause/DSRootCause.java | 122 ++- .../apache/felix/rootcause/RootCauseCommand.java | 11 +- .../apache/felix/rootcause/RootCausePrinter.java | 36 +- .../apache/felix/rootcause/DSRootCauseTest.java | 29 +- .../org/apache/felix/rootcause/util/BaseTest.java | 10 +- scr/changelog.txt | 6 + scr/pom.xml | 1 + .../felix/scr/impl/inject/field/FieldHandler.java | 27 +- .../scr/impl/manager/ComponentContextImpl.java | 13 +- systemready/pom.xml | 89 +- .../org/apache/felix/systemready/CheckStatus.java | 5 + .../org/apache/felix/systemready/StateType.java | 7 +- .../org/apache/felix/systemready/SystemReady.java | 4 + .../apache/felix/systemready/SystemReadyCheck.java | 5 +- .../felix/systemready/SystemReadyMonitor.java | 4 + .../org/apache/felix/systemready/SystemStatus.java | 9 +- .../felix/systemready/impl/ComponentsCheck.java | 99 ++- .../felix/systemready/impl/ServicesCheck.java | 12 +- .../systemready/impl/SystemReadyMonitorImpl.java | 103 ++- .../systemready/osgi/ComponentsCheckTest.java | 20 +- .../systemready/osgi/SystemReadyMonitorTest.java | 2 +- .../felix/systemready/osgi/util/BaseTest.java | 28 +- webconsole/changelog.txt | 8 + webconsole/pom.xml | 15 +- .../org/apache/felix/webconsole/internal/Util.java | 21 + .../internal/configuration/ConfigAdminSupport.java | 987 +++++---------------- .../internal/configuration/ConfigJsonSupport.java | 494 +++++++++++ .../internal/configuration/ConfigManager.java | 226 ++--- .../ConfigurationAdminConfigurationPrinter.java | 113 ++- .../internal/configuration/ConfigurationUtil.java | 161 ++++ .../internal/configuration/MetaTypeSupport.java | 17 +- .../configuration/MetatypePropertyDescriptor.java | 6 + .../internal/configuration/PropertyDescriptor.java | 4 + .../webconsole/internal/misc/ServletSupport.java | 41 +- .../servlet/ConfigurationMetatypeSupport.java | 38 +- .../internal/servlet/ConfigurationUtil.java | 29 + .../webconsole/internal/servlet/OsgiManager.java | 25 + .../felix/webconsole/spi/ConfigurationHandler.java | 71 ++ .../felix/webconsole/spi/ValidationException.java | 17 +- .../apache/felix/webconsole/spi/package-info.java | 6 +- .../main/resources/OSGI-INF/l10n/bundle.properties | 4 + 114 files changed, 4684 insertions(+), 1600 deletions(-) diff --cc scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java index 22d10b2,541e88b..b9e728f --- a/scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java +++ b/scr/src/main/java/org/apache/felix/scr/impl/inject/field/FieldHandler.java @@@ -25,7 -25,7 +25,8 @@@ import java.lang.reflect.Modifier import java.util.ArrayList; import java.util.Collection; import java.util.List; + import java.util.Map; +import java.util.Optional; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; @@@ -192,26 -183,22 +193,30 @@@ public class FieldHandle { // unary references - // unbind needs only be done, if reference is dynamic and optional + // unbind needs only be done, if reference is dynamic and optional if ( mType == METHOD_TYPE.UNBIND ) { - if ( this.metadata.isOptional() && !this.metadata.isStatic() ) + Map<RefPair<?, ?>, Object> boundValues = bp.getComponentContext().getBoundValues(metadata.getName()); + synchronized (boundValues) { - // we only reset if it was previously set with this value - if ( bp.getComponentContext().getBoundValues(metadata.getName()).size() == 1 ) + if ( this.metadata.isOptional() && !this.metadata.isStatic() ) { - if (valueType == ValueType.ref_optional) + // we only reset if it was previously set with this value - if ( boundValues.size() == 1 ) ++ if (boundValues.size() == 1) { - this.setFieldValue(componentInstance, Optional.empty()); - } - else - { - // null the field if optional and unary -- this.setFieldValue(componentInstance, null); ++ if (valueType == ValueType.ref_optional) ++ { ++ this.setFieldValue(componentInstance, Optional.empty()); ++ } ++ else ++ { ++ // null the field if optional and unary ++ this.setFieldValue(componentInstance, null); ++ } } } + boundValues.remove(refPair); } - bp.getComponentContext().getBoundValues(metadata.getName()).remove(refPair); } // updated needs only be done, if the value type is map or tuple // If it's a dynamic reference, the value can be updated
