Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Insert AssertionErrors in "impossible" code branches #24

Open
OLEGSHA opened this issue Dec 22, 2021 · 0 comments
Open

Insert AssertionErrors in "impossible" code branches #24

OLEGSHA opened this issue Dec 22, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@OLEGSHA
Copy link
Owner

OLEGSHA commented Dec 22, 2021

Throughout the project there are multiple instances of code branches, usually catch blocks, which are commented as unreachable. For enhanced robustness, throw new AssertionError("Unreachable code"); should be placed in such places to help identify logic errors.

Code locations of interest are currently marked with comments such as "Impossible" or "X can't happen". A thorough search should be conducted in the entire codebase for these occurrences.

Example

try {
	ChunkIO.save(chunk, this.data.getWriter(), IOContext.COMMS);
} catch (IOException e) {
	// Impossible
}
@OLEGSHA OLEGSHA added the enhancement New feature or request label Dec 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant