-
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
Extend syntax to query different kinds of classes #245
Conversation
DeepCode's analysis on #264220 found:
💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues. |
Cool, thank you so much!! 😄 I'm sorry it took me so long to get back to this, my queue is a little overloaded at the moment |
This commit adds the methods * isTopLevelClass * isMemberClass * isAnonymousClass (as replacement for isAnonymous) * isLocalClass The JavaClassProcessor determines the kind based on byte code. The naming is based on the Java Language Specification, chapter 8. Signed-off-by: Roland Weisleder <[email protected]>
This commit adds classes().that(). and classes().should(). * [are|be]TopLevelClasses * [are|be]NestedClasses * [are|be]MemberClasses * [are|be]InnerClasses * [are|be]AnonymousClasses * [are|be]LocalClasses and their corresponding negations. Signed-off-by: Roland Weisleder <[email protected]>
Signed-off-by: Roland Weisleder <[email protected]>
Since the fine details of the definitions of the different types of classes are probably not widely known, I've excluded some more exhaustive explanations and examples into the Javadoc. Signed-off-by: Peter Gafert <[email protected]>
… static nested class Since we are already testing the case of an explicitly declared static member class, we might as well add a member interface as another test input, since it must behave exactly the same with respect to the class type. Signed-off-by: Peter Gafert <[email protected]>
In `PublicAPIRules` we can now also use the predefined `JavaClass.Predicates.ANONYMOUS_CLASSES`. Signed-off-by: Peter Gafert <[email protected]>
These conditions actually do almost the same, `IsConditionByPredicate` simply needs to be enhanced to customize the description of a single event instead of always taking the predicate description. Signed-off-by: Peter Gafert <[email protected]>
I think `InnerMemberClass` is more narrow than `NonStaticNestedClass`, because technically a local or anonymous class also is a non-static nested class. It might not always be relevant in the context, but `InnerMemberClass` at least gives me a quick understanding of exactly what type of class this is. Also `ClassAccessingLocalClass` is AFAIS a `ClassBeingAccessedByLocalClass` (it does not access the local class, but vice versa, and this is also correct for the test). Signed-off-by: Peter Gafert <[email protected]>
Now that #171 is merged, I finally got around to it 😄 Thank you so much for your support! |
Thanks for adding the Javadoc! I wasn't sure how much I should write or if the description is enough. |
Yeah, but in general I cannot remember when I though "that Javadoc is really too extensive" 😉 Except if it's obsolete duplication like |
adds the following methods to JavaClass * `isTopLevelClass()` * `isMemberClass()` * `isAnonymousClass()` * `isLocalClass()` also adds `classes().that().` and `classes().should().` * `[are|be]TopLevelClasses()` * `[are|be]NestedClasses()` * `[are|be]MemberClasses()` * `[are|be]InnerClasses()` * `[are|be]AnonymousClasses()` * `[are|be]LocalClasses()` and their corresponding negations. The naming is based on the [Java Language Specification, chapter 8](https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html).
This PR adds the following methods to JavaClass
This PR also adds classes().that(). and classes().should().
and their corresponding negations.
The naming is based on the Java Language Specification, chapter 8.
Resolves #207