aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java
diff options
context:
space:
mode:
authorGravatar Adam Michael <ajmichael@google.com>2017-09-21 15:00:07 -0400
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-10-05 00:18:35 +0200
commitb4ebfd724d33223ac78190be88c6f8704c249651 (patch)
tree7dcf4db51a9d5fad13ad17c69074b64e02228418 /third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java
parent74776b409214846aa3fe3a41a3447c6412dc046c (diff)
Add proguard 5.3.3 to third_party.
See https://github.com/bazelbuild/bazel/issues/3777 The Android SDK provides a very old proguard and will be removing it soon, so we need to bundle our own. Change-Id: I054c54130bef1befc8591598768184fe23f76161 RELNOTES: None
Diffstat (limited to 'third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java')
-rw-r--r--third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java63
1 files changed, 63 insertions, 0 deletions
diff --git a/third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java b/third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java
new file mode 100644
index 0000000000..35d3b5d2c0
--- /dev/null
+++ b/third_party/java/proguard/proguard5.3.3/src/proguard/optimize/info/InstanceofClassFilter.java
@@ -0,0 +1,63 @@
+/*
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
+ * of Java bytecode.
+ *
+ * Copyright (c) 2002-2017 Eric Lafortune @ GuardSquare
+ *
+ * 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
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+package proguard.optimize.info;
+
+import proguard.classfile.*;
+import proguard.classfile.visitor.ClassVisitor;
+
+/**
+ * This ClassVisitor delegates all its method calls to another ClassVisitor,
+ * but only for Clazz objects that are used in an 'instanceof' test.
+ *
+ * @see InstanceofClassMarker
+ * @author Eric Lafortune
+ */
+public class InstanceofClassFilter
+implements ClassVisitor
+{
+ private final ClassVisitor classVisitor;
+
+
+ public InstanceofClassFilter(ClassVisitor classVisitor)
+ {
+ this.classVisitor = classVisitor;
+ }
+
+
+ // Implementations for ClassVisitor.
+
+ public void visitProgramClass(ProgramClass programClass)
+ {
+ if (InstanceofClassMarker.isInstanceofed(programClass))
+ {
+ classVisitor.visitProgramClass(programClass);
+ }
+ }
+
+
+ public void visitLibraryClass(LibraryClass libraryClass)
+ {
+ if (InstanceofClassMarker.isInstanceofed(libraryClass))
+ {
+ classVisitor.visitLibraryClass(libraryClass);
+ }
+ }
+} \ No newline at end of file