Updated regarding generics; fixed typos.

master
Sam Brannen 16 years ago
parent 5f473b9f26
commit af56f6497c
  1. 19
      org.springframework.context/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java
  2. 19
      org.springframework.orm/src/test/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java
  3. 19
      org.springframework.test/src/main/java/org/springframework/mock/jndi/SimpleNamingContextBuilder.java
  4. 19
      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<String,Object> boundObjects = new Hashtable<String,Object>();
/**
@ -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.
* <p>Call <code>activate()</code> again in order to expose this contexz builder's own
* <p>Call <code>activate()</code> 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<String, Object>) environment);
}
};
}

@ -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<String,Object> boundObjects = new Hashtable<String,Object>();
/**
@ -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.
* <p>Call <code>activate()</code> again in order to expose this contexz builder's own
* <p>Call <code>activate()</code> 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<String, Object>) environment);
}
};
}

@ -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<String,Object> boundObjects = new Hashtable<String,Object>();
/**
@ -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.
* <p>Call <code>activate()</code> again in order to expose this contexz builder's own
* <p>Call <code>activate()</code> 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<String, Object>) environment);
}
};
}

@ -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<String,Object> boundObjects = new Hashtable<String,Object>();
/**
@ -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.
* <p>Call <code>activate()</code> again in order to expose this contexz builder's own
* <p>Call <code>activate()</code> 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<String, Object>) environment);
}
};
}

Loading…
Cancel
Save