From 4106f50a2b36fb292fd9cc356cf309b2ff1ccc9e Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 28 十一月 2023 17:55:57 +0800 Subject: [PATCH] 解决Controller输出json时未采用fastjson2,原因是FastJsonConfig未实现指定接口。在解决问题过程中发现一些依赖可以排除掉 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java index cfa77d5..13114af 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java @@ -4,7 +4,7 @@ import org.apache.logging.log4j.Logger; /** - * 闃熷垪锛屽厛杩涘厛鍑� + * 闃熷垪锛屽厛杩涘厛鍑猴紝闈炵嚎绋嬪畨鍏� */ public class Queue { @SuppressWarnings("unfinal") @@ -62,6 +62,7 @@ */ @SuppressWarnings("unused") public void pushHead(NodeObj obj)throws Exception{ + //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 synchronized(synObj){ if(obj == null){ return ; @@ -89,6 +90,7 @@ * @param obj 鍏ュ垪鐨勫璞� */ public void pushTail(NodeObj obj)throws Exception{ + //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 synchronized(synObj){ if(obj == null){ return ; @@ -116,6 +118,7 @@ * @return 鍑哄垪瀵硅薄 */ public NodeObj pop(){ + //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 synchronized(synObj){ NodeObj obj = null ; if(this.size > 0){ @@ -139,11 +142,14 @@ */ @SuppressWarnings("unused") public Node getFirstNode(){ - Node node = this.head.next ; - if(node != this.tail){ - return node ; + //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 + synchronized(synObj) { + Node node = this.head.next; + if (node != this.tail) { + return node; + } + return null; } - return null ; } /** * 寰楀埌鏈�鍚庝竴涓妭鐐癸紝浣嗕笉鎶婅妭鐐逛粠闃熷垪涓竻闄� @@ -151,11 +157,14 @@ */ @SuppressWarnings("unused") public Node getLastNode(){ - Node node = this.tail.pre ; - if(node != this.head){ - return node ; + //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 + synchronized(synObj) { + Node node = this.tail.pre; + if (node != this.head) { + return node; + } + return null; } - return null ; } /** -- Gitblit v1.8.0