Clojure

sorted-set-by fails when given no values

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.1
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

As described here: http://groups.google.com/group/clojure/browse_thread/thread/1e9c368245800695
(sorted-set-by >) throws a null pointer exception.

Activity

Hide
Assembla Importer added a comment -

timothypratley said: [file:cCsdcIZ_Wr3QwreJe5aVNr]: removed bad initializers, added tests

Show
Assembla Importer added a comment - timothypratley said: [file:cCsdcIZ_Wr3QwreJe5aVNr]: removed bad initializers, added tests
Hide
Assembla Importer added a comment -

timothypratley said: public static PersistentTreeSet create(Comparator comp, Object... init)
was shadowing
public static PersistentTreeSet create(Comparator comp, List init)

I can't see any reason why Object... init should be there (it is only for sorted-set-by but not needed) so I've simply removed it and added test coverage. Please advise if this is valid or if there is any reason Object... init is useful.

Show
Assembla Importer added a comment - timothypratley said: public static PersistentTreeSet create(Comparator comp, Object... init) was shadowing public static PersistentTreeSet create(Comparator comp, List init) I can't see any reason why Object... init should be there (it is only for sorted-set-by but not needed) so I've simply removed it and added test coverage. Please advise if this is valid or if there is any reason Object... init is useful.
Hide
Assembla Importer added a comment -

richhickey said: FYI - please don't assign things to me - thanks

Show
Assembla Importer added a comment - richhickey said: FYI - please don't assign things to me - thanks
Hide
Assembla Importer added a comment -

richhickey said: 'ant test' fails for clojure, with:
[java] ERROR in (test-sorted-set-by) (test_clojure.clj:77)
[java] expected: (set? (sorted-set-by <))
[java] actual: java.lang.NullPointerException: null
[java] at clojure.lang.PersistentTreeSet.create (PersistentTreeSet.java:33)

Show
Assembla Importer added a comment - richhickey said: 'ant test' fails for clojure, with: [java] ERROR in (test-sorted-set-by) (test_clojure.clj:77) [java] expected: (set? (sorted-set-by <)) [java] actual: java.lang.NullPointerException: null [java] at clojure.lang.PersistentTreeSet.create (PersistentTreeSet.java:33)
Hide
Assembla Importer added a comment -

timothypratley said: Hi Rich,

Ok thanks.

I tried from a fresh branch, for some reason 'ant test' does not recompile the java code (which has changed very slightly to fix the bug). However if you first run 'ant' then run 'ant test' it works fine and all tests pass. This seems to show that the build.xml isn't finding the dependency, but that is unrelated to this patch I believe.

Can you please try again with a clean build before ant test?

Regards,
Tim.

Show
Assembla Importer added a comment - timothypratley said: Hi Rich, Ok thanks. I tried from a fresh branch, for some reason 'ant test' does not recompile the java code (which has changed very slightly to fix the bug). However if you first run 'ant' then run 'ant test' it works fine and all tests pass. This seems to show that the build.xml isn't finding the dependency, but that is unrelated to this patch I believe. Can you please try again with a clean build before ant test? Regards, Tim.
Hide
Assembla Importer added a comment -

richhickey said: I did ant + ant test. Just tried again, same problem. Perhaps some important change didn't make it into your patch? Please pull down master and apply your patch to it in order to reproduce/diff. Thanks.

Show
Assembla Importer added a comment - richhickey said: I did ant + ant test. Just tried again, same problem. Perhaps some important change didn't make it into your patch? Please pull down master and apply your patch to it in order to reproduce/diff. Thanks.
Hide
Assembla Importer added a comment -

timothypratley said: Short answer - I am pretty sure the next attachment will fix it!

Long answer -

Hmmmm very odd! I can't reproduce any error here so it must be related to my environment somehow.

git clone git://github.com/richhickey/clojure.git
cd clojure
ant
ant test
works fine.... of course
git am -s < sorted-set-by.diff
ant
[java] ERROR in (test-sorted-set-by) (test_clojure.clj:77)
[java] expected: (set? (sorted-set-by <))
[java] actual: java.lang.NullPointerException: null
[java] at clojure.lang.PersistentTreeSet.create (PersistentTreeSet.java:50)
expected, line number 50 is different from 33, again that's expected
ant
ant test
works fine for me but errors on line 33 PersistentTreeSet for you
PersistentTreeSet line 33:
for(Object key : init)
init is clearly null
I added some printouts - it never gets called for me - but does for you
Summary - must be shadowing again!!! Argghhhh...

Uploading patch now which should resolve.

Show
Assembla Importer added a comment - timothypratley said: Short answer - I am pretty sure the next attachment will fix it! Long answer - Hmmmm very odd! I can't reproduce any error here so it must be related to my environment somehow. git clone git://github.com/richhickey/clojure.git cd clojure ant ant test works fine.... of course git am -s < sorted-set-by.diff ant [java] ERROR in (test-sorted-set-by) (test_clojure.clj:77) [java] expected: (set? (sorted-set-by <)) [java] actual: java.lang.NullPointerException: null [java] at clojure.lang.PersistentTreeSet.create (PersistentTreeSet.java:50) expected, line number 50 is different from 33, again that's expected ant ant test works fine for me but errors on line 33 PersistentTreeSet for you PersistentTreeSet line 33: for(Object key : init) init is clearly null I added some printouts - it never gets called for me - but does for you Summary - must be shadowing again!!! Argghhhh... Uploading patch now which should resolve.
Hide
Assembla Importer added a comment -

timothypratley said: [file:bHx3hk2Her3QkseJe5aVNr]: new patch

Show
Assembla Importer added a comment - timothypratley said: [file:bHx3hk2Her3QkseJe5aVNr]: new patch

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: