mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +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)
|
public int getIntegerValue(String attribute, int defaultValue, Map<Serializable, Serializable> sourceObject)
|
||||||
{
|
{
|
||||||
int integer = defaultValue;
|
Integer integer = (Integer) sourceObject.get(attribute);
|
||||||
String stringValue = (String) sourceObject.get(attribute);
|
if (integer == null)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
integer = Integer.parseInt(stringValue);
|
integer = defaultValue;
|
||||||
}
|
|
||||||
catch(NumberFormatException nfe)
|
|
||||||
{
|
|
||||||
// No action required
|
|
||||||
}
|
}
|
||||||
return integer;
|
return integer;
|
||||||
}
|
}
|
||||||
@@ -883,17 +878,12 @@ public class Search extends BaseScopableProcessorExtension implements Initializi
|
|||||||
*/
|
*/
|
||||||
public boolean getBooleanValue(String attribute, boolean defaultValue, Map<Serializable, Serializable> sourceObject)
|
public boolean getBooleanValue(String attribute, boolean defaultValue, Map<Serializable, Serializable> sourceObject)
|
||||||
{
|
{
|
||||||
boolean bool = defaultValue;
|
Boolean bool = (Boolean) sourceObject.get(attribute);
|
||||||
String stringValue = (String) sourceObject.get(attribute);
|
if (bool == null)
|
||||||
try
|
{
|
||||||
{
|
bool = defaultValue;
|
||||||
bool = Boolean.getBoolean(stringValue);
|
}
|
||||||
}
|
return bool;
|
||||||
catch(NumberFormatException nfe)
|
|
||||||
{
|
|
||||||
// No action required
|
|
||||||
}
|
|
||||||
return bool;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user