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

refundant nullcheck of value known to non-null #1231

Closed
hqq2023623 opened this issue Jan 17, 2018 · 7 comments · Fixed by #1242
Closed

refundant nullcheck of value known to non-null #1231

hqq2023623 opened this issue Jan 17, 2018 · 7 comments · Fixed by #1242

Comments

@hqq2023623
Copy link
Contributor

There are some "refundant nullcheck of value known to non-null" suggests can be found by findBugs plugin, maybe we should handle these to make the code cleaner
example : CacheFilter#invoke , check the (cache != null) twice

@ralf0131
Copy link
Contributor

Hi, could you provide more details (file name, line number for example)?

@hqq2023623
Copy link
Contributor Author

hqq2023623 commented Jan 18, 2018

type1 : check null more than one time

FutureFilter#fireInvokeCallback

line 110 , onInvokeMethod is checked by line 107
1

the same as FutureFilter#fireReturnCallback

2

### and FutureFilter#fireThrowCallback

3

type2 : checked by context

MergeableClusterInvoker#invoke ,at line 144

4

returnType.getMethod() will not return null

5

JavaBeanDescriptor#getEnumPropertyName , at line 141

6

if getProperty() return null , then toString() may throw NPE before the result == null check

@hqq2023623
Copy link
Contributor Author

hqq2023623 commented Jan 18, 2018

type3 : call method that never return null

###ExtensionLoader#hasExtension , at line 333
7
ExtensionLoader#getExtensionClass() never return null
8

@hqq2023623
Copy link
Contributor Author

hqq2023623 commented Jan 18, 2018

type4 : check by both caller and self

caller : RegistryDirectory#notify , at line 207

1

self : RegistryDirectory#toRouters , at line 309

2

@hqq2023623
Copy link
Contributor Author

@ralf0131

@ralf0131
Copy link
Contributor

Hi @hqq2023623 Thanks for pointing out. It will be really appreciate if you can create a pull request~

hqq2023623 added a commit to hqq2023623/dubbo that referenced this issue Jan 19, 2018
@hqq2023623 hqq2023623 mentioned this issue Jan 23, 2018
6 tasks
@chickenlj
Copy link
Contributor

Thanks, i will review the PR laterly.

zonghaishang pushed a commit to zonghaishang/dubbo that referenced this issue Feb 26, 2018
* @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
zonghaishang pushed a commit to zonghaishang/dubbo that referenced this issue Feb 26, 2018
* @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
zonghaishang pushed a commit to zonghaishang/dubbo that referenced this issue Mar 2, 2018
* @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'
rolandhe pushed a commit to rolandhe/dubbo that referenced this issue Sep 9, 2019
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 a pull request may close this issue.

3 participants