You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2015/11/19 02:41:46 UTC
svn commit: r1715086 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfigUnmarshallerImpl.java
Author: lu4242
Date: Thu Nov 19 01:41:45 2015
New Revision: 1715086
URL: http://svn.apache.org/viewvc?rev=1715086&view=rev
Log:
MYFACES-3988 An empty tag in a custom tag-lib causes an Exception
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfigUnmarshallerImpl.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfigUnmarshallerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfigUnmarshallerImpl.java?rev=1715086&r1=1715085&r2=1715086&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfigUnmarshallerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfigUnmarshallerImpl.java Thu Nov 19 01:41:45 2015
@@ -216,7 +216,7 @@ public class TagLibraryConfigUnmarshalle
}
else if ("renderer-type".equals(qName))
{
- this.rendererType = this.captureBuffer();
+ this.rendererType = this.captureBufferEmptyNull();
}
else if ("tag-name".equals(qName))
{
@@ -279,7 +279,7 @@ public class TagLibraryConfigUnmarshalle
{
//String cName = this.captureBuffer();
//this.handlerClass = createClass(TagHandler.class, cName);
- this.handlerClass = this.captureBuffer();
+ this.handlerClass = this.captureBufferEmptyNull();
}
else if ("component".equals(qName))
{
@@ -405,6 +405,18 @@ public class TagLibraryConfigUnmarshalle
this.buffer.setLength(0);
return s;
}
+
+ private String captureBufferEmptyNull() throws Exception
+ {
+ String s = this.buffer.toString().trim();
+ if (s.length() == 0)
+ {
+ //if is "" just set null instead
+ s = null;
+ }
+ this.buffer.setLength(0);
+ return s;
+ }
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
{