Skip to content

Commit

Permalink
DUBBO-635 JValidator在类名生成的类名有$,有frozen class异常
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Mar 17, 2013
1 parent 841f6c2 commit e4dea02
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public JValidator(URL url) {
}

public void validate(String methodName, Class<?>[] parameterTypes, Object[] arguments) throws Exception {
String methodClassName = clazz.getName() + "$" + toUpperMethoName(methodName);
String methodClassName = clazz.getName() + "_" + toUpperMethoName(methodName);
Class<?> methodClass = null;
try {
methodClass = Class.forName(methodClassName, false, Thread.currentThread().getContextClassLoader());
Expand Down Expand Up @@ -157,7 +157,7 @@ private static Object getMethodParameterBean(Class<?> clazz, Method method, Obje
try {
String upperName = toUpperMethoName(method.getName());
String parameterSimpleName = upperName + "Parameter";
String parameterClassName = clazz.getName() + "$" + parameterSimpleName;
String parameterClassName = clazz.getName() + "_" + parameterSimpleName;
Class<?> parameterClass;
try {
parameterClass = (Class<?>) Class.forName(parameterClassName, true, clazz.getClassLoader());
Expand Down

2 comments on commit e4dea02

@mrfsong363
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ -> _后,@interface生成的内部类无法加载、导致Bean validator无法正常校验

@xfbxag
Copy link

@xfbxag xfbxag commented on e4dea02 Sep 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

怎么解决?

Please sign in to comment.