Skip to content

ObaStudyRequest.Builder.URI should be an instance field, not static #1539

@aaronbrethorst

Description

@aaronbrethorst

Problem

In ObaStudyRequest.java:29, URI is declared private static, meaning it's shared across all Builder instances. If a Builder runs successfully for one region, then a subsequent Builder hits an early return (e.g., region == null or baseUrl == null), URI retains the stale value from the previous invocation. The next build() call would silently create a request targeting the wrong region.

Suggested Fix

Change URI from a static field to an instance field:

public static class Builder {
    private Uri mUri = null;  // was: private static Uri URI = null;
    // ...
}

Context

Discovered during review of #1525, which correctly added a null guard for getCurrentRegion() but the static field issue is pre-existing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions