Inconsistent visibility of ThrowingParser prevents use of typed overloads in CommandParsers #81

Closed
opened 2026-04-10 11:20:37 +02:00 by jona.walpert · 5 comments
jona.walpert commented 2026-04-10 11:20:37 +02:00 (Migrated from git.scicore.unibas.ch)

Bug Report

Environment

  • Branch & Commit: main
  • Operating system: Widnwos
  • How was execution started (Gradle task / IDE debug / IDE run): IDE debug
  • Java version: 25
  • Gradle version: 9.3.1

Summary

The ThrowingParser interface is not declared as public. This prevents classes in other packages (such as Command Parsers) from using the public methods of the RequestParameterAccessor class that utilize this type in their method signatures.

Expected Behavior

According to the project documentation you should be able to use typed overloads like accessor.require("KEY", Integer::parseInt) to avoid manual exception handling within the parsers.

Actual Behavior

The Java compiler fails with the following error:

The type ThrowingParser from the descriptor computed for the target context is not visible here.

Steps to Reproduce

  • Create a new Command Parser in a package outside of ...accessor (e.g., ch.unibas.dmi.dbis.cs108.casono.server.app.commands.raise).
  • Attempt to call the method RequestParameterAccessor.require(String, ThrowingParser<T>) using a method reference like Integer::parseInt

Stack Trace / Error Message

The type ThrowingParser<Integer> from the descriptor computed for the target context is not visible here.

Possible Cause / Notes

The access modifier public is missing from the ThrowingParser interface declaration in RequestParameterAccessor.java. Since this interface serves as a formal parameter in a public API method, it must also be publicly accessible so that the method reference (target typing) can be resolved in the caller's context.

Checklist

  • I reproduced the problem using the steps above
  • I searched documentation for relevant information
  • I added relevant labels
## Bug Report <!--The reccommended type is: Issue--> ### Environment - **Branch & Commit: main** - **Operating system: Widnwos** - **How was execution started (Gradle task / IDE debug / IDE run): IDE debug** - **Java version:** 25 - **Gradle version**: 9.3.1 ### Summary The ThrowingParser interface is not declared as public. This prevents classes in other packages (such as Command Parsers) from using the public methods of the RequestParameterAccessor class that utilize this type in their method signatures. ### Expected Behavior According to the project documentation you should be able to use typed overloads like accessor.require("KEY", Integer::parseInt) to avoid manual exception handling within the parsers. ### Actual Behavior The Java compiler fails with the following error: `The type ThrowingParser from the descriptor computed for the target context is not visible here`. ### Steps to Reproduce * Create a new Command Parser in a package outside of `...accessor` (e.g., `ch.unibas.dmi.dbis.cs108.casono.server.app.commands.raise`). * Attempt to call the method `RequestParameterAccessor.require(String, ThrowingParser<T>)` using a method reference like `Integer::parseInt` ### Stack Trace / Error Message ``` The type ThrowingParser<Integer> from the descriptor computed for the target context is not visible here. ``` ### Possible Cause / Notes The access modifier `public` is missing from the `ThrowingParser` interface declaration in `RequestParameterAccessor.java`. Since this interface serves as a formal parameter in a public API method, it must also be publicly accessible so that the method reference (target typing) can be resolved in the caller's context. ### Checklist - [x] I reproduced the problem using the steps above - [x] I searched documentation for relevant information - [x] I added relevant labels
jona.walpert commented 2026-04-10 11:20:37 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @lars.winzer

assigned to @lars.winzer
lars.winzer commented 2026-04-10 11:24:40 +02:00 (Migrated from git.scicore.unibas.ch)

created branch fix/81-incorrect-visibility-of-throwingparser to address this issue

created branch [`fix/81-incorrect-visibility-of-throwingparser`](/cs108-fs26/Gruppe-13/-/compare/main...fix%2F81-incorrect-visibility-of-throwingparser) to address this issue
lars.winzer commented 2026-04-10 11:25:23 +02:00 (Migrated from git.scicore.unibas.ch)

added 3m of time spent at 2026-04-10 12:00:00 +0200

added 3m of time spent at 2026-04-10 12:00:00 +0200
lars.winzer commented 2026-04-10 11:26:02 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !94

mentioned in merge request !94
lars.winzer commented 2026-04-10 11:30:23 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in commit 3ee1e63577

mentioned in commit 3ee1e6357748f3899428e0abada9029bb10d4367
lars.winzer (Migrated from git.scicore.unibas.ch) closed this issue 2026-04-10 11:30:23 +02:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#81