RFR: Data plugin
Alexandre Iline
shurailine at openjdk.java.net
Wed Apr 27 23:26:35 UTC 2022
On Wed, 27 Apr 2022 17:43:15 GMT, Leonid Kuskov <lkuskov at openjdk.org> wrote:
>> As for reusing the system property by another application after the program shut down, I do not really know what you mean. The properties which are set are the ones which may be set anyway to control the plugin behavior.
>
> It's a minor comment. Just to say that here, I mean there are 2 kinds of properties - Environment > export JCOV_OPTION=path && System.getenv("JCOV_OPTION") and java -DJCOV_OPTION=path && System.getProperty("JCOV_OPTION") First and second ways to get external properties don't have in mind their update/clean. If System properties are used as global mutable variables of the program then it would be much better to use a special singleton container like a hash table for this need. If these options are read-only then all updating/cleaning methods are superfluous.
In fact, in the current state of the code, system properties are changed only from tests. Tests simply do what a user is suggested to do: set some system properties, run a JCov empty point class, either from command line or from some other java code. I think this is acceptable. There can be an additional interface which does not require setting system properties, but system properties will always work anyway.
There is one exception when a system property is set not from a test: "jcov.data-saver" is set to be the same as "jcov.data.saver. I am looking if this is justified.
-------------
PR: https://git.openjdk.java.net/jcov/pull/19
More information about the jcov-dev
mailing list