#984 local variable inference changes (#1025)

* #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices

* #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices
This commit is contained in:
Anurag870
2019-10-20 21:31:02 +05:30
committed by Ilkka Seppälä
parent 2217fbc5ff
commit f00ebe1a8d
12 changed files with 33 additions and 52 deletions

View File

@ -61,7 +61,7 @@ public abstract class AbstractDocument implements Document {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
var builder = new StringBuilder();
builder.append(getClass().getName()).append("[");
properties.forEach((key, value) -> builder.append("[").append(key).append(" : ").append(value).append("]"));
builder.append("]");

View File

@ -24,7 +24,6 @@ package com.iluwatar.abstractdocument;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -52,23 +51,23 @@ public class App {
public App() {
LOGGER.info("Constructing parts and car");
Map<String, Object> carProperties = new HashMap<>();
var carProperties = new HashMap<String, Object>();
carProperties.put(Property.MODEL.toString(), "300SL");
carProperties.put(Property.PRICE.toString(), 10000L);
Map<String, Object> wheelProperties = new HashMap<>();
var wheelProperties = new HashMap<String, Object>();
wheelProperties.put(Property.TYPE.toString(), "wheel");
wheelProperties.put(Property.MODEL.toString(), "15C");
wheelProperties.put(Property.PRICE.toString(), 100L);
Map<String, Object> doorProperties = new HashMap<>();
var doorProperties = new HashMap<String, Object>();
doorProperties.put(Property.TYPE.toString(), "door");
doorProperties.put(Property.MODEL.toString(), "Lambo");
doorProperties.put(Property.PRICE.toString(), 300L);
carProperties.put(Property.PARTS.toString(), Arrays.asList(wheelProperties, doorProperties));
Car car = new Car(carProperties);
var car = new Car(carProperties);
LOGGER.info("Here is our car:");
LOGGER.info("-> model: {}", car.getModel().get());