<?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>362</bug_id>
          
          <creation_ts>2003-07-02 00:53:52 +0000</creation_ts>
          <short_desc>composite names are incorrectly escaped</short_desc>
          <delta_ts>2003-08-01 16:47:44 +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>1.4.1</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>231</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Malmstrom">emalmstrom</reporter>
          <assigned_to name="Gerald Brose">gerald.brose</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>670</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Malmstrom">emalmstrom</who>
    <bug_when>2003-07-02 00:53:52 +0000</bug_when>
    <thetext>I am working with a set of idls, which contains an idl PackageComponent.idl,
which in turn defines a PackageModule with an interface Package. 

Since &lt;X&gt;Package is a reserved format, org.jacorb.idl.lexer will allow &apos;Package&apos;
to pass unescaped, but anything of the form &apos;XPackage&apos; will be escaped. However,
org.jacorb.idl.ScopedName will submit the name &apos;PackageModule.Package&apos; to
lexer.strictJavaEscapeCheck(), which will return true denoting the need to
escape the name, and then check to see if the name is composite, eventually
generating the name &apos;PackageModule._Package&apos;. 

I believe the following is a sufficient fix for the problem:

  In ScopedName
    public void escapeName()
    {
        // new esm 7/1/03
        String checkName = typeName;
        if( typeName.indexOf( &apos;.&apos; ) &gt; 0 ) {
          checkName = typeName.substring( typeName.lastIndexOf( &apos;.&apos; ) + 1 );
        }
        // end new

        if( !name.startsWith( &quot;_&quot; ) &amp;&amp;
                lexer.strictJavaEscapeCheck( checkName ) )
//                lexer.strictJavaEscapeCheck( typeName ) )
        {
            // if the type name is not a simple name, then insert the escape
            // char after the last dot
            if( typeName.indexOf( &apos;.&apos; ) &gt; 0 )
            {
                typeName =
                        typeName.substring( 0, typeName.lastIndexOf( &apos;.&apos; ) + 1 ) +
                        &quot;_&quot; + typeName.substring( typeName.lastIndexOf( &apos;.&apos; ) + 1 );
            }
            else
            {
                typeName = &quot;_&quot; + typeName;
            }
            Environment.output( 3, &quot;ScopedName.escapeName &quot; + typeName );
        }
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>685</commentid>
    <comment_count>1</comment_count>
    <who name="Nick Cross">rnc</who>
    <bug_when>2003-08-01 16:47:44 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 231 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>