Skip to content

Commit

Permalink
Fix reading service type before modification
Browse files Browse the repository at this point in the history
  • Loading branch information
TharmiganK committed Aug 12, 2024
1 parent 71e85df commit 3b6bf30
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import static io.ballerina.stdlib.http.compiler.Constants.COLON;
import static io.ballerina.stdlib.http.compiler.Constants.HTTP;
import static io.ballerina.stdlib.http.compiler.Constants.SERVICE_CONFIG_ANNOTATION;
import static io.ballerina.stdlib.http.compiler.Constants.SERVICE_TYPE;
import static io.ballerina.stdlib.http.compiler.HttpServiceValidator.getServiceContractTypeDesc;

/**
Expand Down Expand Up @@ -177,7 +178,7 @@ private ServiceDeclarationNode updateServiceConfigAnnotation(TypeDescriptorNode
boolean hasServiceType = fields.stream().anyMatch(field -> {
if (field.kind().equals(SyntaxKind.SPECIFIC_FIELD)) {
SpecificFieldNode specificField = (SpecificFieldNode) field;
return specificField.fieldName().toString().equals("serviceType");
return specificField.fieldName().toString().trim().equals(SERVICE_TYPE);

Check warning on line 181 in compiler-plugin/src/main/java/io/ballerina/stdlib/http/compiler/codemodifier/contract/ContractInfoModifierTask.java

View check run for this annotation

Codecov / codecov/patch

compiler-plugin/src/main/java/io/ballerina/stdlib/http/compiler/codemodifier/contract/ContractInfoModifierTask.java#L181

Added line #L181 was not covered by tests
}
return false;
});
Expand Down

0 comments on commit 3b6bf30

Please sign in to comment.