You can follow these steps.
- Clone the repository - carbon-registry
- Checkout to the version of v4.6.38 in the carbon-registry.
You can derive this version v4.6.38 based on the component you patch. For an example, GetTextContentUtil.java is a part of the org.wso2.carbon.registry.resource component. To find the version in the wso2am-2.6.0, navigate to repository/components/plugins folder. There you can find the org.wso2.carbon.registry.resource_4.6.38.jar. Basically we need to patch this jar.
- Apply the fix in the PR
- Build the repository and you can find the built jar in target directory (carbon-registry/components/registry/org.wso2.carbon.registry.resource/target)
- Replace that jar with the jar in repository/components/plugins/ folder. (Make sure you backup your jar)
- Without replacing you can apply this as a patch as well. To do that you can create a folder called patch9999 and add that jar to this folder. And then copy that directory to repository/components/patches directory.