-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.in
39 lines (29 loc) · 1.56 KB
/
README.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## junreachable
The `junreachable` package implements a set of exception types for
unambiguously marking code that is supposed to be unreachable (but that the
compiler cannot prove is unreachable).
## Status
As the Java platform evolves, libraries that may have been necessary in the
past can become unnecessary due to new platform features. The `junreachable`
package falls into this category: There are now far fewer instances in the
Java language where the compiler cannot determine that a given section of
code is unreachable. In particular, switch expressions and sealed types
eliminate many of the situations where unreachable code had to be explicitly
marked.
This package is in maintenance mode and will not see any new functionality.
## Features
* Exceptions for marking unreachable code.
* High coverage test suite.
* [OSGi-ready](https://www.osgi.org/)
* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System)
* ISC license.
## Usage
Throw the `UnreachableCodeException` exception at lines of code that are
expected to be unreachable, but that the compiler cannot prove are really
unreachable. If this exception ends up being thrown, it will unambiguously
signal that the code wasn't as unreachable as the developer thought; this
is clearly a bug.
Throw the `UnimplementedCodeException` exception at lines of code that have
yet to contain real implementations. If this exception ends up being thrown,
it is immediately clear to users and developers alike what happened: The user
tried to use some part of the code that hasn't yet been properly implemented.