The mysterious constant pool tag #2

Alex Buckley alex.buckley at oracle.com
Wed Jan 13 21:08:58 UTC 2021


The earliest JVM Spec listed on docs.oracle.com is actually the Second 
Edition from 1999, specifying Java 1.2: 
https://docs.oracle.com/javase/specs/jvms/se6/html/VMSpecTOC.doc.html. 
It's listed under Java SE 6 due to a complicated update history, not 
relevant here.

In any case, you're right that constant pool tag 2 was not defined in 
even the First Edition from 1996. I have information about many 
historical artifacts in the JVM Spec, but not this. Since tag 1 is 
CONSTANT_Utf8, and since the ClassFile's UTF-8 isn't exactly UTF-8, and 
since tags for numeric constants start rather clearly at 3, I'd guess 
that tag 2 was once another string encoding, perhaps CONSTANT_Utf16.

Alex

On 1/13/2021 11:28 AM, x4e_x4e wrote:
> Hello,
> 
> I am attempting to find the purpose of the seemingly abandoned constant pool tag number 2.
> My guess is that the item type denoted by this tag was removed and the tag was never reclaimed.
> 
> I've attempted to locate the earliest possible JVM spec including this constant tag - to no avail.
> The earliest spec listed on https://docs.oracle.com/javase/specs/ is the SE 6 spec, which does not include the tag.
> I did however find the original JSR catalog (https://jcp.org/en/jsr/all), however it is unclear which JSR contains the first JVM specification (Many links 404 and earlier specifications only cover the language side of things).
> As far as I can tell, this is the first final release JVM specification: http://web.archive.org/web/20000816180614/http://java.sun.com/docs/books/vmspec/html/ClassFile.doc.html however, once again, it seems that there is no constant tag number 2.
> 
> I am wondering if anyone here (probably someone involved in the early JVM design) knows the original purpose of tag number 2?
> 
> Thank You.
> 
> PS: I found that you can actually buy the original JVM specification on amazon (https://www.amazon.co.uk/Java-Virtual-Machine-Specification/dp/020163452X) - even new!
> 
> JSth
> 


More information about the jdk-dev mailing list