[
https://issues.apache.org/jira/browse/LANG-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15295780#comment-15295780
]
Henry Tung commented on LANG-1214:
----------------------------------
I'm not sure I understand; as far as I can tell, {{primitiveToWrapper}} uses
the {{primitiveWrapperMap}}, which has a separate entry for {{void}} (though
that entry is also confusing; {{void}} is not autoboxed to/from {{Void}} by
Java, and the entry maps anyway to {{Void.TYPE == void.class}} instead of
{{Void.class}}; I feel like it's a confusing substitute for what is actually a
special case in the autoboxing-handling code).
This is independent of {{abbreviationMap}} and {{reverseAbbreviationMap}}, all
uses of which seem to relate to array type class names (see
https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/ClassUtils.java).
> ClassUtils.getClass(ClassLoader, String) fails for "void"
> ---------------------------------------------------------
>
> Key: LANG-1214
> URL: https://issues.apache.org/jira/browse/LANG-1214
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.4
> Environment: Mac OS X
> java version "1.8.0_66"
> Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
> Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
> Reporter: Henry Tung
> Original Estimate: 10m
> Remaining Estimate: 10m
>
> ClassUtils.getClass(ClassUtils.class.getClassLoader(), "void") throws
> "ClassNotFoundException: [V".
> Root cause: ClassUtils contains an abbreviationMap for use in dealing with
> abbreviated primitive types like "[I" and "[J". However, [this
> commit|https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=blobdiff;f=src/main/java/org/apache/commons/lang3/ClassUtils.java;h=c15636ed99af1913d8436a2761d2e3e45b0c8b1a;hp=2492182dd6a383bbec970be3c58799bf89929ccf;hb=1d6ab5b8c0bcc69fe5984b882374e856ec198d0e;hpb=609319df2216e00d8f158e5fc5ce7756134b7cb0]
> introduces a "void -> V" mapping for "completeness".
> This seems wholly erroneous, since the maps are used only for [primitive
> array
> abbreviations|http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html#getName%28%29],
> and "void/V" is not among them.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)