Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2322,19 +2322,19 @@ private void _handleListenerForAnnotations(FacesContext context, Object inspecte
List<ListenerFor> listenerForList = null;
boolean isCachedList = false;

if(isProduction && _classToListenerForMap.containsKey(inspectedClass))
if(isProduction)
{
listenerForList = _classToListenerForMap.get(inspectedClass);
if(listenerForList == null)
{
return; //class has been inspected and did not contain any listener annotations
}
else if (listenerForList.isEmpty())

if (listenerForList != null)
{
return;
if (listenerForList.isEmpty())
{
return; //class has been inspected and did not contain any listener annotations
}

isCachedList = true; // else annotations were found in the cache
}

isCachedList = true; // else annotations were found in the cache
}

if(listenerForList == null) //not in production or the class hasn't been inspected yet
Expand Down Expand Up @@ -2465,19 +2465,19 @@ private void _handleResourceDependencyAnnotations(FacesContext context, Class<?>
List<ResourceDependency> dependencyList = null;
boolean isCachedList = false;

if(isProduction && _classToResourceDependencyMap.containsKey(inspectedClass))
if(isProduction)
{
dependencyList = _classToResourceDependencyMap.get(inspectedClass);
if(dependencyList == null)
{
return; //class has been inspected and did not contain any resource dependency annotations
}
else if (dependencyList.isEmpty())

if (dependencyList != null)
{
return;
if (dependencyList.isEmpty())
{
return; //class has been inspected and did not contain any resource dependency annotations
}

isCachedList = true; // else annotations were found in the cache
}

isCachedList = true; // else annotations were found in the cache
}

if(dependencyList == null) //not in production or the class hasn't been inspected yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,11 +947,18 @@ private String encodeURL(String baseUrl, Map<String, List<String>> parameters)
}
}

boolean hasParams = paramMap != null && paramMap.size()>0;

if (!hasParams && fragment == null)
{
return baseUrl;
}

// start building the new URL
StringBuilder newUrl = new StringBuilder(baseUrl);

//now add the updated param list onto the url
if (paramMap != null && paramMap.size()>0)
if (hasParams)
{
boolean isFirstPair = true;
for (Map.Entry<String, List<String>> pair : paramMap.entrySet())
Expand Down Expand Up @@ -989,7 +996,8 @@ private String encodeURL(String baseUrl, Map<String, List<String>> parameters)
//add the fragment back on (if any)
if (fragment != null)
{
newUrl.append(URL_FRAGMENT_SEPERATOR + fragment);
newUrl.append(URL_FRAGMENT_SEPERATOR);
newUrl.append(fragment);
}

return newUrl.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public class HtmlResponseWriterImpl
private boolean _isUTF8;

private String _startElementName;
private Boolean _isInsideScript;
private Boolean _isStyle;
private boolean _isInsideScript = false;
private boolean _isStyle = false;
private Boolean _isTextArea;
private UIComponent _startElementUIComponent;
private boolean _startTagOpen;
Expand Down Expand Up @@ -373,14 +373,14 @@ public void startElement(String name, UIComponent uiComponent) throws IOExceptio
if(isScript(_startElementName))
{
// handle a <script> start
_isInsideScript = Boolean.TRUE;
_isStyle = Boolean.FALSE;
_isInsideScript = true;
_isStyle = false;
_isTextArea = Boolean.FALSE;
}
else if (isStyle(_startElementName))
{
_isInsideScript = Boolean.FALSE;
_isStyle = Boolean.TRUE;
_isInsideScript = false;
_isStyle = true;
_isTextArea = Boolean.FALSE;
}
}
Expand Down Expand Up @@ -516,7 +516,7 @@ private void resetStartedElement()
_startElementName = null;
_startElementUIComponent = null;
_passThroughAttributesMap = null;
_isStyle = null;
_isStyle = false;
_isTextArea = null;
}

Expand Down Expand Up @@ -798,11 +798,11 @@ private void writeEndTag(String name)
if (isScript(name))
{
// reset _isInsideScript
_isInsideScript = Boolean.FALSE;
_isInsideScript = false;
}
else if (isStyle(name))
{
_isStyle = Boolean.FALSE;
_isStyle = false;
}

_currentWriter.write("</");
Expand Down Expand Up @@ -925,7 +925,7 @@ private void encodeAndWriteURIAttribute(String name, Object value) throws IOExce
}
*/
//_writer.write(strValue);
org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder.encodeURIAtributte(_currentWriter,
org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder.encodeURIAttribute(_currentWriter,
strValue, _characterEncoding);
}
_currentWriter.write('"');
Expand Down Expand Up @@ -1018,8 +1018,7 @@ private boolean isScriptOrStyle()
{
//initializeStartedTagInfo();

return (_isStyle != null && _isStyle.booleanValue()) ||
(_isInsideScript != null && _isInsideScript.booleanValue());
return _isStyle || _isInsideScript;
}

/**
Expand All @@ -1034,7 +1033,7 @@ private boolean isScript(String element)

private boolean isScript()
{
return (_isInsideScript != null && _isInsideScript.booleanValue());
return _isInsideScript;
}

private boolean isStyle(String element)
Expand All @@ -1044,7 +1043,7 @@ private boolean isStyle(String element)

private boolean isStyle()
{
return (_isStyle != null && _isStyle.booleanValue());
return _isStyle;
}

private boolean isTextarea()
Expand Down
Loading