dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

fixed pojoutils string class issue

Open zcbbpo opened this issue 1 year ago • 8 comments

Hi

Environment

  • Dubbo version: 3.2.0
  • Operating System version: mac os 12.2
  • Java version: 21

when i use telnet to invoke , it will throw exception dubbo>invoke com.xxx.api.PService.check({"value": 1, "class": "java.lang.Long"}, {"value": 1, "class": "java.lang.Long"}, {"value": "abc", "class": "java.lang.String"}, {"value": "c", "class": "java.lang.String"}) Its response: image

i have add this code for fixed issue: org.apache.dubbo.common.utils.PojoUtils#realize0 image

this is test case

image

Brief changelog

Verifying this change

Checklist

  • [x] 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.

zcbbpo avatar Apr 19 '24 02:04 zcbbpo

image Please fix the code style

AlbumenJ avatar May 08 '24 03:05 AlbumenJ

image

AlbumenJ avatar May 08 '24 06:05 AlbumenJ

image is use jdk21 to run unit test? it's should requred to add jvm args "--add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED"? please help to check

zcbbpo avatar May 08 '24 07:05 zcbbpo

image is use jdk21 to run unit test? it's should requred to add jvm args "--add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED"? please help to check

As design, Dubbo itself should not require any --add-opens configuration

AlbumenJ avatar May 08 '24 07:05 AlbumenJ

in this method: org.apache.dubbo.common.utils.PojoUtils#getField image when the acls is jdk class , we cannot modify field accessible. could we can add this code to ignore jdk classes?

zcbbpo avatar May 08 '24 08:05 zcbbpo

image add check it's if jdk classes

zcbbpo avatar May 08 '24 08:05 zcbbpo