Number-only keys should be disallowed #127

Open
opened 2026-04-25 14:13:35 +02:00 by lars.winzer · 2 comments
lars.winzer commented 2026-04-25 14:13:35 +02:00 (Migrated from git.scicore.unibas.ch)

Bug Report

Environment

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

Summary

While finalizing the changes in #4 I noticed that number-only keys are allowed.

While the protocol document states that

Only a-z, A-Z, 0-9 are allowed in keys.

meaning that number-only keys are allowed too.

However, they should be not.

Expected Behavior

The TokenClassifier should thrown an exception, informing that number-only keys are not allowed.

Actual Behavior

Following the outlined (current) conventions, number-only keys are allowed.

Steps to Reproduce

  1. Tokenize and Classify a string containing a number-only key (ex. CMD 42=abc )
  2. Observe that the Classifier does not throw an exception.

Stack Trace / Error Message

None

Possible Cause / Notes

None.

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 - d4a3ebb487edd3488026db9a8594f8db88e1fec6 - **Operating system:** macOS - **How was execution started (Gradle task / IDE debug / IDE run):** Not applicable - **Java version:** `25` - **Gradle version**: `9.3.1` ### Summary While finalizing the changes in #4 I noticed that number-only keys are allowed. While the [protocol document](https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/blob/22d742d614d97656138b5352a283da7792bf1265/documents/docs/our-protocol.md) states that > Only a-z, A-Z, 0-9 are allowed in keys. meaning that number-only keys are allowed too. However, they should be not. ### Expected Behavior The TokenClassifier should thrown an exception, informing that number-only keys are not allowed. ### Actual Behavior Following the outlined (current) conventions, number-only keys are allowed. ### Steps to Reproduce 1. Tokenize and Classify a string containing a number-only key (ex. `CMD 42=abc` ) 2. Observe that the Classifier does not throw an exception. ### Stack Trace / Error Message ``` None ``` ### Possible Cause / Notes None. ### Checklist - [x] I reproduced the problem using the steps above - [x] I searched documentation for relevant information - [x] I added relevant labels
lars.winzer commented 2026-04-25 14:13:35 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @lars.winzer

assigned to @lars.winzer
lars.winzer commented 2026-04-27 01:11:37 +02:00 (Migrated from git.scicore.unibas.ch)

Issue will be moved to Milestone 6

Issue will be moved to Milestone 6
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#127