harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4049) [classlib][beans] Compatibility: java.beans.Introspector calculates default event index for a bean in a different way
Date Fri, 22 Jun 2007 14:34:26 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507376
] 

Alexei Zakharov commented on HARMONY-4049:
------------------------------------------

Yeah, this was my mistake - thanks. Now I can see the problem. IMO RI behavior is logical.
We have two beans - Bean1 and Bean2 (that extends Bean1). Bean2 itself provides information
about ColorEvent and does not provide information about what event should be default event.
So the default event index is undetermined. Then Introspector goes to Bean2's parent and analyzes
it. Bean2 parent - Bean1 - provides information about Fred event and about the fact that 
FredEvent should be the default event. This way, we got the following information for Bean2
and its ancestors:
ColorEvent(index 0 in Bean2)
FredEvent(index 0 in Bean1 but index 1 in Bean2)
FredEvent should be the default event

because of the fact that Bean2 has no preference about the default event this information
is taken form its parent - Bean1. So the Bean1's default event - FredEvent - is taken as a
default event for whole inheritance tree. And because FredEvent has index 1 the method getDefaultEventIndex()
returns 1. IMO it is a correct and rather logical behavior. Therefore, I think we should fix
this issue and make Harmony behavior identical to RI.
Thanks.


> [classlib][beans] Compatibility: java.beans.Introspector calculates default event index
for a bean in a different way
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4049
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4049
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Roman S. Bushmanov
>            Assignee: Alexei Zakharov
>         Attachments: test.zip
>
>
> In the following case Introspector.getBeanInfo(Bean2.class).getDefaultEventIndex() return
different values on Harmony and RI.
> A Bean2 class extends Bean1 class and doesn't have corresponding BeanInfo class. Bean1
class has BeanInfo class which defines getDefaultEventIndex() and  getEventSetDescriptors().
 Bean1 class is supposed to file events of FredEvent type, i.e. it defines add/remove method
for corresponding event listeners. Bean2 in its turn is supposed to throw events of another
type, ColorEvent. 
> The attached test reproduces the described picture.
> Harmony output is
> beanInfo.getDefaultEventIndex(): 0
> at the same time RI prints
> beanInfo.getDefaultEventIndex(): 1
> In other words, Harmony simply returns the value ruturned by Bean1BeanInfo's getDefaultEventIndex()
method while RI takes in account the events supported by Bean2.
> Affected tests:
> functional/org/apache/harmony/test/func/api/java/beans/introspector/useallmethods/ConcatenateImmidiateAndSuperBeanInfosTest.xml
> (see HARMONY-3528)

-- 
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