Repository navigation
Conversation
…ackage UpgradeApacheHttpClient_5_DeprecatedMethods runs after the class mapping, but renamed getAllHeaders() only on org.apache.http.HttpMessage. In a file that uses types of the org.apache.http package itself, the package change has already moved the method's declaring type to org.apache.hc.core5.http, so the call kept a name HttpClient 5 does not have. Match both names, and overrides, so calls on requests are renamed too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
UpgradeApacheHttpClient_5_DeprecatedMethodsrenamesgetAllHeaders()togetHeaders()onorg.apache.http.HttpMessage, but it runs afterUpgradeApacheHttpClient_5_ClassMapping. In a file that uses types of theorg.apache.httppackage itself (HttpResponse,Header, …), theorg.apache.http→org.apache.hc.core5.httppackage change has by then also moved the method's declaring type, so the pattern no longer matches and the call keeps a name HttpClient 5 does not have:The existing test passed because its file only imports
org.apache.http.client.methods.CloseableHttpResponse, so the declaring type kept its 4.x name. This matches both names, and overrides, so calls on requests such asHttpGet, where the method is declared onAbstractHttpMessage, are renamed too. The new test fails without the YAML change.This surfaced while validating
UpgradeApacheHttpClient_5over the 1,346 open source repositories it changes in Moderne, in a 51-repository sample compiled before and after the migration: perwendel/spark, aliyun/aliyun-dataworks-dataservice-java-sdk, onap/archive-mso-libs, king-zyd/core and Unidata/netcdf-java. Rerunning the migration with this change and recompiling, the error is gone from all but Unidata/netcdf-java, where a call on anHttpRequestBasefield remained; the same shape is renamed in a unit test, so something differs in that repository's model that I have not yet found.