JDK-6367912 : The description of field "originalType" in MXBean javadoc is inconsistent with Descriptor's spec
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-12-30
  • Updated: 2017-05-16
  • Resolved: 2006-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b81Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
"MBeanInfo contents for an MXBean" section in MXBean specification has the following sentence:
-- 
The Descriptor for each of these objects will also have a field originalType that is a
string representing the Java type that appeared in the MXBean interface. *For a generic
Java type, this is the string returned by toString()*. For a class or primitive type, this
is the string returned by Class.getName().
-- 
  About "For a generic Java type, this is the string returned by toString()"...
  The javadoc for javax.management.Descriptor says:

-- 
originalType:
For a non-generic type, the string value is the value returned by Class.getName(). For a
parameterized type such as Map<String,Integer> it is *a string representation of the type,
with the raw type followed by the actual type arguments in angle brackets separated by
commas without spaces*, for example "java.util.Map<java.lang.String,java.lang.Integer>".
-- 

  Consider the type: List<String>
  The originalType:  "java.util.List<java.lang.String>"
  - and this won't be returned by var.getClass().toString()

Comments
SUGGESTED FIX Proposed spec is the following (in doc comments for javax.management.MXBean): --- Type Names Sometimes the unmapped type T of a method parameter or return value in an MXBean must be represented as a string. If T is a non-generic type, this string is the value returned by Class.getName(). Otherwise it is the value of genericstring(T), defined as follows: * If T is a non-generic non-array type, genericstring(T) is value returned by Class.getName(), for example "int" or "java.lang.String". * If T is an array E[], genericstring(T) is genericstring(E) followed by "[]". For example, genericstring(int[]) is "int[]", and genericstring(List<String>[][]) is "java.util.List<java.lang.String>[][]". * Otherwise, T is a parameterized type such as List<String> and genericstring(T) consists of the following: the fully-qualified name of the parameterized type as returned by Class.getName(); a left angle bracket ("<"); genericstring(A) where A is the first type parameter; if there is a second type parameter B then ", " (a comma and a single space) followed by genericstring(B); a right angle bracket (">"). Note that if a method returns int[], this will be represented by the string "[I" returned by Class.getName(), but if a method returns List<int[]>, this will be represented by the string "java.util.List<int[]>". --- This is simpler than a full specification for all possible java.lang.reflect.Type objects, because not all such objects can arise here. For example, parameterized types can only have one or two parameters.
17-03-2006

EVALUATION We need to specify type names for "originalType", and also in the typeName for a TabularType or CompositeType that is mapped from an original type. This should be a new section in the MXBean specification.
15-03-2006