Skip to content

Comments

Introduce new API to refresh the type cache#431

Merged
NipunaRanasinghe merged 3 commits intoballerina-platform:1.2.xfrom
pasindufernando1:refreshAPIDuplicate
Oct 25, 2025
Merged

Introduce new API to refresh the type cache#431
NipunaRanasinghe merged 3 commits intoballerina-platform:1.2.xfrom
pasindufernando1:refreshAPIDuplicate

Conversation

@pasindufernando1
Copy link
Contributor

@pasindufernando1 pasindufernando1 commented Oct 25, 2025

Purpose

Duplicate PR of #354 targeting patch 1.3.2
Addresses : wso2/product-ballerina-integrator#1389

Copilot AI review requested due to automatic review settings October 25, 2025 11:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new API endpoint to clear the type cache in the data mapper service. The change addresses the need to refresh cached type information by providing a mechanism to clear the visited type map used by the ReferenceType class.

Key Changes:

  • Added thread-safe ConcurrentHashMap implementation for the type cache
  • Introduced a new clearTypeCache() API endpoint in DataMapperService
  • Created DataMapperClearCacheResponse class to handle cache clearing responses

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ReferenceType.java Changed type cache from HashMap to ConcurrentHashMap and added public method to clear the cache
DataMapperClearCacheResponse.java New response class for the cache clearing operation with success indicator
DataMapperService.java Added new API endpoint clearTypeCache() that invokes the cache clearing method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@NipunaRanasinghe NipunaRanasinghe merged commit e8694e1 into ballerina-platform:1.2.x Oct 25, 2025
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants