DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Joiner.join with skipNulls() gives NPE when 3th arg is null #1672

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Consider this scenario:
        System.out.println(Joiner.on('&').skipNulls().join("one", null)); // prints "one"
        System.out.println(Joiner.on('&').skipNulls().join("one", "two", "three", null)); // prints "one&two&three"
        System.out.println(Joiner.on('&').skipNulls().join("one", "two", null)); // NullPointerException

The last line will result in a NullPointerException because the 3th argument is 
interpreted as a varargs list which cannot be null.

Original issue reported on code.google.com by joeri.le...@9to5.be on 17 Feb 2014 at 5:26

GoogleCodeExporter commented 9 years ago

Original comment by wasserman.louis on 17 Feb 2014 at 7:17

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07