You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2016/07/05 09:51:10 UTC

[jira] [Commented] (CRYPTO-90) Utils loads system properties during class loading

    [ https://issues.apache.org/jira/browse/CRYPTO-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362298#comment-15362298 ] 

Sebb commented on CRYPTO-90:
----------------------------

CRYPTO-90 Utils loads system properties during class loading

Fix up NativeCodeLoader so it still sees properties from the local file.
These are no longer copied into the System props, so need to use the
defaultProperties from Utils

Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/7274287f
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/7274287f
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/7274287f


> Utils loads system properties during class loading
> --------------------------------------------------
>
>                 Key: CRYPTO-90
>                 URL: https://issues.apache.org/jira/browse/CRYPTO-90
>             Project: Commons Crypto
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 1.0.0
>
>
> The Utils class reads properties from a properties file if it exists, and adds them to the set of System properties.
> There are several problems with this:
> - there's no way of knowing exactly when the properties will be processed, because it depends when the Utils class is first used
> - generally it's a bad idea to update System properties.
> - updates to System properties require additional privileges, so the behaviour of the code will depend on the environment in which it is run.
> - the code catches Throwable, which is not allowed.
> If there is a use case for supporting a properties file, it should be processed at a predictable stage in the code, should be done before command-line parameters are processed, and should not require updating System properties.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)