commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <>
Subject [jira] [Commented] (COMPRESS-354) PureJavaCrc32C constructor calls overrideable method
Date Mon, 16 May 2016 04:18:13 GMT


Stefan Bodewig commented on COMPRESS-354:

No, sebb is talking about the class inside the {{org.apache.commons.compress.compressors.snappy}}

> PureJavaCrc32C constructor calls overrideable method
> ----------------------------------------------------
>                 Key: COMPRESS-354
>                 URL:
>             Project: Commons Compress
>          Issue Type: Bug
>            Reporter: Sebb
>            Priority: Minor
> Constructors must not call overrideable methods.
> An object is not guaranteed fully constructed until the constructor exits, so the subclass
override may not see the proper parent object.
> In this case, the class is package-protected so it's possible to ensure that subclasses
don't override the method.
> However this would have to be checked, so it would be better to fix the issue:
> 1) make class final
> 2) make reset method final
> 3) extract the code into a private method that is used by the ctor and the public method.

This message was sent by Atlassian JIRA

View raw message