Skip to content

Commit f887501

Browse files
committed
Fix wrong operator use for string comparisons
1 parent 2954ed3 commit f887501

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/AbstractAPIManager.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ public List<Documentation> getAllDocumentation(String uuid, String organization)
339339
convertedList.add(DocumentMapper.INSTANCE.toDocumentation(docList.get(i)));
340340
}
341341
if (APIConstants.DOC_OWNER_VISIBILITY.equals(String.valueOf(doc.getVisibility()))) {
342-
if (APIConstants.WSO2_ANONYMOUS_USER != username
342+
if (!APIConstants.WSO2_ANONYMOUS_USER.equals(username)
343343
&& !isTenantDomainNotMatching(organization)) {
344344
convertedList.add(DocumentMapper.INSTANCE.toDocumentation(docList.get(i)));
345345
}
346346
}
347347
if (APIConstants.DOC_SHARED_VISIBILITY.equals(String.valueOf(doc.getVisibility()))) {
348-
if (APIConstants.WSO2_ANONYMOUS_USER != username
348+
if (!APIConstants.WSO2_ANONYMOUS_USER.equals(username)
349349
&& !isTenantDomainNotMatching(organization)){
350350
privateDocs.add(DocumentMapper.INSTANCE.toDocumentation(docList.get(i)));
351351
}
@@ -455,11 +455,11 @@ public boolean isDocVisible(org.wso2.carbon.apimgt.persistence.dto.Documentation
455455
if (APIConstants.DOC_API_BASED_VISIBILITY.equals(String.valueOf(doc.getVisibility()))) {
456456
validDoc = true;
457457
} else if (APIConstants.DOC_OWNER_VISIBILITY.equals(String.valueOf(doc.getVisibility()))) {
458-
if (APIConstants.WSO2_ANONYMOUS_USER != username && !isTenantDomainNotMatching(requestedTenantDomain)) {
458+
if (!APIConstants.WSO2_ANONYMOUS_USER.equals(username) && !isTenantDomainNotMatching(requestedTenantDomain)) {
459459
validDoc = true;
460460
}
461461
} else if (APIConstants.DOC_SHARED_VISIBILITY.equals(String.valueOf(doc.getVisibility()))) {
462-
if (APIConstants.WSO2_ANONYMOUS_USER != username && !isTenantDomainNotMatching(requestedTenantDomain)) {
462+
if (!APIConstants.WSO2_ANONYMOUS_USER.equals(username) && !isTenantDomainNotMatching(requestedTenantDomain)) {
463463
try {
464464
if (validatePrivateScopes(username, loggedInTenantDomain)) {
465465
validDoc = true;

0 commit comments

Comments
 (0)