Code tidy after code inspections

This commit is contained in:
Peter Lawrey
2018-04-21 17:41:31 +01:00
parent 9323cf28a7
commit e7c7dd8975
9 changed files with 23 additions and 31 deletions
@@ -198,9 +198,7 @@ interface AbstractChronicleMap<K, V> extends ChronicleMap<K, V> {
}
return v != null && c.value().equals(c.context().wrapValueAsData(v));
});
} catch (ClassCastException unused) {
return false;
} catch (NullPointerException unused) {
} catch (ClassCastException | NullPointerException unused) {
return false;
}
}
@@ -43,9 +43,7 @@ class ChronicleMapEntrySet<K, V> extends AbstractSet<Map.Entry<K, V>> {
try {
V v = map.get(e.getKey());
return v != null && v.equals(e.getValue());
} catch (ClassCastException ex) {
return false;
} catch (NullPointerException ex) {
} catch (ClassCastException | NullPointerException ex) {
return false;
}
}
@@ -58,9 +56,7 @@ class ChronicleMapEntrySet<K, V> extends AbstractSet<Map.Entry<K, V>> {
Object key = e.getKey();
Object value = e.getValue();
return map.remove(key, value);
} catch (ClassCastException ex) {
return false;
} catch (NullPointerException ex) {
} catch (ClassCastException | NullPointerException ex) {
return false;
}
}
@@ -544,7 +544,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
// lambda is used instead of constructor reference because currently stage-compiler
// has issues with parsing method/constructor refs.
// TODO replace with constructor ref when stage-compiler is improved
(c, m) -> new CompiledReplicatedMapQueryContext<K, V, R>(c, m), this);
CompiledReplicatedMapQueryContext::new, this);
}
/**
@@ -575,7 +575,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
// lambda is used instead of constructor reference because currently stage-compiler
// has issues with parsing method/constructor refs.
// TODO replace with constructor ref when stage-compiler is improved
(c, m) -> new CompiledReplicatedMapIterationContext<K, V, R>(c, m), this);
CompiledReplicatedMapIterationContext::new, this);
}
@Override
@@ -22,7 +22,7 @@ import net.openhft.chronicle.values.*;
interface ReplicatedGlobalMutableState extends VanillaGlobalMutableState {
public static void main(String[] args) {
static void main(String[] args) {
System.setProperty("chronicle.values.dumpCode", "true");
Values.nativeClassFor(ReplicatedGlobalMutableState.class);
}
@@ -342,7 +342,7 @@ public class VanillaChronicleMap<K, V, R>
// lambda is used instead of constructor reference because currently stage-compiler
// has issues with parsing method/constructor refs.
// TODO replace with constructor ref when stage-compiler is improved
(c, m) -> new CompiledMapQueryContext<K, V, R>(c, m), this);
CompiledMapQueryContext::new, this);
}
final ChainingInterface i() {
@@ -385,7 +385,7 @@ public class VanillaChronicleMap<K, V, R>
// lambda is used instead of constructor reference because currently stage-compiler
// has issues with parsing method/constructor refs.
// TODO replace with constructor ref when stage-compiler is improved
(c, m) -> new CompiledMapIterationContext<K, V, R>(c, m), this);
CompiledMapIterationContext::new, this);
}
@Override