Use ClassId name in prettifiedName if canonical name is null #484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Anonymous classes do not have canonical names, It makes
ClassId::canonicalName
property fail with an exception.ClassId::prettifiedName
fails for anonymous classes as well.This fix changes the call to exception-throwing
ClassId::canonicalName
inprettifiedName
with an explicit call tojClass::canonicalName
which returns a nullable value. If the class has no canonical name,ClassId::name
is used instead.Fixes #459
Type of Change
How Has This Been Tested?
Automated Testing
Existing tests should not fail.
Manual Scenario
Run contest estimator with
methodFilter = "com.google.common.base.CaseFormat.*"
andprojectFilter = null
.Without this fix, errors like this will be presented:
With the fix, no these errors will be produced (many other errors will probably be generated instead, as there are related bugs and limitations in enum processing, both in engine and codegen).
Checklist (remove irrelevant options):