Skip to content
Open
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
1 change: 1 addition & 0 deletions modules/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Implementation-Vendor>Odysseus Software GmbH</Implementation-Vendor>
<Implementation-Vendor-Id>de.odysseus</Implementation-Vendor-Id>
<Export-Package>javax.el</Export-Package>
<Import-Package>de.odysseus.el;resolution:=optional</Import-Package>
<Bundle-Vendor>Odysseus.de</Bundle-Vendor>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Name>Expression Language API</Bundle-Name>
Expand Down
28 changes: 25 additions & 3 deletions modules/api/src/main/java/javax/el/ExpressionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,35 @@ public static ExpressionFactory newInstance() {
* if a factory class cannot be found or instantiation fails.
*/
public static ExpressionFactory newInstance(Properties properties) {
ClassLoader classLoader;
try {
classLoader = Thread.currentThread().getContextClassLoader();
return newInstance(properties, Thread.currentThread().getContextClassLoader());
} catch (SecurityException e) {
classLoader = ExpressionFactory.class.getClassLoader();
} catch (ClassNotFoundException e) {
}

try {
return newInstance(properties, ExpressionFactory.class.getClassLoader());
} catch (ClassNotFoundException e) {
throw new ELException("Could not find expression factory class", e);
}
}


/**
* Create an ExpressionFactory instance.
*
* @param properties
* Properties passed to the constructor of the implementation.
* @param classLoader
* The class loader to be used to load the class.
* @return An instance of ExpressionFactory.
* @throws ClassNotFoundException
* if the ExpressionFactory implementation class is not found
* @throws ELException
* if the class could not be found or if it is not a subclass of ExpressionFactory
* or if the class could not be instantiated.
*/
private static ExpressionFactory newInstance ( Properties properties, ClassLoader classLoader) throws ClassNotFoundException {
String className = null;

String serviceId = "META-INF/services/" + ExpressionFactory.class.getName();
Expand Down
2 changes: 1 addition & 1 deletion modules/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<Implementation-Vendor-Id>de.odysseus</Implementation-Vendor-Id>
<Main-Class>de.odysseus.el.tree.impl.Builder</Main-Class>
<Import-Package>javax.el</Import-Package>
<Export-Package>de.odysseus.el,de.odysseus.el.util</Export-Package>
<Export-Package>de.odysseus.el,de.odysseus.el.util,de.odysseus.el.tree,de.odysseus.el.tree.impl,de.odysseus.el.misc</Export-Package>
<Bundle-Vendor>Odysseus.de</Bundle-Vendor>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Name>Expression Language Implementation</Bundle-Name>
Expand Down