commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CONFIGURATION-485) Class fields set by ctors should be final if they don't need to be changed later
Date Wed, 14 Mar 2012 22:08:40 GMT

     [ https://issues.apache.org/jira/browse/CONFIGURATION-485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb updated CONFIGURATION-485:
-------------------------------

    Attachment: CONFIGURATION-485.patch

Sample patch for ConfigurationMap.

Similar fixes could be applied to other classes.
                
> Class fields set by ctors should be final if they don't need to be changed later
> --------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-485
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-485
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Sebb
>         Attachments: CONFIGURATION-485.patch
>
>
> Using final whereever possible simplifies testing (fewer possible states) and improves
thread-safety (final fields may not need synch.)
> Obviously changing public or protected fields to final may cause problems for binary
compatibility (if they form part of the public API), but for private/package variables that
is not a concern.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message