Skip to content

Commit

Permalink
Remove DexIO.getDexPoolOverflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanchon committed Sep 13, 2018
1 parent adc133c commit 341f706
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/lanchon/multidexlib2/DexIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void writeRawDexSingleThread(DexDataStore dataStore, DexFile dexFile, int
while (classIterator.hasNext()) {
ClassDef classDef = classIterator.next();
dexPool.internClass(classDef);
if (getDexPoolOverflow(dexPool, maxDexPoolSize)) {
if (dexPool.hasOverflowed(maxDexPoolSize)) {
handleDexPoolOverflow(classDef, classCount, classes.size());
throw new AssertionError("unexpected type count");
}
Expand Down Expand Up @@ -139,7 +139,7 @@ private static void writeMultiDexDirectoryCommon(File directory, DexFileNameIter
ClassDef classDef = classIterator.peek();
dexPool.mark();
dexPool.internClass(classDef);
if (getDexPoolOverflow(dexPool, maxDexPoolSize)) {
if (dexPool.hasOverflowed(maxDexPoolSize)) {
handleDexPoolOverflow(classDef, fileClassCount, minMainDexClassCount);
dexPool.reset();
break;
Expand All @@ -160,10 +160,6 @@ private static void writeMultiDexDirectoryCommon(File directory, DexFileNameIter
} while (classIterator.hasNext());
}

private static boolean getDexPoolOverflow(DexPool dexPool, int maxDexPoolSize) {
return dexPool.hasOverflowed(maxDexPoolSize);
}

private static void handleDexPoolOverflow(ClassDef classDef, int classCount, int minClassCount) {
if (classCount < minClassCount) throw new DexPoolOverflowException(
"Dex pool overflowed while writing type " + (classCount + 1) + " of " + minClassCount);
Expand Down

0 comments on commit 341f706

Please sign in to comment.