Author: nbelaevski
Date: 2011-04-01 11:56:54 -0400 (Fri, 01 Apr 2011)
New Revision: 22357
Modified:
trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java
Log:
Fixed wrong message for skin not found
EventListenerHandler code optimization
Modified: trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java 2011-04-01
15:28:10 UTC (rev 22356)
+++ trunk/core/impl/src/main/java/org/richfaces/skin/AbstractSkinFactory.java 2011-04-01
15:56:54 UTC (rev 22357)
@@ -166,9 +166,9 @@
skinFuture.run();
return skinFuture.get();
} catch (InterruptedException e) {
- throw new
SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR), e);
+ throw new
SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR, name), e);
} catch (ExecutionException e) {
- throw new
SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR), e);
+ throw new
SkinNotFoundException(Messages.getMessage(Messages.SKIN_NOT_FOUND_ERROR, name), e);
}
}
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java 2011-04-01
15:28:10 UTC (rev 22356)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/EventListenerHandler.java 2011-04-01
15:56:54 UTC (rev 22357)
@@ -30,7 +30,7 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
-import javax.faces.view.EditableValueHolderAttachedObjectHandler;
+import javax.faces.view.AttachedObjectHandler;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.TagAttribute;
@@ -43,7 +43,7 @@
* @author akolonitsky
* @since Aug 31, 2010
*/
-public abstract class EventListenerHandler extends TagHandler implements
EditableValueHolderAttachedObjectHandler {
+public abstract class EventListenerHandler extends TagHandler implements
AttachedObjectHandler {
protected final TagAttribute binding;
@@ -75,7 +75,7 @@
}
if (instance == null && this.type != null) {
try {
- instance = (L) forName(this.type).newInstance();
+ instance = (L) TagHandlerUtils.loadClass(this.type,
Object.class).newInstance();
} catch (Exception e) {
throw new AbortProcessingException("Couldn't Lazily
instantiate EventListener", e);
}
@@ -97,7 +97,7 @@
if (type != null) {
if (type.isLiteral()) {
try {
- forName(type.getValue());
+ TagHandlerUtils.loadClass(type.getValue(), Object.class);
} catch (ClassNotFoundException e) {
throw new TagAttributeException(type, "Couldn't qualify
EventListener", e);
}
@@ -123,7 +123,7 @@
// Allow the composite component to know about the target component.
TagHandlerUtils.getOrCreateRetargetableHandlersList(parent).add(this);
} else {
- throw new TagException(this.tag, "Parent is not of type
EditableValueHolder, type is: " + parent);
+ throw new TagException(this.tag, "Parent does not match event source
requirements: " + parent);
}
}
@@ -132,14 +132,6 @@
return attr == null ? null : attr.getValue();
}
- public static Class<?> forName(String name) throws ClassNotFoundException {
- if (null == name || "".equals(name)) {
- return null;
- }
-
- return Class.forName(name, false,
Thread.currentThread().getContextClassLoader());
- }
-
public abstract boolean isEventSource(UIComponent comp);
}
Show replies by date