GlenKPeterson / Paguro

Generic, Null-safe, Immutable Collections and Functional Transformations for the JVM
Other
312 stars 24 forks source link

ImListTrans.concat() #12

Closed pniederw closed 8 years ago

pniederw commented 8 years ago

I think ImListTrans should override concat, refining the return type to ImListTrans.

PS: Thanks for transient collections. Big improvement for my use case.

GlenKPeterson commented 8 years ago

THANK YOU! This is fixed in 2.0.7. Also union() for sets had the same issue which is taken care of. You are probably the only person to use last night's build, so I'm going to correct the other places where I wrote this and just tell you that I renamed some of the stuff I just made public:

Justification (such as it is) for these changes is in the latest CHANGE_LOG. At some point, I'll have to be more conservative about releases and changes.

GlenKPeterson commented 8 years ago

Peter,

I can't express how nice it is to make a release and have it tested (or at least tried out) the next day. Your bug reports and comments have been really helpful. I wanted you to know how much I appreciate these reports and suggestions! Thank you.

Sincerely, Glen

pniederw commented 8 years ago

Glen, it's the least I can do. Thanks for this great project.

I'm running into a problem with 2.0.7:

java.lang.ClassCastException: org.organicdesign.fp.collections.PersistentVector cannot be cast to org.organicdesign.fp.collections.MutableList
    at org.organicdesign.fp.collections.MutableList.concat(MutableList.java:17)

It seems that MutableList.concat now calls ImList.concat, which returns an immutable list. Therefore, casting to MutableList in MutableList.concat fails.

GlenKPeterson commented 8 years ago

Sorry about that. Fix is in 2.0.8, available now. I made sure to write a test for this, prove that the test showed the error, then prove that it's fixed.

pniederw commented 8 years ago

2.0.8 works fine. Thanks.