Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
This task involves adding the private and static modifiers to all inner classes (existing in "internal" sub-packages) that do not require access to their enclosing instances. The reason for adding the private modifier is because generally an inner class exists to serve its outer class in some way. The reason for adding the static modifier is because non-static inner classes hold a reference to their enclosing instance which is unnecessary. In addition, when instances of non-static inner classes live longer than their enclosing class instance there is the possibility of a memory leak.
An example of where the static modifier should be added to an inner class is the two inner classes in BodyScriptEncodingResponseWriter.java.