commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-106) Accessing full signatures of local variables that contain generics
Date Thu, 24 Apr 2014 14:54:17 GMT

     [ https://issues.apache.org/jira/browse/BCEL-106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Bourg updated BCEL-106:
--------------------------------

    Description: 
LocalVariable object not able to return full signature that contains generics.

Example: I have created a Foo class with the following method:
{code}
public void test(){
   ArrayList<Integer> localVar = new ArrayList<Integer>();
}
{code}
After creating JavaClass from Foo and accessing the {{test()}} method and its local variable,
signature reported for localVar is {{"java.util.ArrayList"}}, where Integer generic part is
truncated. However, after inspecting the ConstantPool for the Foo class, it does contain
{code}
CONSTANT_Utf8[1] ("Ljava/util/ArrayList<Ljava/lang/Integer;>;")
{code}
Why not simply set the SignatureIndex of the localVar to the correct index within the ConstantPool
that also includes the Integer part, or allow LocalVariable to also getAttributes(), where
the Signature attribute is properly set to the full signature that includes Integer, as for
methods.

  was:
LocalVariable object not able to return full signature that contains generics.

Example: I have crated Foo class with the following method:
public void test(){
   ArrayList<Integer> localVar = new ArrayList<Integer>();
}
After creating JavaClass from Foo and accessing test() method and its local 
variable, signature reported for localVar is "java.util.ArrayList", where 
Integer generic part is truncated. However, after inspecting the ConstantPool 
for the Foo class, it does contain CONSTANT_Utf8[1]
("Ljava/util/ArrayList<Ljava/lang/Integer;>;"). Why not simply set the 
SignatureIndex of the localVar to the correct index within the ConstantPool 
that also includes the Integer part, or allow LocalVariable to also 
getAttributes(), where the Signature attribute is properly set to the full 
signature that includes Integer, as for methods.

       Priority: Minor
    Environment:     (was: Operating System: Windows XP
Platform: PC)
       Priority:   (was: P2)
       Severity:   (was: enhancement)
        Summary: Accessing full signatures of local variables that contain generics  (was:
accessing full signatures of local variables that contain generics)

> Accessing full signatures of local variables that contain generics
> ------------------------------------------------------------------
>
>                 Key: BCEL-106
>                 URL: https://issues.apache.org/jira/browse/BCEL-106
>             Project: Commons BCEL
>          Issue Type: Improvement
>          Components: Main
>    Affects Versions: 5.2
>            Reporter: D. Babich
>            Assignee: Apache Commons Developers
>            Priority: Minor
>
> LocalVariable object not able to return full signature that contains generics.
> Example: I have created a Foo class with the following method:
> {code}
> public void test(){
>    ArrayList<Integer> localVar = new ArrayList<Integer>();
> }
> {code}
> After creating JavaClass from Foo and accessing the {{test()}} method and its local variable,
signature reported for localVar is {{"java.util.ArrayList"}}, where Integer generic part is
truncated. However, after inspecting the ConstantPool for the Foo class, it does contain
> {code}
> CONSTANT_Utf8[1] ("Ljava/util/ArrayList<Ljava/lang/Integer;>;")
> {code}
> Why not simply set the SignatureIndex of the localVar to the correct index within the
ConstantPool that also includes the Integer part, or allow LocalVariable to also getAttributes(),
where the Signature attribute is properly set to the full signature that includes Integer,
as for methods.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message