Make the checkPackagePrivateAccess functionality an option

This is only needed for 4.2.0, but not 4.2.1. Both are api 17, so we can't
tie this functionality to an api level.
This commit is contained in:
Ben Gruver
2014-12-28 15:03:02 -08:00
committed by Connor Tumbleson
parent 89e6b06521
commit 52482802dc
3 changed files with 12 additions and 6 deletions

View File

@ -164,7 +164,7 @@ public class ClassPath {
return unknownClass;
}
public boolean needCheckPackagePrivateAccess() {
public boolean shouldCheckPackagePrivateAccess() {
return checkPackagePrivateAccess;
}

View File

@ -628,7 +628,7 @@ public class ClassProto implements TypeProto {
for (int i=0; i<vtable.size(); i++) {
Method superMethod = vtable.get(i);
if (methodSignaturesMatch(superMethod, virtualMethod)) {
if (!classPath.needCheckPackagePrivateAccess() || canAccess(superMethod)) {
if (!classPath.shouldCheckPackagePrivateAccess() || canAccess(superMethod)) {
if (replaceExisting) {
vtable.set(i, virtualMethod);
}