mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
SHA-1771: Improve handling of search term highlighting parameters in script object
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@131681 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -859,15 +859,10 @@ public class Search extends BaseScopableProcessorExtension implements Initializi
|
||||
*/
|
||||
public int getIntegerValue(String attribute, int defaultValue, Map<Serializable, Serializable> sourceObject)
|
||||
{
|
||||
int integer = defaultValue;
|
||||
String stringValue = (String) sourceObject.get(attribute);
|
||||
try
|
||||
Integer integer = (Integer) sourceObject.get(attribute);
|
||||
if (integer == null)
|
||||
{
|
||||
integer = Integer.parseInt(stringValue);
|
||||
}
|
||||
catch(NumberFormatException nfe)
|
||||
{
|
||||
// No action required
|
||||
integer = defaultValue;
|
||||
}
|
||||
return integer;
|
||||
}
|
||||
@@ -883,17 +878,12 @@ public class Search extends BaseScopableProcessorExtension implements Initializi
|
||||
*/
|
||||
public boolean getBooleanValue(String attribute, boolean defaultValue, Map<Serializable, Serializable> sourceObject)
|
||||
{
|
||||
boolean bool = defaultValue;
|
||||
String stringValue = (String) sourceObject.get(attribute);
|
||||
try
|
||||
{
|
||||
bool = Boolean.getBoolean(stringValue);
|
||||
}
|
||||
catch(NumberFormatException nfe)
|
||||
{
|
||||
// No action required
|
||||
}
|
||||
return bool;
|
||||
Boolean bool = (Boolean) sourceObject.get(attribute);
|
||||
if (bool == null)
|
||||
{
|
||||
bool = defaultValue;
|
||||
}
|
||||
return bool;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user