refactor: remove explicit type arguments

This commit is contained in:
broDom
2017-07-03 17:12:41 +02:00
parent b73040771a
commit 0cff0e7e7a
78 changed files with 116 additions and 119 deletions

View File

@@ -288,7 +288,7 @@ public class App
/** Field description */
@Argument(index = 1, metaVar = "arg")
private List<String> arguments = new ArrayList<String>();
private List<String> arguments = new ArrayList<>();
/** Field description */
private BufferedReader input;

View File

@@ -169,7 +169,7 @@ public class CreateGroupSubCommand extends TemplateSubCommand
session.getGroupHandler().create(group);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("group", new GroupWrapper(group));
renderTemplate(env, GetGroupSubCommand.TEMPLATE);

View File

@@ -168,7 +168,7 @@ public class CreateRepositorySubCommand extends TemplateSubCommand
session.getRepositoryHandler().create(repository);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("repository", new RepositoryWrapper(config, repository));
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);

View File

@@ -214,7 +214,7 @@ public class CreateUserSubCommand extends TemplateSubCommand
session.getUserHandler().create(user);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("user", new UserWrapper(user));
renderTemplate(env, GetUserSubCommand.TEMPLATE);

View File

@@ -102,7 +102,7 @@ public class GetGroupSubCommand extends TemplateSubCommand
if (group != null)
{
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("group", new GroupWrapper(group));
renderTemplate(env, TEMPLATE);

View File

@@ -117,7 +117,7 @@ public class GetRepositorySubCommand extends TemplateSubCommand
if (repository != null)
{
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("repository", new RepositoryWrapper(config, repository));
renderTemplate(env, TEMPLATE);

View File

@@ -102,7 +102,7 @@ public class GetUserSubCommand extends TemplateSubCommand
if (user != null)
{
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("user", new UserWrapper(user));
renderTemplate(env, TEMPLATE);

View File

@@ -71,7 +71,7 @@ public class ListGroupsSubCommand extends TemplateSubCommand
{
ScmClientSession session = createSession();
List<Group> groups = session.getGroupHandler().getAll();
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("groups", WrapperUtil.wrapGroups(groups));
renderTemplate(env, TEMPLATE);

View File

@@ -72,7 +72,7 @@ public class ListRepositoriesSubCommand extends TemplateSubCommand
{
ScmClientSession session = createSession();
List<Repository> repositories = session.getRepositoryHandler().getAll();
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("repositories", WrapperUtil.wrapRepositories(config, repositories));
renderTemplate(env, TEMPLATE);

View File

@@ -71,7 +71,7 @@ public class ListUsersSubCommand extends TemplateSubCommand
{
ScmClientSession session = createSession();
List<User> users = session.getUserHandler().getAll();
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("users", WrapperUtil.wrapUsers(users));
renderTemplate(env, TEMPLATE);

View File

@@ -132,7 +132,7 @@ public abstract class MembersSubCommand extends TemplateSubCommand
modifyMembers(group, members);
handler.modify(group);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("group", new GroupWrapper(group));
renderTemplate(env, GetGroupSubCommand.TEMPLATE);

View File

@@ -108,7 +108,7 @@ public class ModifyGroupSubCommand extends TemplateSubCommand
handler.modify(group);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("group", new GroupWrapper(group));
renderTemplate(env, GetGroupSubCommand.TEMPLATE);

View File

@@ -212,7 +212,7 @@ public class ModifyRepositorySubCommand extends TemplateSubCommand
handler.modify(repository);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("repository", new RepositoryWrapper(config, repository));
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);

View File

@@ -184,7 +184,7 @@ public class ModifyUserSubCommand extends TemplateSubCommand
handler.modify(user);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("user", new UserWrapper(user));
renderTemplate(env, GetUserSubCommand.TEMPLATE);

View File

@@ -111,14 +111,14 @@ public abstract class PermissionSubCommand extends TemplateSubCommand
if (permissions == null)
{
permissions = new ArrayList<Permission>();
permissions = new ArrayList<>();
}
modifyPermissions(permissions);
repository.setPermissions(permissions);
handler.modify(repository);
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
env.put("repository", new RepositoryWrapper(config, repository));
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);

View File

@@ -83,7 +83,7 @@ public class SubCommandHandler
*/
private SubCommandHandler()
{
subCommands = new HashMap<String, CommandDescriptor>();
subCommands = new HashMap<>();
loadSubCommands();
}
@@ -133,7 +133,7 @@ public class SubCommandHandler
public List<CommandDescriptor> getDescriptors()
{
List<CommandDescriptor> descs =
new ArrayList<CommandDescriptor>(subCommands.values());
new ArrayList<>(subCommands.values());
Collections.sort(descs);

View File

@@ -63,7 +63,7 @@ public class ScmClientConfig
*/
private ScmClientConfig()
{
this.serverConfigMap = new HashMap<String, ServerConfig>();
this.serverConfigMap = new HashMap<>();
}
//~--- get methods ----------------------------------------------------------

View File

@@ -63,7 +63,7 @@ public class XmlConfigAdapter
@Override
public XmlConfigSet marshal(Map<String, ServerConfig> map) throws Exception
{
Set<XmlConfigElement> set = new HashSet<XmlConfigElement>();
Set<XmlConfigElement> set = new HashSet<>();
for (Map.Entry<String, ServerConfig> e : map.entrySet())
{
@@ -86,7 +86,7 @@ public class XmlConfigAdapter
@Override
public Map<String, ServerConfig> unmarshal(XmlConfigSet set) throws Exception
{
Map<String, ServerConfig> map = new HashMap<String, ServerConfig>();
Map<String, ServerConfig> map = new HashMap<>();
for (XmlConfigElement e : set)
{

View File

@@ -71,7 +71,7 @@ public final class WrapperUtil
*/
public static List<GroupWrapper> wrapGroups(Collection<Group> groups)
{
List<GroupWrapper> wrappers = new ArrayList<GroupWrapper>();
List<GroupWrapper> wrappers = new ArrayList<>();
for (Group g : groups)
{
@@ -95,7 +95,7 @@ public final class WrapperUtil
public static List<RepositoryWrapper> wrapRepositories(ServerConfig config,
Collection<Repository> repositories)
{
List<RepositoryWrapper> wrappers = new ArrayList<RepositoryWrapper>();
List<RepositoryWrapper> wrappers = new ArrayList<>();
for (Repository r : repositories)
{
@@ -115,7 +115,7 @@ public final class WrapperUtil
*/
public static List<UserWrapper> wrapUsers(Collection<User> users)
{
List<UserWrapper> wrappers = new ArrayList<UserWrapper>();
List<UserWrapper> wrappers = new ArrayList<>();
for (User u : users)
{

View File

@@ -187,7 +187,7 @@ public class JerseyClientRepositoryBrowser implements ClientRepositoryBrowser
BrowserResult result = response.getEntity(BrowserResult.class);
AssertUtil.assertIsNotNull(result);
files = new ArrayList<FileObjectWrapper>();
files = new ArrayList<>();
List<FileObject> foList = result.getFiles();

View File

@@ -134,7 +134,7 @@ public final class IterableQueue<T> implements Iterable<T>
else
{
logger.trace("create queue iterator");
iterator = new QueueIterator<T>(this);
iterator = new QueueIterator<>(this);
}
return iterator;

View File

@@ -63,7 +63,7 @@ public class LimitedSortedSet<E> extends ForwardingSortedSet<E>
*/
public LimitedSortedSet(int maxSize)
{
this.sortedSet = new TreeSet<E>();
this.sortedSet = new TreeSet<>();
this.maxSize = maxSize;
}

View File

@@ -183,5 +183,5 @@ public abstract class AbstractResourceProcessor implements ResourceProcessor
//~--- fields ---------------------------------------------------------------
/** Field description */
private Map<String, String> variableMap = new HashMap<String, String>();
private Map<String, String> variableMap = new HashMap<>();
}

View File

@@ -52,7 +52,7 @@ public class INIConfiguration
*/
public INIConfiguration()
{
this.sectionMap = new LinkedHashMap<String, INISection>();
this.sectionMap = new LinkedHashMap<>();
}
//~--- methods --------------------------------------------------------------

View File

@@ -55,7 +55,7 @@ public class INISection
public INISection(String name)
{
this.name = name;
this.parameters = new LinkedHashMap<String, String>();
this.parameters = new LinkedHashMap<>();
}
/**

View File

@@ -111,10 +111,10 @@ public class PluginCenter implements Serializable
/** Field description */
@XmlElement(name = "plugin")
@XmlElementWrapper(name = "plugins")
private Set<PluginInformation> plugins = new HashSet<PluginInformation>();
private Set<PluginInformation> plugins = new HashSet<>();
/** Field description */
@XmlElement(name = "repository")
@XmlElementWrapper(name = "repositories")
private Set<PluginRepository> repositories = new HashSet<PluginRepository>();
private Set<PluginRepository> repositories = new HashSet<>();
}

View File

@@ -101,7 +101,7 @@ public class PluginCondition implements Cloneable, Serializable
if (Util.isNotEmpty(os))
{
clone.setOs(new ArrayList<String>(os));
clone.setOs(new ArrayList<>(os));
}
return clone;

View File

@@ -106,7 +106,7 @@ public class PluginInformation
if (Util.isNotEmpty(screenshots))
{
clone.setScreenshots(new ArrayList<String>(screenshots));
clone.setScreenshots(new ArrayList<>(screenshots));
}
clone.setState(state);

View File

@@ -209,7 +209,7 @@ public abstract class AbstractRepositoryHandler<C extends SimpleRepositoryConfig
private void fireConfigChanged()
{
ScmEventBus.getInstance().post(
new RepositoryHandlerConfigChangedEvent<C>(config));
new RepositoryHandlerConfigChangedEvent<>(config));
}
//~--- fields ---------------------------------------------------------------

View File

@@ -220,7 +220,7 @@ public class Changeset extends BasicPropertiesAware
{
if (branches == null)
{
branches = new ArrayList<String>();
branches = new ArrayList<>();
}
return branches;
@@ -286,7 +286,7 @@ public class Changeset extends BasicPropertiesAware
{
if (parents == null)
{
parents = new ArrayList<String>();
parents = new ArrayList<>();
}
return parents;
@@ -302,7 +302,7 @@ public class Changeset extends BasicPropertiesAware
{
if (tags == null)
{
tags = new ArrayList<String>();
tags = new ArrayList<>();
}
return tags;

View File

@@ -110,7 +110,7 @@ public class PreProcessorUtil
EscapeUtil.escape(blameLine);
PreProcessorHandler<BlameLine> handler =
new PreProcessorHandler<BlameLine>(blameLinePreProcessorFactorySet,
new PreProcessorHandler<>(blameLinePreProcessorFactorySet,
blameLinePreProcessorSet, repository);
handler.callPreProcessors(blameLine);
@@ -154,7 +154,7 @@ public class PreProcessorUtil
}
PreProcessorHandler<BlameLine> handler =
new PreProcessorHandler<BlameLine>(blameLinePreProcessorFactorySet,
new PreProcessorHandler<>(blameLinePreProcessorFactorySet,
blameLinePreProcessorSet, repository);
handler.callPreProcessors(blameResult.getBlameLines());
@@ -198,7 +198,7 @@ public class PreProcessorUtil
}
PreProcessorHandler<Changeset> handler =
new PreProcessorHandler<Changeset>(changesetPreProcessorFactorySet,
new PreProcessorHandler<>(changesetPreProcessorFactorySet,
changesetPreProcessorSet, repository);
handler.callPreProcessors(changeset);
@@ -242,7 +242,7 @@ public class PreProcessorUtil
}
PreProcessorHandler<FileObject> handler =
new PreProcessorHandler<FileObject>(fileObjectPreProcessorFactorySet,
new PreProcessorHandler<>(fileObjectPreProcessorFactorySet,
fileObjectPreProcessorSet, repository);
handler.callPreProcessors(result);
@@ -274,7 +274,7 @@ public class PreProcessorUtil
}
PreProcessorHandler<Changeset> handler =
new PreProcessorHandler<Changeset>(changesetPreProcessorFactorySet,
new PreProcessorHandler<>(changesetPreProcessorFactorySet,
changesetPreProcessorSet, repository);
handler.callPreProcessors(result);

View File

@@ -85,7 +85,7 @@ public final class RepositoryUtil
public static List<File> searchRepositoryDirectories(File directory,
String... names)
{
List<File> repositories = new ArrayList<File>();
List<File> repositories = new ArrayList<>();
searchRepositoryDirectories(repositories, directory, Arrays.asList(names));
@@ -253,7 +253,7 @@ public final class RepositoryUtil
String... directoryNames)
throws IOException
{
List<String> repositories = new ArrayList<String>();
List<String> repositories = new ArrayList<>();
List<File> repositoryFiles = searchRepositoryDirectories(baseDirectory,
directoryNames);

View File

@@ -160,7 +160,7 @@ public final class SearchUtil
public static <T> Collection<T> search(SearchRequest searchRequest,
Collection<T> collection, TransformFilter<T> filter)
{
List<T> items = new ArrayList<T>();
List<T> items = new ArrayList<>();
int index = 0;
int counter = 0;

View File

@@ -592,7 +592,7 @@ public final class IOUtil
public static List<String> searchAll(String[] path, String cmd,
String checkParameter)
{
List<String> cmds = new ArrayList<String>();
List<String> cmds = new ArrayList<>();
if (isCommandAvailable(cmd, checkParameter))
{

View File

@@ -79,7 +79,7 @@ public final class LinkTextParser
public static String parseText(String content)
{
Matcher m = REGEX_URL.matcher(content);
List<Token> tokens = new ArrayList<Token>();
List<Token> tokens = new ArrayList<>();
int position = 0;
String tokenContent = null;

View File

@@ -119,7 +119,7 @@ public final class ServiceUtil
*/
public static <T> List<T> getServices(Class<T> type)
{
List<T> result = new ArrayList<T>();
List<T> result = new ArrayList<>();
try
{

View File

@@ -262,8 +262,8 @@ public final class Util
Comparator<T> comparator, CollectionAppender<T> appender, int start,
int limit)
{
List<T> result = new ArrayList<T>();
List<T> valueList = new ArrayList<T>(values);
List<T> result = new ArrayList<>();
List<T> valueList = new ArrayList<>(values);
if (comparator != null)
{

View File

@@ -66,7 +66,7 @@ public class EnvList
*/
public EnvList()
{
envMap = new HashMap<String, String>();
envMap = new HashMap<>();
}
/**
@@ -77,7 +77,7 @@ public class EnvList
*/
public EnvList(EnvList l)
{
envMap = new HashMap<String, String>(l.envMap);
envMap = new HashMap<>(l.envMap);
}
//~--- methods --------------------------------------------------------------

View File

@@ -470,13 +470,13 @@ public class BufferedHttpServletResponse extends HttpServletResponseWrapper
private ByteArrayPrintWriter pw = null;
/** Field description */
private Set<Cookie> cookies = new HashSet<Cookie>();
private Set<Cookie> cookies = new HashSet<>();
/** Field description */
private int statusCode = HttpServletResponse.SC_OK;
/** Field description */
private Map<String, String> headers = new LinkedHashMap<String, String>();
private Map<String, String> headers = new LinkedHashMap<>();
/** Field description */
private String statusMessage;

View File

@@ -102,7 +102,7 @@ public class XmlMapStringAdapter
public Map<String, String> unmarshal(XmlMapStringElement[] elements)
throws Exception
{
Map<String, String> map = new HashMap<String, String>();
Map<String, String> map = new HashMap<>();
if (elements != null)
{

View File

@@ -90,7 +90,7 @@ public class XmlSetStringAdapter extends XmlAdapter<String, Set<String>>
@Override
public Set<String> unmarshal(String rawString) throws Exception
{
Set<String> tokens = new HashSet<String>();
Set<String> tokens = new HashSet<>();
for (String token : rawString.split(","))
{

View File

@@ -63,7 +63,7 @@ public class IterableQueueTest
@Test(expected = IllegalStateException.class)
public void testDuplicatedEndReached()
{
IterableQueue<String> queue = new IterableQueue<String>();
IterableQueue<String> queue = new IterableQueue<>();
queue.endReached();
queue.endReached();
@@ -76,7 +76,7 @@ public class IterableQueueTest
@Test
public void testIterator()
{
IterableQueue<String> queue = new IterableQueue<String>();
IterableQueue<String> queue = new IterableQueue<>();
assertEquals(QueueIterator.class, queue.iterator().getClass());
queue.endReached();
@@ -120,7 +120,7 @@ public class IterableQueueTest
@Test(expected = IllegalStateException.class)
public void testPushEndReached()
{
IterableQueue<String> queue = new IterableQueue<String>();
IterableQueue<String> queue = new IterableQueue<>();
queue.push("a");
queue.endReached();
@@ -134,7 +134,7 @@ public class IterableQueueTest
@Test
public void testSingleConsumer()
{
final IterableQueue<Integer> queue = new IterableQueue<Integer>();
final IterableQueue<Integer> queue = new IterableQueue<>();
new Thread(new IntegerProducer(queue, false, 100)).start();
assertResult(Lists.newArrayList(queue), 100);
@@ -176,12 +176,12 @@ public class IterableQueueTest
ExecutorService executor = Executors.newFixedThreadPool(threads);
List<Future<List<Integer>>> futures = Lists.newArrayList();
final IterableQueue<Integer> queue = new IterableQueue<Integer>();
final IterableQueue<Integer> queue = new IterableQueue<>();
for (int i = 0; i < consumer; i++)
{
Future<List<Integer>> future =
executor.submit(new CallableQueueCollector<Integer>(queue));
executor.submit(new CallableQueueCollector<>(queue));
futures.add(future);
}

View File

@@ -128,7 +128,7 @@ public class TemplateEngineFactoryTest
assertTrue(engines.contains(engine1));
assertTrue(engines.contains(engine2));
Set<TemplateEngine> ce = new HashSet<TemplateEngine>();
Set<TemplateEngine> ce = new HashSet<>();
ce.add(engine1);
factory = new TemplateEngineFactory(ce, engine2);

View File

@@ -50,7 +50,7 @@ public class WUIModelUrlProviderTest extends ModelUrlProviderTestBase
*/
public WUIModelUrlProviderTest()
{
modelMap = new HashMap<String, String>();
modelMap = new HashMap<>();
modelMap.put(MODEL_REPOSITORY, "repositoryPanel");
modelMap.put(MODEL_USERS, "userPanel");
modelMap.put(MODEL_GROUPS, "groupPanel");

View File

@@ -199,7 +199,7 @@ public class XmlGroupDatabase implements XmlDatabase<Group>
/** Field description */
@XmlJavaTypeAdapter(XmlGroupMapAdapter.class)
@XmlElement(name = "groups")
private Map<String, Group> groupMap = new LinkedHashMap<String, Group>();
private Map<String, Group> groupMap = new LinkedHashMap<>();
/** Field description */
private Long lastModified;

View File

@@ -72,7 +72,7 @@ public class XmlGroupList implements Iterable<Group>
*/
public XmlGroupList(Map<String, Group> groupMap)
{
this.groups = new LinkedList<Group>(groupMap.values());
this.groups = new LinkedList<>(groupMap.values());
}
//~--- methods --------------------------------------------------------------

View File

@@ -81,7 +81,7 @@ public class XmlGroupMapAdapter
@Override
public Map<String, Group> unmarshal(XmlGroupList groups) throws Exception
{
Map<String, Group> groupMap = new LinkedHashMap<String, Group>();
Map<String, Group> groupMap = new LinkedHashMap<>();
for (Group group : groups)
{

View File

@@ -298,6 +298,5 @@ public class XmlRepositoryDatabase implements XmlDatabase<Repository>
/** Field description */
@XmlJavaTypeAdapter(XmlRepositoryMapAdapter.class)
@XmlElement(name = "repositories")
private Map<String, Repository> repositoryMap = new LinkedHashMap<String,
Repository>();
private Map<String, Repository> repositoryMap = new LinkedHashMap<>();
}

View File

@@ -72,7 +72,7 @@ public class XmlRepositoryList implements Iterable<Repository>
*/
public XmlRepositoryList(Map<String, Repository> repositoryMap)
{
this.repositories = new LinkedList<Repository>(repositoryMap.values());
this.repositories = new LinkedList<>(repositoryMap.values());
}
//~--- methods --------------------------------------------------------------

View File

@@ -83,8 +83,7 @@ public class XmlRepositoryMapAdapter
public Map<String, Repository> unmarshal(XmlRepositoryList repositories)
throws Exception
{
Map<String, Repository> repositoryMap = new LinkedHashMap<String,
Repository>();
Map<String, Repository> repositoryMap = new LinkedHashMap<>();
for (Repository repository : repositories)
{

View File

@@ -436,7 +436,7 @@ public class JAXBConfigurationEntryStore<V> implements ConfigurationEntryStore<V
writer.writeEndElement();
// value
JAXBElement<V> je = new JAXBElement<V>(QName.valueOf(TAG_VALUE), type,
JAXBElement<V> je = new JAXBElement<>(QName.valueOf(TAG_VALUE), type,
e.getValue());
m.marshal(je, writer);

View File

@@ -102,7 +102,7 @@ public class JAXBConfigurationEntryStoreFactory
type, name);
//J-
return new JAXBConfigurationEntryStore<T>(
return new JAXBConfigurationEntryStore<>(
new File(directory, name.concat(StoreConstants.FILE_EXTENSION)),
keyGenerator,
type

View File

@@ -202,5 +202,5 @@ public class XmlUserDatabase implements XmlDatabase<User>
/** Field description */
@XmlJavaTypeAdapter(XmlUserMapAdapter.class)
@XmlElement(name = "users")
private Map<String, User> userMap = new LinkedHashMap<String, User>();
private Map<String, User> userMap = new LinkedHashMap<>();
}

View File

@@ -72,7 +72,7 @@ public class XmlUserList implements Iterable<User>
*/
public XmlUserList(Map<String, User> userMap)
{
this.users = new LinkedList<User>(userMap.values());
this.users = new LinkedList<>(userMap.values());
}
//~--- methods --------------------------------------------------------------

View File

@@ -81,7 +81,7 @@ public class XmlUserMapAdapter
@Override
public Map<String, User> unmarshal(XmlUserList users) throws Exception
{
Map<String, User> userMap = new LinkedHashMap<String, User>();
Map<String, User> userMap = new LinkedHashMap<>();
for (User user : users)
{

View File

@@ -198,7 +198,7 @@ public class GitChangesetConverter implements Closeable
if (Util.isNotEmpty(parents))
{
parentList = new ArrayList<String>();
parentList = new ArrayList<>();
for (RevCommit parent : parents)
{

View File

@@ -71,8 +71,7 @@ public final class GitSubModuleParser
*/
public static Map<String, SubRepository> parse(String content)
{
Map<String, SubRepository> subRepositories = new HashMap<String,
SubRepository>();
Map<String, SubRepository> subRepositories = new HashMap<>();
Scanner scanner = new Scanner(content);
SubRepository repository = null;

View File

@@ -137,7 +137,7 @@ public class GitBlameCommand extends AbstractGitCommand implements BlameCommand
request.getPath()));
}
List<BlameLine> blameLines = new ArrayList<BlameLine>();
List<BlameLine> blameLines = new ArrayList<>();
int total = gitBlameResult.getResultContents().size();
int i = 0;

View File

@@ -145,7 +145,7 @@ public class HgPackageReader
*/
private void filterPackage(HgPackages packages)
{
List<HgPackage> pkgList = new ArrayList<HgPackage>();
List<HgPackage> pkgList = new ArrayList<>();
for (HgPackage pkg : packages)
{
@@ -228,7 +228,7 @@ public class HgPackageReader
if (packages == null)
{
packages = new HgPackages();
packages.setPackages(new ArrayList<HgPackage>());
packages.setPackages(new ArrayList<>());
}
return packages;

View File

@@ -282,7 +282,7 @@ public class WindowsHgInstaller extends AbstractHgInstaller
*/
private List<String> getInstallations(String[] registryKeys)
{
List<String> installations = new ArrayList<String>();
List<String> installations = new ArrayList<>();
for (String registryKey : registryKeys)
{

View File

@@ -174,7 +174,7 @@ public class AbstractHgHandler
*/
protected Process createHgProcess(String... args) throws IOException
{
return createHgProcess(new HashMap<String, String>(), args);
return createHgProcess(new HashMap<>(), args);
}
/**
@@ -262,7 +262,7 @@ public class AbstractHgHandler
throws IOException, RepositoryException
{
return getResultFromScript(resultType, script,
new HashMap<String, String>());
new HashMap<>());
}
/**
@@ -315,7 +315,7 @@ public class AbstractHgHandler
throws IOException
{
HgConfig config = handler.getConfig();
List<String> cmdList = new ArrayList<String>();
List<String> cmdList = new ArrayList<>();
cmdList.add(cmd);

View File

@@ -168,7 +168,7 @@ public class HgLogCommand extends AbstractCommand implements LogCommand
{
// empty repository
result = new ChangesetPagingResult(0, new ArrayList<Changeset>());
result = new ChangesetPagingResult(0, new ArrayList<>());
}
}

View File

@@ -282,7 +282,7 @@ public abstract class UserManagerTestBase
throws UserException, IOException, InterruptedException
{
int initialSize = manager.getAll().size();
List<MultiThreadTester> testers = new ArrayList<MultiThreadTester>();
List<MultiThreadTester> testers = new ArrayList<>();
for (int i = 0; i < THREAD_COUNT; i++)
{

View File

@@ -101,7 +101,7 @@ public class UriExtensionsConfig extends PackagesResourceConfig
{
if (mediaTypeMap == null)
{
mediaTypeMap = new HashMap<String, MediaType>();
mediaTypeMap = new HashMap<>();
mediaTypeMap.put(EXTENSION_JSON, MediaType.APPLICATION_JSON_TYPE);
mediaTypeMap.put(EXTENSION_XML, MediaType.APPLICATION_XML_TYPE);
}

View File

@@ -320,7 +320,7 @@ public class RepositoryImportResource
{
SecurityUtils.getSubject().checkRole(Role.ADMIN);
List<Repository> repositories = new ArrayList<Repository>();
List<Repository> repositories = new ArrayList<>();
importFromDirectory(repositories, type);
@@ -354,7 +354,7 @@ public class RepositoryImportResource
logger.info("start directory import for all supported repository types");
List<Repository> repositories = new ArrayList<Repository>();
List<Repository> repositories = new ArrayList<>();
for (Type t : findImportableTypes())
{
@@ -628,7 +628,7 @@ public class RepositoryImportResource
*/
private List<Type> findImportableTypes()
{
List<Type> types = new ArrayList<Type>();
List<Type> types = new ArrayList<>();
Collection<Type> handlerTypes = manager.getTypes();
for (Type t : handlerTypes)

View File

@@ -1028,7 +1028,7 @@ public class RepositoryResource extends AbstractManagerResource<Repository, Repo
{
if (repository.getPermissions() == null)
{
repository.setPermissions(new ArrayList<Permission>());
repository.setPermissions(new ArrayList<>());
}
}
else

View File

@@ -98,13 +98,13 @@ public class SearchResource
// create user searchhandler
Cache<String, SearchResults> userCache = cacheManager.getCache(CACHE_USER);
this.userSearchHandler = new SearchHandler<User>(userCache, userManager);
this.userSearchHandler = new SearchHandler<>(userCache, userManager);
// create group searchhandler
Cache<String, SearchResults> groupCache =
cacheManager.getCache(CACHE_GROUP);
this.groupSearchHandler = new SearchHandler<Group>(groupCache,
this.groupSearchHandler = new SearchHandler<>(groupCache,
groupManager);
}

View File

@@ -140,7 +140,7 @@ public class GuavaCacheManager
logger.debug(
"cache {} does not exists, creating a new instance from default configuration: {}",
name, defaultConfiguration);
cache = new GuavaCache<K, V>(defaultConfiguration, name);
cache = new GuavaCache<>(defaultConfiguration, name);
cacheMap.put(name, cache);
}

View File

@@ -74,7 +74,7 @@ public class MultiParentClassLoader extends ClassLoader
public MultiParentClassLoader(Collection<? extends ClassLoader> parents)
{
super(null);
this.parents = new CopyOnWriteArrayList<ClassLoader>(parents);
this.parents = new CopyOnWriteArrayList<>(parents);
}
//~--- get methods ----------------------------------------------------------

View File

@@ -100,7 +100,7 @@ public final class UberClassLoader extends ClassLoader
if (clazz != null)
{
cache.put(name, new WeakReference<Class<?>>(clazz));
cache.put(name, new WeakReference<>(clazz));
break;
}

View File

@@ -153,7 +153,7 @@ public class ErrorServlet extends HttpServlet
{
writer = response.getWriter();
Map<String, Object> env = new HashMap<String, Object>();
Map<String, Object> env = new HashMap<>();
String error = Util.EMPTY_STRING;
if (context.getStartupError() != null)

View File

@@ -129,7 +129,7 @@ public class TemplateServlet extends HttpServlet
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
Map<String, Object> params = new HashMap<String, Object>();
Map<String, Object> params = new HashMap<>();
String contextPath = request.getContextPath();
params.put("contextPath", contextPath);

View File

@@ -90,7 +90,7 @@ public class GetRepositoriesITCase extends AbstractAdminITCaseBase
@Parameters
public static Collection<String[]> createParameters()
{
Collection<String[]> params = new ArrayList<String[]>();
Collection<String[]> params = new ArrayList<>();
params.add(new String[] { "git" });
params.add(new String[] { "svn" });

View File

@@ -89,7 +89,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
group.setName("group-a");
group.setDescription("group a");
List<String> members = new ArrayList<String>();
List<String> members = new ArrayList<>();
members.add("slarti");
members.add("marvin");
@@ -110,7 +110,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
group.setName("group-b");
group.setDescription("group b");
List<String> members = new ArrayList<String>();
List<String> members = new ArrayList<>();
members.add("slarti");
members.add("dent");

View File

@@ -59,7 +59,7 @@ public class RepositoryTypeITCaseBase
@Parameters
public static Collection<String[]> createParameters()
{
Collection<String[]> params = new ArrayList<String[]>();
Collection<String[]> params = new ArrayList<>();
params.add(new String[] { "git" });
params.add(new String[] { "svn" });

View File

@@ -284,7 +284,7 @@ public class DefaultAdvancedHttpClientTest
public void setUp()
{
configuration = new ScmConfiguration();
transformers = new HashSet<ContentTransformer>();
transformers = new HashSet<>();
client = new TestingAdvacedHttpClient(configuration, transformers);
}

View File

@@ -111,7 +111,7 @@ public class DefaultUberWebResourceLoaderTest extends WebResourceLoaderTestBase
DefaultUberWebResourceLoader resourceLoader =
new DefaultUberWebResourceLoader(servletContext,
new ArrayList<PluginWrapper>());
new ArrayList<>());
resourceLoader.getCache().put("/myresource", GITHUB);
@@ -152,7 +152,7 @@ public class DefaultUberWebResourceLoaderTest extends WebResourceLoaderTestBase
WebResourceLoader resourceLoader =
new DefaultUberWebResourceLoader(servletContext,
new ArrayList<PluginWrapper>());
new ArrayList<>());
URL resource = resourceLoader.getResource("/myresource");
assertSame(SCM_MANAGER, resource);

View File

@@ -66,7 +66,7 @@ public class PluginTreeTest
public void testPluginConditionFailed() throws IOException
{
PluginCondition condition = new PluginCondition("999",
new ArrayList<String>(), "hit");
new ArrayList<>(), "hit");
Plugin plugin = new Plugin(2, createInfo("a", "b", "1"), null, condition,
false, null);
ExplodedSmp smp = createSmp(plugin);