Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property value validation as expression vs. literal should be guarded by "${..}" not merely by a single '$' character #440

Open
scottkurz opened this issue Mar 13, 2024 · 0 comments

Comments

@scottkurz
Copy link

In OpenLiberty/liberty-tools-eclipse#501, with LSP4MP v0.10.0, we see a validation error with a microprofile-config.properties property:

mp.messaging.outgoing.systemLoad.value.serializer=io.openliberty.guides.models.SystemLoad$SystemLoadSerializer

Looking at the code:

private boolean isStopReading(StopReading stop) {
if (isEndOfText() || isNewLine()) {
return true;
}
switch (stop) {
case PropertyName:
return isColonSeparator() || isWhiteSpace();
case PropertyValue:
return false;
case PropertyValueExpression:
return last == '}';
case PropertyValueLiteral:
return current == '$';
default:
return isWhiteSpace();
}
}

it seems our parser "state machine" switches over to assuming a property expression substitution upon seeing a single '$' character, looking for something like:

prop2=${prop1}

It seems we might need to rework it to look for "${" before assuming a property expression substitution.

That is more complicated parsing, but will stop there having identified the problem.

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

No branches or pull requests

1 participant