Why EncodeException's message is not nullable in 1st constructor but nullable in 2nd constructor?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by reading the EncodeException constructors and the resolve method in RequestTemplateFactoryResolver, then trace how runtime exceptions with null messages are wrapped. Determine the intended nullability contract for both constructors and verify the behavior around NegativeArraySizeException. Done means the contract and resulting exception message behavior are consistent.
Written by the indexing model from the issue text.
Description
/**
* @param message the reason for the failure.
*/
public EncodeException(String message) {
super(-1, checkNotNull(message, "message"));
}
/**
* @param message possibly null reason for the failure.
* @param cause the cause of the error.
*/
public EncodeException(String message, Throwable cause) {
super(-1, message, checkNotNull(cause, "cause"));
}
It seems like that EncodeException's message is not null in 1st constructor,
BUT, when a exception with null message is throw (eg. new NegativeArraySizeException() ), you will get a null message EncodeException, such as below codes in RequestTemplateFactoryResolver.
protected RequestTemplate resolve(Object[] argv, RequestTemplate mutable,
Map<String, Object> variables) {
Object body = argv[metadata.bodyIndex()];
checkArgument(body != null, "Body parameter %s was null", metadata.bodyIndex());
try {
encoder.encode(body, metadata.bodyType(), mutable);
} catch (EncodeException e) {
throw e;
} catch (RuntimeException e) {
throw new EncodeException(e.getMessage(), e);
}
return super.resolve(argv, mutable, variables);
}
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 2k
- Avg merge
- 12h 8m
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenFeign/feign
-
JDK 21 on x86_64 causes truncated responses with Feign + HttpClient (content compression related)Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenFeign/feign#3332 · 1 comment ·
Maintainers usually reply within 1 day
-
question
Difficulty 3/5 1-2 days Newbie friendliness 52/100
OpenFeign/feign#3095 · 1 comment ·
Maintainers usually reply within 1 day
-
bug question
Difficulty 5/5 Over a week Newbie friendliness 25/100
OpenFeign/feign#3074 · 2 comments ·
Maintainers usually reply within 1 day
-
Http2Client with native HttpClient does not enforce response timeout correctlyPossibly taken @goutamadwant claimed this 103 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
OpenFeign/feign#3068 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
quelea-projection/Quelea#711 ·
-
bug pdd
Difficulty 2/5 Under an hour Newbie friendliness 67/100
objectionary/eo#9450 ·
Maintainers usually reply within 1 day
-
[EC2] DescribeAvailabilityZones should return real AWS error for unknown zone namePossibly taken @omatheusmesmo claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
area: core good first issue type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ShaftHQ/SHAFT_ENGINE#6909 ·
Maintainers usually reply within 1 day