Repository navigation
fix #1245 - #1375
fix #1245#1375
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1375 +/- ##
==========================================
- Coverage 32.57% 32.35% -0.23%
==========================================
Files 691 691
Lines 34537 34537
Branches 6812 6812
==========================================
- Hits 11252 11173 -79
- Misses 21357 21433 +76
- Partials 1928 1931 +3
Continue to review full report at Codecov.
|
| return 0; | ||
| else if (int.class.equals(cl)) | ||
| return Integer.valueOf(0); | ||
| return 0; |
There was a problem hiding this comment.
Good job, do you think we should merge these else statements?
There was a problem hiding this comment.
Do you mean change like this
protected static Object getParamArg(Class cl) {
if (!cl.isPrimitive())
return null;
else if (boolean.class.equals(cl))
return Boolean.FALSE;
else if (byte.class.equals(cl)
|| short.class.equals(cl)
|| char.class.equals(cl)
|| int.class.equals(cl))
return 0;
else if (long.class.equals(cl))
return 0L;
else if (float.class.equals(cl))
return 0F;
else if (double.class.equals(cl))
return 0D;
else
throw new UnsupportedOperationException();
}It's ok with me to do so
There was a problem hiding this comment.
Never mind, let's keep is as it is.
* @reference support annotate on annotation type * Fixes apache#1303 TimeUnit conversion error * Fixes apache#1289, use bind_port as mapping key * Fixes apache#1313, remove destroy check in Registry. * checkout .travis.yml from origin/master * Fix hessian2 serialized short, byte is converted to int bug (apache#1232) * Fix hessian2 serialized short, byte is converted to int bug * Fix hessian2 serialized short, byte is converted to int bug * adapt jdk1.5+ * fixed travis-ci failed because of test cases. (apache#1370) * Merge pull request apache#1377, remove redundant arguments for StatItem.isAllowable() * Merge pull request apache#1378, replace StringBuider with simple string concatenation in log. * Merge pull request apache#1375, remove unnecessary boxing. Fixes apache#1245 * Merge pull request apache#1331, add optional parameter to support hessian protocol method overload and request protocol version. * Merge pull request apache#1376, do not instantiate load balance if there is no invokers Fixes apache#1297 * Merge pull request apache#1384, fix build string bug. * Merge pull request apache#1040, refactor: replace some deprecated methods related with jedis. * Merge pull request apache#1242, remove redundant null check. fixes apache#1231
|
@hqq2023623 @chickenlj This branch will lead to failure of the deserialization error。 protected static Object getParamArg(Class cl) {
if (!cl.isPrimitive())
return null;
else if (boolean.class.equals(cl))
return Boolean.FALSE;
else if (byte.class.equals(cl))
return 0;
else if (short.class.equals(cl))
return 0;
else if (char.class.equals(cl))
return 0;
else if (int.class.equals(cl))
return 0;
else if (long.class.equals(cl))
return 0L;
else if (float.class.equals(cl))
return 0F;
else if (double.class.equals(cl))
return 0D;
else
throw new UnsupportedOperationException();
}Deserialization requires parsing of constructor argument types. My construct : public PersonType(String, int, double, short, byte, List<Short>) {
this.name = name;
this.age = age;
this.money = money;
this.p1 = p1;
this.p2 = p2;
this.p3 = p3;
}Please revert code. |
|
@hqq2023623 Before submitting the code, please make sure that all local units tested correctly and passed. |
|
@zonghaishang protected static Object getParamArg(Class cl) {
if (!cl.isPrimitive())
return null;
else if (boolean.class.equals(cl))
return Boolean.FALSE;
else if (byte.class.equals(cl))
return Byte.valueOf("0");
else if (short.class.equals(cl))
return Short.valueOf("0");
else if (char.class.equals(cl))
return '0';
else if (int.class.equals(cl))
return 0;
else if (long.class.equals(cl))
return 0L;
else if (float.class.equals(cl))
return 0F;
else if (double.class.equals(cl))
return 0D;
else
throw new UnsupportedOperationException();
} |
|
I have reverted the code, and will merge to PRs created affected with this bug. |
* @reference support annotate on annotation type * Fixes apache#1303 TimeUnit conversion error * Fixes apache#1289, use bind_port as mapping key * Fixes apache#1313, remove destroy check in Registry. * checkout .travis.yml from origin/master * Fix hessian2 serialized short, byte is converted to int bug (apache#1232) * Fix hessian2 serialized short, byte is converted to int bug * Fix hessian2 serialized short, byte is converted to int bug * adapt jdk1.5+ * fixed travis-ci failed because of test cases. (apache#1370) * Merge pull request apache#1377, remove redundant arguments for StatItem.isAllowable() * Merge pull request apache#1378, replace StringBuider with simple string concatenation in log. * Merge pull request apache#1375, remove unnecessary boxing. Fixes apache#1245 * Merge pull request apache#1331, add optional parameter to support hessian protocol method overload and request protocol version. * Merge pull request apache#1376, do not instantiate load balance if there is no invokers Fixes apache#1297 * Merge pull request apache#1384, fix build string bug. * Merge pull request apache#1040, refactor: replace some deprecated methods related with jedis. * Merge pull request apache#1242, remove redundant null check. fixes apache#1231 * Change Mailing list address * Fixed apache#1398, revert bugs introduced from apache#1375 * Fix time unit problem in UT * Fix time unit problem related with FutureAdapter in UT
* @reference support annotate on annotation type * Fixes apache#1303 TimeUnit conversion error * Fixes apache#1289, use bind_port as mapping key * Fixes apache#1313, remove destroy check in Registry. * checkout .travis.yml from origin/master * Fix hessian2 serialized short, byte is converted to int bug (apache#1232) * Fix hessian2 serialized short, byte is converted to int bug * Fix hessian2 serialized short, byte is converted to int bug * adapt jdk1.5+ * fixed travis-ci failed because of test cases. (apache#1370) * Merge pull request apache#1377, remove redundant arguments for StatItem.isAllowable() * Merge pull request apache#1378, replace StringBuider with simple string concatenation in log. * Merge pull request apache#1375, remove unnecessary boxing. Fixes apache#1245 * Merge pull request apache#1331, add optional parameter to support hessian protocol method overload and request protocol version. * Merge pull request apache#1376, do not instantiate load balance if there is no invokers Fixes apache#1297 * Merge pull request apache#1384, fix build string bug. * Merge pull request apache#1040, refactor: replace some deprecated methods related with jedis. * Merge pull request apache#1242, remove redundant null check. fixes apache#1231 * Change Mailing list address * Fixed apache#1398, revert bugs introduced from apache#1375 * Fix time unit problem in UT * Fix time unit problem related with FutureAdapter in UT * Fix time unit problem related with FutureAdapter in UT * Merge pull request apache#1391, fix typo of method name in qos module. * fix hessian lite test case fail bug (apache#1394) * fix hessian lite test case fail bug * update test * remove ignore * Fix time unit problem related with FutureAdapter in UT * revert file * fix number type is lost in yaml config file (apache#1401) * apache#1399 fi * update test * update readme to add some details (apache#1403) * update readme to add some details update readme to add some details * delete duplicated words delete duplicated words * update README format * apache#1411: Locale deserialize 'zh-hant_CN'

What is the purpose of the change
fix #1245
Brief changelog
fix #1245
Verifying this change
fix #1245
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipITsto make sure unit-test pass. Runmvn clean test-compile failsafe:integration-testto make sure integration-test pass.