Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving of array index #34

Closed
beckchr opened this issue Jul 8, 2012 · 7 comments
Closed

Resolving of array index #34

beckchr opened this issue Jul 8, 2012 · 7 comments
Labels

Comments

@beckchr
Copy link
Owner

beckchr commented Jul 8, 2012

[Issue migrated from SourceForge | ID: 2871795 | Submitted by 'pvojtechovsky']
[http://sourceforge.net/support/tracker.php?aid=2871795]

The expression like ${items[0]} throws PropertyNotFoundException when items is empty list. Specification says to return null in such case

@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'beckchr']

fixed in trunk.

@beckchr beckchr closed this as completed Jul 8, 2012
@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'pvojtechovsky']

I checked the fix and it will not work well for Empty List (List with zero items). The fix is ok for list which is null.

@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'beckchr']

fixed in branches/2.1.x

@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'beckchr']

Pavel, what's the problem with the fix?

Note: the only method that should accept a bad index is getValue(). The other methods (setValue(), isReadOnly(), ...) should still throw an exception.

@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'beckchr']

did an analog fix for ArrayELResolver

@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'pvojtechovsky']

Hi Christoph,
shame on me. I did not noticed that method toIndex is called with base = null from getValue.
The code is ok now.
Thank you for fast fix!
Pavel

@beckchr
Copy link
Owner Author

beckchr commented Jul 8, 2012

[Comment migrated from SourceForge | Submitted by 'beckchr']

fixed in 2.1.3 and 2.2.0-rc2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant