You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "upthewaterspout (GitHub)" <gi...@apache.org> on 2019/02/08 18:48:29 UTC

[GitHub] [geode] upthewaterspout opened pull request #3178: GEODE-6380: Add static analysis for mutable static fields

Add a pmd rule to look for any static fields that are marked as static but not final, or static final but have values that can be modified (like a HashMap). This will allow us to eventually eliminate and enforce not having mutable static fields.

Adding a few annotations to categorize our static fields:

- Immutable - mark classes or fields that are really immutable as immutable. The pmd rule can ignore these.
- MakeImmutable - Temporary annotation to mark fields that aren't immutable but should be. For example a static final HashMap that we never change.
- MakeNonStatic - Temporary annotation mark fields that are static that we are allowing to be modified at runtime. These fields should be turned into instance fields or cache.
- MutableForTests - Temporary annotation to mark fields that should be immutable, but are not to allow setting them in tests. These also should eventually be turned into instance fields.

Annotating fields within geode-core with these annotations.


[ Full content available at: https://github.com/apache/geode/pull/3178 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] upthewaterspout closed pull request #3178: GEODE-6380: Add static analysis for mutable static fields

Posted by "upthewaterspout (GitHub)" <gi...@apache.org>.
[ pull request closed by upthewaterspout ]

[ Full content available at: https://github.com/apache/geode/pull/3178 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org

[GitHub] [geode] upthewaterspout commented on issue #3178: GEODE-6380: Add static analysis for mutable static fields

Posted by "upthewaterspout (GitHub)" <gi...@apache.org>.
I haven't annotated everything yet, and the rules only apply to geode-core so far.

[ Full content available at: https://github.com/apache/geode/pull/3178 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org