From d36c1e425e3554b2ee01dd67e73bc90787b03d58 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 21 Mar 2018 21:17:16 -0700 Subject: [PATCH] Clean up compiler warnings. --- .../tests/mock/MockGemFireObjectsSupport.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/springframework/data/gemfire/tests/mock/MockGemFireObjectsSupport.java b/src/main/java/org/springframework/data/gemfire/tests/mock/MockGemFireObjectsSupport.java index 7949186..6d0deea 100644 --- a/src/main/java/org/springframework/data/gemfire/tests/mock/MockGemFireObjectsSupport.java +++ b/src/main/java/org/springframework/data/gemfire/tests/mock/MockGemFireObjectsSupport.java @@ -714,7 +714,7 @@ public abstract class MockGemFireObjectsSupport extends MockObjectsSupport { .map(RegionAttributes::getEntryTimeToLive).orElse(DEFAULT_EXPIRATION_ATTRIBUTES)); AtomicReference evictionAttributes = new AtomicReference<>(optionalRegionAttributes - .map(RegionAttributes::getEvictionAttributes).orElseGet(() -> EvictionAttributes.createLRUEntryAttributes())); + .map(RegionAttributes::getEvictionAttributes).orElseGet(EvictionAttributes::createLRUEntryAttributes)); AtomicReference> keyConstraint = new AtomicReference<>(optionalRegionAttributes .map(RegionAttributes::getKeyConstraint).orElse(null)); @@ -1544,7 +1544,7 @@ public abstract class MockGemFireObjectsSupport extends MockObjectsSupport { .map(RegionAttributes::getEntryTimeToLive).orElse(DEFAULT_EXPIRATION_ATTRIBUTES)); AtomicReference evictionAttributes = new AtomicReference<>(optionalRegionAttributes - .map(RegionAttributes::getEvictionAttributes).orElseGet(() -> EvictionAttributes.createLRUEntryAttributes())); + .map(RegionAttributes::getEvictionAttributes).orElseGet(EvictionAttributes::createLRUEntryAttributes)); AtomicReference> keyConstraint = new AtomicReference<>(optionalRegionAttributes .map(RegionAttributes::getKeyConstraint).orElse(null)); @@ -1568,7 +1568,7 @@ public abstract class MockGemFireObjectsSupport extends MockObjectsSupport { .map(RegionAttributes::getScope).orElse(Scope.DISTRIBUTED_NO_ACK)); AtomicReference subscriptionAttributes = new AtomicReference<>(optionalRegionAttributes - .map(RegionAttributes::getSubscriptionAttributes).orElseGet(() -> new SubscriptionAttributes())); + .map(RegionAttributes::getSubscriptionAttributes).orElseGet(SubscriptionAttributes::new)); AtomicReference> valueConstraint = new AtomicReference<>(optionalRegionAttributes .map(RegionAttributes::getValueConstraint).orElse(null)); @@ -1743,14 +1743,12 @@ public abstract class MockGemFireObjectsSupport extends MockObjectsSupport { AtomicReference criticalHeapPercentage = new AtomicReference<>(ResourceManager.DEFAULT_CRITICAL_PERCENTAGE); - AtomicReference criticalOffHeapPercentage = - new AtomicReference<>(ResourceManager.DEFAULT_CRITICAL_PERCENTAGE); + AtomicReference criticalOffHeapPercentage = new AtomicReference<>(0.0f); AtomicReference evictionHeapPercentage = new AtomicReference<>(ResourceManager.DEFAULT_EVICTION_PERCENTAGE); - AtomicReference evictionOffHeapPercentage = - new AtomicReference<>(ResourceManager.DEFAULT_EVICTION_PERCENTAGE); + AtomicReference evictionOffHeapPercentage = new AtomicReference<>(0.0f); doAnswer(newSetter(criticalHeapPercentage, null)) .when(mockResourceManager).setCriticalHeapPercentage(anyFloat());