playframework / playframework/play-ws

Make nullable getters use Optional<T> or Option[T]

Open
#132 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:backlog
Dominant language
Scala
Stars
224
Forks
92
Avg merge
1d 19h
Merged PRs (30d)
28

Description

In many places, the Java WSRequest and WSResponse still use methods which return null:

public interface StandaloneWSRequest {
    String getUsername();

    String getPassword();

    WSAuthScheme getScheme();

    WSSignatureCalculator getCalculator();

    Duration getRequestTimeoutDuration();

    boolean getFollowRedirects();

    String getContentType();
}

And they should return Optional<String> etc where appropriate.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the StandaloneWSRequest and WSResponse interfaces and reviewing the listed nullable getters, including getUsername, getPassword, getScheme, getCalculator, getRequestTimeoutDuration, getContentType, and getFollowRedirects. Determine which return types should become Optional or Option[T], then update the affected API consistently; done means nullable getters no longer expose null where the issue specifies.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.