Fix class loading for classes with leading L
Fix class loading for classes with leading L

A while ago there was a commit which broke loading classes when they had
a leading L.

bad commit => 1a1b13bd75d50c050291c564f3b4d596d07b9bfc

    commit 1a1b13bd75d50c050291c564f3b4d596d07b9bfc
    Refs: refs/bisect/bad, FlowDroid_1.0-483-g1a1b13b
    Author:     Samuel <Samuel9743@hotmail.com>
    AuthorDate: Mon Apr 14 15:23:48 2014 +0200
    Commit:     Samuel <Samuel9743@hotmail.com>
    CommitDate: Mon Apr 14 15:23:48 2014 +0200

        Change method toBaseQualifiedName to toBaseType which return now a Type
        instead of a String
    ---
     src/soot/asm/AsmUtil.java       | 41 +++++++++++++++++++++++++++++++------
     src/soot/asm/MethodBuilder.java |  3 ++-
     2 files changed, 37 insertions(+), 7 deletions(-)

This commit changed significantly how

     public static Type toBaseType(String internal)

functioned. It tried to make things smarter but in general it failed to follow
the JVM spec for type specifiers. Specifically if you give it

    Lxxxxxxxx

It will return

    xxxxxxxx

The correct behavior should be

    Lxxxxxxxx

It sees the leading L and strips it mangling the valid class name. This
is admitably an uncommon occurance to have a unpackaged class with a
leading L but it does happen.

This function on a whole seem like a bad idea as it accepts both JVM
type specifiers and class names of the form `xxx/xxx/xxx`. It should
either take class names or type specifiers not both. However, that is
definitely a larger issue than this commit.

The Fix
-------

To fix this I only strip the L if there is a ;. This follows the JVM
spec fairly closely. I have tested it on some of my subject programs, it
may need further testing for edge cases I have not thought of.

Signed-off-by: Tim Henderson <96597d1a2ce50fc967745fc8f11359736ad2bda4@gmail.com>

anddann/soot,mbenz89/soot,mbenz89/soot,cfallin/soot,plast-lab/soot,anddann/soot,plast-lab/soot,anddann/soot,cfallin/soot,plast-lab/soot,xph906/SootNew,cfallin/soot,xph906/SootNew,xph906/SootNew,mbenz89/soot,cfallin/soot,xph906/SootNew,mbenz89/soot,anddann/soot