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

Server env blank line issue fix #310

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ public Map<String, PropertiesValidationResult> compute(String text, LibertyTextD
int lineNumber = 0;
try {
while ((line=br.readLine()) != null) {
PropertiesValidationResult validationResult = PropertiesValidationResult.validateServerProperty(line, openedDocument, lineNumber);
if (validationResult.hasErrors()) {
errors.put(line, validationResult);
//blank line is being ignored
if(!line.isBlank()) {
PropertiesValidationResult validationResult = PropertiesValidationResult.validateServerProperty(line, openedDocument, lineNumber);
if (validationResult.hasErrors()) {
errors.put(line, validationResult);
}
}
lineNumber++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void validateServerProperty() {

// check whitespace around equal sign (=)
if (LibertyConfigFileManager.isServerEnvFile(textDocumentItem)) {
if (property.endsWith(" ") || value.startsWith(" ")) {
if ((property != null && property.endsWith(" ")) || (value != null && value.startsWith(" "))) {
startChar = property.trim().length();
endChar = entry.getLineContent().length() - value.trim().length();
hasErrors = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void testServerEnv() throws Exception {
// Checking invalid whitespace before equal sign: WLP_DEBUG_REMOTE =n
createRange(4,16,18),
// Checking invalid whitespace after equal sign: WLP_LOGGING_MESSAGE_FORMAT= SIMPLE
createRange(5,26,28)
createRange(7,26,28)
cherylking marked this conversation as resolved.
Show resolved Hide resolved
);
checkDiagnosticsContainsMessages(
"The value `asdf` is not valid for the variable `WLP_LOGGING_CONSOLE_FORMAT`.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ WLP_LOGGING_CONSOLE_LOGLEVEL=iNfO
WLP_LOGGING_CONSOLE_SOURCE=messagE
WLP_DEBUG_ADDRESS=-2
WLP_DEBUG_REMOTE =n
# adding comment line and blank line to check whether its being ignored

WLP_LOGGING_MESSAGE_FORMAT= SIMPLE
Loading