Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactor some newInstance method #11686

Merged
merged 6 commits into from
Mar 2, 2023
Merged

Conversation

erdengk
Copy link
Contributor

@erdengk erdengk commented Feb 28, 2023

What is the purpose of the change

    @Deprecated(since="9")
    public T newInstance()

The newInstance() method is marked as obsolete, and this pr uses a new method to obtain an instance.

Java 9 introduces a new way to create an instance using the privateLookupIn(Class<?> declaringClass , MethodHandles.Lookup lookup method of the MethodHandles.Lookup class. This method can return a MethodHandles.Lookup object with private access, and then use the findConstructor method of this object to create an instance.

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

erdengk and others added 6 commits February 28, 2023 16:55
Co-Authored-By: 常珂洁 <76939156+lan-dian@users.noreply.github.com>
Co-Authored-By: 常珂洁 <76939156+lan-dian@users.noreply.github.com>
Co-Authored-By: 常珂洁 <76939156+lan-dian@users.noreply.github.com>
Co-Authored-By: 常珂洁 <76939156+lan-dian@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 1, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell D 9 Code Smells

64.7% 64.7% Coverage
3.8% 3.8% Duplication

@erdengk
Copy link
Contributor Author

erdengk commented Mar 1, 2023

@AlbumenJ
Can this pr merge?
SonarCloud Code Analysis is always bad 😭

@codecov-commenter
Copy link

Codecov Report

Merging #11686 (b0d32e5) into 3.2 (ed9e26f) will decrease coverage by 0.65%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                3.2   #11686      +/-   ##
============================================
- Coverage     69.64%   68.99%   -0.65%     
+ Complexity      338        2     -336     
============================================
  Files          1694     1500     -194     
  Lines         88467    62682   -25785     
  Branches      16115     9228    -6887     
============================================
- Hits          61609    43247   -18362     
+ Misses        21755    15203    -6552     
+ Partials       5103     4232     -871     
Impacted Files Coverage Δ
.../org/apache/dubbo/common/logger/LoggerFactory.java
...apache/dubbo/common/utils/CompatibleTypeUtils.java
.../java/org/apache/dubbo/common/utils/PojoUtils.java
...he/dubbo/config/context/AbstractConfigManager.java
...bbo/validation/support/jvalidation/JValidator.java
.../validation/support/jvalidation/JValidatorNew.java
...bbo/spring/security/jackson/ObjectMapperCodec.java
...org/apache/dubbo/rpc/filter/GenericImplFilter.java
...ubbo/rpc/protocol/rest/util/MultiValueCreator.java
.../main/java/org/apache/dubbo/qos/server/Server.java
... and 3184 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AlbumenJ AlbumenJ merged commit c272af3 into apache:3.2 Mar 2, 2023
@erdengk erdengk deleted the reactor_newInstance branch March 3, 2023 02:19
lcb11 pushed a commit to lcb11/dubbo that referenced this pull request Mar 31, 2023
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.

3 participants