Skip to content

Commit

Permalink
Fix broken format strings for ProguardCoreException
Browse files Browse the repository at this point in the history
  • Loading branch information
jelle-dc authored and Emiel Vandeloo committed May 31, 2024
1 parent 89d546d commit df5f395
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,10 @@ public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAtt
new ProguardCoreException(
ErrorId.MAX_STACK_SIZE_COMPUTER_ERROR,
ex,
"Unexpected error while computing stack sizes:{} Class = [{}]{} Method = [{}{}]{} Exception = [{}] ({})",
System.lineSeparator(),
"Unexpected error while computing stack sizes:%n Class = [%s]%n Method = [%s%s]%n Exception = [%s] (%s)",
clazz.getName(),
System.lineSeparator(),
method.getName(clazz),
method.getDescriptor(clazz),
System.lineSeparator(),
ex.getClass().getName(),
ex.getMessage());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,10 @@ public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAtt
throw new ProguardCoreException(
ErrorId.CODE_ATTRIBUTE_EDITOR_ERROR,
ex,
"Unexpected error while editing code:{} Class = [{}]{} Method = [{}{}]{} Exception = [{}] ({})",
System.lineSeparator(),
"Unexpected error while editing code:%n Class = [%s]%n Method = [%s%s]%n Exception = [%s] (%s)",
clazz.getName(),
System.lineSeparator(),
method.getName(clazz),
method.getDescriptor(clazz),
System.lineSeparator(),
ex.getClass().getName(),
ex.getMessage());
}
Expand Down
11 changes: 2 additions & 9 deletions base/src/main/java/proguard/evaluation/PartialEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,10 @@ public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAtt
new ProguardCoreException(
ErrorId.PARTIAL_EVALUATOR_ERROR2,
ex,
"Unexpected error while performing partial evaluation:{} Class = [{}]{} Method = [{}{}]{} Exception = [{}] ({})",
System.lineSeparator(),
"Unexpected error while performing partial evaluation:%n Class = [%s]%n Method = [%s%s]%n Exception = [%s] (%s)",
clazz.getName(),
System.lineSeparator(),
method.getName(clazz),
method.getDescriptor(clazz),
System.lineSeparator(),
ex.getClass().getName(),
ex.getMessage());

Expand Down Expand Up @@ -811,15 +808,11 @@ logger, new CircularIntBuffer(prettyInstructionBuffered), code, clazz, method)
throw new ProguardCoreException(
ErrorId.PARTIAL_EVALUATOR_ERROR1,
ex,
"Unexpected error while evaluating instruction:{} Class = [{}]{} Method = [{}{}]{} Instruction = {}{} Exception = [{}] ({})",
System.lineSeparator(),
"Unexpected error while evaluating instruction:%n Class = [%s]%n Method = [%s%s]%n Instruction = %s%n Exception = [%s] (%s)",
clazz.getName(),
System.lineSeparator(),
method.getName(clazz),
method.getDescriptor(clazz),
System.lineSeparator(),
instruction.toString(clazz, instructionOffset),
System.lineSeparator(),
ex.getClass().getName(),
ex.getMessage());
}
Expand Down
5 changes: 1 addition & 4 deletions base/src/main/java/proguard/preverify/CodePreverifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,10 @@ public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAtt
throw new ProguardCoreException(
ErrorId.CODE_PREVERIFIER_ERROR,
ex,
"Unexpected error while preverifying:{} Class = [{}]{} Method = [{}{}]{} Exception = [{}] ({})",
System.lineSeparator(),
"Unexpected error while preverifying:%n Class = [%s]%n Method = [%s%s]%n Exception = [%s] (%s)",
clazz.getName(),
System.lineSeparator(),
method.getName(clazz),
method.getDescriptor(clazz),
System.lineSeparator(),
ex.getClass().getName(),
ex.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAtt
new ProguardCoreException(
ErrorId.CODE_SUBROUTINE_INLINER_ERROR,
ex,
"Unexpected error while inlining subroutines:{} Class = [{}]{} Method = [{}{}]{} Exception = [{}] ({})",
System.lineSeparator(),
"Unexpected error while inlining subroutines:%n Class = [%s]%n Method = [%s%s]%n Exception = [%s] (%s)",
clazz.getName(),
System.lineSeparator(),
method.getName(clazz),
method.getDescriptor(clazz),
System.lineSeparator(),
ex.getClass().getName(),
ex.getMessage());

Expand Down

0 comments on commit df5f395

Please sign in to comment.