commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Commons Wiki] Update of "CodeStyle" by sebbapache
Date Mon, 13 Feb 2017 12:34:48 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.

The "CodeStyle" page has been changed by sebbapache:

Warning re: constant inlining

   1. Document authors in POM, not in source files (see
   1. Object visibility: once code is released, it can be impossible to reduce the visibility
of fields, classes, methods without breaking compatibility, so initial releases should use
the minimum visibility possible.
   1. Mutable data: this increases the difficulty of ensuring thread-safety (including safe
publication of changes). Data should be confined to a class; mutation should only be allowed
via a setter which can ensure thread-safety. Be careful that the getter does not expose array
contents (which are always mutable)
+  1. Even constants can cause problems: the Java compiler can inline constant values from
another class. So if the constant should ever change, classes that are not recompiled could
contain the old value.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message