From f07aae158ad2d17847b1fd5f6b487bac11cc6971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Tue, 1 Jun 2010 13:30:09 +0200 Subject: [PATCH] TypeName.fetchFromInternalName(): fixed a bug occuring when parsing class name without a package. --- src/brut/androlib/src/TypeName.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/brut/androlib/src/TypeName.java b/src/brut/androlib/src/TypeName.java index dbce8e1e..b14b5ec0 100644 --- a/src/brut/androlib/src/TypeName.java +++ b/src/brut/androlib/src/TypeName.java @@ -182,8 +182,13 @@ public class TypeName { internal = internal.substring(1, pos); pos = internal.lastIndexOf('/'); - package_ = internal.substring(0, pos).replace('/', '.'); - type = internal.substring(pos + 1); + if (pos == -1) { + package_ = ""; + type = internal; + } else { + package_ = internal.substring(0, pos).replace('/', '.'); + type = internal.substring(pos + 1); + } pos = type.indexOf('$'); if (pos != -1) {