-
Notifications
You must be signed in to change notification settings - Fork 0
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
test: test for the agent added #17
Conversation
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.
Left some comments. Major problem is that getSBOM
is not tested properly.
Co-authored-by: Aman Sharma <[email protected]>
Co-authored-by: Aman Sharma <[email protected]>
} | ||
|
||
private boolean isAdditionalMethodPresent(ClassReader classReader) { | ||
final boolean[] methodPresent = {false}; |
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.
why is this a boolean[]
? I think it can be be simply boolean
.
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.
I used the array because it is in an inner class and it requires a final variable. But If the variable is final I cannot change its value from false to true. Using the array I can declare it final and also modify it. But if you think it is better not to use an array, I can declare a boolean as a class-level field.
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.
I can declare a boolean as a class-level field.
That would be a good coding practice. To declare it as a private
field.
|
||
private boolean isAdditionalMethodInvoked(ClassReader classReader) { | ||
final boolean[] methodInvoked = {false}; | ||
classReader.accept(new ClassVisitor(Opcodes.ASM9) { |
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.
Same here.
This test include: