Skip to content

Commit

Permalink
suppress expected spotbugs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
clormor committed Aug 13, 2019
1 parent 2744964 commit cf420bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ plugins {
id 'java'
id 'jacoco'
id "com.github.spotbugs" version "2.0.0"
//id 'findbugs'
id 'eclipse'
id 'idea'
id 'maven'
Expand Down Expand Up @@ -41,6 +40,7 @@ repositories {

dependencies {
compile "com.google.guava:guava:$guavaVersion"
compile "com.github.spotbugs:spotbugs-annotations:$spotbugsVersion"
testCompile "junit:junit:$junitVersion"
}

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ version = 0.1.2-SNAPSHOT
guavaVersion = 27.0.1-jre
immutablesVersion = 2.7.5
junitVersion = 4.12
spotbugsVersion = 3.1.12

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.github.clormor.hackerrank.advanced;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.lang.reflect.Method;
import java.util.Arrays;

Expand Down Expand Up @@ -27,15 +29,17 @@ static class Inner {

class Private {

@SuppressFBWarnings
private boolean powerOf2(int n) {
if (n == 1) {
if (n == 1 || n == 2) {
return true;
}
do {
while (n > 1) {
n /= 2;
if (n == 2) {
return true;
}
} while ((n /= 2) > 1);
}
return false;
}
}
Expand Down

0 comments on commit cf420bc

Please sign in to comment.