-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extraFields to a BoundBox #4
Comments
Woopss. Looks like a miss ;) Thank you very much for reporting these bugs. It would be very nice to have I mean having a dependency on Android would be too heavy, even just for We could isolate what's going wrong and create small test cases for each For the import conflict I still don't see clearly what's wrong and even Stephane
|
You're welcome :) I don't think it's because of generics. |
for imports, I found out that the problem comes from javawriter. it compresses types by default and doesn't handle very well conflicting imports. |
see issue #2 |
Ok for import statements conflict but did you fixed missing private fields issue? |
For import statements, I initiated a pull request in java writer. With this fix, everything is going well for TextView. |
About the missing field. I think I got the explanation. I could reproduce the "bug" locally. It's indeed not a bug to my mind. What happens is that the android jars that are used for compilation are indeed android jars containing only methods that send the "Stub !" exception. They just provide signatures of all methods of android classes but don't actually contain any field of those classes. Therefore, due to full android classes being unavailable at runtime, it will not be possible to get their fields. All fields of your own classes are available, as well as their super class, but, whenver you use an android class, you won't have access to anything other than methods. |
I suspected this problem ... It could be interesting to add extra informations in annotation to force specific field to be bound boxed. Let's imagine
What do you think? |
ok for extraBoundFields. Do you feel like coding it ? I am really eager to see java writer released with optional type 2013/9/24 Flavien Laurent [email protected]
Stéphane NICOLAS, |
yes, I can focus on this feature. |
Wonderful. On my side, I will focus on adding support for inner classes, I should get it within 15 days, at most. Except for javawriter, as it will S. 2013/9/24 Flavien Laurent [email protected]
Stéphane NICOLAS, |
Ok. Some advices on how to see logs? |
mvn clean install will show logs. I don't debug, I just trace. If you find a better way, I would use it. S. 2013/9/24 Flavien Laurent [email protected]
Stéphane NICOLAS, |
I just finished to code a basic implementation of this feature. Do you known how to test this feature? I wrote test in boundbox-library and boundbox-android-sample-tests but I have no idea how to test it in boundbox-library-integration-tests. Actually, I've this test
|
In a unit test for the writer, you would check that the getters and setters In an integration test you would test that the read access fails on a bound Can you change extraBoundFields --> extraFields Nice ! Any pull request ready ? Stéphane 2013/9/24 Flavien Laurent [email protected]
Stéphane NICOLAS, |
Please, when done, document the feature here : https://github.com/stephanenicolas/boundbox/wiki/Adding-extra-fields-to-a-boundbox This page is already referenced/linked from Wiki's main page (section usage). |
Request pulled. Don't hesitate if you have a comment on something! |
UPDATE ---
The thread has been renamed. On Android, we use stub Android jars to compile an app, and those stubs only contain method signatures (their bodies all send the "Stub !" exception), and no fields. So it is interesting to be able to add fields explicitly to a BoundBox class so that, when a call to the BoundBox setters/getters will be made, it will be resolved at runtime by reflection and the field will be accessed for real.
UPDATE ---
The code
BoundBoxOfTextView class isn't well generated:
and there is no method to access to it in BoundBoxOfTextView
The text was updated successfully, but these errors were encountered: