Skip to content

Commit

Permalink
Eliminate jstructural
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed May 4, 2024
1 parent 80831b4 commit 697cc03
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 663 deletions.
39 changes: 39 additions & 0 deletions README.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,43 @@ junreachable
| OpenJDK (Temurin) LTS | Linux | [![Build (OpenJDK (Temurin) LTS, Linux)](https://img.shields.io/github/actions/workflow/status/io7m-com/junreachable/main.linux.temurin.lts.yml)](https://www.github.com/io7m-com/junreachable/actions?query=workflow%3Amain.linux.temurin.lts)|
| OpenJDK (Temurin) Current | Windows | [![Build (OpenJDK (Temurin) Current, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/junreachable/main.windows.temurin.current.yml)](https://www.github.com/io7m-com/junreachable/actions?query=workflow%3Amain.windows.temurin.current)|
| OpenJDK (Temurin) LTS | Windows | [![Build (OpenJDK (Temurin) LTS, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/junreachable/main.windows.temurin.lts.yml)](https://www.github.com/io7m-com/junreachable/actions?query=workflow%3Amain.windows.temurin.lts)|

## 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.

214 changes: 0 additions & 214 deletions com.io7m.junreachable.documentation/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 697cc03

Please sign in to comment.