From cddaf60e672bb1e79498476a5ea9e4c3abba318a Mon Sep 17 00:00:00 2001 From: leaderli <429243408@qq.com> Date: Thu, 19 Dec 2024 15:21:27 +0800 Subject: [PATCH] sonar --- .../io/leaderli/litool/dom/parser/SaxEventInterceptor.java | 2 +- .../main/java/io/leaderli/litool/dom/sax/IgnoreSaxBean.java | 2 +- .../java/io/leaderli/litool/dom/sax/SaxBeanAdapter.java | 4 ++-- .../java/io/leaderli/litool/dom/sax/SaxEventHandler.java | 2 +- litool-dom/src/test/java/io/leaderli/litool/dom/NoBean.java | 2 +- .../java/io/leaderli/litool/runner/xml/EntryElement.java | 2 +- .../io/leaderli/litool/runner/xml/funcs/ParamElement.java | 2 +- .../litool/runner/xml/router/task/AssignElement.java | 2 +- .../litool/runner/xml/router/task/BaseEventElement.java | 2 +- .../leaderli/litool/runner/xml/router/task/TdElement.java | 2 +- .../src/main/java/io/leaderli/litool/test/LiMock.java | 6 +++--- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/litool-dom/src/main/java/io/leaderli/litool/dom/parser/SaxEventInterceptor.java b/litool-dom/src/main/java/io/leaderli/litool/dom/parser/SaxEventInterceptor.java index 4b5904b4..a8f5c87f 100644 --- a/litool-dom/src/main/java/io/leaderli/litool/dom/parser/SaxEventInterceptor.java +++ b/litool-dom/src/main/java/io/leaderli/litool/dom/parser/SaxEventInterceptor.java @@ -91,7 +91,7 @@ public T parse(InputStream xmlStream) { SaxBeanAdapter peek = saxBeanStack.peek(); assert peek != null; - peek.body((BodyEvent) saxEvent); + peek.setBody((BodyEvent) saxEvent); } else if (saxEvent instanceof EndEvent) { diff --git a/litool-dom/src/main/java/io/leaderli/litool/dom/sax/IgnoreSaxBean.java b/litool-dom/src/main/java/io/leaderli/litool/dom/sax/IgnoreSaxBean.java index 2cb701fb..579fe918 100644 --- a/litool-dom/src/main/java/io/leaderli/litool/dom/sax/IgnoreSaxBean.java +++ b/litool-dom/src/main/java/io/leaderli/litool/dom/sax/IgnoreSaxBean.java @@ -22,7 +22,7 @@ public void attribute(AttributeEvent attributeEvent) { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { // ignore } diff --git a/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxBeanAdapter.java b/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxBeanAdapter.java index bec4062f..44df7672 100644 --- a/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxBeanAdapter.java +++ b/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxBeanAdapter.java @@ -74,8 +74,8 @@ public void attribute(AttributeEvent attributeEvent) { } @Override - public void body(BodyEvent bodyEvent) { - parseErrorInvocationHandler(bodyEvent, origin::body); + public void setBody(BodyEvent bodyEvent) { + parseErrorInvocationHandler(bodyEvent, origin::setBody); } @Override diff --git a/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxEventHandler.java b/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxEventHandler.java index d1734637..165467f3 100644 --- a/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxEventHandler.java +++ b/litool-dom/src/main/java/io/leaderli/litool/dom/sax/SaxEventHandler.java @@ -122,7 +122,7 @@ default Lino complexField(Class parameterType, String value) { return ReflectUtil.newInstance(parameterType, value); } - default void body(BodyEvent bodyEvent) { + default void setBody(BodyEvent bodyEvent) { } diff --git a/litool-dom/src/test/java/io/leaderli/litool/dom/NoBean.java b/litool-dom/src/test/java/io/leaderli/litool/dom/NoBean.java index bff91f78..13771b3f 100644 --- a/litool-dom/src/test/java/io/leaderli/litool/dom/NoBean.java +++ b/litool-dom/src/test/java/io/leaderli/litool/dom/NoBean.java @@ -16,7 +16,7 @@ public NoBean() { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { this.body = bodyEvent.description(); } diff --git a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/EntryElement.java b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/EntryElement.java index 8a931510..ea66fc69 100644 --- a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/EntryElement.java +++ b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/EntryElement.java @@ -24,7 +24,7 @@ public EntryElement() { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { String description = bodyEvent.description(); diff --git a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/funcs/ParamElement.java b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/funcs/ParamElement.java index 45b1bc21..30a54185 100644 --- a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/funcs/ParamElement.java +++ b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/funcs/ParamElement.java @@ -20,7 +20,7 @@ public ParamElement() { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { String expr = bodyEvent.description(); this.expression = new Expression(expr); diff --git a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/AssignElement.java b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/AssignElement.java index 3de92599..42e784e0 100644 --- a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/AssignElement.java +++ b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/AssignElement.java @@ -44,7 +44,7 @@ public Lino complexField(Class parameterType, String value) { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { this.value = ExpressionUtil.getExpression(bodyEvent.description()); } } diff --git a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/BaseEventElement.java b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/BaseEventElement.java index dbaebccb..d1381919 100644 --- a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/BaseEventElement.java +++ b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/BaseEventElement.java @@ -35,7 +35,7 @@ public void setLongExpression(LongExpression longExpression) { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { String message = bodyEvent.description(); this.longExpression = new LongExpression(message); } diff --git a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/TdElement.java b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/TdElement.java index baf97a9b..116ca19f 100644 --- a/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/TdElement.java +++ b/litool-runner/src/main/java/io/leaderli/litool/runner/xml/router/task/TdElement.java @@ -27,7 +27,7 @@ public void setValue(List value) { } @Override - public void body(BodyEvent bodyEvent) { + public void setBody(BodyEvent bodyEvent) { String description = bodyEvent.description(); LiAssertUtil.assertTrue(description.matches(TD_VALUE_RULE), String.format("the td value %s is not match %s", description, TD_VALUE_RULE)); diff --git a/litool-test/src/main/java/io/leaderli/litool/test/LiMock.java b/litool-test/src/main/java/io/leaderli/litool/test/LiMock.java index 7b21b818..5420c2ee 100644 --- a/litool-test/src/main/java/io/leaderli/litool/test/LiMock.java +++ b/litool-test/src/main/java/io/leaderli/litool/test/LiMock.java @@ -34,13 +34,13 @@ private Skip() { /** * 用于标记跳过mock */ - public static Skip SKIP_MARK = new Skip(); + public static final Skip SKIP_MARK = new Skip(); public static final Map, byte[]> originClasses = new HashMap<>(); public static final ByteBuddy byteBuddy = new ByteBuddy(); - public static Instrumentation instrumentation = ByteBuddyAgent.install(); - public static ClassPool classPool = ClassPool.getDefault(); + public static final Instrumentation instrumentation = ByteBuddyAgent.install(); + public static final ClassPool classPool = ClassPool.getDefault(); public final static boolean jacoco; static {