//
//Source code recreated from a .class file by IntelliJ IDEA//(powered by Fernflower decompiler)//
packageorg.springframework.cglib.proxy;importjava.lang.reflect.InvocationTargetException;importjava.lang.reflect.Method;importorg.springframework.cglib.core.AbstractClassGenerator;importorg.springframework.cglib.core.CodeGenerationException;importorg.springframework.cglib.core.GeneratorStrategy;importorg.springframework.cglib.core.NamingPolicy;importorg.springframework.cglib.core.Signature;importorg.springframework.cglib.reflect.FastClass;importorg.springframework.cglib.reflect.FastClass.Generator;public classMethodProxy {privateSignature sig1;privateSignature sig2;privateMethodProxy.CreateInfo createInfo;private final Object initLock = newObject();private volatileMethodProxy.FastClassInfo fastClassInfo;public staticMethodProxy create(Class c1, Class c2, String desc, String name1, String name2) {
MethodProxy proxy= newMethodProxy();
proxy.sig1= newSignature(name1, desc);
proxy.sig2= newSignature(name2, desc);
proxy.createInfo= newMethodProxy.CreateInfo(c1, c2);returnproxy;
}private voidinit() {if (this.fastClassInfo == null) {synchronized(this.initLock) {if (this.fastClassInfo == null) {
MethodProxy.CreateInfo ci= this.createInfo;
MethodProxy.FastClassInfo fci= newMethodProxy.FastClassInfo();
fci.f1=helper(ci, ci.c1);
fci.f2=helper(ci, ci.c2);
fci.i1= fci.f1.getIndex(this.sig1);
fci.i2= fci.f2.getIndex(this.sig2);this.fastClassInfo =fci;this.createInfo = null;
}
}
}
}private staticFastClass helper(MethodProxy.CreateInfo ci, Class type) {
Generator g= newGenerator();
g.setType(type);
g.setClassLoader(ci.c2.getClassLoader());
g.setNamingPolicy(ci.namingPolicy);
g.setStrategy(ci.strategy);
g.setAttemptLoad(ci.attemptLoad);returng.create();
}privateMethodProxy() {
}publicSignature getSignature() {return this.sig1;
}publicString getSuperName() {return this.sig2.getName();
}public intgetSuperIndex() {this.init();return this.fastClassInfo.i2;
}
FastClass getFastClass() {this.init();return this.fastClassInfo.f1;
}
FastClass getSuperFastClass() {this.init();return this.fastClassInfo.f2;
}public staticMethodProxy find(Class type, Signature sig) {try{
Method m= type.getDeclaredMethod("CGLIB$findMethodProxy", MethodInterceptorGenerator.FIND_PROXY_TYPES);return (MethodProxy)m.invoke((Object)null, sig);
}catch(NoSuchMethodException var3) {throw new IllegalArgumentException("Class " + type + " does not use a MethodInterceptor");
}catch(IllegalAccessException var4) {throw newCodeGenerationException(var4);
}catch(InvocationTargetException var5) {throw newCodeGenerationException(var5);
}
}public Object invoke(Object obj, Object[] args) throwsThrowable {try{this.init();
MethodProxy.FastClassInfo fci= this.fastClassInfo;returnfci.f1.invoke(fci.i1, obj, args);
}catch(InvocationTargetException var4) {throwvar4.getTargetException();
}catch(IllegalArgumentException var5) {if (this.fastClassInfo.i1 < 0) {throw new IllegalArgumentException("Protected method: " + this.sig1);
}else{throwvar5;
}
}
}public Object invokeSuper(Object obj, Object[] args) throwsThrowable {try{this.init();
MethodProxy.FastClassInfo fci= this.fastClassInfo;returnfci.f2.invoke(fci.i2, obj, args);
}catch(InvocationTargetException var4) {throwvar4.getTargetException();
}
}private static classCreateInfo {
Class c1;
Class c2;
NamingPolicy namingPolicy;
GeneratorStrategy strategy;booleanattemptLoad;publicCreateInfo(Class c1, Class c2) {this.c1 =c1;this.c2 =c2;
AbstractClassGenerator fromEnhancer=AbstractClassGenerator.getCurrent();if (fromEnhancer != null) {this.namingPolicy =fromEnhancer.getNamingPolicy();this.strategy =fromEnhancer.getStrategy();this.attemptLoad =fromEnhancer.getAttemptLoad();
}
}
}private static classFastClassInfo {
FastClass f1;
FastClass f2;inti1;inti2;privateFastClassInfo() {
}
}
}