User Tools

Site Tools


tutorial:accesswideners

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:accesswideners [2020/06/22 14:13] – Clarify the circumstances where an access widener should and should not be used earthcomputertutorial:accesswideners [2020/07/10 22:27] – removed random " in text hydos
Line 5: Line 5:
 Access wideners should **only** be used where mixin does not currently provide a means to do so. Access wideners should **only** be used where mixin does not currently provide a means to do so.
 There are currently only 2 cases where mixins are not sufficient: There are currently only 2 cases where mixins are not sufficient:
-  * Needing to access a private class, especially for the purpose of shadowing or accessing a field or method in a mixin.+  * Needing to access a (package) private class, especially for the purpose of shadowing or accessing a field or method in a mixin.
   * Being able to override final methods or subclass final classes.   * Being able to override final methods or subclass final classes.
 +    * Before you consider overriding final methods, try mixin injecting in final methods first!
 +    * If you want to subclass a class with only (package) private constructors, wideners are a good choice.
  
 ===== Requirements ===== ===== Requirements =====
Line 111: Line 113:
 ... ...
  
-"accessWidener" : "modid.accesswidener","+"accessWidener" : "modid.accesswidener",
  
 ... ...
 </code> </code>
tutorial/accesswideners.txt · Last modified: 2024/04/01 19:23 by matjojo