summaryrefslogtreecommitdiff
path: root/src/proguard/FullyQualifiedClassNameChecker.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/proguard/FullyQualifiedClassNameChecker.java')
-rw-r--r--src/proguard/FullyQualifiedClassNameChecker.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/proguard/FullyQualifiedClassNameChecker.java b/src/proguard/FullyQualifiedClassNameChecker.java
index eb1865a..6b6a3ad 100644
--- a/src/proguard/FullyQualifiedClassNameChecker.java
+++ b/src/proguard/FullyQualifiedClassNameChecker.java
@@ -2,7 +2,7 @@
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
- * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu)
+ * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -36,6 +36,9 @@ public class FullyQualifiedClassNameChecker
extends SimplifiedVisitor
implements ClassVisitor
{
+ private static final String INVALID_CLASS_EXTENSION = ClassUtil.internalClassName(ClassConstants.CLASS_FILE_EXTENSION);
+
+
private final ClassPool programClassPool;
private final ClassPool libraryClassPool;
private final WarningPrinter notePrinter;
@@ -157,10 +160,16 @@ implements ClassVisitor
"Note: the configuration refers to the unknown class '" +
ClassUtil.externalClassName(className) + "'");
+ // Strip "/class" or replace the package name by a wildcard.
+ int lastSeparatorIndex =
+ className.lastIndexOf(ClassConstants.PACKAGE_SEPARATOR);
+
String fullyQualifiedClassName =
- "**" + ClassConstants.INTERNAL_PACKAGE_SEPARATOR +
- className.substring(className.lastIndexOf(ClassConstants.INTERNAL_PACKAGE_SEPARATOR)+1);
+ className.endsWith(INVALID_CLASS_EXTENSION) ?
+ className.substring(0, lastSeparatorIndex) :
+ "**" + ClassConstants.PACKAGE_SEPARATOR + className.substring(lastSeparatorIndex + 1);
+ // Suggest matching classes.
ClassNameFilter classNameFilter =
new ClassNameFilter(fullyQualifiedClassName, this);