Issue 63812 - code generated by javamaker rejected by gij
Summary: code generated by javamaker rejected by gij
Status: CLOSED FIXED
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: 680m161
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 2.0.3
Assignee: Stephan Bergmann
QA Contact: issues@udk
URL:
Keywords:
Depends on:
Blocks: 63390
  Show dependency tree
 
Reported: 2006-03-30 12:26 UTC by Stephan Bergmann
Modified: 2006-05-12 10:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
checkcast in codemaker patch (1.37 KB, patch)
2006-03-31 09:26 UTC, sparcmoz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Bergmann 2006-03-30 12:26:34 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.
Comment 1 Stephan Bergmann 2006-03-30 12:27:04 UTC
.
Comment 2 Stephan Bergmann 2006-03-30 13:10:30 UTC
See codemaker/test/javamaker/ for regression tests.
Comment 3 Stephan Bergmann 2006-03-30 13:11:04 UTC
.
Comment 4 sparcmoz 2006-03-31 09:24:30 UTC
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
Comment 5 sparcmoz 2006-03-31 09:26:50 UTC
Created attachment 35412 [details]
checkcast in codemaker patch
Comment 6 Stephan Bergmann 2006-03-31 09:33:31 UTC
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.
Comment 7 Stephan Bergmann 2006-05-12 10:56:43 UTC
.