Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 166781

Summary: "Internal error" when trying to convert SDB to IBM rules using IBM JDK 1.42
Product: z_Archived Reporter: Praful Rajawat <prafulr>
Component: TPTPAssignee: Marius Slavescu <slavescu>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: apnan, jkubasta
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460
Bug Depends on: 162562    
Bug Blocks:    

Description Praful Rajawat CLA 2006-12-05 09:16:59 EST
Build ID: M20060921-0945

Steps To Reproduce:
"Internal error" when trying to convert SDB to IBM rules using IBM JDK 1.42

How its been used...
FastXPathAPI api = new FastXPathAPI(null);
api.getFastXPathEngine().getExpressionJavaSource(XPATHExpression, cbe, true, null,null,new CompilerPostProcessor(null, null)

Calling FastXPathAPI api shown in the stack trace causing this error. 

Extention point can't be use to get the FastXPathAPI object since it is protected.

Error does not occur when using IBM JDK 1.5

Stack trace:
java.lang.LinkageError: JVMCL048:redefine of class TestXPath (&name=2C662598).
old_cb=1397F68, new_cb=11448E8, (&old_name=2C662598) old_name=TestXPath
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
at java.lang.ClassLoader.defineClass(ClassLoader.java:710)
at
org.eclipse.tptp.platform.provisional.fastxpath.compiler.EclipseCompiler$MyClassLoader.defineClass(EclipseCompiler.java:331)
at
org.eclipse.tptp.platform.provisional.fastxpath.compiler.EclipseCompiler$1.acceptResult(EclipseCompiler.java:119)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
at
org.eclipse.tptp.platform.provisional.fastxpath.compiler.EclipseCompiler.generateClass(EclipseCompiler.java:131)
at
org.eclipse.tptp.platform.provisional.jre14.fastxpath.compiler.CompilerHelper.buildCompiledExpression(CompilerHelper.java:150)
at
org.eclipse.tptp.platform.provisional.jre14.fastxpath.FastXPathEngine.getExpressionJavaSource(FastXPathEngine.java:202)
at


More information:
Comment 1 Dave Smith CLA 2006-12-05 09:44:40 EST
Targetting to 4.4
Comment 2 Alex Nan CLA 2006-12-07 17:34:35 EST
Praful, the problem is in your code, you should do the following:
in the transformer class add a field

private static int i = 0;

and us it to generate different class names like this

cp.setClassName("TestXPath_" + i++);

and you should be fine. No code changes on the TPTP side are required.
Comment 3 Praful Rajawat CLA 2006-12-12 10:18:29 EST
Same code was working in TPTP 4.2.0
Since TPTP has added performance fix for XPATH rules, this is been broken. I will make the change as you suggested.
I am just wondering here that by doing what you are suggesting, is each xpath rule will create different class for it? Is this change will have any performance hit?
Comment 4 Alex Nan CLA 2006-12-12 14:09:28 EST
Praful from the code that I've seen you are creating a class anyway, my code snippet is only setting a different name to each new class. In 4.2 it worked because we were creating a class loader for each XPathExpression, we do reuse the class loader in 4.2.1.
Comment 5 Dave Smith CLA 2007-01-12 02:59:53 EST
Increasing priority as a major should be fixed in 4.4.
Comment 6 Marius Slavescu CLA 2007-01-18 10:18:27 EST
If bug 162562 will be fixed I will fix this also, if the compile code is removed I  will return this defect as WONTFIX.
Comment 7 Dave Smith CLA 2007-01-22 15:51:15 EST
If this is fixed it will be fixed in the Fast XPATH implementation in the Platform.Models component.
Comment 8 Marius Slavescu CLA 2007-04-27 12:01:19 EDT
Fix in CVS.
Comment 9 Paul Slauenwhite CLA 2009-06-30 10:24:37 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since the originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.