import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.HttpJspPage;
-import javax.servlet.jsp.JspFactory;
import org.apache.jasper.compiler.Localizer;
if (this.resolver == null) {
CompositeELResolver r = new CompositeELResolver();
r.add(new ImplicitObjectELResolver());
- for (Iterator itr = this.resolvers.iterator(); itr.hasNext();) {
- r.add((ELResolver) itr.next());
+ for (Iterator<ELResolver> itr = this.resolvers.iterator();
+ itr.hasNext();) {
+ r.add(itr.next());
}
r.add(new MapELResolver());
r.add(new ResourceBundleELResolver());
private transient HashMap<String, Object> pageAttributes;
// ArrayList of NESTED scripting variables
- private ArrayList nestedVars;
+ private ArrayList<String> nestedVars;
// ArrayList of AT_BEGIN scripting variables
- private ArrayList atBeginVars;
+ private ArrayList<String> atBeginVars;
// ArrayList of AT_END scripting variables
- private ArrayList atEndVars;
+ private ArrayList<String> atEndVars;
- private Map aliases;
+ private Map<String,String> aliases;
private HashMap<String, Object> originalNestedVars;
- public JspContextWrapper(JspContext jspContext, ArrayList nestedVars,
- ArrayList atBeginVars, ArrayList atEndVars, Map aliases) {
+ public JspContextWrapper(JspContext jspContext,
+ ArrayList<String> nestedVars, ArrayList<String> atBeginVars,
+ ArrayList<String> atEndVars, Map<String,String> aliases) {
this.invokingJspCtxt = (PageContext) jspContext;
this.nestedVars = nestedVars;
this.atBeginVars = atBeginVars;
public Enumeration<String> getAttributeNamesInScope(int scope) {
if (scope == PAGE_SCOPE) {
- return new Enumerator(pageAttributes.keySet().iterator());
+ return new Enumerator<String>(pageAttributes.keySet().iterator());
}
return invokingJspCtxt.getAttributeNamesInScope(scope);
* variable scope (one of NESTED, AT_BEGIN, or AT_END)
*/
private void copyTagToPageScope(int scope) {
- Iterator iter = null;
+ Iterator<String> iter = null;
switch (scope) {
case VariableInfo.NESTED:
}
while ((iter != null) && iter.hasNext()) {
- String varName = (String) iter.next();
+ String varName = iter.next();
Object obj = getAttribute(varName);
varName = findAlias(varName);
if (obj != null) {
*/
private void saveNestedVariables() {
if (nestedVars != null) {
- Iterator iter = nestedVars.iterator();
+ Iterator<String> iter = nestedVars.iterator();
while (iter.hasNext()) {
- String varName = (String) iter.next();
+ String varName = iter.next();
varName = findAlias(varName);
Object obj = invokingJspCtxt.getAttribute(varName);
if (obj != null) {
*/
private void restoreNestedVariables() {
if (nestedVars != null) {
- Iterator iter = nestedVars.iterator();
+ Iterator<String> iter = nestedVars.iterator();
while (iter.hasNext()) {
- String varName = (String) iter.next();
+ String varName = iter.next();
varName = findAlias(varName);
Object obj = originalNestedVars.get(varName);
if (obj != null) {
if (aliases == null)
return varName;
- String alias = (String) aliases.get(varName);
+ String alias = aliases.get(varName);
if (alias == null) {
return varName;
}
if( Constants.IS_SECURITY_ENABLED ) {
PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
- (JspFactoryImpl)this, servlet, request, response, errorPageURL,
+ this, servlet, request, response, errorPageURL,
needsSession, bufferSize, autoflush);
- return (PageContext)AccessController.doPrivileged(dp);
+ return AccessController.doPrivileged(dp);
} else {
return internalGetPageContext(servlet, request, response,
errorPageURL, needsSession,
return;
if( Constants.IS_SECURITY_ENABLED ) {
PrivilegedReleasePageContext dp = new PrivilegedReleasePageContext(
- (JspFactoryImpl)this,pc);
+ this,pc);
AccessController.doPrivileged(dp);
} else {
internalReleasePageContext(pc);
}
}
- private class PrivilegedGetPageContext implements PrivilegedAction {
+ private class PrivilegedGetPageContext
+ implements PrivilegedAction<PageContext> {
private JspFactoryImpl factory;
private Servlet servlet;
this.autoflush = autoflush;
}
- public Object run() {
+ public PageContext run() {
return factory.internalGetPageContext(servlet, request, response,
errorPageURL, needsSession, bufferSize, autoflush);
}
}
- private class PrivilegedReleasePageContext implements PrivilegedAction {
+ private class PrivilegedReleasePageContext
+ implements PrivilegedAction<Void> {
private JspFactoryImpl factory;
private PageContext pageContext;
this.pageContext = pageContext;
}
- public Object run() {
+ public Void run() {
factory.internalReleasePageContext(pageContext);
return null;
}
= "javax.servlet.jsp.jspException";
protected static class PrivilegedIntrospectHelper
- implements PrivilegedExceptionAction {
+ implements PrivilegedExceptionAction<Void> {
private Object bean;
private String prop;
this.ignoreMethodNF = ignoreMethodNF;
}
- public Object run() throws JasperException {
+ public Void run() throws JasperException {
internalIntrospecthelper(
bean,prop,value,request,param,ignoreMethodNF);
return null;
return Long.valueOf(s).longValue();
}
- public static Object coerce(String s, Class target) {
+ public static Object coerce(String s, Class<?> target) {
boolean isNullOrEmpty = (s == null || s.length() == 0);
}
// __begin convertMethod
- public static Object convert(String propertyName, String s, Class t,
- Class propertyEditorClass)
+ public static Object convert(String propertyName, String s, Class<?> t,
+ Class<?> propertyEditorClass)
throws JasperException
{
try {
public static void introspect(Object bean, ServletRequest request)
throws JasperException
{
- Enumeration e = request.getParameterNames();
+ Enumeration<String> e = request.getParameterNames();
while ( e.hasMoreElements() ) {
- String name = (String) e.nextElement();
+ String name = e.nextElement();
String value = request.getParameter(name);
introspecthelper(bean, name, value, request, name, true);
}
throws JasperException
{
Method method = null;
- Class type = null;
- Class propertyEditorClass = null;
+ Class<?> type = null;
+ Class<?> propertyEditorClass = null;
try {
java.beans.BeanInfo info
= java.beans.Introspector.getBeanInfo(bean.getClass());
throw new JasperException(
Localizer.getMessage("jsp.error.beans.setproperty.noindexset"));
}
- Class t = type.getComponentType();
+ Class<?> t = type.getComponentType();
String[] values = request.getParameterValues(param);
//XXX Please check.
if(values == null) return;
Object bean,
Method method,
String[] values,
- Class t,
- Class propertyEditorClass)
+ Class<?> t,
+ Class<?> propertyEditorClass)
throws JasperException {
try {
}
}
- public static Method getWriteMethod(Class beanClass, String prop)
+ public static Method getWriteMethod(Class<?> beanClass, String prop)
throws JasperException {
Method method = null;
- Class type = null;
+ Class<?> type = null;
try {
java.beans.BeanInfo info
= java.beans.Introspector.getBeanInfo(beanClass);
return method;
}
- public static Method getReadMethod(Class beanClass, String prop)
+ public static Method getReadMethod(Class<?> beanClass, String prop)
throws JasperException {
Method method = null;
- Class type = null;
+ Class<?> type = null;
try {
java.beans.BeanInfo info
= java.beans.Introspector.getBeanInfo(beanClass);
// PropertyEditor Support
public static Object getValueFromBeanInfoPropertyEditor(
- Class attrClass, String attrName, String attrValue,
- Class propertyEditorClass)
+ Class<?> attrClass, String attrName, String attrValue,
+ Class<?> propertyEditorClass)
throws JasperException
{
try {
- PropertyEditor pe = (PropertyEditor)propertyEditorClass.newInstance();
+ PropertyEditor pe =
+ (PropertyEditor)propertyEditorClass.newInstance();
pe.setAsText(attrValue);
return pe.getValue();
} catch (Exception ex) {
}
public static Object getValueFromPropertyEditorManager(
- Class attrClass, String attrName, String attrValue)
+ Class<?> attrClass, String attrName, String attrValue)
throws JasperException
{
try {
private String getLocalizeMessage(final String message){
if (SecurityUtil.isPackageProtectionEnabled()){
- return (String)AccessController.doPrivileged(new PrivilegedAction(){
- public Object run(){
+ return AccessController.doPrivileged(new PrivilegedAction<String>(){
+ public String run(){
return Localizer.getMessage(message);
}
});
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- return AccessController.doPrivileged(new PrivilegedAction() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Object>() {
public Object run() {
return doGetAttribute(name);
}
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- return AccessController.doPrivileged(new PrivilegedAction() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Object>() {
public Object run() {
return doGetAttribute(name, scope);
}
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
doSetAttribute(name, attribute);
return null;
}
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
doSetAttribute(name, o, scope);
return null;
}
.getMessage("jsp.error.attribute.null_name"));
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
doRemoveAttribute(name, scope);
return null;
}
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- return ((Integer) AccessController
- .doPrivileged(new PrivilegedAction() {
- public Object run() {
+ return (AccessController
+ .doPrivileged(new PrivilegedAction<Integer>() {
+ public Integer run() {
return new Integer(doGetAttributeScope(name));
}
})).intValue();
public Object findAttribute(final String name) {
if (SecurityUtil.isPackageProtectionEnabled()) {
- return AccessController.doPrivileged(new PrivilegedAction() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Object>() {
public Object run() {
if (name == null) {
throw new NullPointerException(Localizer
public Enumeration<String> getAttributeNamesInScope(final int scope) {
if (SecurityUtil.isPackageProtectionEnabled()) {
- return (Enumeration) AccessController
- .doPrivileged(new PrivilegedAction() {
- public Object run() {
+ return AccessController.doPrivileged(
+ new PrivilegedAction<Enumeration<String>>() {
+ public Enumeration<String> run() {
return doGetAttributeNamesInScope(scope);
}
});
}
}
- private Enumeration doGetAttributeNamesInScope(int scope) {
+ private Enumeration<String> doGetAttributeNamesInScope(int scope) {
switch (scope) {
case PAGE_SCOPE:
- return new Enumerator(attributes.keySet().iterator());
+ return new Enumerator<String>(attributes.keySet().iterator());
case REQUEST_SCOPE:
return request.getAttributeNames();
}
if (SecurityUtil.isPackageProtectionEnabled()) {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
doRemoveAttribute(name);
return null;
}
throws ServletException, IOException {
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Void>() {
+ public Void run() throws Exception {
doInclude(relativeUrlPath, flush);
return null;
}
IOException {
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Void>() {
+ public Void run() throws Exception {
doForward(relativeUrlPath);
return null;
}
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Void>() {
+ public Void run() throws Exception {
doHandlePageException(t);
return null;
}
* @return The result of the evaluation
*/
public static Object proprietaryEvaluate(final String expression,
- final Class expectedType, final PageContext pageContext,
+ final Class<?> expectedType, final PageContext pageContext,
final ProtectedFunctionMapper functionMap, final boolean escape)
throws ELException {
Object retValue;
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
retValue = AccessController
- .doPrivileged(new PrivilegedExceptionAction() {
+ .doPrivileged(new PrivilegedExceptionAction<Object>() {
public Object run() throws Exception {
ELContextImpl ctx = (ELContextImpl) pageContext.getELContext();
private int maxSize;
// For cleanup
- private Vector perThreadDataVector;
+ private Vector<PerThreadData> perThreadDataVector;
- private ThreadLocal perThread;
+ private ThreadLocal<PerThreadData> perThread;
private static class PerThreadData {
Tag handlers[];
*/
public PerThreadTagHandlerPool() {
super();
- perThreadDataVector = new Vector();
+ perThreadDataVector = new Vector<PerThreadData>();
}
protected void init(ServletConfig config) {
}
}
- perThread = new ThreadLocal() {
- protected Object initialValue() {
+ perThread = new ThreadLocal<PerThreadData>() {
+ protected PerThreadData initialValue() {
PerThreadData ptd = new PerThreadData();
ptd.handlers = new Tag[maxSize];
ptd.current = -1;
*
* @throws JspException if a tag handler cannot be instantiated
*/
- public Tag get(Class handlerClass) throws JspException {
- PerThreadData ptd = (PerThreadData)perThread.get();
+ public Tag get(Class<? extends Tag> handlerClass) throws JspException {
+ PerThreadData ptd = perThread.get();
if(ptd.current >=0 ) {
return ptd.handlers[ptd.current--];
} else {
try {
- return (Tag) handlerClass.newInstance();
+ return handlerClass.newInstance();
} catch (Exception e) {
throw new JspException(e.getMessage(), e);
}
* @param handler Tag handler to add to this tag handler pool
*/
public void reuse(Tag handler) {
- PerThreadData ptd=(PerThreadData)perThread.get();
+ PerThreadData ptd = perThread.get();
if (ptd.current < (ptd.handlers.length - 1)) {
ptd.handlers[++ptd.current] = handler;
} else {
* Calls the release() method of all tag handlers in this tag handler pool.
*/
public void release() {
- Enumeration enumeration = perThreadDataVector.elements();
+ Enumeration<PerThreadData> enumeration = perThreadDataVector.elements();
while (enumeration.hasMoreElements()) {
- PerThreadData ptd = (PerThreadData)enumeration.nextElement();
+ PerThreadData ptd = enumeration.nextElement();
if (ptd.handlers != null) {
for (int i=ptd.current; i>=0; i--) {
if (ptd.handlers[i] != null) {
/**
* Maps "prefix:name" to java.lang.Method objects.
*/
- private HashMap fnmap = null;
+ private HashMap<String,Method> fnmap = null;
/**
* If there is only one function in the map, this is the Method for it.
public static ProtectedFunctionMapper getInstance() {
ProtectedFunctionMapper funcMapper;
if (SecurityUtil.isPackageProtectionEnabled()) {
- funcMapper = (ProtectedFunctionMapper) AccessController
- .doPrivileged(new PrivilegedAction() {
- public Object run() {
+ funcMapper = AccessController.doPrivileged(
+ new PrivilegedAction<ProtectedFunctionMapper>() {
+ public ProtectedFunctionMapper run() {
return new ProtectedFunctionMapper();
}
});
} else {
funcMapper = new ProtectedFunctionMapper();
}
- funcMapper.fnmap = new java.util.HashMap();
+ funcMapper.fnmap = new HashMap<String,Method>();
return funcMapper;
}
* @throws RuntimeException
* if no method with the given signature could be found.
*/
- public void mapFunction(String fnQName, final Class c,
- final String methodName, final Class[] args) {
+ public void mapFunction(String fnQName, final Class<?> c,
+ final String methodName, final Class<?>[] args) {
java.lang.reflect.Method method;
if (SecurityUtil.isPackageProtectionEnabled()) {
try {
- method = (java.lang.reflect.Method) AccessController
- .doPrivileged(new PrivilegedExceptionAction() {
-
- public Object run() throws Exception {
+ method = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Method>() {
+ public Method run() throws Exception {
return c.getDeclaredMethod(methodName, args);
}
});
* if no method with the given signature could be found.
*/
public static ProtectedFunctionMapper getMapForFunction(String fnQName,
- final Class c, final String methodName, final Class[] args) {
+ final Class<?> c, final String methodName, final Class<?>[] args) {
java.lang.reflect.Method method;
ProtectedFunctionMapper funcMapper;
if (SecurityUtil.isPackageProtectionEnabled()) {
- funcMapper = (ProtectedFunctionMapper) AccessController
- .doPrivileged(new PrivilegedAction() {
- public Object run() {
+ funcMapper = AccessController.doPrivileged(
+ new PrivilegedAction<ProtectedFunctionMapper>() {
+ public ProtectedFunctionMapper run() {
return new ProtectedFunctionMapper();
}
});
try {
- method = (java.lang.reflect.Method) AccessController
- .doPrivileged(new PrivilegedExceptionAction() {
-
- public Object run() throws Exception {
+ method = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Method>() {
+ public Method run() throws Exception {
return c.getDeclaredMethod(methodName, args);
}
});
*/
public Method resolveFunction(String prefix, String localName) {
if (this.fnmap != null) {
- return (Method) this.fnmap.get(prefix + ":" + localName);
+ return this.fnmap.get(prefix + ":" + localName);
}
return theMethod;
}
String tpClassName=getOption( config, OPTION_TAGPOOL, null);
if( tpClassName != null ) {
try {
- Class c=Class.forName( tpClassName );
+ Class<?> c=Class.forName( tpClassName );
result=(TagHandlerPool)c.newInstance();
} catch (Exception e) {
e.printStackTrace();
*
* @throws JspException if a tag handler cannot be instantiated
*/
- public Tag get(Class handlerClass) throws JspException {
+ public Tag get(Class<? extends Tag> handlerClass) throws JspException {
Tag handler;
synchronized( this ) {
if (current >= 0) {
if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
return (Tag) instanceManager.newInstance(handlerClass.getName(), handlerClass.getClassLoader());
} else {
- Tag instance = (Tag) handlerClass.newInstance();
+ Tag instance = handlerClass.newInstance();
instanceManager.newInstance(instance);
return instance;
}
*
* @exception ClassNotFoundException if the class was not found
*/
- public Class loadClass(String name) throws ClassNotFoundException {
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
return (loadClass(name, false));
}
*
* @exception ClassNotFoundException if the class was not found
*/
- public Class loadClass(final String name, boolean resolve)
+ public Class<?> loadClass(final String name, boolean resolve)
throws ClassNotFoundException {
- Class clazz = null;
+ Class<?> clazz = null;
// (0) Check our previously loaded class cache
clazz = findLoadedClass(name);
/**
* Servlet context attributes.
*/
- protected Hashtable myAttributes;
+ protected Hashtable<String,Object> myAttributes;
/**
*/
public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL) {
- myAttributes = new Hashtable();
+ myAttributes = new Hashtable<String,Object>();
myLogWriter = aLogWriter;
myResourceBaseURL = aResourceBaseURL;
/**
* Return an enumeration of context attribute names.
*/
- public Enumeration getAttributeNames() {
+ public Enumeration<String> getAttributeNames() {
return (myAttributes.keys());
* Return an enumeration of the names of context initialization
* parameters.
*/
- public Enumeration getInitParameterNames() {
+ public Enumeration<String> getInitParameterNames() {
- return (new Vector().elements());
+ return (new Vector<String>().elements());
}
*
* @param path Context-relative base path
*/
- public Set getResourcePaths(String path) {
+ public Set<String> getResourcePaths(String path) {
- Set thePaths = new HashSet();
+ Set<String> thePaths = new HashSet<String>();
if (!path.endsWith("/"))
path += "/";
String basePath = getRealPath(path);
*
* @deprecated This method has been deprecated with no replacement
*/
- public Enumeration getServletNames() {
+ public Enumeration<String> getServletNames() {
- return (new Vector().elements());
+ return (new Vector<String>().elements());
}
*
* @deprecated This method has been deprecated with no replacement
*/
- public Enumeration getServlets() {
+ public Enumeration<String> getServlets() {
- return (new Vector().elements());
+ return (new Vector<String>().elements());
}
try {
ClassLoader loader = Thread.currentThread()
.getContextClassLoader();
- Class engineOptionsClass = loader.loadClass(engineOptionsName);
- Class[] ctorSig = { ServletConfig.class, ServletContext.class };
- Constructor ctor = engineOptionsClass.getConstructor(ctorSig);
+ Class<?> engineOptionsClass =
+ loader.loadClass(engineOptionsName);
+ Class<?>[] ctorSig =
+ { ServletConfig.class, ServletContext.class };
+ Constructor<?> ctor =
+ engineOptionsClass.getConstructor(ctorSig);
Object[] args = { config, context };
options = (Options) ctor.newInstance(args);
} catch (Throwable e) {
log.debug("\t RequestURI: " + request.getRequestURI());
log.debug("\t QueryString: " + request.getQueryString());
log.debug("\t Request Params: ");
- Enumeration e = request.getParameterNames();
+ Enumeration<String> e = request.getParameterNames();
while (e.hasMoreElements()) {
- String name = (String) e.nextElement();
+ String name = e.nextElement();
log.debug("\t\t " + name + " = "
+ request.getParameter(name));
}
private Servlet theServlet;
private String jspUri;
- private Class tagHandlerClass;
+ private Class<?> tagHandlerClass;
private JspCompilationContext ctxt;
private long available = 0L;
private ServletConfig config;
/**
* Compile (if needed) and load a tag file
*/
- public Class loadTagFile() throws JasperException {
+ public Class<?> loadTagFile() throws JasperException {
try {
if (ctxt.isRemoved()) {
* (skeleton) with no dependencies on other other tag files is
* generated and compiled.
*/
- public Class loadTagFilePrototype() throws JasperException {
+ public Class<?> loadTagFilePrototype() throws JasperException {
ctxt.setPrototypeMode(true);
try {
target = getServlet();
}
if (target != null && target instanceof JspSourceDependent) {
- return ((java.util.List) ((JspSourceDependent) target).getDependants());
+ return ((JspSourceDependent) target).getDependants();
}
} catch (Throwable ex) {
}
* @version $Revision$ $Date$
*/
-public final class Enumerator implements Enumeration {
+public final class Enumerator<T> implements Enumeration<T> {
// ----------------------------------------------------------- Constructors
*
* @param collection Collection whose values should be enumerated
*/
- public Enumerator(Collection collection) {
+ public Enumerator(Collection<T> collection) {
this(collection.iterator());
* @param collection Collection whose values should be enumerated
* @param clone true to clone iterator
*/
- public Enumerator(Collection collection, boolean clone) {
+ public Enumerator(Collection<T> collection, boolean clone) {
this(collection.iterator(), clone);
*
* @param iterator Iterator to be wrapped
*/
- public Enumerator(Iterator iterator) {
+ public Enumerator(Iterator<T> iterator) {
super();
this.iterator = iterator;
* @param iterator Iterator to be wrapped
* @param clone true to clone iterator
*/
- public Enumerator(Iterator iterator, boolean clone) {
+ public Enumerator(Iterator<T> iterator, boolean clone) {
super();
if (!clone) {
this.iterator = iterator;
} else {
- List list = new ArrayList();
+ List<T> list = new ArrayList<T>();
while (iterator.hasNext()) {
list.add(iterator.next());
}
*
* @param map Map whose values should be enumerated
*/
- public Enumerator(Map map) {
+ public Enumerator(Map<?,T> map) {
this(map.values().iterator());
* @param map Map whose values should be enumerated
* @param clone true to clone iterator
*/
- public Enumerator(Map map, boolean clone) {
+ public Enumerator(Map<?,T> map, boolean clone) {
this(map.values().iterator(), clone);
* The <code>Iterator</code> over which the <code>Enumeration</code>
* represented by this class actually operates.
*/
- private Iterator iterator = null;
+ private Iterator<T> iterator = null;
// --------------------------------------------------------- Public Methods
*
* @exception NoSuchElementException if no more elements exist
*/
- public Object nextElement() throws NoSuchElementException {
+ public T nextElement() throws NoSuchElementException {
return (iterator.next());