代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/resteasy 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 7dcc7b2e7938433b8edea3ce9ada867532beb236 Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 9 Jun 2021 17:25:36 +0800
Subject: [PATCH] 2
---
.../core/StringParameterInjector.java | 23 ++++++++++++++-----
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/StringParameterInjector.java b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/StringParameterInjector.java
index b7178f6..537ae0d 100755
--- a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/StringParameterInjector.java
+++ b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/StringParameterInjector.java
@@ -15,6 +15,7 @@ import javax.ws.rs.WebApplicationException;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.RuntimeDelegate;
+import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
@@ -24,6 +25,8 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -298,7 +301,7 @@ public class StringParameterInjector
catch (Exception e)
{
LogMessages.LOGGER.unableToExtractParameter(e, getParamSignature(), strVal, target);
- throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), strVal), e);
+ throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), _encode(strVal)), e);
}
if (paramConverter != null)
{
@@ -325,12 +328,12 @@ public class StringParameterInjector
catch (InstantiationException e)
{
LogMessages.LOGGER.unableToExtractParameter(e, getParamSignature(), strVal, target);
- throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), strVal), e);
+ throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), _encode(strVal)), e);
}
catch (IllegalAccessException e)
{
LogMessages.LOGGER.unableToExtractParameter(e, getParamSignature(), strVal, target);
- throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), strVal), e);
+ throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), _encode(strVal)), e);
}
catch (InvocationTargetException e)
{
@@ -340,7 +343,7 @@ public class StringParameterInjector
throw ((WebApplicationException)targetException);
}
LogMessages.LOGGER.unableToExtractParameter(targetException, getParamSignature(), strVal, target);
- throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), strVal), targetException);
+ throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), _encode(strVal)), targetException);
}
}
else if (valueOf != null)
@@ -352,7 +355,7 @@ public class StringParameterInjector
catch (IllegalAccessException e)
{
LogMessages.LOGGER.unableToExtractParameter(e, getParamSignature(), strVal, target);
- throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), strVal), e);
+ throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), _encode(strVal)), e);
}
catch (InvocationTargetException e)
{
@@ -362,12 +365,20 @@ public class StringParameterInjector
throw ((WebApplicationException)targetException);
}
LogMessages.LOGGER.unableToExtractParameter(targetException, getParamSignature(), strVal, target);
- throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), strVal), targetException);
+ throwProcessingException(Messages.MESSAGES.unableToExtractParameter(getParamSignature(), _encode(strVal)), targetException);
}
}
return null;
}
+ private String _encode(String strVal) {
+ try {
+ return URLEncoder.encode(strVal, StandardCharsets.UTF_8.toString());
+ } catch (UnsupportedEncodingException e) {
+ return e.getMessage();
+ }
+ }
+
protected void throwProcessingException(String message, Throwable cause)
{
throw new BadRequestException(message, cause);
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。