Skip to content

Refactor ProGuard class for improved readability and consistency#471

Open
Jonatha1983 wants to merge 2 commits intoGuardsquare:masterfrom
Jonatha1983:incomplete_class_error_message
Open

Refactor ProGuard class for improved readability and consistency#471
Jonatha1983 wants to merge 2 commits intoGuardsquare:masterfrom
Jonatha1983:incomplete_class_error_message

Conversation

@Jonatha1983
Copy link
Copy Markdown

Added a more descriptive error message when encountering IncompleteClassHierarchyException. The enhanced message now includes:

A clear indication of the missing classes issue
Direct link to the troubleshooting documentation
Original exception as the cause for better debugging
Changes
Wrapped IncompleteClassHierarchyException with RuntimeException
Added formatted multi-line error message with troubleshooting URL
Preserved stack trace by passing original exception
Impact
Users will now receive clearer guidance when encountering class hierarchy issues, making it easier to identify and resolve missing class dependencies.

@Jonatha1983
Copy link
Copy Markdown
Author

Hi

It is really hard to know what is the real issue with the Gradle run output:

> Task :proguard FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':proguard'.
>

  It appears you are missing some classes resulting in an incomplete class hierarchy,
  please refer to the troubleshooting page in the manual:
  https://www.guardsquare.com/en/products/proguard/manual/troubleshooting#superclass

Even with --stacktrace since the original error message was not included in the output.

@Jonatha1983
Copy link
Copy Markdown
Author

Jonatha1983 commented Mar 23, 2025

By adding the original exception I can see the real problem:


It appears you are missing some classes resulting in an incomplete class hierarchy,  please refer to the troubleshooting page in the manual:  https://www.guardsquare.com/en/products/proguard/manual/troubleshooting#superclass > Can't find common super class of [com.anthropic.models.messages.MessageCreateParams$Builder] (with 1 known super classes: com.anthropic.models.messages.MessageCreateParams$Builder and 1 unknown classes: java.lang.Object) and [kotlin.Unit] (with 1 known super classes: kotlin.Unit and 1 unknown classes: java.lang.Object) |  

I tested this locally

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant