-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix a logic to find common package name #147
base: master
Are you sure you want to change the base?
Conversation
@sakuna63 can you 1-2 tests ? Ideally a test that would break before and the would now be green with your PR. Then we can merge it. Thx a lot ! |
@stephanenicolas the issue is that if we have following classes
henson-processor find So I fix the issues and add test. Could you review new commits? |
Oh...CI fails 😩 I'll try to fix it. |
@@ -278,4 +283,110 @@ | |||
.and() | |||
.generatesSources(expectedSource1); | |||
} | |||
|
|||
@Test public void samePackage() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add unit tests for the code you added. Not a generator test to test a lookup method in package name..
@@ -137,16 +140,36 @@ private String findCommonPackage(Collection<InjectionTarget> targets) { | |||
|
|||
private String findCommonPackage(String commonPackageName, String packageName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the method that you should test, in a unit test.
We don't understand. can't we do something a bit simpler. For instance:
This is much simpler and with unit tests it would be accepted. Are you interested ? |
@sakuna63 @stephanenicolas Any news? |
@sakuna63 can you test if the issue happens with the latest release 3.0.1? |
Henson failed to find common package name when we have some classes annotated
@InjectExtra
in different packages.e.g.
If we have following classes
henson-processor find
com.example..
as common package name and outputs following error