Java 16 migration for Geode examples.

See #606.
This commit is contained in:
Mark Paluch
2021-04-29 11:16:44 +02:00
parent 88aabe89e2
commit 6913f7ec5f
29 changed files with 74 additions and 70 deletions

View File

@@ -57,12 +57,12 @@ public class StorageServer {
}
private void createOrders(ProductRepository productRepository, OrderRepository orderRepository) {
Random random = new Random(System.nanoTime());
Address address = new Address("it", "doesn't", "matter");
var random = new Random(System.nanoTime());
var address = new Address("it", "doesn't", "matter");
LongStream.rangeClosed(1, 10).forEach((orderId) -> LongStream.rangeClosed(1, 300).forEach((customerId) -> {
Order order = new Order(orderId, customerId, address);
var order = new Order(orderId, customerId, address);
IntStream.rangeClosed(0, random.nextInt(3) + 1).forEach((lineItemCount) -> {
int quantity = random.nextInt(3) + 1;
var quantity = random.nextInt(3) + 1;
long productId = random.nextInt(3) + 1;
order.add(new LineItem(productRepository.findById(productId).get(), quantity));
});
@@ -73,7 +73,7 @@ public class StorageServer {
private void createProducts(ProductRepository productRepository) {
productRepository.save(new Product(1L, "Apple iPod", new BigDecimal("99.99"), "An Apple portable music player"));
productRepository.save(new Product(2L, "Apple iPad", new BigDecimal("499.99"), "An Apple tablet device"));
Product macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer");
var macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer");
macbook.addAttribute("warranty", "included");
productRepository.save(macbook);
}

View File

@@ -56,7 +56,7 @@ public class StorageServerTests {
assertThat(customers.getAttributes().getCompressor()).isInstanceOf(SnappyCompressor.class);
GemFireCacheImpl impl = (GemFireCacheImpl) cache;
var impl = (GemFireCacheImpl) cache;
assertThat(impl.getCachePerfStats().getTotalPostCompressedBytes())
.isLessThan(impl.getCachePerfStats().getTotalPreCompressedBytes());