JDK-6434065 : bug (com.sun.corba.se.spi.orb.DataCollectorBase) parsing in-parameters in ORB when setting up CORBA
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-05
  • Updated: 2010-04-03
  • Resolved: 2006-08-11
Related Reports
Duplicate :  
Description
We have found a Java SE bug in the class:

  com.sun.corba.se.spi.orb.DataCollectorBase

We have used jdk 1.5.0_06 as base, but this bug stretches at least from
JDK 1.4 to 1.6.

--------

When setting up the ORB in CORBA, possible in-parameters are parsed.

The parser com.sun.corba.se.spi.orb.PropertyParser uses above mentioned
DataCollectorBase.

It stores the properties for CORBA in a HashSet (which has the internal
structure HashMap).

When parsing it looks at suffixes of the properties (a specified suffix,
which correlates to the name of the command line parameter).

The problem it that it has two name spaces for properties and some of
them have the same suffix.

What we have seen happen is that what is intended to be stored as:

   org.omg.CORBA.ORBServerId=<id>

instead is stored as:

   com.sun.CORBA.POA.ORBServerId=<id>

This depends on the order of the iterator in HashMap.

So, when later setting the serverID, it doesn���t find it since it is not
stored as org.omg.CORBA.ORBServerId.

--------

The way the parser works is that it iterates over the HashSet of CORBA
properties and break when it has found a match on the suffix.

It should (as I understand it) depend on the order in the list in
com.sun.corba.se.impl.orb.ParserTable.

( This is documented in org.omg.CORBA.ORB )

Therefore, I think a good change that adds determinism and also reflects
the order in ParserTable is to change the current HashSet in the parser
to LinkedHashSet.

This Set preserves the order of how elements are inserted.

See attached class file.

--------

If you want a test case to work with, where this can fail, I recommend
the JCK test:

javasoft.sqe.tests.api.org.omg.PortableInterceptor.ObjectReferenceTemplate.MethodsTests