You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2014/02/22 02:58:23 UTC
svn commit: r1570779 [3/7] - in
/tomee/tomee/trunk/container/openejb-core/src/main: config/
java/org/apache/openejb/ java/org/apache/openejb/assembler/classic/
java/org/apache/openejb/assembler/classic/cmd/
java/org/apache/openejb/bval/ java/org/apache...
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LegacyProcessor.java Sat Feb 22 01:58:19 2014
@@ -41,7 +41,9 @@ public class LegacyProcessor implements
for (final EjbModule ejbModule : appModule.getEjbModules()) {
final ClassLoader classLoader = ejbModule.getClassLoader();
for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
- if (bean.getEjbClass() == null) continue;
+ if (bean.getEjbClass() == null) {
+ continue;
+ }
try {
final Class<?> clazz = classLoader.loadClass(bean.getEjbClass());
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/LinkBuiltInTypes.java Sat Feb 22 01:58:19 2014
@@ -49,21 +49,27 @@ public class LinkBuiltInTypes implements
for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
- if (consumer == null) continue;
+ if (consumer == null) {
+ continue;
+ }
link(consumer);
}
for (final WebModule module : appModule.getWebModules()) {
final JndiConsumer consumer = module.getWebApp();
- if (consumer == null) continue;
+ if (consumer == null) {
+ continue;
+ }
link(consumer);
}
for (final EjbModule module : appModule.getEjbModules()) {
final EjbJar ejbJar = module.getEjbJar();
- if (ejbJar == null) continue;
+ if (ejbJar == null) {
+ continue;
+ }
for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
link(consumer);
@@ -96,7 +102,9 @@ public class LinkBuiltInTypes implements
for (final JndiReference ref : refs) {
final String link = links.get(ref.getType());
- if (link == null) continue;
+ if (link == null) {
+ continue;
+ }
if (ref.getName().equals(link)) {
// make sure the user hasn't linked it to itself or anything else
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/MergeWebappJndiContext.java Sat Feb 22 01:58:19 2014
@@ -50,11 +50,15 @@ public class MergeWebappJndiContext impl
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
for (final WebModule webModule : appModule.getWebModules()) {
- if (webModule.getFinder() == null) continue;
+ if (webModule.getFinder() == null) {
+ continue;
+ }
for (final EjbModule ejbModule : appModule.getEjbModules()) {
// If they are the same module, they'll have the same finder
- if (ejbModule.getFinder() != webModule.getFinder()) continue;
+ if (ejbModule.getFinder() != webModule.getFinder()) {
+ continue;
+ }
merge(ejbModule, webModule);
}
@@ -126,7 +130,9 @@ public class MergeWebappJndiContext impl
private <R extends JndiReference> void copy(final Map<String, R> from, final Map<String, R> to) {
for (final R a : from.values()) {
- if (isPrivateReference(a)) continue;
+ if (isPrivateReference(a)) {
+ continue;
+ }
final R b = to.get(a.getKey());
@@ -165,12 +171,16 @@ public class MergeWebappJndiContext impl
}
private <R extends JndiReference> boolean isPrivateReference(final R a) {
- if (!isResourceRef(a)) return false;
+ if (!isResourceRef(a)) {
+ return false;
+ }
final Class[] types = {EJBContext.class, EntityContext.class, SessionContext.class, MessageDrivenContext.class, UserTransaction.class};
for (final Class type : types) {
- if (type.getName().equals(a.getType())) return true;
+ if (type.getName().equals(a.getType())) {
+ return true;
+ }
}
return false;
@@ -183,12 +193,16 @@ public class MergeWebappJndiContext impl
private <R extends JndiReference> void mergeUserTransaction(final Map<String, R> from, final Map<String, R> to, final JndiConsumer consumer) {
if (consumer instanceof EnterpriseBean) {
final EnterpriseBean enterpriseBean = (EnterpriseBean) consumer;
- if (enterpriseBean.getTransactionType() != TransactionType.BEAN) return;
+ if (enterpriseBean.getTransactionType() != TransactionType.BEAN) {
+ return;
+ }
}
for (final R a : from.values()) {
- if (!UserTransaction.class.getName().equals(a.getType())) continue;
+ if (!UserTransaction.class.getName().equals(a.getType())) {
+ continue;
+ }
final R b = to.get(a.getKey());
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OpenEJBDeploymentManager.java Sat Feb 22 01:58:19 2014
@@ -107,7 +107,9 @@ public class OpenEJBDeploymentManager im
// target.default - default target
String defaultTargetName = properties.getProperty("target.default");
- if (defaultTargetName == null) defaultTargetName = OpenEJBDeploymentManager.DEFAULT_TARGET_NAME;
+ if (defaultTargetName == null) {
+ defaultTargetName = OpenEJBDeploymentManager.DEFAULT_TARGET_NAME;
+ }
if (!targets.containsKey(defaultTargetName)) {
targets.put(defaultTargetName, new TargetImpl(defaultTargetName, null));
}
@@ -130,14 +132,18 @@ public class OpenEJBDeploymentManager im
}
public Target[] getTargets() {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
return targets.values().toArray(new Target[targets.size()]);
}
public TargetModuleID[] getAvailableModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
try {
final String type = null;
@@ -153,7 +159,9 @@ public class OpenEJBDeploymentManager im
}
public TargetModuleID[] getNonRunningModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
try {
final String type = null;
@@ -169,7 +177,9 @@ public class OpenEJBDeploymentManager im
}
public TargetModuleID[] getRunningModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
try {
final String type = null;
@@ -185,7 +195,9 @@ public class OpenEJBDeploymentManager im
}
public ProgressObject distribute(final Target[] targetList, final File moduleArchive, final File deploymentPlan) {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
// todo merge files
try {
@@ -198,7 +210,9 @@ public class OpenEJBDeploymentManager im
}
public ProgressObject distribute(final Target[] targetList, final InputStream moduleArchive, final InputStream deploymentPlan) {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
// todo merge files
try {
@@ -211,7 +225,9 @@ public class OpenEJBDeploymentManager im
}
public ProgressObject start(final TargetModuleID[] moduleIdList) {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
try {
final Set<String> targetModuleStrings = deployment.start(toModuleSet(moduleIdList));
@@ -223,7 +239,9 @@ public class OpenEJBDeploymentManager im
}
public ProgressObject stop(final TargetModuleID[] moduleIdList) {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
try {
final Set<String> targetModuleStrings = deployment.stop(toModuleSet(moduleIdList));
@@ -235,7 +253,9 @@ public class OpenEJBDeploymentManager im
}
public ProgressObject undeploy(final TargetModuleID[] moduleIdList) {
- if (deployment == null) throw new IllegalStateException("Deployment manager is disconnected");
+ if (deployment == null) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
try {
final Set<String> targetModuleStrings = deployment.undeploy(toModuleSet(moduleIdList));
@@ -341,7 +361,9 @@ public class OpenEJBDeploymentManager im
}
private Set<String> toTargetSet(final Target[] targets) {
- if (targets == null) return Collections.emptySet();
+ if (targets == null) {
+ return Collections.emptySet();
+ }
final TreeSet<String> targetSet = new TreeSet<String>();
for (final Target target : targets) {
@@ -351,7 +373,9 @@ public class OpenEJBDeploymentManager im
}
private Set<String> toModuleSet(final TargetModuleID[] moduleIDList) {
- if (moduleIDList == null) return Collections.emptySet();
+ if (moduleIDList == null) {
+ return Collections.emptySet();
+ }
final TreeSet<String> moduleSet = new TreeSet<String>();
for (final TargetModuleID module : moduleIDList) {
@@ -385,7 +409,9 @@ public class OpenEJBDeploymentManager im
}
public TargetImpl(final String name, final String description) {
- if (name == null) throw new NullPointerException("name is null");
+ if (name == null) {
+ throw new NullPointerException("name is null");
+ }
this.name = name;
this.description = description;
}
@@ -403,8 +429,12 @@ public class OpenEJBDeploymentManager im
}
public boolean equals(final Object o) {
- if (this == o) return true;
- if (!(o instanceof TargetImpl)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TargetImpl)) {
+ return false;
+ }
final TargetImpl target = (TargetImpl) o;
return name.equals(target.name);
@@ -434,8 +464,12 @@ public class OpenEJBDeploymentManager im
}
public TargetModuleIDImpl(final Target target, final String moduleId, final String webUrl) {
- if (target == null) throw new NullPointerException("target is null");
- if (moduleId == null) throw new NullPointerException("moduleId is null");
+ if (target == null) {
+ throw new NullPointerException("target is null");
+ }
+ if (moduleId == null) {
+ throw new NullPointerException("moduleId is null");
+ }
this.target = target;
this.moduleId = moduleId;
this.webUrl = webUrl;
@@ -471,8 +505,12 @@ public class OpenEJBDeploymentManager im
}
public boolean equals(final Object o) {
- if (this == o) return true;
- if (!(o instanceof TargetModuleIDImpl)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TargetModuleIDImpl)) {
+ return false;
+ }
final TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
return target.equals(targetModuleID.target) &&
@@ -491,7 +529,9 @@ public class OpenEJBDeploymentManager im
// compare target name
final int val = target.getName().compareTo(targetModuleID.target.getName());
- if (val != 0) return val;
+ if (val != 0) {
+ return val;
+ }
// compare moduleId
return moduleId.compareTo(targetModuleID.moduleId);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java Sat Feb 22 01:58:19 2014
@@ -171,7 +171,9 @@ public class OutputGeneratedDescriptors
private boolean hasCmpPersistenceUnit(final Persistence persistence) {
for (final PersistenceUnit unit : persistence.getPersistenceUnit()) {
- if (unit.getName().startsWith("cmp")) return true;
+ if (unit.getName().startsWith("cmp")) {
+ return true;
+ }
}
return false;
}
@@ -199,7 +201,9 @@ public class OutputGeneratedDescriptors
try {
final GeronimoEjbJarType geronimoEjbJarType = (GeronimoEjbJarType) ejbModule.getAltDDs().get("geronimo-openejb.xml");
- if (geronimoEjbJarType == null) return;
+ if (geronimoEjbJarType == null) {
+ return;
+ }
final File tempFile = tempFile("geronimo-openejb-", ejbModule.getModuleId() + ".xml");
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/PersistenceContextAnnFactory.java Sat Feb 22 01:58:19 2014
@@ -54,8 +54,12 @@ public class PersistenceContextAnnFactor
private final Set<String> processed = new HashSet<String>();
public void addAnnotations(final Class c) throws OpenEJBException {
- if (!useAsm) return;
- if (processed.contains(c.getName())) return;
+ if (!useAsm) {
+ return;
+ }
+ if (processed.contains(c.getName())) {
+ return;
+ }
try {
final URL u = c.getResource("/" + c.getName().replace('.', '/') + ".class");
@@ -94,7 +98,9 @@ public class PersistenceContextAnnFactor
public DirectPersistenceContext(final PersistenceContext persistenceContext) {
- if (persistenceContext == null) throw new NullPointerException("persistenceContext is null");
+ if (persistenceContext == null) {
+ throw new NullPointerException("persistenceContext is null");
+ }
this.persistenceContext = persistenceContext;
}
@@ -107,7 +113,9 @@ public class PersistenceContextAnnFactor
}
public String type() {
- if (persistenceContext.type() == null) return null;
+ if (persistenceContext.type() == null) {
+ return null;
+ }
return persistenceContext.type().toString();
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java Sat Feb 22 01:58:19 2014
@@ -318,7 +318,9 @@ public class ReadDescriptors implements
realIssue[0] = v2ParsingException;
throw new SAXException("Throw exception to stop parsing");
}
- if (uri == null) return;
+ if (uri == null) {
+ return;
+ }
if (uri.contains("openejb-jar-2.") || uri.contains("geronimo.apache.org/xml/ns")) {
realIssue[0] = v2ParsingException;
throw new SAXException("Throw exception to stop parsing");
@@ -397,7 +399,9 @@ public class ReadDescriptors implements
}
private void readAppClient(final ClientModule clientModule, final AppModule appModule) throws OpenEJBException {
- if (clientModule.getApplicationClient() != null) return;
+ if (clientModule.getApplicationClient() != null) {
+ return;
+ }
final Object data = clientModule.getAltDDs().get("application-client.xml");
if (data instanceof ApplicationClient) {
@@ -415,7 +419,9 @@ public class ReadDescriptors implements
}
public void readEjbJar(final EjbModule ejbModule, final AppModule appModule) throws OpenEJBException {
- if (ejbModule.getEjbJar() != null) return;
+ if (ejbModule.getEjbJar() != null) {
+ return;
+ }
final Source data = getSource(ejbModule.getAltDDs().get("ejb-jar.xml"));
if (data != null) {
@@ -449,7 +455,9 @@ public class ReadDescriptors implements
}
private void readBeans(final EjbModule ejbModule) throws OpenEJBException {
- if (ejbModule.getBeans() != null) return;
+ if (ejbModule.getBeans() != null) {
+ return;
+ }
final Object raw = ejbModule.getAltDDs().get("beans.xml");
final Source data = getSource(raw);
@@ -488,7 +496,9 @@ public class ReadDescriptors implements
}
private void readConnector(final ConnectorModule connectorModule, final AppModule appModule) throws OpenEJBException {
- if (connectorModule.getConnector() != null) return;
+ if (connectorModule.getConnector() != null) {
+ return;
+ }
final Object data = connectorModule.getAltDDs().get("ra.xml");
if (data instanceof Connector) {
@@ -598,7 +608,9 @@ public class ReadDescriptors implements
public static Beans readBeans(final InputStream inputStream) throws OpenEJBException {
try {
final String content = IO.slurp(inputStream);
- if (isEmptyBeansXml(new ByteArrayInputStream(content.getBytes()))) return new Beans();
+ if (isEmptyBeansXml(new ByteArrayInputStream(content.getBytes()))) {
+ return new Beans();
+ }
return (Beans) JaxbJavaee.unmarshalJavaee(Beans.class, new ByteArrayInputStream(content.getBytes()));
} catch (final SAXException e) {
throw new OpenEJBException("Cannot parse the beans.xml");// file: " + url.toExternalForm(), e);
@@ -629,7 +641,9 @@ public class ReadDescriptors implements
try {
parser.parse(inputSource, new DefaultHandler() {
public void startElement(final String uri, final String localName, final String qName, final Attributes att) throws SAXException {
- if (!localName.equals(rootElement)) throw new SAXException(localName);
+ if (!localName.equals(rootElement)) {
+ throw new SAXException(localName);
+ }
}
public InputSource resolveEntity(final String publicId, final String systemId) throws IOException, SAXException {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoteServer.java Sat Feb 22 01:58:19 2014
@@ -183,8 +183,9 @@ public class RemoteServer {
if (profile) {
String yourkitHome = options.get("yourkit.home", "/Applications/YourKit_Java_Profiler_9.5.6.app/bin/mac/");
- if (!yourkitHome.endsWith("/"))
+ if (!yourkitHome.endsWith("/")) {
yourkitHome += "/";
+ }
final String yourkitOpts = options.get("yourkit.opts", "disablestacktelemetry,disableexceptiontelemetry,builtinprobes=none,delay=10000,sessionname=Tomcat");
argsList.add("-agentpath:" + yourkitHome + "libyjpagent.jnilib=" + yourkitOpts);
}
@@ -313,16 +314,19 @@ public class RemoteServer {
}
if (checkPortAvailable) {
if (debug) {
- if (!connect(Integer.MAX_VALUE))
+ if (!connect(Integer.MAX_VALUE)) {
throw new OpenEJBRuntimeException("Could not connect to server");
+ }
} else {
- if (!connect(tries))
+ if (!connect(tries)) {
throw new OpenEJBRuntimeException("Could not connect to server");
+ }
}
}
} else {
- if (verbose)
+ if (verbose) {
System.out.println("[] FOUND STARTED SERVER");
+ }
}
}
@@ -381,12 +385,15 @@ public class RemoteServer {
final File[] files = dir.listFiles();
if (files != null) {
for (final File file : files) {
- if (!file.isFile())
+ if (!file.isFile()) {
continue;
- if (!file.getName().endsWith(".jar"))
+ }
+ if (!file.getName().endsWith(".jar")) {
continue;
- if (file.getName().startsWith(name))
+ }
+ if (file.getName().startsWith(name)) {
return file;
+ }
}
}
}
@@ -499,8 +506,9 @@ public class RemoteServer {
}
private boolean connect(int tries) {
- if (verbose)
+ if (verbose) {
System.out.println("[] CONNECT ATTEMPT " + (this.tries - tries));
+ }
Socket s = null;
try {
@@ -542,8 +550,9 @@ public class RemoteServer {
}
public void killOnExit() {
- if (!serverHasAlreadyBeenStarted && kill.contains(this.server))
+ if (!serverHasAlreadyBeenStarted && kill.contains(this.server)) {
return;
+ }
kill.add(this.server);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/RemoveWebServices.java Sat Feb 22 01:58:19 2014
@@ -60,16 +60,26 @@ class RemoveWebServices implements Dynam
final SessionBean sessionBean = (SessionBean) bean;
- if (sessionBean.getServiceEndpoint() == null) continue;
+ if (sessionBean.getServiceEndpoint() == null) {
+ continue;
+ }
sessionBean.setServiceEndpoint(null);
// Now check if the bean has no other interfaces
// if not, then we should just delete it
- if (sessionBean.getHome() != null) continue;
- if (sessionBean.getLocalHome() != null) continue;
- if (sessionBean.getBusinessLocal().size() > 0) continue;
- if (sessionBean.getBusinessRemote().size() > 0) continue;
+ if (sessionBean.getHome() != null) {
+ continue;
+ }
+ if (sessionBean.getLocalHome() != null) {
+ continue;
+ }
+ if (sessionBean.getBusinessLocal().size() > 0) {
+ continue;
+ }
+ if (sessionBean.getBusinessRemote().size() > 0) {
+ continue;
+ }
// Ok, delete away...
ejbJar.removeEnterpriseBean(ejbName);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java Sat Feb 22 01:58:19 2014
@@ -48,7 +48,9 @@ public class ReportValidationResults imp
final boolean hasFailures = appModule.hasFailures();
final boolean hasWarnings = appModule.hasWarnings();
- if (!hasErrors && !hasFailures && !hasWarnings) return appModule;
+ if (!hasErrors && !hasFailures && !hasWarnings) {
+ return appModule;
+ }
final ValidationFailedException validationFailedException = null;
@@ -71,7 +73,9 @@ public class ReportValidationResults imp
}
}
- if (!hasErrors && !hasFailures) return appModule;
+ if (!hasErrors && !hasFailures) {
+ return appModule;
+ }
if (level != Level.VERBOSE){
List<Level> levels = Arrays.asList(Level.values());
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java Sat Feb 22 01:58:19 2014
@@ -65,7 +65,9 @@ public class ServiceUtils {
public static ProviderManager getManager() {
final ProviderManager manager = SystemInstance.get().getComponent(ProviderManager.class);
- if (manager!= null) return manager;
+ if (manager!= null) {
+ return manager;
+ }
SystemInstance.get().setComponent(ProviderManager.class, new ProviderManager(new ServiceJarXmlLoader()));
return getManager();
@@ -113,7 +115,9 @@ public class ServiceUtils {
{
final ServiceProvider provider = getManager().get(id.getNamespace(), id.getName());
- if (provider != null) return provider;
+ if (provider != null) {
+ return provider;
+ }
}
throw new NoSuchProviderException(messages.format("conf.4901", id.getName(), id.getNamespace()));
@@ -132,7 +136,9 @@ public class ServiceUtils {
public static List<ServiceProvider> getServiceProvidersByServiceType(final String type) throws OpenEJBException {
final ArrayList<ServiceProvider> providers = new ArrayList<ServiceProvider>();
- if (type == null) return providers;
+ if (type == null) {
+ return providers;
+ }
final List<ServiceProvider> services = getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL));
@@ -146,8 +152,12 @@ public class ServiceUtils {
}
public static ServiceProvider getServiceProviderByType(final String type, Properties required) throws OpenEJBException {
- if (type == null) return null;
- if (required == null) required = new Properties();
+ if (type == null) {
+ return null;
+ }
+ if (required == null) {
+ required = new Properties();
+ }
final List<ServiceProvider> services = getServiceProviders(currentDefaultProviderUrl(DEFAULT_PROVIDER_URL));
@@ -171,15 +181,25 @@ public class ServiceUtils {
Object expected = entry.getValue();
if (expected.equals(NONE)){
- if (value != null) return false;
+ if (value != null) {
+ return false;
+ }
} else if (expected.equals(ANY)){
- if (value == null) return false;
+ if (value == null) {
+ return false;
+ }
} else {
- if (value instanceof String) value = ((String) value).toLowerCase();
+ if (value instanceof String) {
+ value = ((String) value).toLowerCase();
+ }
- if (expected instanceof String) expected = ((String) expected).toLowerCase();
+ if (expected instanceof String) {
+ expected = ((String) expected).toLowerCase();
+ }
- if (!expected.equals(value)) return false;
+ if (!expected.equals(value)) {
+ return false;
+ }
}
}
return true;
@@ -187,7 +207,9 @@ public class ServiceUtils {
public static ServiceProvider getServiceProviderByType(final String providerType, final String serviceType) throws OpenEJBException {
- if (serviceType == null) return null;
+ if (serviceType == null) {
+ return null;
+ }
final List<ServiceProvider> services = getServiceProvidersByServiceType(providerType);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/SunConversion.java Sat Feb 22 01:58:19 2014
@@ -461,7 +461,9 @@ public class SunConversion implements Dy
}
private String normalize(String refName) {
- if (!refName.startsWith("java:")) refName = "java:comp/env/" + refName;
+ if (!refName.startsWith("java:")) {
+ refName = "java:comp/env/" + refName;
+ }
return refName;
}
@@ -580,7 +582,9 @@ public class SunConversion implements Dy
final Map<String, WebserviceDescription> descriptions = webModule.getWebservices().getWebserviceDescriptionMap();
for (final org.apache.openejb.jee.sun.WebserviceDescription sunDescription : sunWebApp.getWebserviceDescription()) {
final WebserviceDescription description = descriptions.get(sunDescription.getWebserviceDescriptionName());
- if (description == null) continue;
+ if (description == null) {
+ continue;
+ }
final String serviceId = extractSerivceId(sunDescription.getWsdlPublishLocation(), description.getWsdlFile());
if (serviceId != null) {
@@ -596,7 +600,9 @@ public class SunConversion implements Dy
}
public static String extractSerivceId(String location, String wsdlFile) {
- if (location == null) return null;
+ if (location == null) {
+ return null;
+ }
if (location.startsWith("file:")) {
// location format = file:{repository}/{location}.wsdl
@@ -615,14 +621,18 @@ public class SunConversion implements Dy
location = location.replaceFirst("\\?.*$", "");
}
- if (location.length() == 0) location = null;
+ if (location.length() == 0) {
+ location = null;
+ }
return location;
}
public void convertModule(final EjbModule ejbModule, final EntityMappings entityMappings) {
final Map<String, EntityData> entities = new TreeMap<String, EntityData>();
- if (entityMappings != null ) for (final Entity entity : entityMappings.getEntity()) {
- entities.put(entity.getDescription(), new SunConversion.EntityData(entity));
+ if (entityMappings != null ) {
+ for (final Entity entity : entityMappings.getEntity()) {
+ entities.put(entity.getDescription(), new EntityData(entity));
+ }
}
// merge data from sun-ejb-jar.xml file
@@ -643,9 +653,15 @@ public class SunConversion implements Dy
final EjbJar ejbJar = ejbModule.getEjbJar();
final OpenejbJar openejbJar = ejbModule.getOpenejbJar();
- if (openejbJar == null) return;
- if (sunEjbJar == null) return;
- if (sunEjbJar.getEnterpriseBeans() == null) return;
+ if (openejbJar == null) {
+ return;
+ }
+ if (sunEjbJar == null) {
+ return;
+ }
+ if (sunEjbJar.getEnterpriseBeans() == null) {
+ return;
+ }
final Map<String,Map<String, WebserviceEndpoint>> endpointMap = new HashMap<String,Map<String, WebserviceEndpoint>>();
for (final Ejb ejb : sunEjbJar.getEnterpriseBeans().getEjb()) {
@@ -803,9 +819,15 @@ public class SunConversion implements Dy
}
private void mergeEntityMappings(final Map<String, EntityData> entities, final String moduleId, final EjbJar ejbJar, final OpenejbJar openejbJar, final SunEjbJar sunEjbJar) {
- if (openejbJar == null) return;
- if (sunEjbJar == null) return;
- if (sunEjbJar.getEnterpriseBeans() == null) return;
+ if (openejbJar == null) {
+ return;
+ }
+ if (sunEjbJar == null) {
+ return;
+ }
+ if (sunEjbJar.getEnterpriseBeans() == null) {
+ return;
+ }
for (final Ejb ejb : sunEjbJar.getEnterpriseBeans().getEjb()) {
final Cmp cmp = ejb.getCmp();
@@ -847,7 +869,9 @@ public class SunConversion implements Dy
name.append('(');
boolean first = true;
for (final List<String> methodParam : params) {
- if (!first) name.append(",");
+ if (!first) {
+ name.append(",");
+ }
name.append(methodParam.get(0));
first = false;
}
@@ -999,7 +1023,9 @@ public class SunConversion implements Dy
}
} else {
// skip the non owning side
- if (field.getMappedBy() != null) continue;
+ if (field.getMappedBy() != null) {
+ continue;
+ }
final JoinTable joinTable = new JoinTable();
field.setJoinTable(joinTable);
@@ -1059,7 +1085,9 @@ public class SunConversion implements Dy
}
private List<List<String>> parseQueryParamters(final String queryParams) {
- if (queryParams == null) return Collections.emptyList();
+ if (queryParams == null) {
+ return Collections.emptyList();
+ }
final List bits = Collections.list(new StringTokenizer(queryParams, " \t\n\r\f,", false));
final List<List<String>> params = new ArrayList<List<String>>(bits.size() / 2);
@@ -1089,7 +1117,9 @@ public class SunConversion implements Dy
}
private String convertToEjbQlFilter(final Collection<String> cmpFields, final List<List<String>> queryParams, final String queryFilter) {
- if (queryFilter == null) return null;
+ if (queryFilter == null) {
+ return null;
+ }
final Map<String, String> variableMap = new TreeMap<String, String>();
for (final String cmpField : cmpFields) {
@@ -1221,7 +1251,9 @@ public class SunConversion implements Dy
private final Map<String, RelationField> relations = new TreeMap<String, RelationField>();
public EntityData(final Entity entity) {
- if (entity == null) throw new NullPointerException("entity is null");
+ if (entity == null) {
+ throw new NullPointerException("entity is null");
+ }
this.entity = entity;
final Attributes attributes = entity.getAttributes();
@@ -1265,7 +1297,9 @@ public class SunConversion implements Dy
}
public boolean hasPkColumnMapping(final String column) {
- if (ids.size() > 1) return false;
+ if (ids.size() > 1) {
+ return false;
+ }
for (final Id id : ids.values()) {
if (column.equals(id.getColumn().getName())) {
return true;
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/TldScanner.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/TldScanner.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/TldScanner.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/TldScanner.java Sat Feb 22 01:58:19 2014
@@ -70,10 +70,14 @@ public class TldScanner {
private static Map<Integer, Set<URL>> cacheByhashCode = new WeakHashMap<Integer, Set<URL>>();
public static Set<URL> scan(final ClassLoader classLoader) throws OpenEJBException {
- if (classLoader == null) return Collections.emptySet();
+ if (classLoader == null) {
+ return Collections.emptySet();
+ }
final Set<URL> urls = cache.get(classLoader);
- if (urls != null) return urls;
+ if (urls != null) {
+ return urls;
+ }
final Set<URL> result = scanClassLoaderForTagLibs(classLoader);
cache.put(classLoader, result);
@@ -85,8 +89,12 @@ public class TldScanner {
final Set<URL> tldUrls = new HashSet<URL>();
- if (classLoader == null) return tldUrls;
- if (classLoader == Object.class.getClassLoader()) return tldUrls;
+ if (classLoader == null) {
+ return tldUrls;
+ }
+ if (classLoader == Object.class.getClassLoader()) {
+ return tldUrls;
+ }
final List<URL> urls = urls(classLoader);
@@ -156,7 +164,9 @@ public class TldScanner {
final Set<URL> urls = new HashSet<URL>();
final File webInfDir = new File(war, "WEB-INF");
- if (!webInfDir.isDirectory()) return urls;
+ if (!webInfDir.isDirectory()) {
+ return urls;
+ }
// skip the lib and classes dir in WEB-INF
@@ -171,7 +181,9 @@ public class TldScanner {
}
}
- if (files.isEmpty()) return urls;
+ if (files.isEmpty()) {
+ return urls;
+ }
// recursively scan the directories
while (!files.isEmpty()) {
@@ -216,7 +228,9 @@ public class TldScanner {
static Set<URL> scanJarForTagLibs(final File file) {
final Set<URL> urls = new HashSet<URL>();
- if (!file.isFile()) return urls;
+ if (!file.isFile()) {
+ return urls;
+ }
JarFile jarFile = null;
try {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java Sat Feb 22 01:58:19 2014
@@ -136,7 +136,9 @@ public class VmDeploymentManager impleme
@Override
public Target[] getTargets() {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
return new Target[]{DEFAULT_TARGET};
}
@@ -144,7 +146,9 @@ public class VmDeploymentManager impleme
@Override
public TargetModuleID[] getAvailableModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
if (!containsDefaultTarget(targetList)) {
return null;
@@ -256,7 +260,9 @@ public class VmDeploymentManager impleme
@Override
public TargetModuleID[] getNonRunningModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
if (!containsDefaultTarget(targetList)) {
return null;
@@ -267,7 +273,9 @@ public class VmDeploymentManager impleme
@Override
public TargetModuleID[] getRunningModules(final ModuleType moduleType, final Target[] targetList) throws TargetException {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
if (!containsDefaultTarget(targetList)) {
return null;
@@ -279,7 +287,9 @@ public class VmDeploymentManager impleme
@Override
public ProgressObject distribute(final Target[] targetList, final File moduleFile, final File planFile) {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
if (!isDeployerLocal()) {
// todo when we input stream is a valid remote type we can implement this
@@ -301,7 +311,9 @@ public class VmDeploymentManager impleme
@Override
public ProgressObject distribute(final Target[] targetList, final InputStream moduleStream, final InputStream planStream) {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
// consume module stream
if (isDeployerLocal()) {
@@ -327,7 +339,9 @@ public class VmDeploymentManager impleme
}
private ProgressObject deploy(final Target[] targetList, final Properties properties) {
- if (targetList == null) return new ProgressObjectImpl(CommandType.DISTRIBUTE, new NullPointerException("targetList is null"));
+ if (targetList == null) {
+ return new ProgressObjectImpl(CommandType.DISTRIBUTE, new NullPointerException("targetList is null"));
+ }
if (!containsDefaultTarget(targetList)) {
return new ProgressObjectImpl(CommandType.DISTRIBUTE, Collections.<TargetModuleID>emptySet());
@@ -373,14 +387,18 @@ public class VmDeploymentManager impleme
private boolean containsDefaultTarget(final Target[] targetList) {
for (final Target target : targetList) {
- if (DEFAULT_TARGET.equals(target)) return true;
+ if (DEFAULT_TARGET.equals(target)) {
+ return true;
+ }
}
return false;
}
@Override
public ProgressObject start(final TargetModuleID[] moduleIdList) {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
final Set<TargetModuleID> deployedModules = toTargetModuleIds(getDeployer().getDeployedApps(), null);
final Set<TargetModuleID> targetModuleIds = new HashSet<TargetModuleID>(Arrays.asList(moduleIdList));
@@ -391,14 +409,18 @@ public class VmDeploymentManager impleme
@Override
public ProgressObject stop(final TargetModuleID[] moduleIdList) {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
return new ProgressObjectImpl(CommandType.START, Collections.<TargetModuleID>emptySet());
}
@Override
public ProgressObject undeploy(final TargetModuleID[] moduleIdList) {
- if (!connected) throw new IllegalStateException("Deployment manager is disconnected");
+ if (!connected) {
+ throw new IllegalStateException("Deployment manager is disconnected");
+ }
UndeployException undeployException = null;
final Set<TargetModuleID> results = new TreeSet<TargetModuleID>();
@@ -505,7 +527,9 @@ public class VmDeploymentManager impleme
}
public TargetImpl(final String name, final String description) {
- if (name == null) throw new NullPointerException("name is null");
+ if (name == null) {
+ throw new NullPointerException("name is null");
+ }
this.name = name;
this.description = description;
}
@@ -525,8 +549,12 @@ public class VmDeploymentManager impleme
}
public boolean equals(final Object o) {
- if (this == o) return true;
- if (!(o instanceof TargetImpl)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TargetImpl)) {
+ return false;
+ }
final TargetImpl target = (TargetImpl) o;
return name.equals(target.name);
@@ -557,11 +585,17 @@ public class VmDeploymentManager impleme
}
public TargetModuleIDImpl(final Target target, final String moduleId, String webUrl) {
- if (target == null) throw new NullPointerException("target is null");
- if (moduleId == null) throw new NullPointerException("moduleId is null");
+ if (target == null) {
+ throw new NullPointerException("target is null");
+ }
+ if (moduleId == null) {
+ throw new NullPointerException("moduleId is null");
+ }
this.target = target;
this.moduleId = moduleId;
- if (webUrl != null && !webUrl.startsWith("http:")) webUrl = "http://localhost:8080/" + webUrl;
+ if (webUrl != null && !webUrl.startsWith("http:")) {
+ webUrl = "http://localhost:8080/" + webUrl;
+ }
this.webUrl = webUrl;
}
@@ -600,8 +634,12 @@ public class VmDeploymentManager impleme
}
public boolean equals(final Object o) {
- if (this == o) return true;
- if (!(o instanceof TargetModuleIDImpl)) return false;
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof TargetModuleIDImpl)) {
+ return false;
+ }
final TargetModuleIDImpl targetModuleID = (TargetModuleIDImpl) o;
return target.equals(targetModuleID.target) &&
@@ -621,7 +659,9 @@ public class VmDeploymentManager impleme
// compare target name
final int val = target.getName().compareTo(targetModuleID.target.getName());
- if (val != 0) return val;
+ if (val != 0) {
+ return val;
+ }
// compare moduleId
return moduleId.compareTo(targetModuleID.moduleId);
@@ -647,7 +687,9 @@ public class VmDeploymentManager impleme
@Override
public synchronized TargetModuleID[] getResultTargetModuleIDs() {
- if (targetModuleIds == null) return new TargetModuleID[0];
+ if (targetModuleIds == null) {
+ return new TargetModuleID[0];
+ }
return targetModuleIds.toArray(new TargetModuleID[targetModuleIds.size()]);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java Sat Feb 22 01:58:19 2014
@@ -150,8 +150,9 @@ public class WebModule extends Module im
public void setWebApp(final WebApp webApp) {
this.webApp = webApp;
- if (webApp != null)
+ if (webApp != null) {
webApp.setContextRoot(contextRoot);
+ }
}
@Override
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WlsConversion.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WlsConversion.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WlsConversion.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WlsConversion.java Sat Feb 22 01:58:19 2014
@@ -54,7 +54,9 @@ public class WlsConversion implements Dy
// todo warn about not being able to parse sun descriptor
}
}
- if (altDD == null) return null;
+ if (altDD == null) {
+ return null;
+ }
if (altDD instanceof JAXBElement) {
final JAXBElement jaxbElement = (JAXBElement) altDD;
altDD = jaxbElement.getValue();
@@ -73,9 +75,15 @@ public class WlsConversion implements Dy
private void mergeEjbConfig(final EjbModule ejbModule, final WeblogicEjbJar weblogicEjbJar) {
final OpenejbJar openejbJar = ejbModule.getOpenejbJar();
- if (openejbJar == null) return;
- if (weblogicEjbJar == null) return;
- if (weblogicEjbJar.getWeblogicEnterpriseBean().size() == 0) return;
+ if (openejbJar == null) {
+ return;
+ }
+ if (weblogicEjbJar == null) {
+ return;
+ }
+ if (weblogicEjbJar.getWeblogicEnterpriseBean().size() == 0) {
+ return;
+ }
for (final WeblogicEnterpriseBean ejb : weblogicEjbJar.getWeblogicEnterpriseBean()) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java Sat Feb 22 01:58:19 2014
@@ -140,7 +140,9 @@ public class WsDeployer implements Dynam
final String className = servlet.getServletClass();
// Skip JSPs
- if (className == null) continue;
+ if (className == null) {
+ continue;
+ }
try {
final Class<?> clazz = webModule.getClassLoader().loadClass(className);
@@ -251,15 +253,25 @@ public class WsDeployer implements Dynam
WebserviceDescription webserviceDescription = null;
for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
// skip if this is not a webservices endpoint
- if (!(enterpriseBean instanceof SessionBean)) continue;
+ if (!(enterpriseBean instanceof SessionBean)) {
+ continue;
+ }
final SessionBean sessionBean = (SessionBean) enterpriseBean;
- if (sessionBean.getSessionType() == SessionType.STATEFUL) continue;
- if (sessionBean.getSessionType() == SessionType.MANAGED) continue;
- if (sessionBean.getServiceEndpoint() == null) continue;
+ if (sessionBean.getSessionType() == SessionType.STATEFUL) {
+ continue;
+ }
+ if (sessionBean.getSessionType() == SessionType.MANAGED) {
+ continue;
+ }
+ if (sessionBean.getServiceEndpoint() == null) {
+ continue;
+ }
final EjbDeployment deployment = deploymentsByEjbName.get(sessionBean.getEjbName());
- if (deployment == null) continue;
+ if (deployment == null) {
+ continue;
+ }
final Class<?> ejbClass;
try {
@@ -269,7 +281,9 @@ public class WsDeployer implements Dynam
}
// for now, skip all non jaxws beans
- if (!JaxWsUtils.isWebService(ejbClass)) continue;
+ if (!JaxWsUtils.isWebService(ejbClass)) {
+ continue;
+ }
// create webservices dd if not defined
if (webservices == null) {
@@ -366,7 +380,9 @@ public class WsDeployer implements Dynam
}
private Definition getWsdl(final DeploymentModule module, final String wsdlFile) {
- if (wsdlFile == null) return null;
+ if (wsdlFile == null) {
+ return null;
+ }
final Object object = module.getAltDDs().get(wsdlFile);
if (object instanceof Definition) {
@@ -425,14 +441,20 @@ public class WsDeployer implements Dynam
}
private String getLocationFromWsdl(final Definition definition, final PortComponent portComponent) {
- if (definition == null) return null;
+ if (definition == null) {
+ return null;
+ }
try {
final Service service = definition.getService(portComponent.getWsdlService());
- if (service == null) return null;
+ if (service == null) {
+ return null;
+ }
final Port port = service.getPort(portComponent.getWsdlPort().getLocalPart());
- if (port == null) return null;
+ if (port == null) {
+ return null;
+ }
for (final Object element : port.getExtensibilityElements()) {
if (element instanceof SOAPAddress) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ID.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ID.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ID.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ID.java Sat Feb 22 01:58:19 2014
@@ -25,7 +25,9 @@ public class ID {
private final String name;
public ID(final String namespace, final String name) {
- if (name == null) throw new IllegalArgumentException("name cannot be null");
+ if (name == null) {
+ throw new IllegalArgumentException("name cannot be null");
+ }
this.namespace = namespace != null ? namespace.toLowerCase() : null;
this.name = name.toLowerCase();
}
@@ -39,8 +41,12 @@ public class ID {
}
public void validate() {
- if (namespace == null) throw new IllegalArgumentException("namespace cannot be null");
- if (name == null) throw new IllegalArgumentException("name cannot be null");
+ if (namespace == null) {
+ throw new IllegalArgumentException("namespace cannot be null");
+ }
+ if (name == null) {
+ throw new IllegalArgumentException("name cannot be null");
+ }
}
public static ID parse(final String raw) {
return parse(raw, (String) null);
@@ -51,7 +57,9 @@ public class ID {
}
public static ID parse(final String raw, final String namespace) {
- if (raw == null) throw new NullPointerException("provider id cannot be null");
+ if (raw == null) {
+ throw new NullPointerException("provider id cannot be null");
+ }
final String[] parts = raw.split("[#:]");
@@ -69,13 +77,21 @@ public class ID {
@Override
public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
final ID id = (ID) o;
- if (!name.equals(id.name)) return false;
- if (namespace != null ? !namespace.equals(id.namespace) : id.namespace != null) return false;
+ if (!name.equals(id.name)) {
+ return false;
+ }
+ if (namespace != null ? !namespace.equals(id.namespace) : id.namespace != null) {
+ return false;
+ }
return true;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ProviderManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ProviderManager.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ProviderManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ProviderManager.java Sat Feb 22 01:58:19 2014
@@ -61,7 +61,9 @@ public class ProviderManager {
}
public void register(final String namespace, final ServiceProvider provider) {
- if (provider == null) throw new IllegalArgumentException("provider cannot be null");
+ if (provider == null) {
+ throw new IllegalArgumentException("provider cannot be null");
+ }
final ID id = new ID(namespace, provider.getId());
@@ -69,7 +71,9 @@ public class ProviderManager {
}
public List<ServiceProvider> load(String namespace) {
- if (namespace == null) throw new IllegalArgumentException("namespace cannot be null");
+ if (namespace == null) {
+ throw new IllegalArgumentException("namespace cannot be null");
+ }
namespace = namespace.toLowerCase();
@@ -95,7 +99,9 @@ public class ProviderManager {
}
private void register(final ID id, final ServiceProvider provider, final Set<ID> seen) {
- if (providers.containsKey(id)) return;
+ if (providers.containsKey(id)) {
+ return;
+ }
if (provider.getParent() != null) {
@@ -118,12 +124,24 @@ public class ProviderManager {
private void inherit(final ServiceProvider child, final ServiceProvider parent) {
- if (n(child.getClassName())) child.setClassName(parent.getClassName());
- if (n(child.getConstructor())) child.setConstructor(parent.getConstructor());
- if (n(child.getFactoryName())) child.setFactoryName(parent.getFactoryName());
- if (n(child.getDescription())) child.setDescription(parent.getDescription());
- if (n(child.getDisplayName())) child.setDisplayName(parent.getDisplayName());
- if (n(child.getService())) child.setService(parent.getService());
+ if (n(child.getClassName())) {
+ child.setClassName(parent.getClassName());
+ }
+ if (n(child.getConstructor())) {
+ child.setConstructor(parent.getConstructor());
+ }
+ if (n(child.getFactoryName())) {
+ child.setFactoryName(parent.getFactoryName());
+ }
+ if (n(child.getDescription())) {
+ child.setDescription(parent.getDescription());
+ }
+ if (n(child.getDisplayName())) {
+ child.setDisplayName(parent.getDisplayName());
+ }
+ if (n(child.getService())) {
+ child.setService(parent.getService());
+ }
{ // types
final Set<String> types = new HashSet<String>();
@@ -149,12 +167,16 @@ public class ProviderManager {
}
private ServiceProvider getProvider(final ID id, final Set<ID> seen) {
- if (seen.contains(id)) throw new ProviderCircularReferenceException(seen);
+ if (seen.contains(id)) {
+ throw new ProviderCircularReferenceException(seen);
+ }
seen.add(id);
{ // Already loaded?
final ServiceProvider provider = providers.get(id);
- if (provider != null) return provider;
+ if (provider != null) {
+ return provider;
+ }
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ServiceJarXmlLoader.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ServiceJarXmlLoader.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ServiceJarXmlLoader.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/provider/ServiceJarXmlLoader.java Sat Feb 22 01:58:19 2014
@@ -41,12 +41,16 @@ public class ServiceJarXmlLoader impleme
{ // Already loaded and waiting?
final ServiceProvider provider = loaded.remove(id);
- if (provider != null) return provider;
+ if (provider != null) {
+ return provider;
+ }
}
final String namespace = id.getNamespace();
- if (namespaces.contains(namespace)) return null;
+ if (namespaces.contains(namespace)) {
+ return null;
+ }
namespaces.add(namespace);
parse(namespace);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckAssemblyBindings.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckAssemblyBindings.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckAssemblyBindings.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckAssemblyBindings.java Sat Feb 22 01:58:19 2014
@@ -43,7 +43,9 @@ public class CheckAssemblyBindings exten
final AssemblyDescriptor assembly = ejbModule.getEjbJar().getAssemblyDescriptor();
- if (assembly == null) return;
+ if (assembly == null) {
+ return;
+ }
for (final InterceptorBinding binding : assembly.getInterceptorBinding()) {
final List<String> interceptorClasses = binding.getInterceptorClass();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCallbacks.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCallbacks.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCallbacks.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCallbacks.java Sat Feb 22 01:58:19 2014
@@ -308,14 +308,17 @@ public class CheckCallbacks extends Vali
final Method method = getMethod(delcaringClass, callback.getMethodName(), parameterTypes);
if (implementsSessionBean(delcaringClass)) {
if ("PreDestroy".equals(type)) {
- if (!callback.getMethodName().equals("ejbRemove"))
+ if (!callback.getMethodName().equals("ejbRemove")) {
fail(bean.getEjbName(), "callback.sessionbean.invalidusage", type, callback.getMethodName(), ejbClass);
+ }
} else if ("PostActivate".equals(type)) {
- if (!callback.getMethodName().equals("ejbActivate"))
+ if (!callback.getMethodName().equals("ejbActivate")) {
fail(bean.getEjbName(), "callback.sessionbean.invalidusage", type, callback.getMethodName(), ejbClass);
+ }
} else if ("PrePassivate".equals(type)) {
- if (!callback.getMethodName().equals("ejbPassivate"))
+ if (!callback.getMethodName().equals("ejbPassivate")) {
fail(bean.getEjbName(), "callback.sessionbean.invalidusage", type, callback.getMethodName(), ejbClass);
+ }
} else if ("PostConstruct".equals(type)) {
if (!callback.getMethodName().equals("ejbCreate")) {
@@ -357,8 +360,9 @@ public class CheckCallbacks extends Vali
private boolean implementsSessionBean(final Class<?> ejbClass) {
final Class<?>[] interfaces = ejbClass.getInterfaces();
for (final Class<?> interfce : interfaces) {
- if(interfce.equals(javax.ejb.SessionBean.class))
+ if(interfce.equals(javax.ejb.SessionBean.class)) {
return true;
+ }
}
return false;
}
@@ -417,7 +421,9 @@ public class CheckCallbacks extends Vali
try {
return clazz.getDeclaredMethod(methodName, parameterTypes);
} catch (final NoSuchMethodException e) {
- if (original == null) original = e;
+ if (original == null) {
+ original = e;
+ }
}
clazz = clazz.getSuperclass();
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java Sat Feb 22 01:58:19 2014
@@ -97,9 +97,13 @@ public class CheckClasses extends Valida
final Class<?> beanClass = check_hasEjbClass(bean);
// All the subsequent checks require the bean class
- if (beanClass == null) continue;
+ if (beanClass == null) {
+ continue;
+ }
- if (!(bean instanceof RemoteBean)) continue;
+ if (!(bean instanceof RemoteBean)) {
+ continue;
+ }
if (bean instanceof SessionBean && ((SessionBean) bean).getProxy() != null) {
continue;
@@ -151,7 +155,9 @@ public class CheckClasses extends Valida
private void checkInterface(final RemoteBean b, final Class<?> beanClass, String tag, final String className) {
final Class<?> interfce = lookForClass(className, tag, b.getEjbName());
- if (interfce == null) return;
+ if (interfce == null) {
+ return;
+ }
check_hasDependentClasses(b, className, tag);
@@ -175,8 +181,12 @@ public class CheckClasses extends Valida
}
private void check_hasInterface(final RemoteBean b) {
- if (b.getRemote() != null) return;
- if (b.getLocal() != null) return;
+ if (b.getRemote() != null) {
+ return;
+ }
+ if (b.getLocal() != null) {
+ return;
+ }
Class<?> beanClass = null;
try {
@@ -190,12 +200,20 @@ public class CheckClasses extends Valida
return;
}
- if (b.getBusinessLocal().size() > 0) return;
- if (b.getBusinessRemote().size() > 0) return;
+ if (b.getBusinessLocal().size() > 0) {
+ return;
+ }
+ if (b.getBusinessRemote().size() > 0) {
+ return;
+ }
- if (((SessionBean) b).getServiceEndpoint() != null) return;
+ if (((SessionBean) b).getServiceEndpoint() != null) {
+ return;
+ }
- if (beanClass.isAnnotationPresent(WebService.class)) return;
+ if (beanClass.isAnnotationPresent(WebService.class)) {
+ return;
+ }
//fail(b, "noInterfaceDeclared.session");
}
@@ -242,13 +260,17 @@ public class CheckClasses extends Valida
final Class<?> beanClass = lookForClass(b.getEjbClass(), "ejb-class", ejbName);
final boolean isDynamicProxyImpl = DynamicProxyImplFactory.isKnownDynamicallyImplemented(beanClass);
- if (beanClass == null) return null;
+ if (beanClass == null) {
+ return null;
+ }
if (beanClass.isInterface() && !isDynamicProxyImpl){
fail(ejbName, "interfaceDeclaredAsBean", beanClass.getName());
}
- if (isCmp(b)) return beanClass;
+ if (isCmp(b)) {
+ return beanClass;
+ }
if (isAbstract(beanClass.getModifiers()) && !isAbstractAllowed(beanClass)){
fail(ejbName, "abstractDeclaredAsBean", beanClass.getName());
@@ -258,8 +280,12 @@ public class CheckClasses extends Valida
}
public static boolean isAbstractAllowed(final Class clazz) {
- if (DynamicProxyImplFactory.isKnownDynamicallyImplemented(clazz)) return true;
- if (DynamicSubclass.isDynamic(clazz)) return true;
+ if (DynamicProxyImplFactory.isKnownDynamicallyImplemented(clazz)) {
+ return true;
+ }
+ if (DynamicSubclass.isDynamic(clazz)) {
+ return true;
+ }
return false;
}
@@ -319,25 +345,33 @@ public class CheckClasses extends Valida
} else if (EJBHome.class.isAssignableFrom(clazz)) {
- if (tag.equals("home")) return true;
+ if (tag.equals("home")) {
+ return true;
+ }
fail(b, "xml." + tag + ".ejbHome", clazz.getName());
} else if (EJBLocalHome.class.isAssignableFrom(clazz)) {
- if (tag.equals("localHome")) return true;
+ if (tag.equals("localHome")) {
+ return true;
+ }
fail(b, "xml." + tag + ".ejbLocalHome", clazz.getName());
} else if (EJBObject.class.isAssignableFrom(clazz)) {
- if (tag.equals("remote")) return true;
+ if (tag.equals("remote")) {
+ return true;
+ }
fail(b, "xml." + tag + ".ejbObject", clazz.getName());
} else if (EJBLocalObject.class.isAssignableFrom(clazz)) {
- if (tag.equals("local")) return true;
+ if (tag.equals("local")) {
+ return true;
+ }
fail(b, "xml." + tag + ".ejbLocalObject", clazz.getName());
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckDependsOn.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckDependsOn.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckDependsOn.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckDependsOn.java Sat Feb 22 01:58:19 2014
@@ -60,11 +60,15 @@ public class CheckDependsOn extends Vali
for (final Bean bean : app.values()) {
final EnterpriseBean enterpriseBean = bean.bean;
- if (!(enterpriseBean instanceof SessionBean)) continue;
+ if (!(enterpriseBean instanceof SessionBean)) {
+ continue;
+ }
final SessionBean sessionBean = (SessionBean) enterpriseBean;
- if (sessionBean.getSessionType() != SessionType.SINGLETON) continue;
+ if (sessionBean.getSessionType() != SessionType.SINGLETON) {
+ continue;
+ }
for (final String ejbName : sessionBean.getDependsOn()) {
final Bean referee = bean.resolveLink(ejbName);
@@ -113,7 +117,9 @@ public class CheckDependsOn extends Vali
public T resolveLink(final String link, final URI moduleUri) {
final T value = module.resolveLink(link, moduleUri);
- if (value != null) return value;
+ if (value != null) {
+ return value;
+ }
return app.resolveLink(link, moduleUri);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionPointUsage.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionPointUsage.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionPointUsage.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionPointUsage.java Sat Feb 22 01:58:19 2014
@@ -30,7 +30,9 @@ public class CheckInjectionPointUsage ex
@Override
public void validate(final EjbModule ejbModule) {
- if (ejbModule.getBeans() == null) return;
+ if (ejbModule.getBeans() == null) {
+ return;
+ }
try {
for (final Field field : ejbModule.getFinder().findAnnotatedFields(Inject.class)) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionTargets.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionTargets.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionTargets.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckInjectionTargets.java Sat Feb 22 01:58:19 2014
@@ -60,7 +60,9 @@ public class CheckInjectionTargets exten
correctName.delete(0, 3);
correctName.setCharAt(0, Character.toLowerCase(correctName.charAt(0)));
final String shortNameCorrect = correctName.toString();
- if (classPrefix) correctName.insert(0, target.getInjectionTargetClass() + "/");
+ if (classPrefix) {
+ correctName.insert(0, target.getInjectionTargetClass() + "/");
+ }
warn(bean, "injectionTarget.nameContainsSet", target.getInjectionTargetName(), shortNameInvalid, shortNameCorrect, correctName, reference.getName(), reference.getClass().getSimpleName());
target.setInjectionTargetName(correctName.toString());
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckMethods.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckMethods.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckMethods.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckMethods.java Sat Feb 22 01:58:19 2014
@@ -37,7 +37,9 @@ public class CheckMethods extends Valida
public void validate(final EjbModule ejbModule) {
for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
- if (!(bean instanceof RemoteBean)) continue;
+ if (!(bean instanceof RemoteBean)) {
+ continue;
+ }
final RemoteBean b = (RemoteBean) bean;
if (b.getHome() != null) {
@@ -92,7 +94,9 @@ public class CheckMethods extends Valida
final Method[] interfaceMethods = intrface.getMethods();
for (int i = 0; i < interfaceMethods.length; i++) {
- if (interfaceMethods[i].getDeclaringClass() == EJBLocalObject.class) continue;
+ if (interfaceMethods[i].getDeclaringClass() == EJBLocalObject.class) {
+ continue;
+ }
final String name = interfaceMethods[i].getName();
try {
final Class[] params = interfaceMethods[i].getParameterTypes();
@@ -141,7 +145,9 @@ public class CheckMethods extends Valida
final Method[] interfaceMethods = intrface.getMethods();
for (int i = 0; i < interfaceMethods.length; i++) {
- if (interfaceMethods[i].getDeclaringClass() == EJBObject.class) continue;
+ if (interfaceMethods[i].getDeclaringClass() == EJBObject.class) {
+ continue;
+ }
final String name = interfaceMethods[i].getName();
try {
final Class[] params = interfaceMethods[i].getParameterTypes();
@@ -223,7 +229,9 @@ public class CheckMethods extends Valida
final Method[] homeMethods = home.getMethods();
for (int i = 0; i < homeMethods.length; i++) {
- if (!homeMethods[i].getName().startsWith("create")) continue;
+ if (!homeMethods[i].getName().startsWith("create")) {
+ continue;
+ }
final Method create = homeMethods[i];
@@ -249,8 +257,9 @@ public class CheckMethods extends Valida
if (b instanceof SessionBean) {
final SessionBean sb = (SessionBean) b;
// Under EJB 3.1, it is not required that a stateless session bean have an ejbCreate method, even when it has a home interface
- if (!sb.getSessionType().equals(SessionType.STATELESS))
+ if (!sb.getSessionType().equals(SessionType.STATELESS)) {
fail(b, "session.no.ejb.create", b.getEjbClass(), ejbCreateName.toString(), paramString);
+ }
}
}
}
@@ -262,13 +271,17 @@ public class CheckMethods extends Valida
public boolean check_postCreateMethodsAreImplemented(final RemoteBean b, final Class bean, final Class home) {
boolean result = true;
- if (b instanceof SessionBean) return true;
+ if (b instanceof SessionBean) {
+ return true;
+ }
final Method[] homeMethods = home.getMethods();
final Method[] beanMethods = bean.getMethods();
for (int i = 0; i < homeMethods.length; i++) {
- if (!homeMethods[i].getName().startsWith("create")) continue;
+ if (!homeMethods[i].getName().startsWith("create")) {
+ continue;
+ }
final Method create = homeMethods[i];
final StringBuilder ejbPostCreateName = new StringBuilder(create.getName());
ejbPostCreateName.replace(0, 1, "ejbPostC");
@@ -308,7 +321,9 @@ public class CheckMethods extends Valida
for (final Method ejbCreate : bean.getMethods()) {
- if (!ejbCreate.getName().startsWith("ejbCreate")) continue;
+ if (!ejbCreate.getName().startsWith("ejbCreate")) {
+ continue;
+ }
final StringBuilder create = new StringBuilder(ejbCreate.getName());
create.replace(0, "ejbC".length(), "c");
@@ -354,7 +369,9 @@ public class CheckMethods extends Valida
for (final Method postCreate : bean.getMethods()) {
- if (!postCreate.getName().startsWith("ejbPostCreate")) continue;
+ if (!postCreate.getName().startsWith("ejbPostCreate")) {
+ continue;
+ }
final StringBuilder ejbCreate = new StringBuilder(postCreate.getName());
ejbCreate.replace(0, "ejbPostCreate".length(), "ejbCreate");
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckPersistenceRefs.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckPersistenceRefs.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckPersistenceRefs.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckPersistenceRefs.java Sat Feb 22 01:58:19 2014
@@ -72,8 +72,12 @@ public class CheckPersistenceRefs extend
case MANAGED: return "Managed";
default: throw new IllegalArgumentException("Uknown SessionBean type "+bean.getClass());
}
- } else if (bean instanceof MessageDrivenBean) return "MessageDriven";
- else if (bean instanceof EntityBean) return "EJB 2.1 Entity";
- else throw new IllegalArgumentException("Uknown bean type "+bean.getClass());
+ } else if (bean instanceof MessageDrivenBean) {
+ return "MessageDriven";
+ } else if (bean instanceof EntityBean) {
+ return "EJB 2.1 Entity";
+ } else {
+ throw new IllegalArgumentException("Uknown bean type " + bean.getClass());
+ }
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/ValidationBase.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/ValidationBase.java?rev=1570779&r1=1570778&r2=1570779&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/ValidationBase.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/ValidationBase.java Sat Feb 22 01:58:19 2014
@@ -109,7 +109,9 @@ public abstract class ValidationBase imp
for (int i = 0; i < methodA.getParameterTypes().length; i++) {
final Class<?> a = methodA.getParameterTypes()[i];
final Class<?> b = methodB.getParameterTypes()[i];
- if (!a.equals(b)) return false;
+ if (!a.equals(b)) {
+ return false;
+ }
}
return true;
}