-
Notifications
You must be signed in to change notification settings - Fork 14
This checkin removes un-necessary code reported by findbugs, these ch… #66
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
Conversation
c214399 to
24fbd9a
Compare
|
This branch covers two stories: |
anubhavi25
left a comment
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.
Looks good for the most part 👍
| public final class SubjectResourceFixture { | ||
|
|
||
| private SubjectResourceFixture() { | ||
| //not called |
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.
best to throw an exception if construction is attempted by a method of this class:
throw new IllegalAccessError("Class is non-instantiable");
| </module> | ||
| <module name="EmptyStatement"/> | ||
| <module name="EqualsHashCode"/> | ||
| <module name="HiddenField"> |
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.
need to reach a consensus on whether or not to remove this CheckStyle rule.
d5b63c9 to
6af98fd
Compare
d2a3707 to
54bea11
Compare
| * | ||
| * @author 212338046 | ||
| */ | ||
| //CHECKSTYLE:OFF |
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 checkstyle is off here is it because it is a test?
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 probably add notes everywhere "CHECKSTYLE:OFF" and "CHECKSTYLE:ON" are used mentioning why we're doing so
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.
Checkstyle is off because these cucumber tests don't follow the naming conventions in checkstyle.
| Assert.assertNull(HttpServletRequestUtil.getSubdomain(hostname, domain)); | ||
| } | ||
|
|
||
| @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL") |
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 will have to remove @SuppressFBWarnings even though it means false positive from findbugs report since our black duck scan team is disallowing findBugs annotations usage in our code. I need to talk to Jeff from black duck scan team why they are disallowing findBugs annotation until then we will have to assume that findBugs annotations are dis-allowed.
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.
OK
| private LinkedHashSet<String> policySetsEvaluationOrder = EMPTY_POLICY_EVALUATION_ORDER; | ||
|
|
||
| public static LinkedHashSet<String> getEmptyPolicyEvaluationOrder() { | ||
| return EMPTY_POLICY_EVALUATION_ORDER; |
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 are passing access to private variable through this function, do we really want to do this?
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 remove this method since i'm removing LinkedHashSet in favor of the Set interface in another feature branch
pom.xml
Outdated
| <artifactId>jackson-databind</artifactId> | ||
| <!-- <version>${jackson.version}</version> --> | ||
| </dependency> | ||
| <dependency> |
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.
black ducks scan team at GE does not want us to use findBugs as dependency please remove it.
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.
OK
| } | ||
|
|
||
| abstract void delete(final String key); | ||
| abstract void delete(String key); |
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.
Can you please tell why are we removing the final keyword?
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.
@anurag-gujral "final" is redundant when used for parameters in abstract method signatures (since the concrete method should add "final")
| public interface SubjectRepository extends JpaRepository<SubjectEntity, Long> { | ||
|
|
||
| List<SubjectEntity> findByZone(final ZoneEntity zone); | ||
| List<SubjectEntity> findByZone(ZoneEntity zone); |
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.
at many places we are removing final keyword, can you please explain why?
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.
@anurag-gujral "final" is redundant when used for parameters in interface method signatures (since the concrete method should add "final")
| } | ||
|
|
||
| @SuppressWarnings("unused") | ||
| @SuppressFBWarnings(value = "DLS_DEAD_LOCAL_STORE") |
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.
Remove finbugs annotations
| @ApiModel(description = "Policy evaluation request for V1.") | ||
| public class PolicyEvaluationRequestV1 { | ||
| public static final LinkedHashSet<String> EMPTY_POLICY_EVALUATION_ORDER = new LinkedHashSet<String>(); | ||
| private static final LinkedHashSet<String> EMPTY_POLICY_EVALUATION_ORDER = new LinkedHashSet<String>(); |
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 revert this change since i'm removing LinkedHashSet in favor of the Set interface in another feature branch
…anges have been discussed with Sanjeev
… need to be run) Signed-off-by: Anurag <[email protected]>
f6d0897 to
c415ddc
Compare
…anges have been discussed with Sanjeev