[
https://issues.apache.org/jira/browse/BCEL-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14246789#comment-14246789
]
Emmanuel Bourg commented on BCEL-183:
-------------------------------------
Thank you for the patch Jérôme. You are right, the class file format
specification has the following constraints on the field names:
https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5
{quote}
name_index
The value of the name_index item must be a valid index into the constant_pool
table. The constant_pool entry at that index must be a CONSTANT_Utf8_info
structure (§4.4.7) which represents a valid unqualified name denoting a field
(§4.2.2).
{quote}
and:
{quote}
4.2.2. Unqualified Names
Names of methods, fields, and local variables are stored as unqualified names.
An unqualified name must not contain any of the ASCII characters . ; [ / (that
is, period or semicolon or left square bracket or forward slash).
Method names are further constrained so that, with the exception of the special
method names <init> and <clinit> (§2.9), they must not contain the ASCII
characters < or > (that is, left angle bracket or right angle bracket).
Note that a field name or interface method name may be <init> or <clinit>, but
no method invocation instruction may reference <clinit> and only the
invokespecial instruction (§invokespecial) may reference <init>.
{quote}
So fields starting with a digit for example should be allowed.
> JustIce verifier checks for field and variable name validity whereas it is
> not needed
> -------------------------------------------------------------------------------------
>
> Key: BCEL-183
> URL: https://issues.apache.org/jira/browse/BCEL-183
> Project: Commons BCEL
> Issue Type: Bug
> Components: Verifier
> Affects Versions: 5.2, 6.0
> Reporter: Jérôme Leroux
> Attachments: BCEL-183.patch, BCEL-183.zip
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> The JustIce bytecode verifier checks the validity of the field name and the
> variable name considering the java langage specification.
> This check is not specified by the bytecode verifier specification.
> This may lead to bytecode verification errors in pass2 on valid classfiles.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)