Skip to content

Commit 6d99dc2

Browse files
committed
HV-2020 Remove direct dependency on Expressly
1 parent 009a645 commit 6d99dc2

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

engine/pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@
7272
<scope>provided</scope>
7373
<optional>true</optional>
7474
</dependency>
75-
<dependency>
76-
<groupId>org.glassfish.expressly</groupId>
77-
<artifactId>expressly</artifactId>
78-
<scope>provided</scope>
79-
<optional>true</optional>
80-
</dependency>
8175
<dependency>
8276
<groupId>org.jboss.logging</groupId>
8377
<artifactId>jboss-logging-annotations</artifactId>
@@ -123,6 +117,11 @@
123117
<!--
124118
Test dependencies
125119
-->
120+
<dependency>
121+
<groupId>org.glassfish.expressly</groupId>
122+
<artifactId>expressly</artifactId>
123+
<scope>test</scope>
124+
</dependency>
126125
<dependency>
127126
<groupId>org.testng</groupId>
128127
<artifactId>testng</artifactId>

engine/src/main/java/org/hibernate/validator/messageinterpolation/ResourceBundleMessageInterpolator.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import org.hibernate.validator.spi.messageinterpolation.LocaleResolver;
2525
import org.hibernate.validator.spi.resourceloading.ResourceBundleLocator;
2626

27-
import com.sun.el.ExpressionFactoryImpl;
28-
2927
/**
3028
* Resource bundle backed message interpolator.
3129
*
@@ -195,14 +193,16 @@ private static ExpressionFactory buildExpressionFactory() {
195193
return expressionFactory;
196194
}
197195

198-
// Finally we try the CL of the EL implementation itself. This is necessary for OSGi now that the
199-
// implementation is separated from the API.
200-
SetContextClassLoader.action( ExpressionFactoryImpl.class.getClassLoader() );
201-
if ( canLoadExpressionFactory() ) {
202-
ExpressionFactory expressionFactory = ELManager.getExpressionFactory();
203-
LOG.debug( "Loaded expression factory via com.sun.el classloader" );
204-
return expressionFactory;
205-
}
196+
// We do not directly rely on Expressly anymore, which is the RI of EL.
197+
// Keeping the code for now, just in case we decide to come back to OSGi support...
198+
// // Finally we try the CL of the EL implementation itself. This is necessary for OSGi now that the
199+
// // implementation is separated from the API.
200+
// SetContextClassLoader.action( com.sun.el.ExpressionFactoryImpl.class.getClassLoader() );
201+
// if ( canLoadExpressionFactory() ) {
202+
// ExpressionFactory expressionFactory = ELManager.getExpressionFactory();
203+
// LOG.debug( "Loaded expression factory via com.sun.el classloader" );
204+
// return expressionFactory;
205+
// }
206206
}
207207
catch (Throwable e) {
208208
throw LOG.getUnableToInitializeELExpressionFactoryException( e );

0 commit comments

Comments
 (0)