You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/04/29 15:15:42 UTC

svn commit: r398147 - /myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java

Author: bommel
Date: Sat Apr 29 06:15:41 2006
New Revision: 398147

URL: http://svn.apache.org/viewcvs?rev=398147&view=rev
Log:
try to fix classloader issue

Modified:
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java?rev=398147&r1=398146&r2=398147&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java (original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/FaceletAnnotationVisitor.java Sat Apr 29 06:15:41 2006
@@ -23,6 +23,7 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.faces.component.UIComponent;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Set;
@@ -133,6 +134,8 @@
       return;
     }
     try {
+      ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
+      Thread.currentThread().setContextClassLoader(UIComponent.class.getClassLoader());
       Class uiComponentClass = Class.forName(componentTag.uiComponent());
 
       StringBuffer addComponent = new StringBuffer("addComponent(\"");
@@ -140,6 +143,7 @@
 
       Field componentField = uiComponentClass.getField("COMPONENT_TYPE");
       String componentType = (String) componentField.get(null);
+      Thread.currentThread().setContextClassLoader(currentClassLoader);
 
       addComponent.append("\", \"");
       addComponent.append(componentType);