Title: Problem with generic types · Issue #1056 · androidannotations/androidannotations · GitHub
Open Graph Title: Problem with generic types · Issue #1056 · androidannotations/androidannotations
X Title: Problem with generic types · Issue #1056 · androidannotations/androidannotations
Description: I have generic super class: @EViewGroup(R.layout.report_list_item_descr) abstract public class BaseReportRowListDescr
Open Graph Description: I have generic super class: @EViewGroup(R.layout.report_list_item_descr) abstract public class BaseReportRowListDescr
X Description: I have generic super class: @EViewGroup(R.layout.report_list_item_descr) abstract public class BaseReportRowListDescr<T> extends LinearLayout { public interface ItemSelectListener<T> { ...
Opengraph URL: https://github.com/androidannotations/androidannotations/issues/1056
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problem with generic types","articleBody":"I have generic super class:\n\n```\n@EViewGroup(R.layout.report_list_item_descr)\nabstract public class BaseReportRowListDescr\u003cT\u003e extends LinearLayout {\n\npublic interface ItemSelectListener\u003cT\u003e {\n public void onItemSelected(T object);\n}\n\nprivate String title;\nprivate String descr;\nprivate T object;\nprivate ItemSelectListener\u003cT\u003e listener;\n\npublic BaseReportRowListDescr(Context context, String title, String descr, T object, ItemSelectListener\u003cT\u003e listener) {\n super(context);\n this.title = title;\n this.descr = descr;\n this.object = object;\n this.listener = listener;\n}\n...\n```\n\nAA does not save generic info, so \u003cT\u003e translated to T class, which is not found. So I make base class abstract and create child:\n\n```\n@EViewGroup(R.layout.report_list_item_descr)\npublic class HistoryDayReportRowListDescr extends BaseReportRowListDescr\u003cHistoryDay\u003e {\n\npublic HistoryDayReportRowListDescr(Context context, String title, String descr, HistoryDay object,\n ItemSelectListener\u003cHistoryDay\u003e listener) {\n super(context, title, descr, object, listener);\n}\n}\n```\n\nAA generated this code: \n\n```\npublic final class HistoryDayReportRowListDescr_\nextends HistoryDayReportRowListDescr\nimplements HasViews, OnViewChangedListener\n```\n\n{\n\n```\nprivate boolean alreadyInflated_ = false;\nprivate final OnViewChangedNotifier onViewChangedNotifier_ = new OnViewChangedNotifier();\n\npublic HistoryDayReportRowListDescr_(Context context, String title, String descr, HistoryDay object, HistoryDay\u003elistener) {\n super(context, title, descr, object, listener);\n init_();\n}\n```\n\nimportant part is last param of constructor: `HistoryDay\u003elistener` instead of `ItemSelectListener\u003cHistoryDay\u003e listener`.\n\nVersion is 3.0.1\n","author":{"url":"https://github.com/ryabenko-pro","@type":"Person","name":"ryabenko-pro"},"datePublished":"2014-06-20T09:19:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/1056/androidannotations/issues/1056"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4cdbdb66-fdc5-8d49-5a18-13fd2a4f0f4c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A14C:28F19D:11F5F0:19C6FD:6A61FB1C |
| html-safe-nonce | 72e9a2fb8a8c58dd0e4bad6eff02921259e697a319c328786bdf2cc40fcce4f6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTRDOjI4RjE5RDoxMUY1RjA6MTlDNkZEOjZBNjFGQjFDIiwidmlzaXRvcl9pZCI6IjI2Mjk1MDUyMjIzNjk3Mzc1MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8f3fc55fa0dab608f7e7ea61fda491b40dc659d34cc22aef64b18ed0e7ea7890 |
| hovercard-subject-tag | issue:36152307 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/androidannotations/androidannotations/1056/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0681b9bb292bf83c6278d3f4444eea075a790365c51d0977e9d8fe914bd94c13/androidannotations/androidannotations/issues/1056 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0681b9bb292bf83c6278d3f4444eea075a790365c51d0977e9d8fe914bd94c13/androidannotations/androidannotations/issues/1056 |
| og:image:alt | I have generic super class: @EViewGroup(R.layout.report_list_item_descr) abstract public class BaseReportRowListDescr |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ryabenko-pro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e41a6fd863e96b9c7e9185dc317bf107dbbf8cb10efd6dea957211963f33775 |
| turbo-cache-control | no-preview |
| go-import | github.com/androidannotations/androidannotations git https://github.com/androidannotations/androidannotations.git |
| octolytics-dimension-user_id | 1315313 |
| octolytics-dimension-user_login | androidannotations |
| octolytics-dimension-repository_id | 3116751 |
| octolytics-dimension-repository_nwo | androidannotations/androidannotations |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3116751 |
| octolytics-dimension-repository_network_root_nwo | androidannotations/androidannotations |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2ed5e9c44acb35dcc1d752e449d2a6f7a6164b7b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width