[TIMOB-28262] Android: Hyperloop does not expose super class' static methods/fields to subclass
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android |
| Labels | android, class, hyperloop, static |
| Reporter | Joshua Quick |
| Assignee | Joshua Quick |
| Created | 2020-12-01T17:39:31.000+0000 |
| Updated | 2021-02-22T18:33:08.000+0000 |
Description
*Summary:*
Hyperloop's generated JS code for a Java subclass does not expose its Java super class' public static methods and static constants. Only the instance methods/fields are exposed to the subclass.
This is needed to avoid issues, such as with Google's "SnackBar" shown below.
https://github.com/appcelerator/hyperloop-examples/commit/00f4c1d20747ee5adfacbf2d0cb26dba644c8a43
*Note:*
If the subclass has a static method/field of the same name as it's super class, then the subclass' method/field should take priority. This is legal in Java and is known as "shadowing".
*Work-Around:*
You must access the super class' static methods/fields directly from the super class itself.
No comments