From af56f6497ccb709b13c0fabd0db25b47cc94b204 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 25 May 2009 09:04:05 +0000 Subject: [PATCH] Updated regarding generics; fixed typos. --- .../mock/jndi/SimpleNamingContextBuilder.java | 19 ++++++++++--------- .../mock/jndi/SimpleNamingContextBuilder.java | 19 ++++++++++--------- .../mock/jndi/SimpleNamingContextBuilder.java | 19 ++++++++++--------- .../mock/jndi/SimpleNamingContextBuilder.java | 19 ++++++++++--------- 4 files changed, 40 insertions(+), 36 deletions(-) diff --git a/org.springframework.context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/org.springframework.context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java index 130de79de5..8b816b45d0 100644 --- a/org.springframework.context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ b/org.springframework.context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder else { // Create and activate new context builder. SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); - // The activate() call will cause an assigment to the activated variable. + // The activate() call will cause an assignment to the activated variable. builder.activate(); } return activated; @@ -124,7 +124,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder private final Log logger = LogFactory.getLog(getClass()); - private final Hashtable boundObjects = new Hashtable(); + private final Hashtable boundObjects = new Hashtable(); /** @@ -156,7 +156,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * Temporarily deactivate this context builder. It will remain registered with * the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory * (if configured) instead of exposing its own bound objects. - *

Call activate() again in order to expose this contexz builder's own + *

Call activate() again in order to expose this context builder's own * bound objects again. Such activate/deactivate sequences can be applied any number * of times (e.g. within a larger integration test suite running in the same VM). * @see #activate() @@ -192,13 +192,13 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * creating a new SimpleNamingContext instance. * @see SimpleNamingContext */ - public InitialContextFactory createInitialContextFactory(Hashtable environment) { + public InitialContextFactory createInitialContextFactory(Hashtable environment) { if (activated == null && environment != null) { Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); if (icf != null) { - Class icfClass = null; + Class icfClass = null; if (icf instanceof Class) { - icfClass = (Class) icf; + icfClass = (Class) icf; } else if (icf instanceof String) { icfClass = ClassUtils.resolveClassName((String) icf, getClass().getClassLoader()); @@ -225,8 +225,9 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder // Default case... return new InitialContextFactory() { - public Context getInitialContext(Hashtable environment) { - return new SimpleNamingContext("", boundObjects, environment); + @SuppressWarnings("unchecked") + public Context getInitialContext(Hashtable environment) { + return new SimpleNamingContext("", boundObjects, (Hashtable) environment); } }; } diff --git a/org.springframework.orm/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/org.springframework.orm/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java index 130de79de5..8b816b45d0 100644 --- a/org.springframework.orm/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ b/org.springframework.orm/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder else { // Create and activate new context builder. SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); - // The activate() call will cause an assigment to the activated variable. + // The activate() call will cause an assignment to the activated variable. builder.activate(); } return activated; @@ -124,7 +124,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder private final Log logger = LogFactory.getLog(getClass()); - private final Hashtable boundObjects = new Hashtable(); + private final Hashtable boundObjects = new Hashtable(); /** @@ -156,7 +156,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * Temporarily deactivate this context builder. It will remain registered with * the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory * (if configured) instead of exposing its own bound objects. - *

Call activate() again in order to expose this contexz builder's own + *

Call activate() again in order to expose this context builder's own * bound objects again. Such activate/deactivate sequences can be applied any number * of times (e.g. within a larger integration test suite running in the same VM). * @see #activate() @@ -192,13 +192,13 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * creating a new SimpleNamingContext instance. * @see SimpleNamingContext */ - public InitialContextFactory createInitialContextFactory(Hashtable environment) { + public InitialContextFactory createInitialContextFactory(Hashtable environment) { if (activated == null && environment != null) { Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); if (icf != null) { - Class icfClass = null; + Class icfClass = null; if (icf instanceof Class) { - icfClass = (Class) icf; + icfClass = (Class) icf; } else if (icf instanceof String) { icfClass = ClassUtils.resolveClassName((String) icf, getClass().getClassLoader()); @@ -225,8 +225,9 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder // Default case... return new InitialContextFactory() { - public Context getInitialContext(Hashtable environment) { - return new SimpleNamingContext("", boundObjects, environment); + @SuppressWarnings("unchecked") + public Context getInitialContext(Hashtable environment) { + return new SimpleNamingContext("", boundObjects, (Hashtable) environment); } }; } diff --git a/org.springframework.test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/org.springframework.test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java index 130de79de5..8b816b45d0 100644 --- a/org.springframework.test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ b/org.springframework.test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder else { // Create and activate new context builder. SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); - // The activate() call will cause an assigment to the activated variable. + // The activate() call will cause an assignment to the activated variable. builder.activate(); } return activated; @@ -124,7 +124,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder private final Log logger = LogFactory.getLog(getClass()); - private final Hashtable boundObjects = new Hashtable(); + private final Hashtable boundObjects = new Hashtable(); /** @@ -156,7 +156,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * Temporarily deactivate this context builder. It will remain registered with * the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory * (if configured) instead of exposing its own bound objects. - *

Call activate() again in order to expose this contexz builder's own + *

Call activate() again in order to expose this context builder's own * bound objects again. Such activate/deactivate sequences can be applied any number * of times (e.g. within a larger integration test suite running in the same VM). * @see #activate() @@ -192,13 +192,13 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * creating a new SimpleNamingContext instance. * @see SimpleNamingContext */ - public InitialContextFactory createInitialContextFactory(Hashtable environment) { + public InitialContextFactory createInitialContextFactory(Hashtable environment) { if (activated == null && environment != null) { Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); if (icf != null) { - Class icfClass = null; + Class icfClass = null; if (icf instanceof Class) { - icfClass = (Class) icf; + icfClass = (Class) icf; } else if (icf instanceof String) { icfClass = ClassUtils.resolveClassName((String) icf, getClass().getClassLoader()); @@ -225,8 +225,9 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder // Default case... return new InitialContextFactory() { - public Context getInitialContext(Hashtable environment) { - return new SimpleNamingContext("", boundObjects, environment); + @SuppressWarnings("unchecked") + public Context getInitialContext(Hashtable environment) { + return new SimpleNamingContext("", boundObjects, (Hashtable) environment); } }; } diff --git a/org.springframework.transaction/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java b/org.springframework.transaction/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java index 130de79de5..8b816b45d0 100644 --- a/org.springframework.transaction/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java +++ b/org.springframework.transaction/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder else { // Create and activate new context builder. SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); - // The activate() call will cause an assigment to the activated variable. + // The activate() call will cause an assignment to the activated variable. builder.activate(); } return activated; @@ -124,7 +124,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder private final Log logger = LogFactory.getLog(getClass()); - private final Hashtable boundObjects = new Hashtable(); + private final Hashtable boundObjects = new Hashtable(); /** @@ -156,7 +156,7 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * Temporarily deactivate this context builder. It will remain registered with * the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory * (if configured) instead of exposing its own bound objects. - *

Call activate() again in order to expose this contexz builder's own + *

Call activate() again in order to expose this context builder's own * bound objects again. Such activate/deactivate sequences can be applied any number * of times (e.g. within a larger integration test suite running in the same VM). * @see #activate() @@ -192,13 +192,13 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder * creating a new SimpleNamingContext instance. * @see SimpleNamingContext */ - public InitialContextFactory createInitialContextFactory(Hashtable environment) { + public InitialContextFactory createInitialContextFactory(Hashtable environment) { if (activated == null && environment != null) { Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); if (icf != null) { - Class icfClass = null; + Class icfClass = null; if (icf instanceof Class) { - icfClass = (Class) icf; + icfClass = (Class) icf; } else if (icf instanceof String) { icfClass = ClassUtils.resolveClassName((String) icf, getClass().getClassLoader()); @@ -225,8 +225,9 @@ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder // Default case... return new InitialContextFactory() { - public Context getInitialContext(Hashtable environment) { - return new SimpleNamingContext("", boundObjects, environment); + @SuppressWarnings("unchecked") + public Context getInitialContext(Hashtable environment) { + return new SimpleNamingContext("", boundObjects, (Hashtable) environment); } }; }