Skip to content

Commit

Permalink
SAK-32735 use appropriate isNotBlank or isBlank method (sakaiproject#…
Browse files Browse the repository at this point in the history
…4642)

* SAK-32735 use appropriate isNotBlank or isBlank method

* SAK-32735 one more unnecessary null
  • Loading branch information
ottenhoff authored and ern committed Aug 1, 2017
1 parent 0a378dc commit 0b4cf31
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public List<?> getAnnouncementsForSite(EntityView view, Map<String, Object> para

//check if logged in
String currentUserId = sessionManager.getCurrentSessionUserId();
boolean isLoggedIn = !StringUtils.isBlank(currentUserId);
boolean isLoggedIn = StringUtils.isNotBlank(currentUserId);
boolean canReadThemAnyway = securityService.unlock(AnnouncementService.SECURE_ANNC_READ, siteService.siteReference(siteId));

if (isLoggedIn || canReadThemAnyway) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ private void syncSiteMembershipsOnceThenSchedule(Map payload, Site site, boolean

final String membershipsUrl = (String) payload.get("ext_ims_lis_memberships_url");

if (!BasicLTIUtil.isNotBlank(membershipsUrl)) {
if (BasicLTIUtil.isBlank(membershipsUrl)) {
M_log.info("LTI Memberships extension is not supported.");
return;
}
Expand All @@ -966,7 +966,7 @@ private void syncSiteMembershipsOnceThenSchedule(Map payload, Site site, boolean

final String membershipsId = (String) payload.get("ext_ims_lis_memberships_id");

if (!BasicLTIUtil.isNotBlank(membershipsId)) {
if (BasicLTIUtil.isBlank(membershipsId)) {
M_log.info("No memberships id supplied. Memberships will NOT be synchronized.");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void onInitialize() {
final List<GbUser> teachingAssistants = this.businessService.getTeachingAssistants();

// get the TA GbUser for selected (if provided)
if (!StringUtils.isBlank(taUuid)) {
if (StringUtils.isNotBlank(taUuid)) {
for (final GbUser gbUser : teachingAssistants) {
if (taUuid.equals(gbUser.getUserUuid())) {
this.taSelected = gbUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ protected String dereferenceValue(String value) {
int pointer = 0;
while (matcher.find()) {
String name = matcher.group(1);
if (name != null && StringUtils.isNotBlank(name)) {
if (StringUtils.isNotBlank(name)) {
// look up the value
String replacementValue = null;
ConfigItemImpl ci = findConfigItem(name, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void merge(ConfigItem ci) {
this.value = ci.getValue();
this.type = setValue(ci.getValue());
this.description = ci.getDescription();
if (!StringUtils.isBlank(ci.getSource())) {
if (StringUtils.isNotBlank(ci.getSource())) {
this.source = ci.getSource();
}
this.defaultValue = ci.getDefaultValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private boolean isMathJaxEnabled(Entity entity) {
if (entity instanceof Site) {
Site site = (Site)entity;
String strMathJaxEnabled = site.getProperties().getProperty(MATHJAX_ENABLED);
if (!StringUtils.isBlank(strMathJaxEnabled))
if (StringUtils.isNotBlank(strMathJaxEnabled))
{
String[] mathJaxTools = strMathJaxEnabled.split(",");
if (ArrayUtils.contains(mathJaxTools, "sakai.resources"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public boolean isAllowedToJoin(Site site)
*/
public boolean isLimitByAccountTypeEnabled(String siteID)
{
if(siteID == null || StringUtils.isBlank(siteID))
if(StringUtils.isBlank(siteID))
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ public Properties toolHeaderProperties(HttpServletRequest req, String skin, Site
if (site != null)
{
String strMathJaxEnabledForSite = site.getProperties().getProperty(MATHJAX_ENABLED);
if (!StringUtils.isBlank(strMathJaxEnabledForSite))
if (StringUtils.isNotBlank(strMathJaxEnabledForSite))
{
if (Boolean.valueOf(strMathJaxEnabledForSite))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public Object readSqlResultRecord(ResultSet rs) {
try {
User fromUser = userDirectoryService.getUser(alert.from);
alert.fromDisplayName = fromUser.getDisplayName();
if (!StringUtils.isBlank(alert.siteId)) {
if (StringUtils.isNotBlank(alert.siteId)) {
alert.siteTitle = siteService.getSite(alert.siteId).getTitle();
}
} catch (UserNotDefinedException unde) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ protected void setupForward(HttpServletRequest req, HttpServletResponse res,
if (site != null)
{
String strMathJaxEnabledForSite = site.getProperties().getProperty(MATHJAX_ENABLED);
if (!StringUtils.isBlank(strMathJaxEnabledForSite))
if (StringUtils.isNotBlank(strMathJaxEnabledForSite))
{
if (Boolean.valueOf(strMathJaxEnabledForSite))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ public void processActionEdit(ActionRequest request, ActionResponse response)
}

// If we have a URL from the user, lets validate it
if ((!StringUtils.isBlank(source)) && (!validateURL(source)) ) {
if ((StringUtils.isNotBlank(source)) && (!validateURL(source)) ) {
addAlert(request, rb.getString("gen.url.invalid"));
return;
}
Expand All @@ -775,7 +775,7 @@ public void processActionEdit(ActionRequest request, ActionResponse response)
}

// If we have an infourl from the user, lets validate it
if ((!StringUtils.isBlank(infoUrl)) && (!validateURL(infoUrl)) ) {
if ((StringUtils.isNotBlank(infoUrl)) && (!validateURL(infoUrl)) ) {
addAlert(request, rb.getString("gen.url.invalid"));
return;
}
Expand Down

0 comments on commit 0b4cf31

Please sign in to comment.