From 7e5fde2f0c4a98293b49f80440d68b6fa5ec10ef Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 27 May 2024 16:18:54 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20TypeReference<>=20generic=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/adds/core/spring/aop/TraceLoggerAspect.java | 2 +- .../inf/iros/service/bean/InfIrosServiceBean.java | 2 +- .../inf/nims/service/bean/InfNimsServiceBean.java | 12 ++++++------ .../java/cokr/xit/adds/inf/iros/IrosRestfulTest.java | 3 +-- .../xit/adds/inf/mois/model/ExchangeDtoTest.java | 4 ++-- .../xit/adds/inf/mois/model/ExchangepackDtoTest.java | 2 +- .../cokr/xit/adds/inf/mois/model/PackDtoTest.java | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/main/java/cokr/xit/adds/core/spring/aop/TraceLoggerAspect.java b/src/main/java/cokr/xit/adds/core/spring/aop/TraceLoggerAspect.java index ea519c9..0b04d6b 100644 --- a/src/main/java/cokr/xit/adds/core/spring/aop/TraceLoggerAspect.java +++ b/src/main/java/cokr/xit/adds/core/spring/aop/TraceLoggerAspect.java @@ -117,7 +117,7 @@ public class TraceLoggerAspect { HttpServletRequest request = attributes != null? attributes.getRequest(): null; //traceApiLogging(JsonUtils.toObjByObj(pjp.getArgs()[0], JSONObject.class), request); - traceApiLogging(json.parse(json.stringify(pjp.getArgs()[0]), new TypeReference() {}), request); + traceApiLogging(json.parse(json.stringify(pjp.getArgs()[0]), new TypeReference<>() {}), request); Object result = pjp.proceed(); //noinspection rawtypes diff --git a/src/main/java/cokr/xit/adds/inf/iros/service/bean/InfIrosServiceBean.java b/src/main/java/cokr/xit/adds/inf/iros/service/bean/InfIrosServiceBean.java index bbebb78..c8ba5ff 100644 --- a/src/main/java/cokr/xit/adds/inf/iros/service/bean/InfIrosServiceBean.java +++ b/src/main/java/cokr/xit/adds/inf/iros/service/bean/InfIrosServiceBean.java @@ -77,7 +77,7 @@ public class InfIrosServiceBean extends AbstractServiceBean implements InfIrosSe String rslt = ApiUtil.callIrosApi(irosUrl + drugPrdtMcpnDtlInq, params); IrosResponse result = null; try { - result = json.parse(rslt, new TypeReference>() {}); + result = json.parse(rslt, new TypeReference<>() {}); } catch (Exception e) { if(!isEmpty(e.getCause())){ diff --git a/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java b/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java index 5b995a2..d707a90 100644 --- a/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java +++ b/src/main/java/cokr/xit/adds/inf/nims/service/bean/InfNimsServiceBean.java @@ -86,7 +86,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null); String rslt = ApiUtil.callNimsApi(nimsUrl + bsshInfoStV1, dto); - NimsApiResult result = json.parse(rslt, new TypeReference>() {}); + NimsApiResult result = json.parse(rslt, new TypeReference<>() {}); return result.getResponse(); } @@ -98,7 +98,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null); String rslt = ApiUtil.callNimsApi(nimsUrl + productinfoKd, dto); - NimsApiResult result = json.parse(rslt, new TypeReference>() {}); + NimsApiResult result = json.parse(rslt, new TypeReference<>() {}); return result.getResponse(); } @@ -110,7 +110,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe if(!isEmpty(dto.getYmd())) ApiUtil.checkYmdError(dto.getYmd(), null); String rslt = ApiUtil.callNimsApi(nimsUrl + seqinfo, dto); - NimsApiResult result = json.parse(rslt, new TypeReference>() {}); + NimsApiResult result = json.parse(rslt, new TypeReference<>() {}); return result.getResponse(); } @@ -125,7 +125,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe // } // // String rslt = ApiUtil.callNimsApi(nimsUrl + officeinfo, dto); - // NimsApiResult result = json.parse(rslt, new TypeReference>() {}); + // NimsApiResult result = json.parse(rslt, new TypeReference<>() {}); // return result.getResponse(); // } // @@ -142,7 +142,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe // } // // String rslt = ApiUtil.callNimsApi(nimsUrl + placeinfoV1, dto); - // NimsApiResult result = json.parse(rslt, new TypeReference>() {}); + // NimsApiResult result = json.parse(rslt, new TypeReference<>() {}); // return result.getResponse(); // } @@ -155,7 +155,7 @@ public class InfNimsServiceBean extends AbstractServiceBean implements InfNimsSe ApiUtil.checkYmdError(dto.getEdt(), "edt"); //String rslt = ApiUtil.callNimsApi(nimsUrl + reportinfo, dto); - //NimsApiResult result = json.parse(rslt, new TypeReference>() {}); + //NimsApiResult result = json.parse(rslt, new TypeReference<>() {}); //return result.getResponse(); return getDsuseRptResponse(); diff --git a/src/test/java/cokr/xit/adds/inf/iros/IrosRestfulTest.java b/src/test/java/cokr/xit/adds/inf/iros/IrosRestfulTest.java index 6ff03fb..5dd61a4 100644 --- a/src/test/java/cokr/xit/adds/inf/iros/IrosRestfulTest.java +++ b/src/test/java/cokr/xit/adds/inf/iros/IrosRestfulTest.java @@ -63,8 +63,7 @@ public class IrosRestfulTest { request.uri(uri + urlParam); }); - IrosResponse parse = new JSON().parse(rslt.body(), - new TypeReference>() { + IrosResponse parse = new JSON().parse(rslt.body(), new TypeReference<>() { }); System.out.println(parse); diff --git a/src/test/java/cokr/xit/adds/inf/mois/model/ExchangeDtoTest.java b/src/test/java/cokr/xit/adds/inf/mois/model/ExchangeDtoTest.java index 6b57d8e..2e2a650 100644 --- a/src/test/java/cokr/xit/adds/inf/mois/model/ExchangeDtoTest.java +++ b/src/test/java/cokr/xit/adds/inf/mois/model/ExchangeDtoTest.java @@ -193,7 +193,7 @@ public class ExchangeDtoTest { XML xml = new XML(); //ApiUtil.validateXmlFromXmlStr(content, "src/main/resources/xsd/pack.xsd"); - ExchangeDto dto2 = xml.parse(content, new TypeReference() {}); + ExchangeDto dto2 = xml.parse(content, new TypeReference<>() {}); log.info("dto: {}", dto2); xml.write(System.out, dto2, true); @@ -226,7 +226,7 @@ public class ExchangeDtoTest { XML xml = new XML(); //ApiUtil.validateXmlFromXmlStr(content, "src/main/resources/xsd/pack.xsd"); - ExchangeDto dto2 = xml.parse(content, new TypeReference() {}); + ExchangeDto dto2 = xml.parse(content, new TypeReference<>() {}); log.info("dto: {}", dto2); xml.write(System.out, dto2, true); diff --git a/src/test/java/cokr/xit/adds/inf/mois/model/ExchangepackDtoTest.java b/src/test/java/cokr/xit/adds/inf/mois/model/ExchangepackDtoTest.java index c90033e..dff7aec 100644 --- a/src/test/java/cokr/xit/adds/inf/mois/model/ExchangepackDtoTest.java +++ b/src/test/java/cokr/xit/adds/inf/mois/model/ExchangepackDtoTest.java @@ -87,7 +87,7 @@ public class ExchangepackDtoTest { // xmlMapper.writeValue(System.out, dto); XML xml = new XML(); - ExchangepackDto dto = xml.parse(exchangeXml, new TypeReference() {}); + ExchangepackDto dto = xml.parse(exchangeXml, new TypeReference<>() {}); log.info("dto: {}", dto); xml.write(System.out, dto, true); } diff --git a/src/test/java/cokr/xit/adds/inf/mois/model/PackDtoTest.java b/src/test/java/cokr/xit/adds/inf/mois/model/PackDtoTest.java index 9ae5e2e..4345c4d 100644 --- a/src/test/java/cokr/xit/adds/inf/mois/model/PackDtoTest.java +++ b/src/test/java/cokr/xit/adds/inf/mois/model/PackDtoTest.java @@ -53,7 +53,7 @@ public class PackDtoTest { String content = new String(bytes); ApiUtil.validateXmlFromXmlStr(content, "src/main/resources/xsd/pack.xsd"); - PackDto dto = xml.parse(content, new TypeReference() {}); + PackDto dto = xml.parse(content, new TypeReference<>() {}); log.info("dto: {}", dto); xml.write(System.out, dto, true);