Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Fix/1422 for corner cases.#1427

Closed
ened wants to merge 1 commit into
androidannotations:developandroidannotations/androidannotations:developfrom
ened:fix/1422ened/androidannotations:fix/1422Copy head branch name to clipboard
Closed

Fix/1422 for corner cases.#1427
ened wants to merge 1 commit into
androidannotations:developandroidannotations/androidannotations:developfrom
ened:fix/1422ened/androidannotations:fix/1422Copy head branch name to clipboard

Conversation

@ened

@ened ened commented May 24, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@WonderCsabo

Copy link
Copy Markdown
Member

I think the first commit is accidental. Also, you have checkstyle violations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if you just create an if (element.getAnnotation(DrawableRes.class) != null) then call a method and handle all @DrawableRes related things, it would be cleaner and better structured.

@WonderCsabo

Copy link
Copy Markdown
Member

There is a problem: activityCompilesOnMinSdk21WithoutContextCompat and activityCompilesOnMinSdkLower21CompileSdkHigher21WithoutContextCompat fail, because ActivityIntentBuilder.hasActivityOptionsInFragment returns true, hence generates a call to a version of startActivityForResult which does not exist and a compilation error is raised. However i am not really sure why the test can find that kind of Fragment class in the classpath at all. 😕

@ened ened force-pushed the fix/1422 branch 2 times, most recently from c1f556e to be21184 Compare May 25, 2015 01:55
@ened

ened commented May 25, 2015

Copy link
Copy Markdown
Contributor Author

Unfortunately I'm not able to reproduce the failing test for activityCompilesOnMinSdk21WithoutContextCompat or activityCompilesOnMinSdkLower21CompileSdkHigher21WithoutContextCompat as mentioned by you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we inline this method?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this is fine.

@WonderCsabo

WonderCsabo commented May 25, 2015 via email

Copy link
Copy Markdown
Member

@ened

ened commented May 25, 2015

Copy link
Copy Markdown
Contributor Author

No, I'm using TextMate & maven for this. Any chance you can help me out for the Eclipse-testing part, please? ;-)

@WonderCsabo

Copy link
Copy Markdown
Member

OK, i found out what is the problem with the classpath. The POM defines 4.1.1.4 version of the Android dependency. However, in our setup, we also add the eclipse-dependencies project to the classpath, which brings android 1.6 dependency, and overrides 4.1.1.4. That is why Eclipse cannot find the newer Activity methods. Maven does, because we do not have the eclipse-dependencies in Maven builds obviously.

Actually the POM also defined the 1.6 version Android dep, but 1b9f70e changed it to 4.1.1.4. I think it was a bad idea, because in our tests, we simulate we do not have Fragment in classpath, then we simulate we have it and add it manually. If we have 4.1.1.4 in the test classpath, we cannot simulate the cases without Fragment, and adding that manually makes no sense. @yDelouis, you are the author of that commit, i think we should revert the version incrementation. That means we have to change some tests, though.

@WonderCsabo

Copy link
Copy Markdown
Member

@ened i think we should refactor ResHandler in a separate commit. We should make it abstract, and the process method should call an abstract processResource method and pass it idRef etc. Just like AbstractListenerHandler. Then create AnimationResHandler, DrawableResHandler etc, and a DefaultResHandler. Then register the correct classes in AnnotationHandlers. This way we do not mix the different cases into one class as we do now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed, since ElementFilter.methodsIn() already returns ExecutableElements.

@ened

ened commented May 25, 2015

Copy link
Copy Markdown
Contributor Author

@WonderCsabo got it.

@WonderCsabo

Copy link
Copy Markdown
Member

@ened please squash the current two commits.

@WonderCsabo

Copy link
Copy Markdown
Member

@ened did you read #1427 (comment)?

@ened

ened commented May 25, 2015

Copy link
Copy Markdown
Contributor Author

@WonderCsabo yes, I'm on it, later tonight hopefully.

@WonderCsabo

Copy link
Copy Markdown
Member

OK, thanks, just add some reactions to let me know you saw it. :)

@ened

ened commented May 25, 2015

Copy link
Copy Markdown
Contributor Author

@WonderCsabo added the abstraction. Regarding the "missing" unit test, it turns out we have it already, I think: activityCompilesWithRegularDrawable.

@WonderCsabo

Copy link
Copy Markdown
Member

Thanks for creating an abstraction. However, that should have go in a separate commit. Any chance you can split the commit into two?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.