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

MetaData.size doesn't match MetaData.iterator.size #5115

Closed
scabug opened this issue Oct 26, 2011 · 3 comments
Closed

MetaData.size doesn't match MetaData.iterator.size #5115

scabug opened this issue Oct 26, 2011 · 3 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Oct 26, 2011

Reading the API from Iterable I understand that size should return the number of elements to be returned by the iterator.

MetaData breaches this contract:

scala> <a x="x"/>.attributes.size
res2: Int = 2

scala> <a x="x"/>.attributes.iterator.size
res3: Int = 1
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 26, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5115?orig=1
Reporter: @jsalvata
Affected Versions: 2.9.0, 2.9.2

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 26, 2011

@jsalvata said (edited on Oct 26, 2011 9:21:26 AM UTC):
I've proposed a fix: scala/scala#111

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 31, 2011

Commit Message Bot (anonymous) said:
(extempore in r25917) Fixes NPE using iterator with an XML attribute being null or None (#5052)
Also fixes incorrect size method (#5115)

Contributed by Jordi Salvat i Alabart. Closes #5052, #5115, no review.

@scabug scabug closed this Oct 31, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.