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/19 16:48:09 UTC
svn commit: r1569795 [8/35] - in
/tomee/tomee/trunk/container/openejb-core/src/main: config/pmd/
java/javax/xml/ws/ java/javax/xml/ws/wsaddressing/ java/org/apache/openejb/
java/org/apache/openejb/assembler/
java/org/apache/openejb/assembler/classic/ j...
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppContextConfigDeployer.java Wed Feb 19 15:47:58 2014
@@ -37,7 +37,7 @@ public class AppContextConfigDeployer im
private final EnvEntriesPropertiesDeployer envEntriesDeployer;
private final BeanProperties beanPropertiesDeployer;
- public AppContextConfigDeployer(final EnvEntriesPropertiesDeployer envEntriesPropertiesDeployer, BeanProperties beanProperties) {
+ public AppContextConfigDeployer(final EnvEntriesPropertiesDeployer envEntriesPropertiesDeployer, final BeanProperties beanProperties) {
envEntriesDeployer = envEntriesPropertiesDeployer;
beanPropertiesDeployer = beanProperties;
}
@@ -50,7 +50,7 @@ public class AppContextConfigDeployer im
// parse files once since it is application scoped (we don't want duplicates)
final Set<String> alreadyParsed = new HashSet<String>();
- for (DeploymentModule module : deploymentModule) {
+ for (final DeploymentModule module : deploymentModule) {
final Object o = module.getAltDDs().get(CONFIG_NAME);
if (o instanceof URL) {
final URL url = (URL) o;
@@ -72,11 +72,11 @@ public class AppContextConfigDeployer im
try {
is = IO.read(url);
SaxAppCtxConfig.parse(appModule, new InputSource(is), envEntriesDeployer, beanPropertiesDeployer); // work directly on the module/deployer, avoid temp objects
- } catch (SAXException e) {
+ } catch (final SAXException e) {
throw new OpenEJBException("can't parse " + url.toExternalForm(), e);
- } catch (ParserConfigurationException e) {
+ } catch (final ParserConfigurationException e) {
throw new OpenEJBException("can't configure the parser for " + url.toExternalForm(), e);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new OpenEJBException("can't read " + url.toExternalForm(), e);
} finally {
IO.close(is);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java Wed Feb 19 15:47:58 2014
@@ -210,7 +210,7 @@ class AppInfoBuilder {
appInfo.ejbJars.add(ejbJarInfo);
- } catch (OpenEJBException e) {
+ } catch (final OpenEJBException e) {
ConfigUtils.logger.warning("conf.0004", ejbModule.getJarLocation(), e.getMessage());
throw e;
}
@@ -258,7 +258,7 @@ class AppInfoBuilder {
return new LinkedHashSet<String>(bean.dependsOn);
}
});
- } catch (CircularReferencesException e) {
+ } catch (final CircularReferencesException e) {
// List<List> circuits = e.getCircuits();
// TODO Seems we lost circular reference detection, or we do it elsewhere and don't need it here
}
@@ -282,7 +282,7 @@ class AppInfoBuilder {
final File file = toFile(url);
try {
appInfo.libs.add(file.getCanonicalPath());
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new OpenEJBException("Invalid application lib path " + file.getAbsolutePath());
}
}
@@ -290,7 +290,7 @@ class AppInfoBuilder {
if (appModule.getCmpMappings() != null) {
try {
appInfo.cmpMappingsXml = JpaJaxbUtil.marshal(EntityMappings.class, appModule.getCmpMappings());
- } catch (JAXBException e) {
+ } catch (final JAXBException e) {
throw new OpenEJBException("Unable to marshal cmp entity mappings", e);
}
}
@@ -408,7 +408,7 @@ class AppInfoBuilder {
servletInfo.servletName = servlet.getServletName();
servletInfo.servletClass = servlet.getServletClass();
servletInfo.mappings = webModule.getWebApp().getServletMappings(servletInfo.servletName);
- for (ParamValue pv : servlet.getInitParam()) {
+ for (final ParamValue pv : servlet.getInitParam()) {
final ParamValueInfo pvi = new ParamValueInfo();
pvi.name = pv.getParamName();
pvi.value = pv.getParamValue();
@@ -464,7 +464,7 @@ class AppInfoBuilder {
final File file = toFile(url);
try {
connectorInfo.libs.add(file.getCanonicalPath());
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new IllegalArgumentException("Invalid application lib path " + file.getAbsolutePath());
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppValidator.java Wed Feb 19 15:47:58 2014
@@ -70,7 +70,7 @@ public class AppValidator {
public AppValidator() throws OpenEJBException {
}
- public AppValidator(int level, boolean printXml, boolean printWarnings, boolean printCount) {
+ public AppValidator(final int level, final boolean printXml, final boolean printWarnings, final boolean printCount) {
this.level = level;
this.printXml = printXml;
this.printWarnings = printWarnings;
@@ -81,12 +81,12 @@ public class AppValidator {
additionalValidators = additionalValidator;
}
- public void addValidationResults(ValidationResults set) {
+ public void addValidationResults(final ValidationResults set) {
sets.add(set);
}
public ValidationResults[] getValidationResultsSets() {
- ValidationResults[] ejbSets = new ValidationResults[sets.size()];
+ final ValidationResults[] ejbSets = new ValidationResults[sets.size()];
return sets.toArray(ejbSets);
}
@@ -95,13 +95,13 @@ public class AppValidator {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(appModule.getClassLoader()); // be sure to not mix classloaders
try {
- ValidationRule[] rules = getValidationRules();
+ final ValidationRule[] rules = getValidationRules();
for (int i = 0; i < rules.length; i++) {
rules[i].validate(appModule);
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
e.printStackTrace(System.out);
- ValidationError err = new ValidationError("cannot.validate");
+ final ValidationError err = new ValidationError("cannot.validate");
err.setCause(e);
err.setDetails(e.getMessage());
appModule.getValidation().addError(err);
@@ -143,7 +143,7 @@ public class AppValidator {
}
// END SNIPPET : code1
- public void printResults(ValidationResults set) {
+ public void printResults(final ValidationResults set) {
if (!set.hasErrors() && !set.hasFailures() && (!printWarnings || !set.hasWarnings())) {
return;
}
@@ -159,7 +159,7 @@ public class AppValidator {
}
}
- protected void printValidationExceptions(ValidationException[] exceptions) {
+ protected void printValidationExceptions(final ValidationException[] exceptions) {
for (int i = 0; i < exceptions.length; i++) {
System.out.print(" ");
System.out.print(exceptions[i].getPrefix());
@@ -187,7 +187,7 @@ public class AppValidator {
}
- public void printResultsXML(ValidationResults set) {
+ public void printResultsXML(final ValidationResults set) {
if (!set.hasErrors() && !set.hasFailures() && (!printWarnings || !set.hasWarnings())) {
return;
}
@@ -206,7 +206,7 @@ public class AppValidator {
System.out.println("</jar>");
}
- protected void printValidationExceptionsXML(ValidationException[] exceptions) {
+ protected void printValidationExceptionsXML(final ValidationException[] exceptions) {
for (int i = 0; i < exceptions.length; i++) {
System.out.print(" <");
System.out.print(exceptions[i].getPrefix());
@@ -228,7 +228,7 @@ public class AppValidator {
}
}
- public void displayResults(ValidationResults[] sets) {
+ public void displayResults(final ValidationResults[] sets) {
if (printXml) {
System.out.println("<results>");
for (int i = 0; i < sets.length; i++) {
@@ -251,18 +251,18 @@ public class AppValidator {
}
}
- public static void main(String[] args) throws SystemExitException {
- CommandLineParser parser = new PosixParser();
+ public static void main(final String[] args) throws SystemExitException {
+ final CommandLineParser parser = new PosixParser();
// create the Options
- Options options = new Options();
+ final Options options = new Options();
options.addOption(AppValidator.option("v", "version", "cmd.validate.opt.version"));
options.addOption(AppValidator.option("h", "help", "cmd.validate.opt.help"));
CommandLine line = null;
try {
line = parser.parse(options, args);
- } catch (ParseException exp) {
+ } catch (final ParseException exp) {
AppValidator.help(options);
throw new SystemExitException(-1);
}
@@ -280,31 +280,31 @@ public class AppValidator {
AppValidator.help(options);
}
- DeploymentLoader deploymentLoader = new DeploymentLoader();
+ final DeploymentLoader deploymentLoader = new DeploymentLoader();
try {
- AppValidator validator = new AppValidator();
- for (Object obj : line.getArgList()) {
- String module = (String) obj;
- File file = new File(module);
- AppModule appModule = deploymentLoader.load(file);
+ final AppValidator validator = new AppValidator();
+ for (final Object obj : line.getArgList()) {
+ final String module = (String) obj;
+ final File file = new File(module);
+ final AppModule appModule = deploymentLoader.load(file);
validator.validate(appModule);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
}
- private static void help(Options options) {
- HelpFormatter formatter = new HelpFormatter();
+ private static void help(final Options options) {
+ final HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("validate [options] <file> [<file>...]", "\n" + AppValidator.i18n("cmd.validate.description"), options, "\n");
}
- private static Option option(String shortOpt, String longOpt, String description) {
+ private static Option option(final String shortOpt, final String longOpt, final String description) {
return OptionBuilder.withLongOpt(longOpt).withDescription(AppValidator.i18n(description)).create(shortOpt);
}
- private static String i18n(String key) {
+ private static String i18n(final String key) {
return AppValidator._messages.format(key);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplicationProperties.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplicationProperties.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplicationProperties.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplicationProperties.java Wed Feb 19 15:47:58 2014
@@ -37,7 +37,7 @@ public class ApplicationProperties imple
private static final Logger log = Logger.getInstance(LogCategory.OPENEJB_STARTUP_CONFIG, ApplicationProperties.class);
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
readPropertiesFiles(appModule);
@@ -46,13 +46,13 @@ public class ApplicationProperties imple
return appModule;
}
- private void readPropertiesFiles(AppModule appModule) throws OpenEJBException {
+ private void readPropertiesFiles(final AppModule appModule) throws OpenEJBException {
final Collection<DeploymentModule> deploymentModule = appModule.getDeploymentModule();
// We intentionally add the AppModule itself LAST so its properties trump all
deploymentModule.add(appModule);
- for (DeploymentModule module : deploymentModule) {
+ for (final DeploymentModule module : deploymentModule) {
final Object o = module.getAltDDs().get("application.properties");
@@ -61,7 +61,7 @@ public class ApplicationProperties imple
try {
final Properties properties = IO.readProperties(url);
appModule.getProperties().putAll(properties);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new OpenEJBException("Cannot read application.properties: " + url, e);
}
} else if (o instanceof Properties) {
@@ -74,12 +74,12 @@ public class ApplicationProperties imple
}
- private void applyOverrides(AppModule appModule) {
+ private void applyOverrides(final AppModule appModule) {
final String id = appModule.getModuleId() + ".";
final Properties properties = SystemInstance.get().getProperties();
- for (Map.Entry<Object, Object> entry : properties.entrySet()) {
+ for (final Map.Entry<Object, Object> entry : properties.entrySet()) {
final String key = entry.getKey().toString();
if (key.startsWith(id)) {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplyOpenejbJar.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplyOpenejbJar.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplyOpenejbJar.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ApplyOpenejbJar.java Wed Feb 19 15:47:58 2014
@@ -34,51 +34,51 @@ import java.util.Map;
*/
public class ApplyOpenejbJar implements DynamicDeployer {
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
- Map<String, EjbDeployment> ejbDeployments = ejbModule.getOpenejbJar().getDeploymentsByEjbName();
+ final Map<String, EjbDeployment> ejbDeployments = ejbModule.getOpenejbJar().getDeploymentsByEjbName();
- for (EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
// Get the OpenEJB deployment from openejb-jar.xml
- EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
+ final EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
enterpriseBean.setId(ejbDeployment.getDeploymentId());
// Copy all links over to mappedName
- for (ResourceRef ref : enterpriseBean.getResourceRef()) {
- ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
+ for (final ResourceRef ref : enterpriseBean.getResourceRef()) {
+ final ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
if (resourceLink != null && resourceLink.getResId() != null /* don't overwrite with null */) {
ref.setMappedName(resourceLink.getResId());
}
}
- for (ResourceEnvRef ref : enterpriseBean.getResourceEnvRef()) {
- ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
+ for (final ResourceEnvRef ref : enterpriseBean.getResourceEnvRef()) {
+ final ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
if (resourceLink != null && resourceLink.getResId() != null /* don't overwrite with null */) {
ref.setMappedName(resourceLink.getResId());
}
}
- for (MessageDestinationRef ref : enterpriseBean.getMessageDestinationRef()) {
- ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
+ for (final MessageDestinationRef ref : enterpriseBean.getMessageDestinationRef()) {
+ final ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
if (resourceLink != null && resourceLink.getResId() != null /* don't overwrite with null */) {
ref.setMappedName(resourceLink.getResId());
}
}
- for (EjbRef ref : enterpriseBean.getEjbRef()) {
- EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName());
+ for (final EjbRef ref : enterpriseBean.getEjbRef()) {
+ final EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName());
if (ejbLink != null && ejbLink.getDeployentId() != null /* don't overwrite with null */) {
ref.setMappedName(ejbLink.getDeployentId());
}
}
- for (EjbLocalRef ref : enterpriseBean.getEjbLocalRef()) {
- EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName());
+ for (final EjbLocalRef ref : enterpriseBean.getEjbLocalRef()) {
+ final EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName());
if (ejbLink != null && ejbLink.getDeployentId() != null /* don't overwrite with null */) {
ref.setMappedName(ejbLink.getDeployentId());
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java Wed Feb 19 15:47:58 2014
@@ -338,7 +338,7 @@ public class AutoConfig implements Dynam
URI unitURI = URLs.uri(persistenceUnit.getId());
unitURI = URISupport.relativize(moduleURI, unitURI);
possibleUnits.add(unitURI.toString());
- } catch (Exception e) {
+ } catch (final Exception e) {
// id is typically not a valid URI
possibleUnits.add(persistenceUnit.getId());
}
@@ -739,7 +739,7 @@ public class AutoConfig implements Dynam
String destinationId = mappedName.length() == 0 ? ref.getName() : mappedName;
try {
destinationId = getResourceId(moduleId, destinationId, refType, appResources);
- } catch (OpenEJBException ex) {
+ } catch (final OpenEJBException ex) {
if (!(ref instanceof ContextRef)) {
throw ex;
} else { // let jaxrs provider manage it
@@ -800,7 +800,7 @@ public class AutoConfig implements Dynam
try {
final Class<?> type = loader.loadClass(typeName);
return type.isAnnotationPresent(ManagedBean.class);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// ignore
}
}
@@ -864,7 +864,7 @@ public class AutoConfig implements Dynam
try {
final String destinationId = getResourceEnvId(bean.getEjbName(), resourceLink.getResId(), mdb.getMessageDestinationType(), appResources);
resourceLink.setResId(destinationId);
- } catch (OpenEJBException e) {
+ } catch (final OpenEJBException e) {
// The MDB doesn't need the auto configured "openejb/destination" env entry
ejbDeployment.removeResourceLink("openejb/destination");
}
@@ -1005,7 +1005,7 @@ public class AutoConfig implements Dynam
try {
classLoader.loadClass(type);
return true;
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
return false;
}
}
@@ -1072,10 +1072,10 @@ public class AutoConfig implements Dynam
private static int getInt(final Object number) {
try {
return (Integer) number;
- } catch (Exception e) {
+ } catch (final Exception e) {
try {
return Integer.parseInt(number + "");
- } catch (NumberFormatException e1) {
+ } catch (final NumberFormatException e1) {
return -1;
}
}
@@ -1135,7 +1135,7 @@ public class AutoConfig implements Dynam
if (clazz.isAnnotationPresent(ManagedBean.class)) {
return;
}
- } catch (Throwable t) {
+ } catch (final Throwable t) {
// no-op
}
@@ -1161,7 +1161,7 @@ public class AutoConfig implements Dynam
} else {
id = getResourceId(ejbDeployment.getDeploymentId(), id, refType, appResources);
}
- } catch (OpenEJBException e) { // changing the message to be explicit
+ } catch (final OpenEJBException e) { // changing the message to be explicit
throw new OpenEJBException("Can't find resource for " + ref.getOrigin() + ". (" + e.getMessage() + ")", e.getCause());
}
logger.info("Auto-linking resource-ref '" + refName + "' in bean " + ejbDeployment.getDeploymentId() + " to Resource(id=" + id + ")");
@@ -1175,7 +1175,7 @@ public class AutoConfig implements Dynam
link.setResId(id);
link.setResRefName(refName);
}
- } catch (OpenEJBException ex) {
+ } catch (final OpenEJBException ex) {
if (!(ref instanceof ContextRef)) {
throw ex;
}
@@ -1237,9 +1237,9 @@ public class AutoConfig implements Dynam
final Class target = classLoader.loadClass(injection.getInjectionTargetClass().trim());
final Class type = IntrospectionSupport.getPropertyType(target, injection.getInjectionTargetName().trim());
return type.getName();
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// ignore
- } catch (NoSuchFieldException e) {
+ } catch (final NoSuchFieldException e) {
// ignore
}
}
@@ -1732,7 +1732,7 @@ public class AutoConfig implements Dynam
+ " DataSource to avoid too much network bandwidth usage."
+ " If you want to keep it please define the DataSource explicitely.");
}
- } catch (NumberFormatException nfe) {
+ } catch (final NumberFormatException nfe) {
// no-op
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AutoDeployer.java Wed Feb 19 15:47:58 2014
@@ -94,7 +94,7 @@ public class AutoDeployer {
assembler.createApplication(appInfo);
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.error("Failed Auto-Deployment of: " + appPath, e);
}
@@ -134,7 +134,7 @@ public class AutoDeployer {
for (int i = 0; i < 3; i++) {
try {
Files.remove(delete);
- } catch (Exception e) {
+ } catch (final Exception e) {
if (i < 2) {
//Try again as file IO is not a science
Thread.sleep(100);
@@ -149,7 +149,7 @@ public class AutoDeployer {
logger.info("Completed Auto-Undeployment of: " + app.appId);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
logger.error("Auto-Undeploy Failed: " + file.getAbsolutePath(), e);
}
break;
@@ -184,7 +184,7 @@ public class AutoDeployer {
try {
//Will block if scanning
SEMAPHORE.acquire();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
//Ignore
} finally {
SEMAPHORE.release();
@@ -196,7 +196,7 @@ public class AutoDeployer {
try {
SEMAPHORE.acquire();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
logger.warning("AutoDeployer.start failed to obtain lock");
return;
}
@@ -211,7 +211,7 @@ public class AutoDeployer {
public void run() {
try {
scan();
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.error("Scan failed.", e);
}
}
@@ -250,7 +250,7 @@ public class AutoDeployer {
try {
SEMAPHORE.acquire();
- } catch (InterruptedException e) {
+ } catch (final InterruptedException e) {
logger.warning("AutoDeployer.scan failed to obtain lock");
return;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BeanProperties.java Wed Feb 19 15:47:58 2014
@@ -40,13 +40,13 @@ public class BeanProperties implements D
private final Properties globalProperties = new Properties();
@Override
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
final Properties base = new Properties();
base.putAll(SystemInstance.get().getProperties());
base.putAll(appModule.getProperties());
- for (EjbModule module : appModule.getEjbModules()) {
+ for (final EjbModule module : appModule.getEjbModules()) {
final Properties overrides = new SuperProperties().caseInsensitive(true);
overrides.putAll(base);
overrides.putAll(module.getProperties());
@@ -58,14 +58,14 @@ public class BeanProperties implements D
final OpenejbJar openejbJar = module.getOpenejbJar();
final Map<String, EjbDeployment> deploymentMap = openejbJar.getDeploymentsByEjbName();
- for (EnterpriseBean bean : module.getEjbJar().getEnterpriseBeans()) {
+ for (final EnterpriseBean bean : module.getEjbJar().getEnterpriseBeans()) {
final SuperProperties properties = new SuperProperties().caseInsensitive(true);
properties.putAll(globalProperties);
final String additionalKey = bean.getEjbName();
if (additionalProperties.containsKey(additionalKey)) {
- for (Map.Entry<Object, Object> entry : additionalProperties.get(additionalKey).entrySet()) {
+ for (final Map.Entry<Object, Object> entry : additionalProperties.get(additionalKey).entrySet()) {
properties.put(entry.getKey().toString(), entry.getValue().toString());
}
}
@@ -78,7 +78,7 @@ public class BeanProperties implements D
final String id = bean.getEjbName() + ".";
- for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
+ for (final Map.Entry<Object, Object> entry : overrides.entrySet()) {
final String key = entry.getKey().toString();
if (key.startsWith(id)) {
@@ -128,7 +128,7 @@ public class BeanProperties implements D
if (prefix == null || prefix.isEmpty()) {
addGlobalProperties(properties);
} else {
- for (Map.Entry<Object, Object> entry : properties.entrySet()) {
+ for (final Map.Entry<Object, Object> entry : properties.entrySet()) {
globalProperties.put(prefix + "." + entry.getKey(), entry.getValue());
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BuiltInEnvironmentEntries.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BuiltInEnvironmentEntries.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BuiltInEnvironmentEntries.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/BuiltInEnvironmentEntries.java Wed Feb 19 15:47:58 2014
@@ -33,27 +33,27 @@ import java.util.Map;
public class BuiltInEnvironmentEntries implements DynamicDeployer {
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
- for (ClientModule module : appModule.getClientModules()) {
+ for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
if (consumer == null) continue;
add(consumer, module, appModule);
}
- for (WebModule module : appModule.getWebModules()) {
+ for (final WebModule module : appModule.getWebModules()) {
final JndiConsumer consumer = module.getWebApp();
if (consumer == null) continue;
add(consumer, module, appModule);
}
- for (EjbModule module : appModule.getEjbModules()) {
+ for (final EjbModule module : appModule.getEjbModules()) {
final EjbJar ejbJar = module.getEjbJar();
if (ejbJar == null) continue;
- for (EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
add(consumer, module, appModule);
}
}
@@ -61,7 +61,7 @@ public class BuiltInEnvironmentEntries i
return appModule;
}
- private void add(JndiConsumer jndi, DeploymentModule module, DeploymentModule app) {
+ private void add(final JndiConsumer jndi, final DeploymentModule module, final DeploymentModule app) {
// Standard names
add(jndi.getEnvEntryMap(), new EnvEntry().name("java:module/ModuleName").value(module.getModuleId()).type(String.class));
@@ -80,7 +80,7 @@ public class BuiltInEnvironmentEntries i
}
- private <E extends JndiReference> void add(Map<String, E> map, E entry) {
+ private <E extends JndiReference> void add(final Map<String, E> map, final E entry) {
final E existing = map.get(entry.getKey());
map.put(entry.getKey(), entry);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Cipher.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Cipher.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Cipher.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/Cipher.java Wed Feb 19 15:47:58 2014
@@ -43,22 +43,22 @@ public class Cipher {
private static Messages messages = new Messages(Cipher.class);
- public static void main(String[] args) throws SystemExitException {
+ public static void main(final String[] args) throws SystemExitException {
- CommandLineParser parser = new PosixParser();
+ final CommandLineParser parser = new PosixParser();
// create the Options
- Options options = new Options();
+ final Options options = new Options();
options.addOption(option("h", "help", "cmd.cipher.opt.help"));
options.addOption(option("c", "cipher", "c", "cmd.cipher.opt.impl"));
options.addOption(option("d", "decrypt", "cmd.cipher.opt.decrypt"));
options.addOption(option("e", "encrypt", "cmd.cipher.opt.encrypt"));
- CommandLine line;
+ final CommandLine line;
try {
// parse the command line arguments
line = parser.parse(options, args);
- } catch (ParseException exp) {
+ } catch (final ParseException exp) {
help(options);
throw new SystemExitException(-1);
}
@@ -80,20 +80,20 @@ public class Cipher {
}
try {
- PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(cipherName);
+ final PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(cipherName);
if (line.hasOption("decrypt")) {
- String pwdArg = (String) line.getArgList().get(0);
- char[] encryptdPassword = pwdArg.toCharArray();
+ final String pwdArg = (String) line.getArgList().get(0);
+ final char[] encryptdPassword = pwdArg.toCharArray();
System.out.println(cipher.decrypt(encryptdPassword));
} else { // if option neither encrypt/decrypt is specified, we assume
// it is encrypt.
- String plainPassword = (String) line.getArgList().get(0);
+ final String plainPassword = (String) line.getArgList().get(0);
System.out.println(new String(cipher.encrypt(plainPassword)));
}
- } catch (SQLException e) {
+ } catch (final SQLException e) {
System.out.println("Could not load password cipher implementation class. Check your classpath.");
availableCiphers();
@@ -105,30 +105,30 @@ public class Cipher {
private static void availableCiphers() {
try {
- ResourceFinder finder = new ResourceFinder("META-INF/");
- Map<String, Class<? extends PasswordCipher>> impls = finder.mapAllImplementations(PasswordCipher.class);
+ final ResourceFinder finder = new ResourceFinder("META-INF/");
+ final Map<String, Class<? extends PasswordCipher>> impls = finder.mapAllImplementations(PasswordCipher.class);
System.out.println("Available ciphers are: "+ Join.join(", ", impls.keySet()));
- } catch (Exception dontCare) {
+ } catch (final Exception dontCare) {
// no-op
}
}
- private static void help(Options options) {
- HelpFormatter formatter = new HelpFormatter();
+ private static void help(final Options options) {
+ final HelpFormatter formatter = new HelpFormatter();
formatter.printHelp("cipher [options] <value>", "\n" + i18n("cmd.cipher.description"), options, "\n");
System.out.println("");
availableCiphers();
}
- private static Option option(String shortOpt, String longOpt, String description) {
+ private static Option option(final String shortOpt, final String longOpt, final String description) {
return OptionBuilder.withLongOpt(longOpt).withDescription(i18n(description)).create(shortOpt);
}
- private static Option option(String shortOpt, String longOpt, String argName, String description) {
+ private static Option option(final String shortOpt, final String longOpt, final String argName, final String description) {
return OptionBuilder.withLongOpt(longOpt).withArgName(argName).hasArg().withDescription(i18n(description)).create(shortOpt);
}
- private static String i18n(String key) {
+ private static String i18n(final String key) {
return messages.format(key);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CleanEnvEntries.java Wed Feb 19 15:47:58 2014
@@ -124,7 +124,7 @@ public class CleanEnvEntries implements
final EjbJar ejbJar = module.getEjbJar();
if (ejbJar == null) continue;
- for (EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
fillInMissingType(consumer, module);
}
}
@@ -211,14 +211,14 @@ public class CleanEnvEntries implements
}
- private Class<?> getType(ClassLoader loader, InjectionTarget target) {
+ private Class<?> getType(final ClassLoader loader, final InjectionTarget target) {
try {
final Class<?> clazz = loader.loadClass(target.getInjectionTargetClass());
try {
final Field field = clazz.getDeclaredField(target.getInjectionTargetName());
return field.getType();
- } catch (NoSuchFieldException e) {
+ } catch (final NoSuchFieldException e) {
// no-op
}
@@ -226,7 +226,7 @@ public class CleanEnvEntries implements
final String bestName = "set" + StringUtils.capitalize(target.getInjectionTargetName());
final String name = "set" + target.getInjectionTargetName().toLowerCase();
Class<?> found = null;
- for (Method method : clazz.getDeclaredMethods()) {
+ for (final Method method : clazz.getDeclaredMethods()) {
if (method.getParameterTypes().length == 1) {
if (method.getName().equals(bestName)) {
return method.getParameterTypes()[0];
@@ -240,7 +240,7 @@ public class CleanEnvEntries implements
return found;
}
- } catch (Throwable e) {
+ } catch (final Throwable e) {
// no-op
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClearEmptyMappedName.java Wed Feb 19 15:47:58 2014
@@ -28,25 +28,25 @@ import java.util.List;
*/
public class ClearEmptyMappedName implements DynamicDeployer {
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
- for (JndiConsumer consumer : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final JndiConsumer consumer : ejbModule.getEjbJar().getEnterpriseBeans()) {
clearEmptyMappedName(consumer);
}
}
- for (ClientModule clientModule : appModule.getClientModules()) {
+ for (final ClientModule clientModule : appModule.getClientModules()) {
clearEmptyMappedName(clientModule.getApplicationClient());
}
- for (WebModule webModule : appModule.getWebModules()) {
+ for (final WebModule webModule : appModule.getWebModules()) {
clearEmptyMappedName(webModule.getWebApp());
}
return appModule;
}
- private void clearEmptyMappedName(JndiConsumer consumer) {
+ private void clearEmptyMappedName(final JndiConsumer consumer) {
if (consumer == null) return;
- List<JndiReference> refs = new ArrayList<JndiReference>();
+ final List<JndiReference> refs = new ArrayList<JndiReference>();
refs.addAll(consumer.getEjbLocalRef());
refs.addAll(consumer.getEjbRef());
refs.addAll(consumer.getEnvEntry());
@@ -57,7 +57,7 @@ public class ClearEmptyMappedName implem
refs.addAll(consumer.getResourceRef());
refs.addAll(consumer.getServiceRef());
- for (JndiReference ref : refs) {
+ for (final JndiReference ref : refs) {
if (ref.getMappedName() != null && ref.getMappedName().length() == 0) ref.setMappedName(null);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ClientModule.java Wed Feb 19 15:47:58 2014
@@ -40,12 +40,12 @@ public class ClientModule extends Module
private ID id;
private final Set<String> watchedResources = new TreeSet<String>();
- public ClientModule(ApplicationClient applicationClient, ClassLoader classLoader, String jarLocation, String mainClass, String moduleId) {
+ public ClientModule(final ApplicationClient applicationClient, final ClassLoader classLoader, final String jarLocation, final String mainClass, final String moduleId) {
this.applicationClient = applicationClient;
setClassLoader(classLoader);
this.mainClass = mainClass;
- File file = jarLocation == null ? null : new File(jarLocation);
+ final File file = jarLocation == null ? null : new File(jarLocation);
this.id = new ID(null, applicationClient, moduleId, file, null, this);
this.validation = new ValidationContext(this);
}
@@ -54,7 +54,7 @@ public class ClientModule extends Module
return ejbModuleGenerated;
}
- public void setEjbModuleGenerated(boolean ejbModuleGenerated) {
+ public void setEjbModuleGenerated(final boolean ejbModuleGenerated) {
this.ejbModuleGenerated = ejbModuleGenerated;
}
@@ -62,7 +62,7 @@ public class ClientModule extends Module
return finder != null ? finder.get(): null;
}
- public void setFinderReference(AtomicReference<IAnnotationFinder> finder) {
+ public void setFinderReference(final AtomicReference<IAnnotationFinder> finder) {
this.finder = finder;
}
@@ -78,7 +78,7 @@ public class ClientModule extends Module
return id.getLocation() != null ? id.getLocation().getAbsolutePath() : null;
}
- public void setJarLocation(String jarLocation) {
+ public void setJarLocation(final String jarLocation) {
this.id = new ID(null, applicationClient, id.getName(), new File(jarLocation), id.getUri(), this);
}
@@ -98,7 +98,7 @@ public class ClientModule extends Module
return applicationClient;
}
- public void setApplicationClient(ApplicationClient applicationClient) {
+ public void setApplicationClient(final ApplicationClient applicationClient) {
this.applicationClient = applicationClient;
}
@@ -114,7 +114,7 @@ public class ClientModule extends Module
return mainClass;
}
- public void setMainClass(String mainClass) {
+ public void setMainClass(final String mainClass) {
this.mainClass = mainClass;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java Wed Feb 19 15:47:58 2014
@@ -97,7 +97,7 @@ public class CmpJpaConversion implements
"serialVersionUID"
)));
- public AppModule deploy(AppModule appModule) throws OpenEJBException {
+ public AppModule deploy(final AppModule appModule) throws OpenEJBException {
if (!hasCmpEntities(appModule)) return appModule;
@@ -113,11 +113,11 @@ public class CmpJpaConversion implements
// we process this one jar-file at a time...each contributing to the
// app mapping data
- for (EjbModule ejbModule : appModule.getEjbModules()) {
- EjbJar ejbJar = ejbModule.getEjbJar();
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
+ final EjbJar ejbJar = ejbModule.getEjbJar();
// scan for CMP entity beans and merge the data into the collective set
- for (EnterpriseBean enterpriseBean : ejbJar.getEnterpriseBeans()) {
+ for (final EnterpriseBean enterpriseBean : ejbJar.getEnterpriseBeans()) {
if (isCmpEntity(enterpriseBean)) {
processEntityBean(ejbModule, cmpMappings, (EntityBean) enterpriseBean);
}
@@ -125,44 +125,44 @@ public class CmpJpaConversion implements
// if there are relationships defined in this jar, get a list of the defined
// entities and process the relationship maps.
- Relationships relationships = ejbJar.getRelationships();
+ final Relationships relationships = ejbJar.getRelationships();
if (relationships != null) {
- Map<String, Entity> entitiesByEjbName = new TreeMap<String,Entity>();
- for (Entity entity : cmpMappings.getEntity()) {
+ final Map<String, Entity> entitiesByEjbName = new TreeMap<String,Entity>();
+ for (final Entity entity : cmpMappings.getEntity()) {
entitiesByEjbName.put(entity.getEjbName(), entity);
}
- for (EjbRelation relation : relationships.getEjbRelation()) {
+ for (final EjbRelation relation : relationships.getEjbRelation()) {
processRelationship(entitiesByEjbName, relation);
}
}
// Let's warn the user about any declarations we didn't end up using
// so there can be no misunderstandings.
- EntityMappings userMappings = getUserEntityMappings(ejbModule);
- for (Entity mapping : userMappings.getEntity()) {
+ final EntityMappings userMappings = getUserEntityMappings(ejbModule);
+ for (final Entity mapping : userMappings.getEntity()) {
logger.warning("openejb-cmp-orm.xml mapping ignored: module="+ejbModule.getModuleId()+": <entity class=\""+mapping.getClazz()+"\">");
}
- for (MappedSuperclass mapping : userMappings.getMappedSuperclass()) {
+ for (final MappedSuperclass mapping : userMappings.getMappedSuperclass()) {
logger.warning("openejb-cmp-orm.xml mapping ignored: module="+ejbModule.getModuleId()+": <mapped-superclass class=\""+mapping.getClazz()+"\">");
}
}
if (!cmpMappings.getEntity().isEmpty()) {
- PersistenceUnit persistenceUnit = getCmpPersistenceUnit(appModule);
+ final PersistenceUnit persistenceUnit = getCmpPersistenceUnit(appModule);
persistenceUnit.getMappingFile().add("META-INF/openejb-cmp-generated-orm.xml");
- for (Entity entity : cmpMappings.getEntity()) {
+ for (final Entity entity : cmpMappings.getEntity()) {
persistenceUnit.getClazz().add(entity.getClazz());
}
}
// TODO: This should not be necessary, but having an empty <attributes/> tag
// causes some of the unit tests to fail. Not sure why. Should be fixed.
- for (Entity entity : appModule.getCmpMappings().getEntity()) {
+ for (final Entity entity : appModule.getCmpMappings().getEntity()) {
if (entity.getAttributes() != null && entity.getAttributes().isEmpty()){
entity.setAttributes(null);
}
@@ -170,12 +170,12 @@ public class CmpJpaConversion implements
return appModule;
}
- private PersistenceUnit getCmpPersistenceUnit(AppModule appModule) {
+ private PersistenceUnit getCmpPersistenceUnit(final AppModule appModule) {
// search for the cmp persistence unit
PersistenceUnit persistenceUnit = null;
- for (PersistenceModule persistenceModule : appModule.getPersistenceModules()) {
- Persistence persistence = persistenceModule.getPersistence();
- for (PersistenceUnit unit : persistence.getPersistenceUnit()) {
+ for (final PersistenceModule persistenceModule : appModule.getPersistenceModules()) {
+ final Persistence persistence = persistenceModule.getPersistence();
+ for (final PersistenceUnit unit : persistence.getPersistenceUnit()) {
if (CMP_PERSISTENCE_UNIT_NAME.equals(unit.getName())) {
persistenceUnit = unit;
break;
@@ -192,25 +192,25 @@ public class CmpJpaConversion implements
// persistenceUnit.setJtaDataSource("java:openejb/Resource/Default JDBC Database");
// persistenceUnit.setNonJtaDataSource("java:openejb/Resource/Default Unmanaged JDBC Database");
// todo paramterize this
- Properties properties = new Properties();
+ final Properties properties = new Properties();
properties.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true, Indexes=false, IgnoreErrors=true)");
// properties.setProperty("openjpa.DataCache", "false");
properties.setProperty("openjpa.Log", "DefaultLevel=INFO");
persistenceUnit.setProperties(properties);
- Persistence persistence = new Persistence();
+ final Persistence persistence = new Persistence();
persistence.setVersion("1.0");
persistence.getPersistenceUnit().add(persistenceUnit);
- PersistenceModule persistenceModule = new PersistenceModule(appModule, getPersistenceModuleId(appModule), persistence);
+ final PersistenceModule persistenceModule = new PersistenceModule(appModule, getPersistenceModuleId(appModule), persistence);
appModule.addPersistenceModule(persistenceModule);
}
return persistenceUnit;
}
- private String getPersistenceModuleId(AppModule appModule) {
+ private String getPersistenceModuleId(final AppModule appModule) {
if (appModule.getModuleId() != null) return appModule.getModuleId();
- for (EjbModule ejbModule: appModule.getEjbModules()) {
+ for (final EjbModule ejbModule: appModule.getEjbModules()) {
return ejbModule.getModuleId();
}
throw new IllegalStateException("Comp must be in an ejb module, this one has none: " + appModule);
@@ -225,9 +225,9 @@ public class CmpJpaConversion implements
* @return true if the module contains any entity beans
* using container managed persistence.
*/
- private boolean hasCmpEntities(AppModule appModule) {
- for (EjbModule ejbModule : appModule.getEjbModules()) {
- for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
+ private boolean hasCmpEntities(final AppModule appModule) {
+ for (final EjbModule ejbModule : appModule.getEjbModules()) {
+ for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
if (isCmpEntity(bean)) return true;
}
}
@@ -242,28 +242,28 @@ public class CmpJpaConversion implements
*
* @return True if all of the conditions for a CMP bean are met.
*/
- private static boolean isCmpEntity(EnterpriseBean bean) {
+ private static boolean isCmpEntity(final EnterpriseBean bean) {
return bean instanceof EntityBean && ((EntityBean) bean).getPersistenceType() == PersistenceType.CONTAINER;
}
- private void processRelationship(Map<String, Entity> entitiesByEjbName, EjbRelation relation) throws OpenEJBException {
- List<EjbRelationshipRole> roles = relation.getEjbRelationshipRole();
+ private void processRelationship(final Map<String, Entity> entitiesByEjbName, final EjbRelation relation) throws OpenEJBException {
+ final List<EjbRelationshipRole> roles = relation.getEjbRelationshipRole();
// if we don't have two roles, the relation is bad so we skip it
if (roles.size() != 2) {
return;
}
// get left entity
- EjbRelationshipRole leftRole = roles.get(0);
- RelationshipRoleSource leftRoleSource = leftRole.getRelationshipRoleSource();
- String leftEjbName = leftRoleSource == null ? null : leftRoleSource.getEjbName();
- Entity leftEntity = entitiesByEjbName.get(leftEjbName);
+ final EjbRelationshipRole leftRole = roles.get(0);
+ final RelationshipRoleSource leftRoleSource = leftRole.getRelationshipRoleSource();
+ final String leftEjbName = leftRoleSource == null ? null : leftRoleSource.getEjbName();
+ final Entity leftEntity = entitiesByEjbName.get(leftEjbName);
// get right entity
- EjbRelationshipRole rightRole = roles.get(1);
- RelationshipRoleSource rightRoleSource = rightRole.getRelationshipRoleSource();
- String rightEjbName = rightRoleSource == null ? null : rightRoleSource.getEjbName();
- Entity rightEntity = entitiesByEjbName.get(rightEjbName);
+ final EjbRelationshipRole rightRole = roles.get(1);
+ final RelationshipRoleSource rightRoleSource = rightRole.getRelationshipRoleSource();
+ final String rightEjbName = rightRoleSource == null ? null : rightRoleSource.getEjbName();
+ final Entity rightEntity = entitiesByEjbName.get(rightEjbName);
// neither left or right have a mapping which is fine
if (leftEntity == null && rightEntity == null) {
@@ -281,9 +281,9 @@ public class CmpJpaConversion implements
}
final Attributes rightAttributes = rightEntity.getAttributes();
- Map<String, RelationField> rightRelationships = rightAttributes.getRelationshipFieldMap();
+ final Map<String, RelationField> rightRelationships = rightAttributes.getRelationshipFieldMap();
final Attributes leftAttributes = leftEntity.getAttributes();
- Map<String, RelationField> leftRelationships = leftAttributes.getRelationshipFieldMap();
+ final Map<String, RelationField> leftRelationships = leftAttributes.getRelationshipFieldMap();
String leftFieldName = null;
boolean leftSynthetic = false;
@@ -293,7 +293,7 @@ public class CmpJpaConversion implements
leftFieldName = rightEntity.getName() + "_" + rightRole.getCmrField().getCmrFieldName();
leftSynthetic = true;
}
- boolean leftIsOne = leftRole.getMultiplicity() == Multiplicity.ONE;
+ final boolean leftIsOne = leftRole.getMultiplicity() == Multiplicity.ONE;
String rightFieldName = null;
boolean rightSynthetic = false;
@@ -303,7 +303,7 @@ public class CmpJpaConversion implements
rightFieldName = leftEntity.getName() + "_" + leftRole.getCmrField().getCmrFieldName();
rightSynthetic = true;
}
- boolean rightIsOne = rightRole.getMultiplicity() == Multiplicity.ONE;
+ final boolean rightIsOne = rightRole.getMultiplicity() == Multiplicity.ONE;
if (leftIsOne && rightIsOne) {
//
@@ -408,12 +408,12 @@ public class CmpJpaConversion implements
}
}
- private <R extends RelationField> R addRelationship(R relationship, Map<String, RelationField> existing, List<R> relationships) {
+ private <R extends RelationField> R addRelationship(final R relationship, final Map<String, RelationField> existing, final List<R> relationships) {
R r = null;
try {
r = (R) existing.get(relationship.getKey());
- } catch (ClassCastException e) {
+ } catch (final ClassCastException e) {
return relationship;
}
@@ -434,7 +434,7 @@ public class CmpJpaConversion implements
* The accumulated set of entity mappings.
* @param bean The been we're generating the mapping for.
*/
- private void processEntityBean(EjbModule ejbModule, EntityMappings entityMappings, EntityBean bean) {
+ private void processEntityBean(final EjbModule ejbModule, final EntityMappings entityMappings, final EntityBean bean) {
// try to add a new persistence-context-ref for cmp
if (!addPersistenceContextRef(bean)) {
// Bean already has a persistence-context-ref for cmp
@@ -443,10 +443,10 @@ public class CmpJpaConversion implements
}
// get the real bean class
- Class ejbClass = loadClass(ejbModule.getClassLoader(), bean.getEjbClass());
+ final Class ejbClass = loadClass(ejbModule.getClassLoader(), bean.getEjbClass());
// and generate a name for the subclass that will be generated and handed to the JPA
// engine as the managed class.
- String jpaEntityClassName = CmpUtil.getCmpImplClassName(bean.getAbstractSchemaName(), ejbClass.getName());
+ final String jpaEntityClassName = CmpUtil.getCmpImplClassName(bean.getAbstractSchemaName(), ejbClass.getName());
// We don't use this mapping directly, instead we pull entries from it
// the reason being is that we intend to support mappings that aren't
@@ -455,13 +455,13 @@ public class CmpJpaConversion implements
// these user supplied mappings might need to be adjusted as the jpa orm.xml
// file is extremely subclass/supperclass aware and mappings specified in it
// need to be spot on.
- EntityMappings userMappings = getUserEntityMappings(ejbModule);
+ final EntityMappings userMappings = getUserEntityMappings(ejbModule);
// Look for any existing mapped superclass mappings. We check the entire inheritance
// chain of the bean looking for any that have user defined mappings.
for (Class clazz = ejbClass; clazz != null; clazz = clazz.getSuperclass()){
- MappedSuperclass mappedSuperclass = removeMappedSuperclass(userMappings, clazz.getName());
+ final MappedSuperclass mappedSuperclass = removeMappedSuperclass(userMappings, clazz.getName());
// We're going to assume that if they bothered to map a superclass
// that the mapping is correct. Copy it from their mappings to ours
@@ -525,14 +525,14 @@ public class CmpJpaConversion implements
// PRESERVE has queries: name: the name of the entity in queries
- String entityName = bean.getAbstractSchemaName();
+ final String entityName = bean.getAbstractSchemaName();
entity.setName(entityName);
entity.setEjbName(bean.getEjbName());
- ClassLoader classLoader = ejbModule.getClassLoader();
- Collection<MappedSuperclass> mappedSuperclasses;
+ final ClassLoader classLoader = ejbModule.getClassLoader();
+ final Collection<MappedSuperclass> mappedSuperclasses;
if (bean.getCmpVersion() == CmpVersion.CMP2) {
// perform the 2.x class mapping. This really just identifies the primary key and
// other cmp fields that will be generated for the concrete class and identify them
@@ -549,23 +549,23 @@ public class CmpJpaConversion implements
if (mappedSuperclasses != null) {
// now that things are mapped out, add the superclass mappings to the entity mappings
// that will get passed to the JPA engine.
- for (MappedSuperclass mappedSuperclass : mappedSuperclasses) {
+ for (final MappedSuperclass mappedSuperclass : mappedSuperclasses) {
entityMappings.getMappedSuperclass().add(mappedSuperclass);
}
}
// process queries
- for (Query query : bean.getQuery()) {
- NamedQuery namedQuery = new NamedQuery();
- QueryMethod queryMethod = query.getQueryMethod();
+ for (final Query query : bean.getQuery()) {
+ final NamedQuery namedQuery = new NamedQuery();
+ final QueryMethod queryMethod = query.getQueryMethod();
// todo deployment id could change in one of the later conversions... use entity name instead, but we need to save it off
- StringBuilder name = new StringBuilder();
+ final StringBuilder name = new StringBuilder();
name.append(entityName).append(".").append(queryMethod.getMethodName());
if (queryMethod.getMethodParams() != null && !queryMethod.getMethodParams().getMethodParam().isEmpty()) {
name.append('(');
boolean first = true;
- for (String methodParam : queryMethod.getMethodParams().getMethodParam()) {
+ for (final String methodParam : queryMethod.getMethodParams().getMethodParam()) {
if (!first) name.append(",");
name.append(methodParam);
first = false;
@@ -579,20 +579,20 @@ public class CmpJpaConversion implements
}
// todo: there should be a common interface between ejb query object and openejb query object
- OpenejbJar openejbJar = ejbModule.getOpenejbJar();
- EjbDeployment ejbDeployment = openejbJar.getDeploymentsByEjbName().get(bean.getEjbName());
+ final OpenejbJar openejbJar = ejbModule.getOpenejbJar();
+ final EjbDeployment ejbDeployment = openejbJar.getDeploymentsByEjbName().get(bean.getEjbName());
if (ejbDeployment != null) {
- for (org.apache.openejb.jee.oejb3.Query query : ejbDeployment.getQuery()) {
- NamedQuery namedQuery = new NamedQuery();
- org.apache.openejb.jee.oejb3.QueryMethod queryMethod = query.getQueryMethod();
+ for (final org.apache.openejb.jee.oejb3.Query query : ejbDeployment.getQuery()) {
+ final NamedQuery namedQuery = new NamedQuery();
+ final org.apache.openejb.jee.oejb3.QueryMethod queryMethod = query.getQueryMethod();
// todo deployment id could change in one of the later conversions... use entity name instead, but we need to save it off
- StringBuilder name = new StringBuilder();
+ final StringBuilder name = new StringBuilder();
name.append(entityName).append(".").append(queryMethod.getMethodName());
if (queryMethod.getMethodParams() != null && !queryMethod.getMethodParams().getMethodParam().isEmpty()) {
name.append('(');
boolean first = true;
- for (String methodParam : queryMethod.getMethodParams().getMethodParam()) {
+ for (final String methodParam : queryMethod.getMethodParams().getMethodParam()) {
if (!first) name.append(",");
name.append(methodParam);
first = false;
@@ -607,8 +607,8 @@ public class CmpJpaConversion implements
}
}
- private Entity removeEntity(EntityMappings userMappings, String className) {
- Entity entity;
+ private Entity removeEntity(final EntityMappings userMappings, final String className) {
+ final Entity entity;
entity = userMappings.getEntityMap().get(className);
if (entity != null){
@@ -630,8 +630,8 @@ public class CmpJpaConversion implements
* @return Returns the superclass mapping for the named class, or
* null if the class is not in the mapping set.
*/
- private MappedSuperclass removeMappedSuperclass(EntityMappings userMappings, String className) {
- MappedSuperclass mappedSuperclass;
+ private MappedSuperclass removeMappedSuperclass(final EntityMappings userMappings, final String className) {
+ final MappedSuperclass mappedSuperclass;
mappedSuperclass = userMappings.getMappedSuperclassMap().get(className);
if (mappedSuperclass != null){
@@ -640,8 +640,8 @@ public class CmpJpaConversion implements
return mappedSuperclass;
}
- private EntityMappings getUserEntityMappings(EjbModule ejbModule) {
- Object o = ejbModule.getAltDDs().get("openejb-cmp-orm.xml");
+ private EntityMappings getUserEntityMappings(final EjbModule ejbModule) {
+ final Object o = ejbModule.getAltDDs().get("openejb-cmp-orm.xml");
if (o instanceof EntityMappings) {
return (EntityMappings) o;
}
@@ -664,10 +664,10 @@ public class CmpJpaConversion implements
* The classloader for resolving class references and
* primary key classes.
*/
- private Collection<MappedSuperclass> mapClass2x(Mapping mapping, EntityBean bean, ClassLoader classLoader) {
- Set<String> allFields = new TreeSet<String>();
+ private Collection<MappedSuperclass> mapClass2x(final Mapping mapping, final EntityBean bean, final ClassLoader classLoader) {
+ final Set<String> allFields = new TreeSet<String>();
// get an acculated set of the CMP fields.
- for (CmpField cmpField : bean.getCmpField()) {
+ for (final CmpField cmpField : bean.getCmpField()) {
allFields.add(cmpField.getFieldName());
}
@@ -675,7 +675,7 @@ public class CmpJpaConversion implements
try {
beanClass = classLoader.loadClass(bean.getEjbClass());
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
// class was already loaded in validation phase, so this should succeed
// if it does fail, just return null from here
return null;
@@ -687,14 +687,14 @@ public class CmpJpaConversion implements
// we support some migration steps toward EJB3, so this can be defined completely
// or partially as a POJO with concrete fields and accessors. This allows us to
// locate and generate the mappings
- Map<String, MappedSuperclass> superclassByField = mapFields(beanClass, allFields);
+ final Map<String, MappedSuperclass> superclassByField = mapFields(beanClass, allFields);
// Add the cmp-field declarations for all the cmp fields that
// weren't explicitly declared in the ejb-jar.xml.
// we can identify these by looking for abstract methods that match
// the get<Name> or is<Name> pattern.
- for (Method method : beanClass.getMethods()) {
+ for (final Method method : beanClass.getMethods()) {
if (!Modifier.isAbstract(method.getModifiers())) continue;
if (method.getParameterTypes().length != 0) continue;
if (method.getReturnType().equals(Void.TYPE)) continue;
@@ -734,12 +734,12 @@ public class CmpJpaConversion implements
//
// id: the primary key
//
- Set<String> primaryKeyFields = new HashSet<String>();
+ final Set<String> primaryKeyFields = new HashSet<String>();
if (bean.getPrimkeyField() != null) {
- String fieldName = bean.getPrimkeyField();
- MappedSuperclass superclass = superclassByField.get(fieldName);
+ final String fieldName = bean.getPrimkeyField();
+ final MappedSuperclass superclass = superclassByField.get(fieldName);
// this need not be here...for CMP 2.x, these are generally autogenerated fields.
if (superclass != null) {
// ok, add this field to the superclass mapping
@@ -755,8 +755,8 @@ public class CmpJpaConversion implements
} else if ("java.lang.Object".equals(bean.getPrimKeyClass())) {
// the automatically generated keys use a special property name
// and will always be in the generated superclass.
- String fieldName = "OpenEJB_pk";
- Id field = new Id(fieldName);
+ final String fieldName = "OpenEJB_pk";
+ final Id field = new Id(fieldName);
field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO));
mapping.addField(field);
primaryKeyFields.add(fieldName);
@@ -767,12 +767,12 @@ public class CmpJpaConversion implements
MappedSuperclass idclass = null;
// now validate the primary class fields against the bean cmp fields
// to make sure everything maps correctly.
- for (Field pkField : pkClass.getFields()) {
- String pkFieldName = pkField.getName();
- int modifiers = pkField.getModifiers();
+ for (final Field pkField : pkClass.getFields()) {
+ final String pkFieldName = pkField.getName();
+ final int modifiers = pkField.getModifiers();
if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && allFields.contains(pkFieldName)) {
// see if the bean field is concretely defined in one of the superclasses
- MappedSuperclass superclass = superclassByField.get(pkFieldName);
+ final MappedSuperclass superclass = superclassByField.get(pkFieldName);
if (superclass != null) {
// ok, we have an override that needs to be specified at the main class level.
superclass.addField(new Id(pkFieldName));
@@ -794,7 +794,7 @@ public class CmpJpaConversion implements
// do this for the toplevel mapping
mapping.setIdClass(new IdClass(bean.getPrimKeyClass()));
}
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw (IllegalStateException)new IllegalStateException("Could not find entity primary key class " + bean.getPrimKeyClass()).initCause(e);
}
}
@@ -803,12 +803,12 @@ public class CmpJpaConversion implements
// basic: cmp-fields
// This again, adds all of the additional cmp-fields to the mapping
//
- for (CmpField cmpField : bean.getCmpField()) {
+ for (final CmpField cmpField : bean.getCmpField()) {
// only add entries for cmp fields that are not part of the primary key
if (!primaryKeyFields.contains(cmpField.getFieldName())) {
- String fieldName = cmpField.getFieldName();
+ final String fieldName = cmpField.getFieldName();
// this will be here if we've already processed this
- MappedSuperclass superclass = superclassByField.get(fieldName);
+ final MappedSuperclass superclass = superclassByField.get(fieldName);
// if this field is defined by one of the superclasses, then
// we need to provide a mapping for this.
if (superclass != null) {
@@ -846,24 +846,24 @@ public class CmpJpaConversion implements
* @return The set of mapped superclasses used in this
* bean mapping.
*/
- private Collection<MappedSuperclass> mapClass1x(String ejbClassName, Mapping mapping, EntityBean bean, ClassLoader classLoader) {
- Class ejbClass = loadClass(classLoader, ejbClassName);
+ private Collection<MappedSuperclass> mapClass1x(final String ejbClassName, final Mapping mapping, final EntityBean bean, final ClassLoader classLoader) {
+ final Class ejbClass = loadClass(classLoader, ejbClassName);
// build a set of all field names
- Set<String> allFields = new TreeSet<String>();
- for (CmpField cmpField : bean.getCmpField()) {
+ final Set<String> allFields = new TreeSet<String>();
+ for (final CmpField cmpField : bean.getCmpField()) {
allFields.add(cmpField.getFieldName());
}
// build a map from the field name to the super class that contains that field
- Map<String, MappedSuperclass> superclassByField = mapFields(ejbClass, allFields);
+ final Map<String, MappedSuperclass> superclassByField = mapFields(ejbClass, allFields);
//
// id: the primary key
//
- Set<String> primaryKeyFields = new HashSet<String>();
+ final Set<String> primaryKeyFields = new HashSet<String>();
if (bean.getPrimkeyField() != null) {
- String fieldName = bean.getPrimkeyField();
- MappedSuperclass superclass = superclassByField.get(fieldName);
+ final String fieldName = bean.getPrimkeyField();
+ final MappedSuperclass superclass = superclassByField.get(fieldName);
if (superclass == null) {
throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
}
@@ -873,8 +873,8 @@ public class CmpJpaConversion implements
} else if ("java.lang.Object".equals(bean.getPrimKeyClass())) {
// a primary field type of Object is an automatically generated
// pk field. Mark it as such and add it to the mapping.
- String fieldName = "OpenEJB_pk";
- Id field = new Id(fieldName);
+ final String fieldName = "OpenEJB_pk";
+ final Id field = new Id(fieldName);
field.setGeneratedValue(new GeneratedValue(GenerationType.AUTO));
mapping.addField(field);
} else if (bean.getPrimKeyClass() != null) {
@@ -886,9 +886,9 @@ public class CmpJpaConversion implements
pkClass = classLoader.loadClass(bean.getPrimKeyClass());
MappedSuperclass superclass = null;
MappedSuperclass idclass = null;
- for (Field pkField : pkClass.getFields()) {
- String fieldName = pkField.getName();
- int modifiers = pkField.getModifiers();
+ for (final Field pkField : pkClass.getFields()) {
+ final String fieldName = pkField.getName();
+ final int modifiers = pkField.getModifiers();
// the primary key fields must be public, non-static, must be defined as a CMP field,
// AND must also exist in the class hierarchy (not enforced by mapFields());
if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && allFields.contains(fieldName)) {
@@ -908,7 +908,7 @@ public class CmpJpaConversion implements
if (idclass != null) {
idclass.setIdClass(new IdClass(bean.getPrimKeyClass()));
}
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw (IllegalStateException)new IllegalStateException("Could not find entity primary key class " + bean.getPrimKeyClass()).initCause(e);
}
}
@@ -916,11 +916,11 @@ public class CmpJpaConversion implements
//
// basic: cmp-fields
//
- for (CmpField cmpField : bean.getCmpField()) {
- String fieldName = cmpField.getFieldName();
+ for (final CmpField cmpField : bean.getCmpField()) {
+ final String fieldName = cmpField.getFieldName();
// all of the primary key fields have been processed, so only handle whatever is left over
if (!primaryKeyFields.contains(fieldName)) {
- MappedSuperclass superclass = superclassByField.get(fieldName);
+ final MappedSuperclass superclass = superclassByField.get(fieldName);
if (superclass == null) {
throw new IllegalStateException("CMP field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
}
@@ -954,15 +954,15 @@ public class CmpJpaConversion implements
* @return Either idClass or current, depending on which is
* the most derived of the classes.
*/
- private MappedSuperclass resolveIdClass(MappedSuperclass idclass, MappedSuperclass current, Class ejbClass)
+ private MappedSuperclass resolveIdClass(final MappedSuperclass idclass, final MappedSuperclass current, final Class ejbClass)
{
// None identified yet? Just use the one we just found
if (idclass == null) {
return current;
}
- String idClassName = idclass.getClazz();
- String currentClassName = current.getClazz();
+ final String idClassName = idclass.getClazz();
+ final String currentClassName = current.getClazz();
// defined at the same level (common). Just keep the same id class
if (idClassName.equals(currentClassName)) {
@@ -972,7 +972,7 @@ public class CmpJpaConversion implements
// we have a split across the hiearchy, we need to figure out which of the classes is
// the most derived
for (Class clazz = ejbClass; clazz != null; clazz = clazz.getSuperclass()) {
- String name = clazz.getName();
+ final String name = clazz.getName();
// if we find the current one first, return it
if (name.equals(currentClassName)) {
return current;
@@ -988,11 +988,11 @@ public class CmpJpaConversion implements
}
- private static Class loadClass(ClassLoader classLoader, String className) {
+ private static Class loadClass(final ClassLoader classLoader, final String className) {
Class ejbClass = null;
try {
ejbClass = classLoader.loadClass(className);
- } catch (ClassNotFoundException e) {
+ } catch (final ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
return ejbClass;
@@ -1012,24 +1012,24 @@ public class CmpJpaConversion implements
*/
private Map<String, MappedSuperclass> mapFields(Class clazz, Set<String> persistantFields) {
persistantFields = new TreeSet<String>(persistantFields);
- Map<String,MappedSuperclass> fields = new TreeMap<String,MappedSuperclass>();
+ final Map<String,MappedSuperclass> fields = new TreeMap<String,MappedSuperclass>();
// spin down the class hierarchy until we've either processed all of the fields
// or we've reached the Object class.
while (!persistantFields.isEmpty() && !clazz.equals(Object.class)) {
// This is a single target for the relationship mapping for each
// class in the hierarchy.
- MappedSuperclass superclass = new MappedSuperclass(clazz.getName());
- for (Field field : clazz.getDeclaredFields()) {
+ final MappedSuperclass superclass = new MappedSuperclass(clazz.getName());
+ for (final Field field : clazz.getDeclaredFields()) {
if (!field.isSynthetic()) {
- String fieldName = field.getName();
+ final String fieldName = field.getName();
// if this is one of bean's persistence fields, create the mapping
if (persistantFields.contains(fieldName)) {
fields.put(fieldName, superclass);
persistantFields.remove(fieldName);
} else if (!ENHANCED_FIELDS.contains(fieldName)){
// these are fields we need to identify as transient for the persistence engine.
- Transient transientField = new Transient(fieldName);
+ final Transient transientField = new Transient(fieldName);
superclass.addField(transientField);
}
}
@@ -1050,20 +1050,20 @@ public class CmpJpaConversion implements
* the bean already is associated with the CMP persistence
* context.
*/
- private boolean addPersistenceContextRef(EntityBean bean) {
+ private boolean addPersistenceContextRef(final EntityBean bean) {
// if a ref is already defined, skip this bean
if (bean.getPersistenceContextRefMap().containsKey("java:" + JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME)) return false;
- PersistenceContextRef persistenceContextRef = new PersistenceContextRef();
+ final PersistenceContextRef persistenceContextRef = new PersistenceContextRef();
persistenceContextRef.setName("java:" + JpaCmpEngine.CMP_PERSISTENCE_CONTEXT_REF_NAME);
persistenceContextRef.setPersistenceUnitName(CMP_PERSISTENCE_UNIT_NAME);
bean.getPersistenceContextRef().add(persistenceContextRef);
return true;
}
- private void setCascade(EjbRelationshipRole role, RelationField field) {
+ private void setCascade(final EjbRelationshipRole role, final RelationField field) {
if (role.getCascadeDelete()) {
- CascadeType cascadeType = new CascadeType();
+ final CascadeType cascadeType = new CascadeType();
cascadeType.setCascadeAll(true);
field.setCascade(cascadeType);
}