<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.jacorb.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://www.jacorb.org/bugzilla/"
          
          maintainer="jacorb@goots.org"
>

    <bug>
          <bug_id>517</bug_id>
          
          <creation_ts>2004-10-04 00:10:21 +0000</creation_ts>
          <short_desc>interitance redefinition fails to compile</short_desc>
          <delta_ts>2005-10-03 22:47:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>JacORB</product>
          <component>IDL compiler</component>
          <version>2.2</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 2000</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rob Gordon">gordon</reporter>
          <assigned_to name="Simon McQueen">sm</assigned_to>
          <cc>lxhjw2000</cc>
    
    <cc>Thomas.Leineweber</cc>
    
    <cc>zhijiedong</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1152</commentid>
    <comment_count>0</comment_count>
    <who name="Rob Gordon">gordon</who>
    <bug_when>2004-10-04 00:10:21 +0000</bug_when>
    <thetext>We use interitance quite heavily in our app and inevitably we will reuse the
same class variable names. But redefinition is allowed with inheritance in IDL.
Under jacorb 1.4 this worked fine.  Under 2.2 it is failing to compile.  Sample
code:

interface A
{
	const string NAME = &quot;interface_A&quot;;
};
interface B : A
{
	const string NAME = &quot;interface_B&quot;;
};

This code above compiles under 1.4 and TAO but fails under 2.2 with message:

java.lang.RuntimeException: Could not find definition of : B.NAME
        at org.jacorb.idl.TypeMap.removeDefinition(Unknown Source)
        at org.jacorb.idl.NameTable.define(Unknown Source)
        at org.jacorb.idl.ConstDecl.parse(Unknown Source)
        at org.jacorb.idl.InterfaceBody.internal_parse(Unknown Source)
        at org.jacorb.idl.InterfaceBody.parse(Unknown Source)
        at org.jacorb.idl.Interface.parse(Unknown Source)
        at org.jacorb.idl.Definition.parse(Unknown Source)
        at org.jacorb.idl.Spec.parse(Unknown Source)
        at org.jacorb.idl.CUP$actions.CUP$do_action(Unknown Source)
        at org.jacorb.idl.parser.do_action(Unknown Source)
        at org.jacorb.idl.runtime.lr_parser.parse(Unknown Source)
        at org.jacorb.idl.parser.prepareAndParse(Unknown Source)
        at org.jacorb.idl.parser.compile(Unknown Source)
        at org.jacorb.idl.parser.compile(Unknown Source)
        at org.jacorb.idl.parser.compileAndHandle(Unknown Source)
        at org.jacorb.idl.parser.main(Unknown Source)
[jacorb.idl] ERROR : C:\Projects\test_jacorb.idl, line: 9(1): Exception: java.la
ng.RuntimeException: Could not find definition of : B.NAME</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1153</commentid>
    <comment_count>1</comment_count>
    <who name="Simon McQueen">sm</who>
    <bug_when>2004-10-04 10:35:51 +0000</bug_when>
    <thetext>This is quite correct as per the CORBA spec. Redefinition is *not* allowed. You
need to change your IDL so it conforms. See bug 479 for more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1154</commentid>
    <comment_count>2</comment_count>
    <who name="Simon McQueen">sm</who>
    <bug_when>2004-10-04 10:36:27 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 479 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1156</commentid>
    <comment_count>3</comment_count>
    <who name="Simon McQueen">sm</who>
    <bug_when>2004-10-04 15:07:55 +0000</bug_when>
    <thetext>Sorry - my mistake. I didn&apos;t read that properly. I thought they were attributes
rather than consts. Not a duplicate at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1477</commentid>
    <comment_count>4</comment_count>
    <who name="Simon McQueen">sm</who>
    <bug_when>2005-07-15 12:25:13 +0000</bug_when>
    <thetext>*** Bug 613 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1516</commentid>
    <comment_count>5</comment_count>
    <who name="Simon McQueen">sm</who>
    <bug_when>2005-08-15 17:22:25 +0000</bug_when>
    <thetext>*** Bug 624 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1539</commentid>
    <comment_count>6</comment_count>
      <attachid>180</attachid>
    <who name="Thomas Leineweber">Thomas.Leineweber</who>
    <bug_when>2005-08-23 15:26:10 +0000</bug_when>
    <thetext>Created attachment 180
proposed patch. Gives correct result for given testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1540</commentid>
    <comment_count>7</comment_count>
    <who name="Thomas Leineweber">Thomas.Leineweber</who>
    <bug_when>2005-08-24 12:05:16 +0000</bug_when>
    <thetext>this bug seems to be the same as bug #616. The patch given there resolves the
problem in this bug, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1565</commentid>
    <comment_count>8</comment_count>
    <who name="André Spiegel">spiegel</who>
    <bug_when>2005-10-03 22:47:35 +0000</bug_when>
    <thetext>Should be solved now by the patch for bug 616, which I just installed.
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>180</attachid>
            <date>2005-08-23 15:26:10 +0000</date>
            <delta_ts>2005-08-23 15:26:10 +0000</delta_ts>
            <desc>proposed patch. Gives correct result for given testcase</desc>
            <filename>bug517.diff</filename>
            <type>text/plain</type>
            <size>600</size>
            <attacher name="Thomas Leineweber">Thomas.Leineweber</attacher>
            
              <data encoding="base64">LS0tIC9ob21lL2xlaW5ld2ViL3dvcmsvamFjb3JiL0phY09SQi0yLjIuMi9zcmMvb3JnL2phY29y
Yi9pZGwvTmFtZVRhYmxlLmphdmEJTW9uIE1hciAyOCAyMTo1ODozMCAyMDA1CisrKyAuL05hbWVU
YWJsZS5qYXZhCVR1ZSBBdWcgMjMgMTU6MjM6NDEgMjAwNQpAQCAtMTc0LDcgKzE3NCw5IEBACiAg
ICAgICAgICAgICAgICAgLy8gcmVtb3ZlIHRoZSBpbmhlcml0ZWQgdHlwZSBkZWZpbml0aW9uLCBh
IG5ldyBvbmUgd2lsbCBiZQ0KICAgICAgICAgICAgICAgICAvLyBhZGRlZCBzb29uIHVuZGVyIHRo
aXMgbmFtZSEgQWRkaXRpb24gb2YgdGhpcyBsaW5lIGZpeGVzDQogICAgICAgICAgICAgICAgIC8v
IGJ1ZyAjMzQ1DQotICAgICAgICAgICAgICAgIFR5cGVNYXAucmVtb3ZlRGVmaW5pdGlvbiggbmFt
ZSApOw0KKyAgICAgICAgICAgICAgICAvLyBhZGRpdGlvbmFsbHksIGNoZWNrIGZvciBhIHJlZGVm
aW5lZCBjb25zdGFudCAoYnVnIDUxNykNCisJCWlmICgha2luZC5lcXVhbHMoImNvbnN0YW50Iikp
DQorICAgICAgICAgICAgICAgICAgVHlwZU1hcC5yZW1vdmVEZWZpbml0aW9uKCBuYW1lICk7DQog
ICAgICAgICAgICAgfQ0KICAgICAgICAgfQ0KIA0K
</data>

          </attachment>
      

    </bug>

</bugzilla>