Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
Bug 610 - IDL Compiler interpretes interface declarartion wrongly and breaks down as a result
Summary: IDL Compiler interpretes interface declarartion wrongly and breaks down as a ...
Status: RESOLVED FIXED
Alias: None
Product: JacORB
Classification: Unclassified
Component: IDL compiler (show other bugs)
Version: 2.2.2
Hardware: PC Windows 2000
: P1 blocker
Assignee: Gerald Brose
URL:
: 436 639 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-06 13:55 CEST by Omar Ekine
Modified: 2005-11-19 22:13 CET (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Omar Ekine 2005-07-06 13:55:19 CEST
Compilation of the following IDL results in the error message:

[jacidl] processing idl file: 
D:\Uni\Diplomarbeit\Tests\Example\Client\idl\Example_0.idl
   [jacidl] [jacorb.idl] ERROR : Example_0.idl, line:222(31): Undefined name: 
Example._.Reflective.RefPackage
   [jacidl] Can't recover from previous error(s), giving up.
   [jacidl] : ::Reflective::RefPackage
   [jacidl] org.jacorb.idl.ParseException: Parse error

More to that the line number seems to be incorrect because it changes when I 
run it again. It is sometimes even greater than the last line of the IDL file.
I'm using JDK 1.4.2.07. on Windows XP (SP2). The compiler doesn't seem to 
understand an interface declaration of the form:

"interface" <identifier> ":" "::" <identifier>"::"<identifier>

such as

inteface ExamplePackage: ::Reflective::RefPackage

which is a legal IDL synthax.

This is my Example_0.idl:

#include <Reflective.idl>
#include <CorbaIdlTypes.idl>
#include <PrimitiveTypes.idl>

#ifndef _Example_0_idl_
#define _Example_0_idl_

module Example
{
  interface WriterClass;
  interface LibraryClass;
  interface BookClass;
  interface ExamplePackage
    : ::Reflective::RefPackage
  {
    readonly attribute Example::WriterClass writer_ref;
    readonly attribute Example::LibraryClass library_ref;
    readonly attribute Example::BookClass book_ref;
  };
  
  interface Writer;
  typedef sequence < Writer >  WriterSet;
  
  
  /* 
  class proxy::Example::Writer
  */
  interface WriterClass
    : ::Reflective::RefObject
  {
    readonly attribute Example::WriterSet all_of_type_writer;
    readonly attribute Example::WriterSet all_of_class_writer;
    Example::Writer create_writer ( 
      in wstring name) raises ( 
        Reflective::MofError);
  };
  
  interface Book;
  typedef sequence < Book >  BookSet;
  
  interface Library;
  
  /* 
  ::Example::Writer
  */
  interface Writer
    : WriterClass
  {
    wstring name ( ) raises ( 
        Reflective::MofError);
    void set_name ( 
      in wstring new_value) raises ( 
        Reflective::MofError);
    Example::BookSet books ( ) raises ( 
        Reflective::MofError);
    void set_books ( 
      in Example::BookSet new_value) raises ( 
        Reflective::MofError);
    void add_books ( 
      in Example::Book new_element) raises ( 
        Reflective::MofError);
    void modify_books ( 
      in Example::Book old_element,
      in Example::Book new_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
    void remove_books ( 
      in Example::Book old_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
    Example::Library library ( ) raises ( 
        Reflective::MofError);
    void set_library ( 
      in Example::Library new_value) raises ( 
        Reflective::MofError);
  };
  
  typedef sequence < Library >  LibrarySet;
  
  
  /* 
  class proxy::Example::Library
  */
  interface LibraryClass
    : ::Reflective::RefObject
  {
    readonly attribute Example::LibrarySet all_of_type_library;
    readonly attribute Example::LibrarySet all_of_class_library;
    Example::Library create_library ( 
      in wstring name) raises ( 
        Reflective::MofError);
  };
  
  
  /* 
  ::Example::Library
  */
  interface Library
    : LibraryClass
  {
    wstring name ( ) raises ( 
        Reflective::MofError);
    void set_name ( 
      in wstring new_value) raises ( 
        Reflective::MofError);
    Example::WriterSet writers ( ) raises ( 
        Reflective::MofError);
    void set_writers ( 
      in Example::WriterSet new_value) raises ( 
        Reflective::MofError);
    void add_writers ( 
      in Example::Writer new_element) raises ( 
        Reflective::MofError);
    void modify_writers ( 
      in Example::Writer old_element,
      in Example::Writer new_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
    void remove_writers ( 
      in Example::Writer old_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
    Example::BookSet books ( ) raises ( 
        Reflective::MofError);
    void set_books ( 
      in Example::BookSet new_value) raises ( 
        Reflective::MofError);
    void add_books ( 
      in Example::Book new_element) raises ( 
        Reflective::MofError);
    void modify_books ( 
      in Example::Book old_element,
      in Example::Book new_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
    void remove_books ( 
      in Example::Book old_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
  };
  
  
  /* 
  ::Example::BookCategory
  */
  enum BookCategory
    {
    Fantasy,
    Biography,
    ScienceFiction,
    NonFiction,
    Novel
    };
  
  /* 
  class proxy::Example::Book
  */
  interface BookClass
    : ::Reflective::RefObject
  {
    readonly attribute Example::BookSet all_of_type_book;
    readonly attribute Example::BookSet all_of_class_book;
    Example::Book create_book ( 
      in wstring title,
      in long pages,
      in Example::BookCategory category) raises ( 
        Reflective::MofError);
  };
  
  
  /* 
  ::Example::Book
  */
  interface Book
    : BookClass
  {
    Example::BookCategory category ( ) raises ( 
        Reflective::MofError);
    void set_category ( 
      in Example::BookCategory new_value) raises ( 
        Reflective::MofError);
    long pages ( ) raises ( 
        Reflective::MofError);
    void set_pages ( 
      in long new_value) raises ( 
        Reflective::MofError);
    wstring title ( ) raises ( 
        Reflective::MofError);
    void set_title ( 
      in wstring new_value) raises ( 
        Reflective::MofError);
    Example::Library library ( ) raises ( 
        Reflective::MofError);
    void set_library ( 
      in Example::Library new_value) raises ( 
        Reflective::MofError);
    Example::WriterSet author ( ) raises ( 
        Reflective::MofError);
    void set_author ( 
      in Example::WriterSet new_value) raises ( 
        Reflective::MofError);
    void add_author ( 
      in Example::Writer new_element) raises ( 
        Reflective::MofError);
    void modify_author ( 
      in Example::Writer old_element,
      in Example::Writer new_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
    void remove_author ( 
      in Example::Writer old_element) raises ( 
        Reflective::NotFound,
        Reflective::MofError);
  };
  
  interface ExamplePackageFactory
    : ::Reflective::RefPackageFactory
  {
    Example::ExamplePackage create_example_package ( ) raises ( 
        Reflective::MofError);
  };
  
}; // end module Example
#endif
Comment 1 Gerald Brose 2005-11-19 20:13:42 CET
The problem was with the name resolution algorithm that escapes identifiers
that end in "Package". (This suffix is reseved in the IDL Java mapping). 

The fix is committed, but to workaround without updating from CVS or waiting
for a new release, you can simply rename your interfaces and avoid the 
"Package" suffix.
Comment 2 Gerald Brose 2005-11-19 21:37:17 CET
*** Bug 559 has been marked as a duplicate of this bug. ***
Comment 3 Gerald Brose 2005-11-19 21:40:12 CET
*** Bug 639 has been marked as a duplicate of this bug. ***
Comment 4 Gerald Brose 2005-11-19 22:13:54 CET
*** Bug 436 has been marked as a duplicate of this bug. ***