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

Matthew Dinep updated ACCUMULO-1972:
------------------------------------
    Attachment: accumulo-1972_2.patch

Good call. Updated code moving logic for beforeStartKey and afterEndKey to 
private implementation methods with public methods to call them, returning the 
resulting output. Also  added/updated comments to reflect this. Unit tests are 
all still good and the change seems to function fine locally.

> Range constructors call overridable method
> ------------------------------------------
>
>                 Key: ACCUMULO-1972
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-1972
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.4.4, 1.5.0
>            Reporter: Bill Havanki
>            Priority: Minor
>              Labels: newbie
>         Attachments: accumulo-1972.patch, accumulo-1972_2.patch
>
>
> Several {{Range}} constructors call {{Range.beforeStartKey()}}, which is not 
> final. This is dangerous:
> bq. The superclass constructor runs before the subclass constructor, so the 
> overriding method in the subclass will get invoked before the subclass 
> constructor has run. If the overriding method depends on any initialization 
> performed by the subclass constructor, the method will not behave as 
> expected.  ??Item 17, Effective Java Vol. 2, Bloch??
> If {{beforeStartKey()}} cannot be made final, the code should be refactored 
> to make the constructors safe.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to