Avoid redundant specification of type for GenericConstraintDef

Description

Currently the constraint type needs to be specified twice when using GenericConstraintDef:

This could be avoided by providing a static factory method which leverages type inference:

Or we provide a parameterless constructor used by anonymous subclasses and retrieve the value of the type parameter internally:

The latter would break compatability though if we want to enforce subclassing by making GenericConstraintDef an anonymous class.

Environment

None

Activity

Gunnar MorlingSeptember 19, 2016 at 2:03 PM

It became a non-issue really with the diamond operator in Java 7. Now that we require 8, this one isn't needed any longer.

Won't Fix

Details

Assignee

Reporter

Participants

Gunnar Morling

Components

Affects versions

Priority

Created July 25, 2013 at 7:17 AM
Updated December 3, 2024 at 9:26 AM
Resolved September 19, 2016 at 2:03 PM