commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Commented: (SANDBOX-209) NullPointerException
Date Sat, 01 Mar 2008 08:21:51 GMT


Henri Yandell commented on SANDBOX-209:

So the API has:

  public void println(String value) {
  public void println() {
  public void println(String[] values) {
  public void println(String[][] values) {
  public void printlnComment(String comment) {
  public void print(String value) {

Question being; what should the null functionality be in each case. If you look at either
System.out.println or StringWriter, it is to turn 'null' into "null". In the array cases,
I guess it would be { "null" } and {{ "null" }}. Very lame.

So the other obvious solution would be to implement empty functionality. That still leaves
an open question of whether that means nothing happens, or it's akin to an empty string. ie)
in the println(null) case, would you expect a newline to be printed.

I'm thinking that can be up to the CSVStrategy.ignoreEmptyLines - if it's true, then null
means nothing. If false then null means an empty string. Or is that bad because it's reusing
a configuration option for something that is not necessarily symmetrical with the usage in
the parser :)

> NullPointerException
> --------------------
>                 Key: SANDBOX-209
>                 URL:
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>    Affects Versions: Nightly Builds
>            Reporter: Andriy Sholokh
>             Fix For: Nightly Builds
> If
> public void print(String value) method of CSVPrinter class gets null parameter it throws

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message