| Summary: | struct foo generates _foo.java instead of foo.java | ||
|---|---|---|---|
| Product: | JacORB | Reporter: | john.seltzer |
| Component: | IDL compiler | Assignee: | Gerald Brose <gerald.brose> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0 beta3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
More explanation
stack trace showing error case from debug lexer.java debug version of lexer.java |
||
|
Description
john.seltzer
2004-01-06 21:48:55 UTC
Underscores are gerenally prepended by the IDL compiler to prevent identifiers from clashing with Java keywords. If you want to debug, I suggest you edit the method needsJavaEscape in the class src/org/jacorb/idl/lexer.java to emit additional output when escaping occurs. Created attachment 57 [details]
More explanation
Created attachment 58 [details]
stack trace showing error case from debug lexer.java
Created attachment 59 [details]
debug version of lexer.java
The root of the problem is a clash between libraries that were loaded from the endorsed dir and the Java_CUP parser runtime classes used by JacORB. After moving these classes to a different namespace in JacORB, this clash is no longer possible. I am sorry, I meant to add the last comment to another bug, NOT this one! Don't know how this happened.... :-( Gerald. The root of the problem is that the lexer is overly cautious and complains about the suffix "Operations" in *any* identifier because this could potentially clash with generated signature class "fooOperations" for an interface "foo". Complaining about "fooOperations" is okay WRT the Java language mapping if there is an interface "foo". The workaround here is to avoid the suffixes "Operations", "Holder", "Helper" and "Package" which are used to in the names of mapped classes. The solution is to modify the lexer such that it will check if there is an interface named "foo" before complaining. I am downgrading the severity because I believe the workarounds should be viable in most cases. Cannot promise the fix for this maintenance release, I am afraid. Regards and thanks for the bug report, Gerald. |