This is an automated email from the ASF dual-hosted git repository.
jgallimore pushed a commit to branch tomee-7.0.x
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/tomee-7.0.x by this push:
new 4a81bd3 Tweaking for Java 7
4a81bd3 is described below
commit 4a81bd34fe84f76deaf6f0ab8c51bf13950a7242
Author: Jonathan Gallimore <[email protected]>
AuthorDate: Wed Jul 24 12:12:08 2019 +0100
Tweaking for Java 7
---
.../src/main/java/org/apache/openejb/config/CmpJpaConversion.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
index 71ea091..0e9d067 100644
---
a/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
+++
b/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
@@ -78,7 +78,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
@@ -110,7 +109,7 @@ class CmpJpaConversion implements DynamicDeployer {
try {
final URL url = new ResourceFinder("",
appModule.getClassLoader()).getResource(location);
- if (Objects.isNull(url)) {
+ if (url == null) {
return null;
}
return (EntityMappings) JaxbJavaee.unmarshal(EntityMappings.class,
IO.read(url));
@@ -275,11 +274,12 @@ class CmpJpaConversion implements DynamicDeployer {
private String getPersistenceModuleId(final AppModule appModule) {
if (appModule.getModuleId() != null) {
- return
Optional.ofNullable(appModule.getModuleUri().toString()).orElse(appModule.getModuleId());
+ return appModule.getModuleUri() != null ?
appModule.getModuleUri().toString() : appModule.getModuleId();
}
+
for (final EjbModule ejbModule : appModule.getEjbModules()) {
if (ejbModule.getModuleId() != null) {
- return
Optional.ofNullable(ejbModule.getModuleUri().toString()).orElse(ejbModule.getModuleId());
+ return ejbModule.getModuleUri() != null ?
ejbModule.getModuleUri().toString() : ejbModule.getModuleId();
}
}
throw new IllegalStateException("Comp must be in an ejb module, this
one has none: " + appModule);