Make minifiers use the global state for -useuniqueclassmembernames.
Refactored FieldNameMinifier and MethodNameMinifier to share the same
base class, MemberNameMinifier, which hooks creations and retrievals of
NamingState mappings and returns the global state if the option is set.
Bug: 36799684
Change-Id: Ieba14dae5df89ffc2cf82ecad0c4ca74507df7ec
diff --git a/src/test/examples/uniquemembernames/BaseCls.java b/src/test/examples/uniquemembernames/BaseCls.java
new file mode 100644
index 0000000..9843c7b
--- /dev/null
+++ b/src/test/examples/uniquemembernames/BaseCls.java
@@ -0,0 +1,21 @@
+// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package uniquemembernames;
+
+public abstract class BaseCls {
+
+ protected int a;
+ protected double f2;
+
+ protected abstract int a();
+
+ protected int foo() {
+ return a * (int) f2;
+ }
+
+ protected double bar() {
+ return a * f2;
+ }
+
+}