rzo1 commented on code in PR #170:
URL: https://github.com/apache/openjpa/pull/170#discussion_r3897688832


##########
openjpa-kernel/src/main/java/org/apache/openjpa/util/ImplHelper.java:
##########
@@ -61,7 +61,16 @@ public class ImplHelper {
     private static final Map _assignableTypes =
         new ConcurrentReferenceHashMap(ReferenceStrength.WEAK, 
ReferenceStrength.HARD);
 
-    // map of all new unenhanced instances active in this classloader
+    /**
+     * Map of all new unenhanced instances active in this classloader, keyed
+     * by object identity. Keys are held weakly, values strongly.
+     *
+     * @deprecated use
+     * {@link #registerUnenhancedInstance(Object, PersistenceCapable)} to add
+     * mappings and {@link #toPersistenceCapable(Object, Object)} to resolve
+     * them.
+     */
+    @Deprecated
     public static final Map _unenhancedInstanceMap =

Review Comment:
   Agreed, and my reasoning in the description was wrong — 4.2.0 already 
removes public API (`J2DoPrivHelper` lost ~52 public static methods, 
`DBDictionary.SerializedData` became a record and dropped a public field), so 
there was nothing left to protect. Nothing outside `ImplHelper` touches the 
field any more.
   
   I made it package private rather than private: once it's private there's no 
read path at all, since `toPersistenceCapable()` rejects a non-manageable 
instance before it reaches the map, so the unit test in the same package could 
no longer verify a registration. Description updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to