You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by GitBox <gi...@apache.org> on 2022/09/14 11:21:36 UTC

[GitHub] [felix-dev] amitjoy opened a new pull request, #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

amitjoy opened a new pull request, #172:
URL: https://github.com/apache/felix-dev/pull/172

   Fixes https://issues.apache.org/jira/browse/FELIX-6564


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] amitjoy commented on a diff in pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
amitjoy commented on code in PR #172:
URL: https://github.com/apache/felix-dev/pull/172#discussion_r978659010


##########
scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java:
##########
@@ -117,6 +117,10 @@ public Collection<ComponentConfigurationDTO> getComponentConfigurationDTOs(Compo
         try
         {
             ComponentHolder<?> holder = getHolderFromDescription( description);
+            // the holder can also be null if the associated component is deregistered

Review Comment:
   Thanks a lot for the detailed feedback 👍  I have updated the MR with the required changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] amitjoy commented on pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
amitjoy commented on PR #172:
URL: https://github.com/apache/felix-dev/pull/172#issuecomment-1256549717

   Thanks @tjwatson 👍 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] tjwatson commented on pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
tjwatson commented on PR #172:
URL: https://github.com/apache/felix-dev/pull/172#issuecomment-1256297819

   > If you want, you can also cross-check it from your end. Just to be on the safe side.
   
   The fix looks safe enough, I just wanted to verify they ran on your end.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] tjwatson commented on a diff in pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
tjwatson commented on code in PR #172:
URL: https://github.com/apache/felix-dev/pull/172#discussion_r978575369


##########
scr/src/main/java/org/apache/felix/scr/impl/runtime/ServiceComponentRuntimeImpl.java:
##########
@@ -117,6 +117,10 @@ public Collection<ComponentConfigurationDTO> getComponentConfigurationDTOs(Compo
         try
         {
             ComponentHolder<?> holder = getHolderFromDescription( description);
+            // the holder can also be null if the associated component is deregistered

Review Comment:
   If null is allowed to be returned here then I think we need null checks in all 4 locations it is called:
   
   `disableComponent(ComponentDescriptionDTO)`
   `enableComponent(ComponentDescriptionDTO)`
   `getComponentConfigurationDTOs(ComponentDescriptionDTO)`
   `isComponentEnabled(ComponentDescriptionDTO)`
   
   Also, looking at `getHolderFromDescription(ComponentDescriptionDTO description)` I think it has an issue where it could get called on an uninstalled bundle in which case `Bundle b = context.getBundle(bundleId);` will result in a `null` value in `b` causing an NPE also.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] tjwatson merged pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
tjwatson merged PR #172:
URL: https://github.com/apache/felix-dev/pull/172


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] amitjoy commented on pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
amitjoy commented on PR #172:
URL: https://github.com/apache/felix-dev/pull/172#issuecomment-1246677441

   @tjwatson Could you kindly have a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] amitjoy commented on pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
amitjoy commented on PR #172:
URL: https://github.com/apache/felix-dev/pull/172#issuecomment-1255952462

   @tjwatson Do you have any update on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] amitjoy commented on pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
amitjoy commented on PR #172:
URL: https://github.com/apache/felix-dev/pull/172#issuecomment-1256259643

   If you want, you can also cross-check it from your end. Just to be on the safe side.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [felix-dev] amitjoy commented on pull request #172: [FELIX-6564] Fixed NPE while retrieving component descriptions from SCR

Posted by GitBox <gi...@apache.org>.
amitjoy commented on PR #172:
URL: https://github.com/apache/felix-dev/pull/172#issuecomment-1256258253

   I built it locally and all the tests ran successfully


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@felix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org