JDK-6317211 : org.omg.CORBA.ORB.string_to_object throws NPE instead of DataConversion
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-08-29
  • Updated: 2012-07-20
  • Resolved: 2006-08-31
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
When parsing URL with the wrong prefix, 1.4.2 throws DataConversion when 1.5.04 throws NullPointerException.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the provided test case.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
org.omg.CORBA.DATA_CONVERSION or org.omg.CORBA.BAD_PARAM.
ACTUAL -
java.lang.NullPointerException

ERROR MESSAGES/STACK TRACES THAT OCCUR :
For 1.4.2 the provided test case prints:

Thrown org.omg.CORBA.DATA_CONVERSION:   vmcid: SUN  minor code: 202  completed: No

For 1.5.0 it prints:

Thrown java.lang.NullPointerException

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import org.omg.CORBA.ORB;

public class Regress
{
  public static void main(String[] args)
  {
    try
      {
        ORB orb = ORB.init(new String[0], null);
        orb.string_to_object("beer:corbaloc:###@###.###/Prod/aTradingService:80");
      }
    catch (Exception e)
      {
        System.out.println("Thrown "+e);
      }
  }
}

---------- END SOURCE ----------

Comments
EVALUATION This is fixed for the JDK 7 ORB. The proper exception in this case is BAD_PARAM, with a standard minor code 7: conversion failed due to bad scheme name.
12-08-2006