Skip to content

Commit

Permalink
LPS-66853 SF, Use Objects.equals instead of Validator.equals
Browse files Browse the repository at this point in the history
  • Loading branch information
hhuijser committed Sep 22, 2016
1 parent 0f091e2 commit 96b1835
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 19 deletions.
Expand Up @@ -16,15 +16,15 @@

<%!
private static boolean _isPendingApproval(WikiPage wikiPage) {
if ((wikiPage == null) || !Validator.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_PENDING_APPROVAL)) {
if ((wikiPage == null) || !Objects.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_PENDING_APPROVAL)) {
return false;
}
return true;
}
private static boolean _isSpam(WikiPage wikiPage) {
if ((wikiPage == null) || !Validator.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_MARKED_AS_SPAM)) {
if ((wikiPage == null) || !Objects.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_MARKED_AS_SPAM)) {
return false;
}
Expand Down
Expand Up @@ -88,15 +88,15 @@ if (bean instanceof WikiPage) {

<%!
private static boolean _isPendingApproval(WikiPage wikiPage) {
if ((wikiPage == null) || !Validator.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_PENDING_APPROVAL)) {
if ((wikiPage == null) || !Objects.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_PENDING_APPROVAL)) {
return false;
}
return true;
}
private static boolean _isSpam(WikiPage wikiPage) {
if ((wikiPage == null) || !Validator.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_MARKED_AS_SPAM)) {
if ((wikiPage == null) || !Objects.equals(wikiPage.getSummary(), _AKISMET_CONSTANTS_WIKI_PAGE_MARKED_AS_SPAM)) {
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions portlets/so-portlet/docroot/activities/init.jsp
Expand Up @@ -35,6 +35,8 @@ page import="com.liferay.social.kernel.model.SocialActivitySet" %><%@
page import="com.liferay.social.kernel.service.SocialActivityLocalServiceUtil" %><%@
page import="com.liferay.social.kernel.service.SocialActivitySetLocalServiceUtil" %>
<%@ page import="java.util.Objects" %>
<%
String tabs1 = ParamUtil.getString(request, "tabs1", "all");
Expand Down
Expand Up @@ -64,7 +64,7 @@ for (SocialActivitySet activitySet : results) {
<%= activityFeedEntry.getBody() %>

<div class="activity-footer">
<c:if test="<%= !Validator.equals(activitySet.getClassName(), MBMessage.class.getName()) %>">
<c:if test="<%= !Objects.equals(activitySet.getClassName(), MBMessage.class.getName()) %>">
<div class="activity-footer-toolbar">
<c:if test="<%= Validator.isNotNull(activityFeedEntry.getLink()) %>">
<span class="action"><%= activityFeedEntry.getLink() %></span>
Expand Down
5 changes: 3 additions & 2 deletions portlets/test-cache-configuration-portlet/docroot/init.jsp
Expand Up @@ -16,10 +16,11 @@

<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>

<%@ page import="com.liferay.portal.kernel.util.Validator" %><%@
page import="com.liferay.registry.Registry" %><%@
<%@ page import="com.liferay.registry.Registry" %><%@
page import="com.liferay.registry.RegistryUtil" %>
<%@ page import="java.util.Objects" %>
<%@ page import="javax.management.Attribute" %><%@
page import="javax.management.AttributeList" %><%@
page import="javax.management.MBeanServer" %><%@
Expand Down
2 changes: 1 addition & 1 deletion portlets/test-cache-configuration-portlet/docroot/view.jsp
Expand Up @@ -46,7 +46,7 @@ private static String _testAttributeList(String cacheManagerName, String name, O
String value = String.valueOf(attribute.getValue());
if (!Validator.equals(value, String.valueOf(values[i]))) {
if (!Objects.equals(value, String.valueOf(values[i]))) {
return name + "=FAILED<br />";
}
}
Expand Down
3 changes: 2 additions & 1 deletion portlets/test-hook-portlet/docroot/init.jsp
Expand Up @@ -24,10 +24,11 @@ page import="com.liferay.portal.kernel.service.UserLocalServiceUtil" %><%@
page import="com.liferay.portal.kernel.util.GetterUtil" %><%@
page import="com.liferay.portal.kernel.util.PropsUtil" %><%@
page import="com.liferay.portal.kernel.util.StringPool" %><%@
page import="com.liferay.portal.kernel.util.Validator" %><%@
page import="com.liferay.testhook.hook.model.impl.TestHookUserImpl" %><%@
page import="com.liferay.testhook.util.TestHookUtil" %>
<%@ page import="java.util.Objects" %>
<liferay-theme:defineObjects />
<portlet:defineObjects />
2 changes: 1 addition & 1 deletion portlets/test-hook-portlet/docroot/view.jsp
Expand Up @@ -56,7 +56,7 @@

<%!
private static String _assertEquals(Object expected, Object actual) {
return _assertTrue(Validator.equals(expected, actual));
return _assertTrue(Objects.equals(expected, actual));
}
private static String _assertFalse(boolean value) {
Expand Down
3 changes: 2 additions & 1 deletion portlets/test-misc-portlet/docroot/init.jsp
Expand Up @@ -25,11 +25,12 @@ page import="com.liferay.portal.kernel.portlet.LiferayWindowState" %><%@
page import="com.liferay.portal.kernel.util.LocaleUtil" %><%@
page import="com.liferay.portal.kernel.util.ParamUtil" %><%@
page import="com.liferay.portal.kernel.util.PortalUtil" %><%@
page import="com.liferay.portal.kernel.util.Validator" %><%@
page import="com.liferay.portal.kernel.util.WebKeys" %><%@
page import="com.liferay.testmisc.messaging.TestPortletConfigMessageListener" %><%@
page import="com.liferay.testmisc.messaging.TestSpringConfigMessageListener" %>
<%@ page import="java.util.Objects" %>
<%@ page import="javax.portlet.ActionRequest" %>
<liferay-theme:defineObjects />
Expand Down
2 changes: 1 addition & 1 deletion portlets/test-misc-portlet/docroot/view.jsp
Expand Up @@ -104,7 +104,7 @@

<%!
private static String _assertEquals(Object expected, Object actual) {
return _assertTrue(Validator.equals(expected, actual));
return _assertTrue(Objects.equals(expected, actual));
}
private static String _assertTrue(boolean value) {
Expand Down
4 changes: 2 additions & 2 deletions portlets/test-pacl-portlet/docroot/init.jsp
Expand Up @@ -67,7 +67,6 @@ page import="com.liferay.portal.kernel.util.PortalClassLoaderUtil" %><%@
page import="com.liferay.portal.kernel.util.PortalUtil" %><%@
page import="com.liferay.portal.kernel.util.PropsKeys" %><%@
page import="com.liferay.portal.kernel.util.ServerDetector" %><%@
page import="com.liferay.portal.kernel.util.Validator" %><%@
page import="com.liferay.testpacl.hook.action.FailureStrutsAction" %><%@
page import="com.liferay.testpacl.hook.action.SuccessStrutsAction" %><%@
page import="com.liferay.testpacl.hook.indexer.OrganizationIndexerPostProcessor" %><%@
Expand Down Expand Up @@ -98,7 +97,8 @@ page import="java.sql.Statement" %>
<%@ page import="java.util.ArrayList" %><%@
page import="java.util.List" %><%@
page import="java.util.Map" %>
page import="java.util.Map" %><%@
page import="java.util.Objects" %>
<%@ page import="javax.crypto.Cipher" %><%@
page import="javax.crypto.KeyGenerator" %><%@
Expand Down
6 changes: 3 additions & 3 deletions portlets/test-pacl-portlet/docroot/view.jsp
Expand Up @@ -1555,8 +1555,8 @@ new JNDISecurityExceptionTest(out, themeDisplay, false) {
Entry existingEntry = EntryLocalServiceUtil.getEntry(entryId);
if (!Validator.equals(entryId, existingEntry.getEntryId()) ||
!Validator.equals(content, existingEntry.getContent())) {
if (!Objects.equals(entryId, existingEntry.getEntryId()) ||
!Objects.equals(content, existingEntry.getContent())) {
throw new Exception("Expected identical entry");
}
Expand Down Expand Up @@ -2792,7 +2792,7 @@ DB db = DBManagerUtil.getDB();

<%!
private static String _assertEquals(Object expected, Object actual) {
return _assertTrue(Validator.equals(expected, actual));
return _assertTrue(Objects.equals(expected, actual));
}
private static String _assertFalse(boolean value) {
Expand Down
3 changes: 2 additions & 1 deletion portlets/test-resources-importer-portlet/docroot/init.jsp
Expand Up @@ -86,7 +86,8 @@ page import="com.liferay.wiki.model.WikiPage" %>
<%@ page import="java.util.HashMap" %><%@
page import="java.util.List" %><%@
page import="java.util.Locale" %><%@
page import="java.util.Map" %>
page import="java.util.Map" %><%@
page import="java.util.Objects" %>
<liferay-theme:defineObjects />
Expand Down
2 changes: 1 addition & 1 deletion portlets/test-resources-importer-portlet/docroot/view.jsp
Expand Up @@ -314,7 +314,7 @@ for (String importer : importers) {

<%!
private static String _assertEquals(Object expected, Object actual) {
return _assertTrue(Validator.equals(expected, actual));
return _assertTrue(Objects.equals(expected, actual));
}
private static String _assertTrue(boolean value) {
Expand Down

0 comments on commit 96b1835

Please sign in to comment.