-
Notifications
You must be signed in to change notification settings - Fork 288
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 API methods to JavaPackage to read package-info.java #290
Conversation
Congratulations 🎉. DeepCode analyzed your code in 0.385 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard |
Thanks a lot!! 😄 Now there is only one problem, with #171 merged, |
As a user of the API, I would expect JavaAnnotation<JavaPackage> a = javaPackage.getAnnotationOfType(PackageAnnotation.class);
JavaPackage owner = a.getOwner(); // same as javaPackage And it feels strange to handle package-info as a class because it's not really a class. We should get rid of this: ArchUnit/archunit/src/main/java/com/tngtech/archunit/core/domain/JavaPackage.java Line 63 in f1d7da3
|
If we wanna break the user's code we could make the methods of ArchUnit/archunit/src/main/java/com/tngtech/archunit/core/domain/properties/HasAnnotations.java Lines 33 to 43 in a15d47a
Some methods return |
Issue TNG#263 Signed-off-by: Roland Weisleder <[email protected]>
Issue TNG#263 Signed-off-by: Roland Weisleder <[email protected]>
`Some.class.getName()` is better to maintain than using some inline string for the class name. Also rename `notAnnotatedFoo` -> `nonAnnotatedFoo` since it sounds better to me for combined nouns. Use `JavaPackage.getDescription()` where possible in messages to be consistent. Signed-off-by: Peter Gafert <[email protected]>
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.
Hey, thanks again 😃 I've rebased against master and fixed the incompatibilities. The API looks okay for me. Whether package-info.class
is a JavaClass
or not is a matter of perspective to me. It is compiled to bytecode and it shares some properties, but yes, semantically I would agree.
Still this would be a major refactoring to change this, so I don't know if it's worth it at the moment, since the API looks okay (it should be consistent in either talking about untyped HasAnnotations<?> packageInfo
or JavaAnnotation<JavaPackage>
where the original package is the owner.
Can you check out the current state if that is okay for you, too?
Yes, looks good to me 👍 thanks, @codecholeric |
Closing and reopening to trigger a new Travis build (the old one seems stuck) |
Resolves #263