diff options
Diffstat (limited to 'src/proguard/DataEntryReaderFactory.java')
-rw-r--r-- | src/proguard/DataEntryReaderFactory.java | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/proguard/DataEntryReaderFactory.java b/src/proguard/DataEntryReaderFactory.java index a9724b5..5b9c711 100644 --- a/src/proguard/DataEntryReaderFactory.java +++ b/src/proguard/DataEntryReaderFactory.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2011 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 @@ -48,11 +48,10 @@ public class DataEntryReaderFactory ClassPathEntry classPathEntry, DataEntryReader reader) { - String entryName = classPathEntry.getName(); - boolean isJar = endsWithIgnoreCase(entryName, ".jar"); - boolean isWar = endsWithIgnoreCase(entryName, ".war"); - boolean isEar = endsWithIgnoreCase(entryName, ".ear"); - boolean isZip = endsWithIgnoreCase(entryName, ".zip"); + boolean isJar = classPathEntry.isJar(); + boolean isWar = classPathEntry.isWar(); + boolean isEar = classPathEntry.isEar(); + boolean isZip = classPathEntry.isZip(); List filter = classPathEntry.getFilter(); List jarFilter = classPathEntry.getJarFilter(); @@ -139,17 +138,4 @@ public class DataEntryReaderFactory reader); } } - - - /** - * Returns whether the given string ends with the given suffix, ignoring its - * case. - */ - private static boolean endsWithIgnoreCase(String string, String suffix) - { - int stringLength = string.length(); - int suffixLength = suffix.length(); - - return string.regionMatches(true, stringLength - suffixLength, suffix, 0, suffixLength); - } } |