diff --git a/src/main/java/dev/nmarulo/depensaapp/ServletInitializer.java b/src/main/java/dev/nmarulo/depensaapp/ServletInitializer.java index 65009cb..3ad7be7 100644 --- a/src/main/java/dev/nmarulo/depensaapp/ServletInitializer.java +++ b/src/main/java/dev/nmarulo/depensaapp/ServletInitializer.java @@ -1,21 +1,20 @@ package dev.nmarulo.depensaapp; -import java.util.HashMap; -import java.util.Map; -import java.net.URL; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ConcurrentSkipListMap; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; -public class ServletInitializer extends SpringBootServletInitializer { +import java.net.URL; +import java.util.HashMap; +public class ServletInitializer extends SpringBootServletInitializer { + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - Integer.valueOf(3).compareTo(2); + Integer.valueOf(3) + .compareTo(2); new Integer(3).compareTo(2); HashMap hits = new HashMap<>(); - for (HashMap.Entry e : hits) { + for (HashMap.Entry e : hits.entrySet()) { // ... This can become very slow for larger hashmaps of URLS. } String x = "foo"; @@ -24,15 +23,15 @@ protected SpringApplicationBuilder configure(SpringApplicationBuilder applicatio } Integer value = 1; try { - // ... + // ... } catch (Exception e) { - // ... + // ... value = null; // Value set to null within a catch block - // ... + // ... } //value.member += 1; - + return application.sources(DespensaRestApiApplication.class); } - + } diff --git a/src/main/java/dev/nmarulo/depensaapp/commons/gson/GsonUtil.java b/src/main/java/dev/nmarulo/depensaapp/commons/gson/GsonUtil.java index f213cae..0e21cd8 100644 --- a/src/main/java/dev/nmarulo/depensaapp/commons/gson/GsonUtil.java +++ b/src/main/java/dev/nmarulo/depensaapp/commons/gson/GsonUtil.java @@ -1,21 +1,20 @@ package dev.nmarulo.depensaapp.commons.gson; -import java.util.HashMap; -import java.util.Map; -import java.net.URL; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.ConcurrentSkipListMap; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import lombok.RequiredArgsConstructor; import org.springframework.core.ResolvableType; import org.springframework.stereotype.Component; +import java.net.URL; +import java.util.HashMap; import java.util.List; @Component @RequiredArgsConstructor public class GsonUtil { + // -- + // -- private final Gson gson; @@ -27,11 +26,12 @@ public R convertTo(Object object, Class clazz) { if (isList) { return fromJsonTo(json, TypeToken.getParameterized(List.class, clazz)); } - - Integer.valueOf(3).compareTo(2); + + Integer.valueOf(3) + .compareTo(2); new Integer(3).compareTo(2); HashMap hits = new HashMap<>(); - for (HashMap.Entry e : hits) { + for (HashMap.Entry e : hits.entrySet()) { // ... This can become very slow for larger hashmaps of URLS. } String x = "foo";