Skip to content

Commit

Permalink
Merge pull request #2735 from ChristianMurphy/chore/spell-check-code
Browse files Browse the repository at this point in the history
chore: spelling fixes
  • Loading branch information
ChristianMurphy authored Nov 18, 2023
2 parents 2f20f81 + 3a39583 commit 2f66730
Show file tree
Hide file tree
Showing 190 changed files with 1,078 additions and 1,048 deletions.
18 changes: 18 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"words": [
"Apereo",
"Cacheable",
"ClassPath",
"Gradle",
"Jasig",
"JDBC",
"Portlet",
"Portlets",
"RDBM",
"Respondr",
"Servlet",
"SpringFramework",
"uPortal"
]
}
6 changes: 3 additions & 3 deletions docs/developer/soffits/soffit_data_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ public class Attributes {

@SoffitModelAttribute("bearerJson")
public String getBearerJson(Bearer bearer) {
String rslt = null;
String result = null;
try {
rslt = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(bearer);
result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(bearer);
} catch (JsonProcessingException e) {
final String msg = "Unable to write the Bearer object to JSON";
throw new RuntimeException(msg, e);
}
return rslt;
return result;
}

}
Expand Down
6 changes: 3 additions & 3 deletions docs/fr/developper/soffits/soffit_modele_de_donnee.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public class Attributes {

@SoffitModelAttribute("bearerJson")
public String getBearerJson(Bearer bearer) {
String rslt = null;
String result = null;
try {
rslt = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(bearer);
result = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(bearer);
} catch (JsonProcessingException e) {
final String msg = "Unable to write the Bearer object to JSON";
throw new RuntimeException(msg, e);
}
return rslt;
return result;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public JsonEntityBean getIndividualBestRootEntity(

// So much for the easy path -- see if the user has any records at all for this specific
// owner/activity
JsonEntityBean rslt = null; // Default
JsonEntityBean result = null; // Default
final List<IPermission> permissionsOfRelevantActivity = new ArrayList<IPermission>();
for (String activity : permissionActivities) {
permissionsOfRelevantActivity.addAll(
Expand Down Expand Up @@ -219,18 +219,18 @@ public JsonEntityBean getIndividualBestRootEntity(
if (!candidate.getEntityTypeAsString().equalsIgnoreCase(groupType)) {
continue;
}
if (rslt == null) {
if (result == null) {
// First allowable selection; run with this one
// unless/until we're forced to make a choice.
rslt = candidate;
result = candidate;
} else {
// For the present we'll assume the match with the most
// children is the best; this approach should work
// decently unless folks start putting redundant
// permissions records in the DB for multiple levels of
// the same rich hierarchy.
if (candidate.getChildren().size() > rslt.getChildren().size()) {
rslt = candidate;
if (candidate.getChildren().size() > result.getChildren().size()) {
result = candidate;
}
}
}
Expand All @@ -248,10 +248,10 @@ public JsonEntityBean getIndividualBestRootEntity(
+ "', permissionActivities='"
+ Arrays.toString(permissionActivities)
+ "' the following best root group: "
+ rslt);
+ result);
}

return rslt;
return result;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.io.Serializable;

/**
* Simple class that wraps a string and provides a getter/setter. Nessescary for binding into the
* Simple class that wraps a string and provides a getter/setter. Necessary for binding into the
* value of a Map in WebFlow
*/
public class Attribute implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class StringListAttribute implements Serializable {
private static final long serialVersionUID = 1L;
public static final List<String> LIST_EMTPY_ITEMS = Arrays.asList("", null);
public static final List<String> LIST_EMPTY_ITEMS = Arrays.asList("", null);
private List<String> value = new ArrayList<String>();

public StringListAttribute() {}
Expand Down Expand Up @@ -51,16 +51,16 @@ public List<String> getValue() {
* @return
*/
public boolean isBlank() {
boolean rslt = true; // default
boolean result = true; // default
if (value != null) {
for (String v : value) {
if (StringUtils.isNotBlank(v)) {
rslt = false;
result = false;
break;
}
}
}
return rslt;
return result;
}

/** @param value the value to set */
Expand All @@ -77,7 +77,7 @@ public void setValue(String[] value) {
}

private void removeAllEmptyItems(List<String> value) {
value.removeAll(LIST_EMTPY_ITEMS);
value.removeAll(LIST_EMPTY_ITEMS);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ public void setAttributes(Map<String, StringListAttribute> attributes) {
* @return The user's attributes that are not listed in <code>accountEditAttributes</code>
*/
public Map<String, StringListAttribute> getCustomAttributes() {
Map<String, StringListAttribute> rslt =
Map<String, StringListAttribute> result =
new HashMap<String, StringListAttribute>(attributes);
for (Preference p : accountEditAttributes) {
rslt.remove(p.getName());
result.remove(p.getName());
}
return Collections.unmodifiableMap(rslt);
return Collections.unmodifiableMap(result);
}

public String getPassword() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public List<IUserLayoutNodeDescription> getFavoritePortletLayoutNodes(IUserLayou
}

public Set<IPortletDefinition> getFavoritePortletDefinitions(IUserLayout layout) {
final Set<IPortletDefinition> rslt = new HashSet<>();
final Set<IPortletDefinition> result = new HashSet<>();
final List<IUserLayoutNodeDescription> favoriteLayoutNodes =
getFavoritePortletLayoutNodes(layout);
favoriteLayoutNodes.stream()
Expand All @@ -267,11 +267,11 @@ public String getStringId() {
final IPortletDefinition pDef =
portletRegistry.getPortletDefinition(pId);
if (pDef != null) {
rslt.add(pDef);
result.add(pDef);
}
}
});
return rslt;
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ public static EntityEnum getEntityEnum(String type) {
}

public static EntityEnum getEntityEnum(Class<?> entityTypeClazz, boolean isGroup) {
EntityEnum rslt = null;
EntityEnum result = null;
for (EntityEnum val : EntityEnum.values()) {
if (val.getClazz().equals(entityTypeClazz) && val.isGroup() == isGroup) {
rslt = val;
result = val;
break;
}
}
return rslt;
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void updateUserLocale(HttpServletRequest request, String localeString) {
localeManager.setUserLocales(Collections.singletonList(userLocale));
localeStore.updateUserLocales(person, new Locale[] {userLocale});

// remove person layout framgent from session since it contains some of the data
// remove person layout fragment from session since it contains some of the data
// in previous
// translation and won't be cleared until next logout-login (applies when using
// RDBMDistributedLayoutStore as user layout store).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,16 +462,16 @@ protected Set<String> getPermittedOwnAttributes(
final Set<String> generallyPermittedAttributes) {

// The permttedOwnAttributes collection includes all the generallyPermittedAttributes
final Set<String> rslt = new HashSet<>(generallyPermittedAttributes);
final Set<String> result = new HashSet<>(generallyPermittedAttributes);

for (String attr : personAttributeDao.getPossibleUserAttributeNames()) {
if (principal.hasPermission(
IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) {
rslt.add(attr);
result.add(attr);
}
}

return rslt;
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void resetAttributes(ExternalContext externalContext) {
final Principal currentUser = externalContext.getCurrentUser();
final String uid = currentUser.getName();

this.logger.warn("User '" + uid + "' reseting to default attributes");
this.logger.warn("User '" + uid + "' resetting to default attributes");

// Remove the person directory override
this.portalRootPersonAttributeDao.removeUserAttributeOverride(uid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public ModelAndView getPortletRegistry(
*/
final Set<IPortletDefinition> favoritePortlets = calculateFavoritePortlets(request);

Map<String, SortedSet<PortletCategoryBean>> rslt =
Map<String, SortedSet<PortletCategoryBean>> result =
getRegistry43(
webRequest,
user,
Expand All @@ -245,10 +245,10 @@ public ModelAndView getPortletRegistry(
if (Boolean.valueOf(favorite)) {
log.debug(
"Filtering out non-favorite portlets because 'favorite=true' was included in the query string");
rslt = filterRegistryFavoritesOnly(rslt);
result = filterRegistryFavoritesOnly(result);
}

return new ModelAndView("jsonView", "registry", rslt);
return new ModelAndView("jsonView", "registry", result);
}

/*
Expand All @@ -269,7 +269,7 @@ private Map<String, SortedSet<?>> getRegistryOriginal(WebRequest request, IPerso
new HashSet<>(portletDefinitionRegistry.getAllPortletDefinitions());

// construct a new channel registry
Map<String, SortedSet<?>> rslt = new TreeMap<>();
Map<String, SortedSet<?>> result = new TreeMap<>();
SortedSet<ChannelCategoryBean> categories = new TreeSet<>();

// add the root category and all its children to the registry
Expand Down Expand Up @@ -311,8 +311,8 @@ private Map<String, SortedSet<?>> getRegistryOriginal(WebRequest request, IPerso
// Add even if no portlets in category
categories.add(uncategorizedPortletsBean);

rslt.put(CATEGORIES_MAP_KEY, categories);
return rslt;
result.put(CATEGORIES_MAP_KEY, categories);
return result;
}

private ChannelCategoryBean prepareCategoryBean(
Expand Down Expand Up @@ -410,7 +410,7 @@ private Map<String, SortedSet<PortletCategoryBean>> getRegistry43(
// tracking them

// construct a new channel registry
Map<String, SortedSet<PortletCategoryBean>> rslt = new TreeMap<>();
Map<String, SortedSet<PortletCategoryBean>> result = new TreeMap<>();
SortedSet<PortletCategoryBean> categories = new TreeSet<>();

// add the root category and all its children to the registry
Expand Down Expand Up @@ -459,8 +459,8 @@ private Map<String, SortedSet<PortletCategoryBean>> getRegistry43(
categories.add(unc);
}

rslt.put(CATEGORIES_MAP_KEY, categories);
return rslt;
result.put(CATEGORIES_MAP_KEY, categories);
return result;
}

private PortletCategoryBean preparePortletCategoryBean(
Expand Down Expand Up @@ -518,18 +518,18 @@ private PortletDefinitionBean preparePortletDefinitionBean(
WebRequest req, IPortletDefinition portlet, Locale locale, Boolean favorite) {
MarketplacePortletDefinition mktpd =
marketplaceService.getOrCreateMarketplacePortletDefinition(portlet);
PortletDefinitionBean rslt =
PortletDefinitionBean result =
PortletDefinitionBean.fromMarketplacePortletDefinition(mktpd, locale, favorite);

// See api docs for postProcessIconUrlParameter() below
IPortletDefinitionParameter iconParameter =
rslt.getParameters().get(ICON_URL_PARAMETER_NAME);
result.getParameters().get(ICON_URL_PARAMETER_NAME);
if (iconParameter != null) {
IPortletDefinitionParameter evaluated = postProcessIconUrlParameter(iconParameter, req);
rslt.putParameter(evaluated);
result.putParameter(evaluated);
}

return rslt;
return result;
}

/*
Expand Down Expand Up @@ -604,13 +604,13 @@ private Set<IPortletDefinition> calculateFavoritePortlets(HttpServletRequest req
final UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
final IUserLayoutManager ulm = upm.getUserLayoutManager();
final IUserLayout layout = ulm.getUserLayout();
final Set<IPortletDefinition> rslt = favoritesUtils.getFavoritePortletDefinitions(layout);
final Set<IPortletDefinition> result = favoritesUtils.getFavoritePortletDefinitions(layout);

log.debug(
"Found the following favoritePortlets for user='{}': {}",
request.getRemoteUser(),
rslt);
return rslt;
result);
return result;
}

private Map<String, SortedSet<PortletCategoryBean>> filterRegistryFavoritesOnly(
Expand All @@ -626,9 +626,9 @@ private Map<String, SortedSet<PortletCategoryBean>> filterRegistryFavoritesOnly(
}
});

final Map<String, SortedSet<PortletCategoryBean>> rslt = new TreeMap<>();
rslt.put(CATEGORIES_MAP_KEY, otpt);
return rslt;
final Map<String, SortedSet<PortletCategoryBean>> result = new TreeMap<>();
result.put(CATEGORIES_MAP_KEY, otpt);
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,31 @@ public void setType(Type type) {
this.type = type;
}

public Assignment findDecendentOrSelfIfExists(JsonEntityBean principal) {
public Assignment findDescendantOrSelfIfExists(JsonEntityBean principal) {

// Assertions.
if (principal == null) {
String msg = "Argument 'principal' cannot be null";
throw new IllegalArgumentException(msg);
}

Assignment rslt = null; // default...
Assignment result = null; // default...

if (principal.getId().equals(this.principal.getId())
&& principal
.getEntityTypeAsString()
.equals(this.principal.getEntityTypeAsString())) {
rslt = this;
result = this;
} else {
for (Assignment a : children) {
rslt = a.findDecendentOrSelfIfExists(principal);
if (rslt != null) {
result = a.findDescendantOrSelfIfExists(principal);
if (result != null) {
break;
}
}
}

return rslt;
return result;
}

public String getPrincipalId() {
Expand Down
Loading

0 comments on commit 2f66730

Please sign in to comment.