Skip to content

fix: read full line for each client message in JavaLoggingClient#555

Open
bmuschko wants to merge 1 commit into
aspect-build:mainfrom
bmuschko:bmuschko/cli-multi-word-input-bug
Open

fix: read full line for each client message in JavaLoggingClient#555
bmuschko wants to merge 1 commit into
aspect-build:mainfrom
bmuschko:bmuschko/cli-multi-word-input-bug

Conversation

@bmuschko
Copy link
Copy Markdown

@bmuschko bmuschko commented May 19, 2026

Summary

The interactive loop in JavaLoggingClient (logger/client/src/build/aspect/JavaLoggingClient.java) called scanner.next() on every iteration after the initial scanner.nextLine(). Scanner.next() reads only a single whitespace-delimited token, so any message containing a space was split into one send per word. The first message worked correctly because it was read with nextLine(); every subsequent message was tokenized.

Switching the in-loop read to scanner.nextLine() makes the behavior consistent and captures the entire line as a single message.

Reproduction

Enter log messages to send to the server, enter 'exit' to stop the client.
hello world
May 15, 2026 2:51:06 PM build.aspect.JavaLoggingClientLibrary sendLogMessageToServer
INFO: Trying to send message 'hello world' to server...
other message
May 15, 2026 2:51:36 PM build.aspect.JavaLoggingClientLibrary sendLogMessageToServer
INFO: Trying to send message 'other' to server...
May 15, 2026 2:51:36 PM build.aspect.JavaLoggingClientLibrary sendLogMessageToServer
INFO: Trying to send message 'message' to server...

Note the second input other message was sent as two separate messages (other, then message).

The interactive loop used Scanner.next() which reads a single
whitespace-delimited token, causing multi-word messages after the
first to be split into separate sends. Use nextLine() to match the
initial read and capture the entire line.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants