summaryrefslogtreecommitdiff
path: root/src/proguard/FullyQualifiedClassNameChecker.java
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2015-01-08 08:24:06 -0800
committerBrian Carlstrom <bdc@google.com>2015-01-08 09:27:15 -0800
commit2270795fbe0b277bfd49f40950ecaa78583175cc (patch)
tree9ac962825d41c4fb8ad1ec0fc2e8b441b42d3869 /src/proguard/FullyQualifiedClassNameChecker.java
parent9961286c06c25cd03464d3e2b00bd9b9dedf96ba (diff)
downloadproguard-2270795fbe0b277bfd49f40950ecaa78583175cc.tar.gz
Upgrade Proguard to 5.1.
Downloaded from: http://sourceforge.net/projects/proguard/files/proguard/5.1/ Bug: 17550647 Change-Id: I2b4eab16eb7821fc232b294ab7f433aae08f71e1
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);