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

Fix ReflectionsException while scanning docstrings #2494

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

trustin
Copy link
Member

@trustin trustin commented Feb 14, 2020

Motivation:

DocStringsExtractor makes Reflections throw a ReflectionsException
if a resource folder (e.g. META-INF/armeria/grpc) exists but it
contains no files.

Modifications:

  • Do not attempt to call Reflections.getResources() if the resource
    folder does not contain any files.

Result:

Motivation:

`DocStringsExtractor` makes `Reflections` throw a `ReflectionsException`
if a resource folder (e.g. `META-INF/armeria/grpc`) exists but it
contains no files.

Modifications:

- Do not attempt to call `Reflections.getResources()` if the resource
  folder does not contain any files.

Result:

- No more `ReflectionsException` while scanning docstrings.
- Fixes line#2491
@trustin trustin added the defect label Feb 14, 2020
@trustin trustin added this to the 0.98.2 milestone Feb 14, 2020
@codecov
Copy link

codecov bot commented Feb 14, 2020

Codecov Report

Merging #2494 into master will increase coverage by 0.09%.
The diff coverage is 57.14%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2494      +/-   ##
============================================
+ Coverage     72.96%   73.06%   +0.09%     
- Complexity    10826    10829       +3     
============================================
  Files           948      947       -1     
  Lines         41871    41788      -83     
  Branches       5193     5175      -18     
============================================
- Hits          30553    30533      -20     
+ Misses         8670     8613      -57     
+ Partials       2648     2642       -6
Impacted Files Coverage Δ Complexity Δ
...necorp/armeria/server/docs/DocStringExtractor.java 64.86% <57.14%> (-1.81%) 6 <0> (ø)
.../linecorp/armeria/client/Http2ResponseDecoder.java 63.02% <0%> (-0.85%) 33% <0%> (-1%)
...armeria/server/healthcheck/HealthCheckService.java 85.2% <0%> (-0.45%) 52% <0%> (-1%)
...inecorp/armeria/server/grpc/ArmeriaServerCall.java 87.5% <0%> (ø) 86% <0%> (ø) ⬇️
...corp/armeria/internal/client/Http1ClientCodec.java
...om/linecorp/armeria/client/HttpSessionHandler.java 62.2% <0%> (+2.36%) 30% <0%> (+1%) ⬆️
...a/com/linecorp/armeria/client/HttpChannelPool.java 78.94% <0%> (+2.42%) 61% <0%> (+2%) ⬆️
...com/linecorp/armeria/client/OneEventLoopState.java 71.42% <0%> (+4.76%) 7% <0%> (+1%) ⬆️
...inecorp/armeria/client/AbstractEventLoopState.java 100% <0%> (+7.69%) 7% <0%> (+1%) ⬆️
...corp/armeria/client/DefaultEventLoopScheduler.java 89.09% <0%> (+10%) 34% <0%> (+5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e0a4c0...09d8694. Read the comment docs.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@trustin trustin merged commit ae84af3 into line:master Feb 14, 2020
@trustin trustin deleted the fix_reflections_error branch February 14, 2020 10:48
@trustin trustin removed the request for review from minwoox February 17, 2020 07:52
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
Motivation:

`DocStringsExtractor` makes `Reflections` throw a `ReflectionsException`
if a resource folder (e.g. `META-INF/armeria/grpc`) exists but it
contains no files.

Modifications:

- Do not attempt to call `Reflections.getResources()` if the resource
  folder does not contain any files.

Result:

- No more `ReflectionsException` while scanning docstrings.
- Fixes line#2491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReflectionsException while extracting doc strings
2 participants