Skip to content

Commit

Permalink
Remove usage of Vector collection
Browse files Browse the repository at this point in the history
  • Loading branch information
dreis2211 authored and philwebb committed Jan 25, 2018
1 parent 3bd940b commit 542c3b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.function.Supplier;

import javax.servlet.FilterRegistration;
Expand Down Expand Up @@ -75,9 +74,9 @@ public class MappingsEndpointTests {
public void servletWebMappings() {
ServletContext servletContext = mock(ServletContext.class);
given(servletContext.getInitParameterNames())
.willReturn(new Vector<String>().elements());
.willReturn(Collections.emptyEnumeration());
given(servletContext.getAttributeNames())
.willReturn(new Vector<String>().elements());
.willReturn(Collections.emptyEnumeration());
FilterRegistration filterRegistration = mock(FilterRegistration.class);
given((Map<String, FilterRegistration>) servletContext.getFilterRegistrations())
.willReturn(Collections.singletonMap("testFilter", filterRegistration));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
Expand All @@ -20,10 +20,10 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
Expand Down Expand Up @@ -336,7 +336,7 @@ private static class HideDataScriptClassLoader extends URLClassLoader {
@Override
public Enumeration<URL> getResources(String name) throws IOException {
if (HIDDEN_RESOURCES.contains(name)) {
return new Vector<URL>().elements();
return Collections.emptyEnumeration();
}
return super.getResources(name);
}
Expand Down

0 comments on commit 542c3b7

Please sign in to comment.