April 22, 2020
Estimated Post Reading Time ~

AEM Code Pitfalls cases

Statement - Code pitfalls in AEM
Solution:
Avoid Sling Bindings in Java code
Sling Bindings are an inappropriate way to get access to a service in 90% of cases. Instead, you should use @Reference or @Inject annotations.

Avoid Thread.interrupt in Java code
Thread.interrupt is dangerous because it can close files, including Lucene files and persistent cache files, when called at the wrong time.

Avoid mixing Java synchronization with ReadWriteLocks
This can lead to a race condition in which the code will eventually deadlock.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.