Skip to content

Releases: problem4j/problem4j-core

v2.0.0

07 May 19:00
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:2.0.0")
    }

Important

The primary point of release 2.0.0 is refinement and cleanup of the library's public API.

Migration Guide

  • Method Problem.getExtensions() now returns Map<String, Object> (full unmodifiable map of extensions) instead of extension names.
  • Method Problem.getExtensionMembers() was removed - use Problem.getExtensions().
  • Method Problem.getExtensionValue(String) was removed - use Problem.getExtensions().get(Object).
  • Method Problem.hasExtension(String) was removed - use Problem.getExtensions().containsKey(Object).
  • Interface Problem.Extension no longer extends Map.Entry and getKey() was renamed to getName().
  • Enum ProblemStatus was removed.
  • Default AbstractProblem, AbstractProblemBuilder, AbstractProblemContext and AbstractProblemMapper classes were removed - library now favors internal default implementations.
  • Deprecated methods from Problem and ProblemBuilder were removed.

Added

  • Add DefaultProblemMapper to replace AbstractProblemMapper and ProblemMapper.create().
  • Add StatusTitleResolver SPI to allow users to provide custom resolution of status code into title. To be used with HTTP status enums depending on the user's framework.
  • Add ProblemSupport for common utilities.

Changed

  • Make all methods in Problem, ProblemBuilder and ProblemContext interfaces non-default.
  • Make Problem.Extension not extend Map.Entry and instead be a simple data class with name and value properties.
  • Reorganize interface default methods.

Removed

  • Remove deprecated methods from ProblemBuilder.
  • Minify number of methods in Problem - plain getExtensions() returning Map<String, Object> is enough.
  • Remove deprecated ProblemStatus enum from public API. The resolution of status code into title is still supported and available for extension via StatusTitleResolver SPI.
  • Remove AbstractProblem class - use Problem objects created via Problem.builder() or static factory methods. Custom implementations of Problem can be created by implementing the Problem interface.
  • Remove AbstractProblemBuilder class - use Problem.builder() static method to get default builder implementation. Custom implementations of ProblemBuilder can be created by implementing the ProblemBuilder interface.
  • Remove AbstractProblemContext class - use ProblemContext objects created via ProblemContext.create() static method. Custom implementations of ProblemContext can be created by implementing the ProblemContext interface.
  • Remove AbstractProblemMapper class - use DefaultProblemMapper instead.

v2.0.0-RC1

03 May 19:18
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

v2.0.0-RC1 Pre-release
Pre-release
  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>2.0.0-RC1</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:2.0.0-RC1")
    }

Important

The primary point of release 2.0.0 is refinement and cleanup of the library's public API. It simplifies the API for Problem by providing a single getExtensions() method for problem extension members management, returning an unmodifiable Map, and drops abstract implementations in favour of keeping most of the the internals as package-private.

Migration guide will be noted for the final 2.0.0 release.

Added

  • Add DefaultProblemMapper to replace AbstractProblemMapper and ProblemMapper.create().
  • Add StatusTitleResolver SPI to allow users to provide custom resolution of status code into title. To be used with HTTP status enums depending on the user's framework.
  • Add ProblemSupport for common utilities.

Changed

  • Make all methods in Problem, ProblemBuilder and ProblemContext interfaces non-default.
  • Make Problem.Extension not extend Map.Entry and instead be a simple data class with name and value properties.
  • Reorganize interface default methods.

Removed

  • Remove deprecated methods from ProblemBuilder.
  • Minify number of methods in Problem - plain getExtensions() returning Map<String, Object> is enough.
  • Remove deprecated ProblemStatus enum from public API. The resolution of status code into title is still supported and available for extension via StatusTitleResolver SPI.
  • Remove AbstractProblem class - use Problem objects created via Problem.builder() or static factory methods. Custom implementations of Problem can be created by implementing the Problem interface.
  • Remove AbstractProblemBuilder class - use Problem.builder() static method to get default builder implementation. Custom implementations of ProblemBuilder can be created by implementing the ProblemBuilder interface.
  • Remove AbstractProblemContext class - use ProblemContext objects created via ProblemContext.create() static method. Custom implementations of ProblemContext can be created by implementing the ProblemContext interface.
  • Remove AbstractProblemMapper class - use DefaultProblemMapper instead.

v1.4.3

14 Mar 20:03
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.4.3</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.4.3")
    }

Fixed

  • Deprecate ProblemStatus (see JavaDocs for details).

v1.4.2

26 Feb 18:12
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.4.2</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.4.2")
    }

Fixed

  • Make ProblemBuilder remove extension member if null values is passed, instead of silently ignoring it and keeping the previous value.
  • Cleanup default methods in ProblemBuilder interface.

v1.4.1

17 Feb 20:43
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.4.1</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.4.1")
    }

Fixed

  • Change type from Object to ? extends Object (and @Nullable Object to ? extends @Nullable Object) for generics in method arguments to support covariant arguments.

v1.4.0

16 Feb 22:23
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.4.0</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.4.0")
    }

Added

  • Add various static Problem.of(...) factory methods for in-place creation convenience.
  • Add support for JSpecify annotations for nullability and Kotlin interop.
  • Add support for Java Platform Module System if using Java version 9+, due to producing multi-release JAR artifacts.
    module org.example.project {
        requires io.github.problem4j.core;
    }

v1.4.0-RC1

14 Feb 15:54
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

v1.4.0-RC1 Pre-release
Pre-release
  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.4.0-RC1</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.4.0-RC1")
    }

Added

  • Add various static Problem.of(...) factory methods for in-place creation convenience.
  • Add support for JSpecify annotations for nullability and Kotlin interop.
  • Add support for Java Platform Module System if using Java version 9+, due to producing multi-release JAR artifacts.
    module org.example.project {
        requires io.github.problem4j.core;
    }

v1.3.3

12 Feb 17:04
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.3.3</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.3.3")
    }

Fixed

  • Pull back from the idea of returning JSON-alike strings in toString() methods of this library's classes. While it was nice, since Content-Type is named application/problem+json, these strings were not 100% valid JSONs in all scenarios, and it could be tempting to use it as a response body somewhere. Instead of that, toString methods will now produce strings that are simple, useful for logging/debugging and JSON representations should be delegated to jackson-databind and problem4j-jackson, or any other library that may be supported in the future.
  • Seal the contract between toProblemBuilder method overloading in AbstractProblemMapper by making one method final. Any extensions this logic should be performed by overriding the second method as the first one must only delegate to it.
    @Override
    public final ProblemBuilder toProblemBuilder(Throwable t) {
        return toProblemBuilder(t, null);
    }
    
    @Override
    public ProblemBuilder toProblemBuilder(Throwable t, ProblemContext context) {
        // ...
  • Re-use instance of default implementation of ProblemMapper returned by ProblemMapper.create(), because it's thread-safe, stateless and immutable.
  • Make resolution of deprecated HTTP status codes in ProblemStatus lazy, by delegating to nested class.
  • Apply minor improvements to JavaDocs.

v1.3.2

29 Jan 22:08
Immutable release. Only release title and notes can be modified.
d6a5a0e

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.3.2</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.3.2")
    }

Fixed

  • Resolve confusing naming of ProblemBuilder interface methods having singular naming, but actually taking plural arguments (and deprecate old ones).
  • Apply minor fixes in JavaDocs, toString and exception messages.

v1.3.1

13 Jan 19:11
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

  1. Maven:
    <dependencies>
        <dependency>
            <groupId>io.github.problem4j</groupId>
            <artifactId>problem4j-core</artifactId>
            <version>1.3.1</version>
        </dependency>
    </dependencies>
  2. Gradle (Kotlin DSL):
    dependencies {
        implementation("io.github.problem4j:problem4j-core:1.3.1")
    }

Added

  • Override toString in AbstractProblemBuilder (probably won't be used but useful in debug mode).
  • Unify toString overrides of AbstractProblem, AbstractProblemBuilder and AbstractProblemContext to return output in similar style.
  • Finalize missing JavaDocs (and fix various existing) - all public classes and methods now have proper JavaDocs.
  • Annotate ProblemMapping with @Documented so it will appear in JavaDocs.

Changed

  • Use HashMap instead of LinkedHashMap for AbstractProblemBuilder, as order of insertion of extension members does not matter.