Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPD-44271 Move if clause inside return #2983

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -921,13 +921,8 @@ public boolean isViewOriginalFileActionAvailable() {
}

public boolean isViewUsagesActionAvailable() {
if (FeatureFlagManagerUtil.isEnabled(
_themeDisplay.getCompanyId(), "LPD-36446")) {

return true;
}

return false;
return FeatureFlagManagerUtil.isEnabled(
_themeDisplay.getCompanyId(), "LPD-36446");
}

public boolean isViewVersionActionAvailable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,11 +1160,7 @@ protected boolean isKeepRecordVersionLabel(
Map<String, Serializable> latestAttributes =
latestExpandoBridge.getAttributes();

if (!lastAttributes.equals(latestAttributes)) {
return false;
}

return true;
return lastAttributes.equals(latestAttributes);
}

protected Fields toFields(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,7 @@ public boolean isShowAddRecordSetIcon() {
}

public boolean isShowCancelButton() {
if (isFormView()) {
return false;
}

return true;
return !isFormView();
}

public boolean isShowConfigurationIcon() throws PortalException {
Expand Down Expand Up @@ -763,11 +759,7 @@ protected boolean hasResults() {
}

protected boolean isSearch() {
if (Validator.isNotNull(getKeywords())) {
return true;
}

return false;
return Validator.isNotNull(getKeywords());
}

private DDMTemplate _fetchDisplayDDMTemplate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,7 @@ protected boolean hasResults() throws PortalException {
}

protected boolean isSearch() {
if (Validator.isNotNull(getKeywords())) {
return true;
}

return false;
return Validator.isNotNull(getKeywords());
}

protected boolean isShowAddRecordButton() throws PortalException {
Expand Down Expand Up @@ -592,11 +588,7 @@ private SearchContext _getSearchContext(
}

private boolean _isDDMFormFieldTransient(DDMFormField ddmFormField) {
if (Validator.isNull(ddmFormField.getDataType())) {
return true;
}

return false;
return Validator.isNull(ddmFormField.getDataType());
}

private void _putDDMFormFieldValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ public boolean validateReference(
fetchStagedModelsByUuidAndCompanyId(
uuid, portletDataContext.getCompanyId());

if (ListUtil.isEmpty(stagedExpandoColumns)) {
return false;
}

return true;
return !ListUtil.isEmpty(stagedExpandoColumns);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ public String getScope() {

@Override
public boolean isVisible() {
if (_featureFlagType.isUIEnabled()) {
return true;
}

return false;
return _featureFlagType.isUIEnabled();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1089,13 +1089,8 @@ private boolean _isImpersonated(
}

private boolean _isPermanentRedirect(long companyId) {
if (Objects.equals(
_getFriendlyURLRedirectionType(companyId), "permanent")) {

return true;
}

return false;
return Objects.equals(
_getFriendlyURLRedirectionType(companyId), "permanent");
}

private boolean _isShowAlternativeLayoutFriendlyURLMessage(long companyId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ public String getLabel(Locale locale) {

@Override
public boolean isSelectable(HttpServletRequest httpServletRequest) {
if (!FeatureFlagManagerUtil.isEnabled("LPS-164563")) {
return false;
}

return true;
return FeatureFlagManagerUtil.isEnabled("LPS-164563");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ public boolean equals(Object object) {
InfoItemFormVariation infoItemFormVariation =
(InfoItemFormVariation)object;

if (Objects.equals(_key, infoItemFormVariation._key)) {
return true;
}

return false;
return Objects.equals(_key, infoItemFormVariation._key);
}

public String getExternalReferenceCode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ public String getViewGroupURL(Group group) {
}

public boolean isGroupTypeActive(String groupType) {
if (groupType.equals(_getGroupType())) {
return true;
}

return false;
return groupType.equals(_getGroupType());
}

protected GroupSelectorDisplayContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,7 @@ private ItemSelectorViewRenderer _applyCustomizations(
private boolean _isSearch(Map<String, String[]> parameters) {
String keywords = getValue(parameters, "keywords");

if (Validator.isNotNull(keywords)) {
return true;
}

return false;
return Validator.isNotNull(keywords);
}

private static final Pattern _itemSelectorURLPattern = Pattern.compile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,11 @@ public SearchContainer<Object> getSearchContainer() throws PortalException {
}

public boolean isDescriptiveDisplayStyle() {
if (Objects.equals(getDisplayStyle(), "descriptive")) {
return true;
}

return false;
return Objects.equals(getDisplayStyle(), "descriptive");
}

public boolean isIconDisplayStyle() {
if (Objects.equals(getDisplayStyle(), "icon")) {
return true;
}

return false;
return Objects.equals(getDisplayStyle(), "icon");
}

public boolean isMultipleSelection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ public Boolean contains(
PermissionChecker permissionChecker, String name, Group group,
String actionId) {

if (permissionChecker.hasPermission(group, name, 0, actionId)) {
return true;
}

return false;
return permissionChecker.hasPermission(group, name, 0, actionId);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ public class CreateAccountPortletManager implements PortletManager {

@Override
public boolean isVisible(Layout layout) {
if (FeatureFlagManagerUtil.isEnabled("LPD-6378")) {
return true;
}

return false;
return FeatureFlagManagerUtil.isEnabled("LPD-6378");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ public class ForgotPasswordPortletManager implements PortletManager {

@Override
public boolean isVisible(Layout layout) {
if (FeatureFlagManagerUtil.isEnabled("LPD-6378")) {
return true;
}

return false;
return FeatureFlagManagerUtil.isEnabled("LPD-6378");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ public static void installLPKG(File file) throws Exception {
}

public static boolean isInstalled(Bundle bundle) {
if (ArrayUtil.contains(_INSTALLED_BUNDLE_STATES, bundle.getState())) {
return true;
}

return false;
return ArrayUtil.contains(_INSTALLED_BUNDLE_STATES, bundle.getState());
}

public static boolean isInstalled(String symbolicName, String version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ public boolean isShow(PortletRequest portletRequest) {

User user = themeDisplay.getUser();

if (user.isGuestUser()) {
return false;
}

return true;
return !user.isGuestUser();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ public static boolean isFragment(Bundle bundle) {

String fragmentHost = headers.get(Constants.FRAGMENT_HOST);

if (Validator.isNotNull(fragmentHost)) {
return true;
}

return false;
return Validator.isNotNull(fragmentHost);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ private static boolean _containsMatches(String regex, String string) {

Matcher matcher = pattern.matcher(string);

if (matcher.find()) {
return true;
}

return false;
return matcher.find();
}

private static String _getKeywordsRegex(String keywords) {
Expand Down Expand Up @@ -111,11 +107,7 @@ private static boolean _hasBundleKeywordsMatch(

String bundleName = headers.get(Constants.BUNDLE_NAME);

if (_containsMatches(keywordsRegex, bundleName)) {
return true;
}

return false;
return _containsMatches(keywordsRegex, bundleName);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ public static void check(PermissionChecker permissionChecker)
public static boolean contains(PermissionChecker permissionChecker)
throws PortalException {

if (!permissionChecker.isOmniadmin()) {
return false;
}

return true;
return permissionChecker.isOmniadmin();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,10 @@ public boolean contains(
if (actionId.equals(ActionKeys.DELETE) ||
actionId.equals(ActionKeys.UPDATE)) {

if (permissionChecker.hasOwnerPermission(
microblogsEntry.getCompanyId(),
MicroblogsEntry.class.getName(),
microblogsEntry.getMicroblogsEntryId(),
microblogsEntry.getUserId(), actionId)) {

return true;
}

return false;
return permissionChecker.hasOwnerPermission(
microblogsEntry.getCompanyId(), MicroblogsEntry.class.getName(),
microblogsEntry.getMicroblogsEntryId(),
microblogsEntry.getUserId(), actionId);
}

if (permissionChecker.hasOwnerPermission(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ public Boolean contains(
PermissionChecker permissionChecker, String name, Group group,
String actionId) {

if (permissionChecker.hasPermission(group, name, 0, actionId)) {
return true;
}

return false;
return permissionChecker.hasPermission(group, name, 0, actionId);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ public Boolean contains(
PermissionChecker permissionChecker, String name, Group group,
String actionId) {

if (permissionChecker.hasPermission(group, name, 0, actionId)) {
return true;
}

return false;
return permissionChecker.hasPermission(group, name, 0, actionId);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,9 @@ public boolean isShow(PortletRequest portletRequest) {
ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
WebKeys.THEME_DISPLAY);

if (PasswordPolicyPermissionUtil.contains(
themeDisplay.getPermissionChecker(),
_getPasswordPolicyId(portletRequest),
ActionKeys.ASSIGN_MEMBERS)) {

return true;
}

return false;
return PasswordPolicyPermissionUtil.contains(
themeDisplay.getPermissionChecker(),
_getPasswordPolicyId(portletRequest), ActionKeys.ASSIGN_MEMBERS);
}

private long _getPasswordPolicyId(PortletRequest portletRequest) {
Expand Down
Loading