{"action":"opened","issue":{"url":"https://api.github.com/repos/wso2/product-ei/issues/2109","repository_url":"https://api.github.com/repos/wso2/product-ei","labels_url":"https://api.github.com/repos/wso2/product-ei/issues/2109/labels{/name}","comments_url":"https://api.github.com/repos/wso2/product-ei/issues/2109/comments","events_url":"https://api.github.com/repos/wso2/product-ei/issues/2109/events","html_url":"https://github.com/wso2/product-ei/issues/2109","id":312386264,"number":2109,"title":"Cache does not get expired after using clearCache().","user":{"login":"NipuniC","id":29249776,"avatar_url":"https://avatars2.githubusercontent.com/u/29249776?v=4","gravatar_id":"","url":"https://api.github.com/users/NipuniC","html_url":"https://github.com/NipuniC","followers_url":"https://api.github.com/users/NipuniC/followers","following_url":"https://api.github.com/users/NipuniC/following{/other_user}","gists_url":"https://api.github.com/users/NipuniC/gists{/gist_id}","starred_url":"https://api.github.com/users/NipuniC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NipuniC/subscriptions","organizations_url":"https://api.github.com/users/NipuniC/orgs","repos_url":"https://api.github.com/users/NipuniC/repos","events_url":"https://api.github.com/users/NipuniC/events{/privacy}","received_events_url":"https://api.github.com/users/NipuniC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-09T04:08:09Z","updated_at":"2018-04-09T04:08:09Z","closed_at":null,"author_association":"NONE","body":"**Description:**\r\n\r\nWhen clearing cache using clearCache() method it sets the cache expiry time to current system time. \r\n\r\n```\r\nclearCache() {\r\n      if (this.isDynamic()) {\r\n            value = null;\r\n            **expiryTime = System.currentTimeMillis();**\r\n       }\r\n}\r\n```\r\n\r\nSometimes there might be a possibility that getting a null value as isExpired method checks System.currentTimeMillis() > expiryTime. When System.currentTimeMillis() = expiryTime, isExpired set to false which could cause to give a null response. \r\n\r\n```\r\npublic boolean isExpired() {\r\n        return getType() == REMOTE_ENTRY && getExpiryTime() > 0\r\n                && **System.currentTimeMillis() > expiryTime;**\r\n }\r\n```\r\nThis should be fixed as **System.currentTimeMillis() => expiryTime**. Then if current time and expiry time is same, Cache will be considered as expired. \r\n\r\n**Suggested Labels:**\r\nType:Bug\r\n\r\n**Suggested Assignees:**\r\n<!--Optional comma separated list of suggested team members who should attend the issue. Non committers can’t assign issues to assignees, so this will help issue creators who are not a committer to suggest possible assignees-->\r\n\r\n**Affected Product Version:**\r\nEI 6.1.1\r\n\r\n**OS, DB, other environment details and versions:**    \r\n\r\n**Steps to reproduce:**\r\n\r\n\r\n**Related Issues:**\r\n<!-- Any related issues such as sub tasks, issues reported in other repositories (e.g component repositories), similar problems, etc. -->"}}
{"actor":{"display_login":"NipuniC"}}