ArrayList<Field> fields = getSortedInstanceFields(getClassDef()); final int fieldCount = fields.size(); while (back > front) { if (fieldTypes[back] == REFERENCE) { swap(fieldTypes, fields, front, back--); break; while (back > front) { if (fieldTypes[back] == OTHER) { swap(fieldTypes, fields, front++, back); break; while (back > front) { if (fieldTypes[back] == WIDE) { swap(fieldTypes, fields, front, back--); break;
ArrayList<Field> fields = getSortedInstanceFields(getClassDef()); final int fieldCount = fields.size(); while (back > front) { if (fieldTypes[back] == REFERENCE) { swap(fieldTypes, fields, front, back--); break; while (back > front) { if (fieldTypes[back] == OTHER) { swap(fieldTypes, fields, front++, back); break; while (back > front) { if (fieldTypes[back] == WIDE) { swap(fieldTypes, fields, front, back--); break;
addToVtable(getClassDef().getVirtualMethods(), vtable, true); interfaceMethods.add(method); addToVtable(interfaceMethods, vtable, false);
private void addToVtable(@Nonnull Iterable<? extends Method> localMethods, @Nonnull List<Method> vtable, boolean replaceExisting) { List<? extends Method> methods = Lists.newArrayList(localMethods); Collections.sort(methods); outer: for (Method virtualMethod: methods) { for (int i=0; i<vtable.size(); i++) { Method superMethod = vtable.get(i); if (methodSignaturesMatch(superMethod, virtualMethod)) { if (classPath.getApi() < 17 || canAccess(superMethod)) { if (replaceExisting) { vtable.set(i, virtualMethod); } continue outer; } } } // we didn't find an equivalent method, so add it as a new entry vtable.add(virtualMethod); } }
private boolean canAccess(@Nonnull Method virtualMethod) { if (!methodIsPackagePrivate(virtualMethod.getAccessFlags())) { return true; } String otherPackage = getPackage(virtualMethod.getDefiningClass()); String ourPackage = getPackage(getClassDef().getType()); return otherPackage.equals(ourPackage); }