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 <X>Package is a reserved format, org.jacorb.idl.lexer will allow 'Package' to pass unescaped, but anything of the form 'XPackage' will be escaped. However, org.jacorb.idl.ScopedName will submit the name 'PackageModule.Package' 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 'PackageModule._Package'. 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( '.' ) > 0 ) { checkName = typeName.substring( typeName.lastIndexOf( '.' ) + 1 ); } // end new if( !name.startsWith( "_" ) && 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( '.' ) > 0 ) { typeName = typeName.substring( 0, typeName.lastIndexOf( '.' ) + 1 ) + "_" + typeName.substring( typeName.lastIndexOf( '.' ) + 1 ); } else { typeName = "_" + typeName; } Environment.output( 3, "ScopedName.escapeName " + typeName ); } }
*** This bug has been marked as a duplicate of 231 ***