Apache OpenOffice (AOO) Bugzilla – Issue 63812
code generated by javamaker rejected by gij
Last modified: 2006-05-12 10:56:43 UTC
Found in issue 63390: > gij --verbose --classpath .../ridl.jar com.sun.star.bridge.UnoUrlResolver [...] java.lang.VerifyError: verification failed at PC 16 in com.sun.star.bridge.UnoUrlResolver:create((Lcom.sun.star.uno.XComponentContext;)Lcom.sun.star.bridge.XUnoUrlResolver;): incompatible return type The problem is that the generated method uses areturn to return an object of type java.lang.Object as an object of type com.sun.star.bridge.XUnoUrlResolver, without doing a prior checkcast. While it is not obvious to me from looking at <http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#88597> that this is illegal, it is probably good style to add the checkcast, anyway.
.
See codemaker/test/javamaker/ for regression tests.
Seen in sb49 and tested on GNU/Linux Sparc m161 using examples from openoffice.org2.0_sdk/examples/DevelopersGuide/FirstSteps. I will attach a copy of the patch for future reference. All three examples function correctly as expected with gcc4.1. Build the examples with gcc4.0 and run with gcc4.1 is OK too. ------------ But some problem when running the examples with gcc4.0, probably a different issue? /home/jim/openoffice.org2.0_sdk/LINUXexample.out/class/FirstStepsExamples/FirstUnoContact.jar com.sun.star.lib.loader.Loader::getCustomLoader: cannot add UNO jar files: java.lang.reflect.InvocationTargetException Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: FirstUnoContact *** Got java.lang.NegativeArraySizeException while trying to print stack trace. make: *** [FirstUnoContact.run] Error 1
Created attachment 35412 [details] checkcast in codemaker patch
sb->sparcmoz: "But some problem when running the examples with gcc4.0, probably a different issue?" Yes, please use an issue different from this one to solve that problem.