diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java index 53125daf6d5a..ee15d8d96395 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/SubscriptionValidationDAO.java @@ -1149,7 +1149,6 @@ private void attachURlMappingDetailsOfApiProduct(Connection connection, API api) } public API getAPIByContextAndVersion(String context, String version, String deployment, boolean isExpand) { - long start = System.nanoTime(); String sql = SubscriptionValidationSQLConstants.GET_API_BY_CONTEXT_AND_VERSION_SQL; try (Connection connection = APIMgtDBUtil.getConnection()) { try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) { @@ -1188,9 +1187,6 @@ public API getAPIByContextAndVersion(String context, String version, String depl } else { api.setPolicy(null); } - long end = System.nanoTime(); - log.info("Time taken to execute query : " + (end - start) + " ns"); - log.debug("Time taken to execute query : " + (end - start) + " ns"); return api; } } @@ -1214,10 +1210,6 @@ private void attachURLMappingDetails(Connection connection, String revisionId, A String urlPattern = resultSet.getString("URL_PATTERN"); String throttlingTier = resultSet.getString("THROTTLING_TIER"); String scopeName = resultSet.getString("SCOPE_NAME"); -// String policyName = resultSet.getString("POLICY_NAME"); -// String policyVersion = resultSet.getString("POLICY_VERSION"); -// String direction = resultSet.getString("DIRECTION"); -// String policyID = resultSet.getString("POLICY_UUID"); URLMapping urlMapping = api.getResource(urlPattern, httpMethod); if (urlMapping == null) { urlMapping = new URLMapping(); @@ -1226,15 +1218,6 @@ private void attachURLMappingDetails(Connection connection, String revisionId, A urlMapping.setThrottlingPolicy(throttlingTier); urlMapping.setUrlPattern(urlPattern); } -// if (StringUtils.isNotEmpty(policyID) && StringUtils.isNotEmpty(policyName) -// && StringUtils.isNotEmpty(policyVersion) && StringUtils.isNotEmpty(direction)) { -// OperationPolicy operationPolicy = new OperationPolicy(); -// operationPolicy.setPolicyId(policyID); -// operationPolicy.setPolicyName(policyName); -// operationPolicy.setPolicyVersion(policyVersion); -// operationPolicy.setDirection(direction); -// urlMapping.setOperationPolicies(operationPolicy); -// } if (StringUtils.isNotEmpty(scopeName)) { urlMapping.addScope(scopeName); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/java/org/wso2/carbon/apimgt/keymgt/handlers/DefaultKeyValidationHandler.java b/components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/java/org/wso2/carbon/apimgt/keymgt/handlers/DefaultKeyValidationHandler.java index b8ea9e9f0e73..c918dc8ea863 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/java/org/wso2/carbon/apimgt/keymgt/handlers/DefaultKeyValidationHandler.java +++ b/components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/java/org/wso2/carbon/apimgt/keymgt/handlers/DefaultKeyValidationHandler.java @@ -189,7 +189,7 @@ public boolean validateScopes(TokenValidationContext validationContext) throws A scopesValidated = true; continue; } - List mappingScopes = new ArrayList<>(urlMapping.getScopes()); + List mappingScopes = urlMapping.getScopes(); boolean validate = false; for (String scope : mappingScopes) { if (scopesSet.contains(scope)) {