Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta-1
-
Fix Version/s: 1.1-beta-2
-
Component/s: groovy-jdk
-
Labels:None
-
Environment:Windows XP SP2 / Sun JDK1.5..0_09
-
Testcase included:yes
-
Number of attachments :
Description
NullPointerException is always thrown when running the two scripts in multiple threads with the same GroovyScriptEngine instance.
Besides the NPE,the result is not correct sometime.
Here is a wrong result:
java.lang.NullPointerException
at groovy.util.GroovyScriptEngine$ScriptCacheEntry.access$502(GroovyScriptEngine.java:101)
at groovy.util.GroovyScriptEngine.updateCacheEntry(GroovyScriptEngine.java:358)
at groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:395)
at GroovyConcurrentTest$ScriptRunner.run(GroovyConcurrentTest.java:63)
run :script2.groovy result:script2
run :script3.groovy result:null
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script2.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
run :script3.groovy result:script2
I extpect the resut looks like this:
run :script2.groovy result:script2
run :script3.groovy result:script3
Maybe the NPE is caused by the currentCacheEntry is null?
I was trying to fix this bug, and created a patch file. You can apply it to see whether it 's right to help repair bug.
Thanks.