Skip to content

Commit

Permalink
Update ASMAccessorOptimizer.java
Browse files Browse the repository at this point in the history
There is a bug:
((int) Math.random() * 100) ==0 it did not play the role of random numbers,
when confronted with a large amount of concurrency,it throwed an exception:
java.lang.LinkageError: loader (instance of  org/mvel2/optimizers/dynamic/DynamicClassLoader): attempted  duplicate class definition for name: "ASMAccessorImpl_18581126171481266284560"
  • Loading branch information
wangnk authored Jan 7, 2017
1 parent 5dc9fe3 commit eea5b7a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private void _initJIT() {
synchronized (Runtime.getRuntime()) {
cw.visit(OPCODES_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className = "ASMAccessorImpl_"
+ valueOf(cw.hashCode()).replaceAll("\\-", "_") + (System.currentTimeMillis() / 10) +
((int) Math.random() * 100),
((int) (Math.random() * 100)),
null, "java/lang/Object", new String[]{NAMESPACE + "compiler/Accessor"});
}

Expand Down Expand Up @@ -235,7 +235,7 @@ private void _initJIT2() {
synchronized (Runtime.getRuntime()) {
cw.visit(OPCODES_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className = "ASMAccessorImpl_"
+ valueOf(cw.hashCode()).replaceAll("\\-", "_") + (System.currentTimeMillis() / 10) +
((int) Math.random() * 100),
((int) (Math.random() * 100)),
null, "java/lang/Object", new String[]{NAMESPACE + "compiler/Accessor"});
}

Expand Down

0 comments on commit eea5b7a

Please sign in to comment.