commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Smith (JIRA)" <>
Subject [jira] Updated: (SANDBOX-279) CSVStrategy has modifiable public static variables
Date Sun, 08 Feb 2009 02:56:59 GMT


Bob Smith updated SANDBOX-279:

    Attachment: CSVStrategyAndTests.patch

A patch for the changes described in the issue report.  This includes the changes to CSVStrategy,
some comments on the variables that were changed to indicate that they are not modifiable,
some test cases to make sure these fields are not modifiable, and changes the CSVParserTest
to stop attempting to modify the field.

> CSVStrategy has modifiable public static variables
> --------------------------------------------------
>                 Key: SANDBOX-279
>                 URL:
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: CSV
>    Affects Versions: Nightly Builds
>            Reporter: Bob Smith
>            Priority: Minor
>         Attachments: CSVStrategyAndTests.patch
> The public static variables in CSVStrategy are not final and DEFAULT_STRATEGY, EXCEL_STRATEGY,
and TDF_STRATEGY can be modified using setter methods.  I would recommend making them all
final and using an unmodifiable subclass for the CSVStrategy variables.   
> For this change to work, the main CSVStrategy constructor would have to be changed to
set the class fields directly instead of using the setters since the unmodifiable subclass
will have overwritten all of the setters to thrown UnsupportedOperationExceptions.  And I
think a copy constructor would also be a good addition to allow easily copying one of these
(or any) CSVStrategy objects if any modifications have to be made to them (as an alternative
to the clone method).

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

View raw message