#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

@ -50,7 +50,7 @@ public class Aggregator {
*/
@RequestMapping(path = "/product", method = RequestMethod.GET)
public Product getProduct() {
Product product = new Product();
var product = new Product();
product.setTitle(informationClient.getProductTitle());
product.setProductInventories(inventoryClient.getProductInventories());
return product;

View File

@ -43,10 +43,10 @@ public class ProductInformationClientImpl implements ProductInformationClient {
@Override
public String getProductTitle() {
String response = null;
HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51515/information")).build();
HttpClient client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51515/information")).build();
var client = HttpClient.newHttpClient();
try {
HttpResponse<String> httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
var httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
response = httpResponse.body();
} catch (IOException ioe) {
LOGGER.error("IOException Occurred", ioe);

View File

@ -42,12 +42,12 @@ public class ProductInventoryClientImpl implements ProductInventoryClient {
@Override
public int getProductInventories() {
String response = "0";
var response = "0";
HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51516/inventories")).build();
HttpClient client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51516/inventories")).build();
var client = HttpClient.newHttpClient();
try {
HttpResponse<String> httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
var httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
response = httpResponse.body();
} catch (IOException ioe) {
LOGGER.error("IOException Occurred", ioe);