harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nellya Udovichenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4272) [classlib][beans] BeanContextServicesSupport.releaseService() throws unexpected NPE
Date Tue, 26 Jun 2007 09:02:26 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nellya Udovichenko updated HARMONY-4272:
----------------------------------------

    Attachment: H-4272-test.patch
                H-4272.patch

Yes, this NPE is thrown in BeanContextServicesSupport.releaseServiceWithoutCheck() method
because of the field bcssChild.serviceRecords is null. I agree with Roman's suggestion to
do as RI. Therefore the corresponding check-up is added in the attached patch.

Please could anybody verify the patch?


> [classlib][beans]  BeanContextServicesSupport.releaseService() throws unexpected NPE
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4272
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4272
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Roman S. Bushmanov
>         Attachments: H-4272-test.patch, H-4272.patch
>
>
> The following NPE is thrown by the testcase listed below.
> Uncaught exception in main:
> java.lang.NullPointerException
>         at java.beans.beancontext.BeanContextServicesSupport.releaseServiceWithoutCheck(BeanContextServicesSupport.java:786)
>         at java.beans.beancontext.BeanContextServicesSupport.releaseService(BeanContextServicesSupport.java:773)
>         at Test.main(Test.java:12)
> The exception is thrown on attempt  to call releaseServise() method for the bean which
didn't previously request any services.
> In my opinion in such a case releaseService() method should return silently as RI does.
In other words an additional check for bcssChild.serviceRecords field is required in the method
releaseServiceWithoutCheck().
> --------------------------- Test.java -------------------------------------
> import java.beans.beancontext.*;
> public class Test {
>     public static void main(String[] args) throws Exception {
>         BeanContextServicesSupport context = new BeanContextServicesSupport();
>         BeanContextChild child = new BeanContextChildSupport();
>         context.add(child);
>         context.releaseService(child, child, new Object());
>     }
> }
> ------------------------------------------------------------------------------
> This issue affects the following functional test
> functional/org/apache/harmony/test/func/api/java/beans/beancontext/TestBeanContextServicesSupport.xml

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message