Skip to content

MapboxDirections.Builder requires unnecessary generics #414

@ben-manes

Description

@ben-manes

The builder is defined as,

public static class Builder<T extends Builder> extends MapboxBuilder

and has no subclasses.

The usage examples in the unit tests are,

MapboxDirections client = new MapboxDirections.Builder()
  // ...
  .build();

which produces a warning due to raw types, e.g.

MapboxDirections.Builder is a raw type. References to generic type 
MapboxDirections.Builder<T> should be parameterized.

The client-side solution is to either suppress the warning or fulfill the contract,

MapboxDirections client = new MapboxDirections.Builder<MapboxDirections.Builder<?>>()

Both of these are ugly, with suppression a little less so as the above is ridiculous.

Since the generics serve no purpose, please remove them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions