-
New Feature
-
Resolution: Done
-
Major
-
8.6.1
-
Security Level: Jimmy
-
ZK 8.6.3 S1
-
None
Steps to Reproduce
extend GenericForwardComposer
public class MyGenericForwardComposer extends GenericForwardComposer { }
apply the composer to any zk component
<div apply="MyGenericForwardComposer"/>
Start in debug mode, and set an ExceptionBreakpoint for java.lang.NoSuchFieldException
Current Result
The exception break point is triggered 64 times even for this very simple scenario (the same fields are queried multiple times)
This happens everytime the page is refreshed. For every user.
The effect multiplies with deeper class hierarchies, and multiple composers in a single page.
Expected Result
Caching results to avoid recurring exceptions.
Debug Info
Root Cause
Classes#getAnyField
https://github.com/zkoss/zk/blob/master/zcommon/src/org/zkoss/lang/Classes.java#L1214-L1225
same with Classes#getAnyMethod
https://github.com/zkoss/zk/blob/master/zcommon/src/org/zkoss/lang/Classes.java#L1176-L1194
Workaround
SelectorComposer which uses Annotations scanning instead of naming conventions doesn't have this problem.