Skip to content
This repository has been archived by the owner on Nov 13, 2018. It is now read-only.

Adding bug to be caught by sonar #2

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/java/com/bakdata/ignite/hbase/HBaseCacheStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import javax.annotation.Nonnull;
import javax.cache.Cache.Entry;
import javax.cache.CacheException;
import javax.cache.integration.CacheLoaderException;
Expand Down Expand Up @@ -123,7 +124,7 @@ public Map<K, V> loadAll(Iterable<? extends K> keys) throws CacheLoaderException
*/
@Override
public void loadCache(IgniteBiInClosure<K, V> clo, Object... args) throws CacheLoaderException {
Scan scan = createScan(args);
Scan scan = null;//createScan(args);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR This block of commented-out lines of code should be removed. rule

Map<K, V> values = scan(scan);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Parameter 1 to this call is marked "javax.annotation.Nonnull" but null is passed. rule

values.forEach(clo::apply);
}
Expand Down Expand Up @@ -254,7 +255,7 @@ private Scan createScan(Object[] args) {
return scan;
}

private Map<K, V> scan(Scan scan) {
private Map<K, V> scan(@Nonnull Scan scan) {
try (ResultScanner scanner = table().getScanner(scan)) {
return resultsToMap(scanner);
} catch (IOException | IllegalStateException e) {
Expand Down