Hi guys, recently the new encoding stuff has dawned in the codebase, and I must admit that keeping track what's in storage-format and what's not (and I think I've spotted some bugs). I think that we could use Java 8's type annotations that would explicitly mark the contents as encoded or not encoded:
@Target({ ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER, ElementType.TYPE_PARAMETER, ElementType.TYPE_USE }) public @interface Storage { } @Target({ ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.PARAMETER, ElementType.TYPE_PARAMETER, ElementType.TYPE_USE }) public @interface External { } Then the Encoder would look like: public interface Encoder { @Storage Object toStorage(@External Object content); @External Object fromStorage(@Storage Object content); } Eventually we could use tools like the Checker Framework [1] to enforce explicit casts from non-annotated type to annotated. I am still not fully decided if we should have separate annotations for keys & values. While this gives some clarity on use, those annotations would have to be rather ubiquitous (code bloat?). Nevertheless, what do you think about it? Radim [1] https://checkerframework.org/jsr308/ -- Radim Vansa <rva...@redhat.com> JBoss Performance Team _______________________________________________ infinispan-dev mailing list infinispan-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/infinispan-dev