Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiyanwso2 committed Jan 3, 2025
1 parent 65d92ad commit 138b265
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants.EQUAL_SIGN;
import static org.wso2.healthcare.fhir.ballerina.packagegen.tool.ToolConstants.REGEX_FOR_DEPENDENT_IG_AND_PACKAGE;

/**
* Ballerina package level config.
*/
Expand Down Expand Up @@ -174,10 +171,10 @@ public Map<String, String> getDependentIgs() {
public void setDependentIgs(List<String> dependentIgs) {
for (String dependentIg : dependentIgs) {
// This regex will validate the profile dependentIg pattern <profile_url>=<Ballerina_org_name>/<Ballerina_package_name>
Pattern pattern = Pattern.compile(REGEX_FOR_DEPENDENT_IG_AND_PACKAGE);
Pattern pattern = Pattern.compile(ToolConstants.REGEX_FOR_DEPENDENT_IG_AND_PACKAGE);
Matcher matcher = pattern.matcher(dependentIg);
if (matcher.matches()) {
String[] separatedIgUrlAndDependentPackage = dependentIg.split(EQUAL_SIGN);
String[] separatedIgUrlAndDependentPackage = dependentIg.split(ToolConstants.EQUAL_SIGN);
this.dependentIgs.put(separatedIgUrlAndDependentPackage[0], separatedIgUrlAndDependentPackage[1]);
} else {
throw new RuntimeException("Provided profile dependentIg is wrong: " + dependentIg + " " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private TemplateContext createTemplateContextForResourceSkeletons(ResourceTempla
templateContext.setProperty("importIdentifier", this.resourceProperties.get("importIdentifier"));

Set<String> resourceDependencies = new TreeSet<>();
if (!(boolean)this.resourceProperties.get("isBasePackage")){
if (!(boolean) this.resourceProperties.get("isBasePackage")) {
resourceDependencies.add((String) this.resourceProperties.get("basePackage"));
}

Expand Down

0 comments on commit 138b265

Please sign in to comment.