Skip to content

Commit

Permalink
commit something like Dan's changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Feb 16, 2010
1 parent ab675b2 commit 828652b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions impl/src/main/java/org/jboss/weld/jsf/JsfApiAbstraction.java
Expand Up @@ -19,7 +19,6 @@
import org.jboss.weld.bootstrap.api.Service;
import org.jboss.weld.resources.spi.ResourceLoader;
import org.jboss.weld.util.ApiAbstraction;
import org.jboss.weld.util.reflection.SecureReflections;

/**
* Utility class for JSF related components, concepts etc. It can also
Expand All @@ -46,12 +45,14 @@ public JsfApiAbstraction(ResourceLoader resourceLoader)
this.UICOMPONENT_CLASS = classForName("javax.faces.component.UIComponent");
this.FACES_CONTEXT = classForName("javax.faces.context.FacesContext");
this.BEHAVIOR_CLASS = classForName("javax.faces.component.behavior.Behavior");
double version = 2.0;
if (this.FACES_CONTEXT != null)
if (this.BEHAVIOR_CLASS.getName().equals("javax.faces.component.behavior.Behavior"))
{
version = SecureReflections.isMethodExists(FACES_CONTEXT, "isPostback") ? 2.0 : 1.2;
MINIMUM_API_VERSION = 2.0;
}
else
{
MINIMUM_API_VERSION = 1.2;
}
MINIMUM_API_VERSION = version;
}

public boolean isApiVersionCompatibleWith(double version)
Expand Down

0 comments on commit 828652b

Please sign in to comment.