mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
refactor: remove explicit type arguments
This commit is contained in:
@@ -288,7 +288,7 @@ public class App
|
|||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
@Argument(index = 1, metaVar = "arg")
|
@Argument(index = 1, metaVar = "arg")
|
||||||
private List<String> arguments = new ArrayList<String>();
|
private List<String> arguments = new ArrayList<>();
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private BufferedReader input;
|
private BufferedReader input;
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public class CreateGroupSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
session.getGroupHandler().create(group);
|
session.getGroupHandler().create(group);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("group", new GroupWrapper(group));
|
env.put("group", new GroupWrapper(group));
|
||||||
renderTemplate(env, GetGroupSubCommand.TEMPLATE);
|
renderTemplate(env, GetGroupSubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class CreateRepositorySubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
session.getRepositoryHandler().create(repository);
|
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));
|
env.put("repository", new RepositoryWrapper(config, repository));
|
||||||
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);
|
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ public class CreateUserSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
session.getUserHandler().create(user);
|
session.getUserHandler().create(user);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("user", new UserWrapper(user));
|
env.put("user", new UserWrapper(user));
|
||||||
renderTemplate(env, GetUserSubCommand.TEMPLATE);
|
renderTemplate(env, GetUserSubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class GetGroupSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("group", new GroupWrapper(group));
|
env.put("group", new GroupWrapper(group));
|
||||||
renderTemplate(env, TEMPLATE);
|
renderTemplate(env, TEMPLATE);
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class GetRepositorySubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
if (repository != null)
|
if (repository != null)
|
||||||
{
|
{
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("repository", new RepositoryWrapper(config, repository));
|
env.put("repository", new RepositoryWrapper(config, repository));
|
||||||
renderTemplate(env, TEMPLATE);
|
renderTemplate(env, TEMPLATE);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class GetUserSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("user", new UserWrapper(user));
|
env.put("user", new UserWrapper(user));
|
||||||
renderTemplate(env, TEMPLATE);
|
renderTemplate(env, TEMPLATE);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class ListGroupsSubCommand extends TemplateSubCommand
|
|||||||
{
|
{
|
||||||
ScmClientSession session = createSession();
|
ScmClientSession session = createSession();
|
||||||
List<Group> groups = session.getGroupHandler().getAll();
|
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));
|
env.put("groups", WrapperUtil.wrapGroups(groups));
|
||||||
renderTemplate(env, TEMPLATE);
|
renderTemplate(env, TEMPLATE);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class ListRepositoriesSubCommand extends TemplateSubCommand
|
|||||||
{
|
{
|
||||||
ScmClientSession session = createSession();
|
ScmClientSession session = createSession();
|
||||||
List<Repository> repositories = session.getRepositoryHandler().getAll();
|
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));
|
env.put("repositories", WrapperUtil.wrapRepositories(config, repositories));
|
||||||
renderTemplate(env, TEMPLATE);
|
renderTemplate(env, TEMPLATE);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class ListUsersSubCommand extends TemplateSubCommand
|
|||||||
{
|
{
|
||||||
ScmClientSession session = createSession();
|
ScmClientSession session = createSession();
|
||||||
List<User> users = session.getUserHandler().getAll();
|
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));
|
env.put("users", WrapperUtil.wrapUsers(users));
|
||||||
renderTemplate(env, TEMPLATE);
|
renderTemplate(env, TEMPLATE);
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public abstract class MembersSubCommand extends TemplateSubCommand
|
|||||||
modifyMembers(group, members);
|
modifyMembers(group, members);
|
||||||
handler.modify(group);
|
handler.modify(group);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("group", new GroupWrapper(group));
|
env.put("group", new GroupWrapper(group));
|
||||||
renderTemplate(env, GetGroupSubCommand.TEMPLATE);
|
renderTemplate(env, GetGroupSubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class ModifyGroupSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
handler.modify(group);
|
handler.modify(group);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("group", new GroupWrapper(group));
|
env.put("group", new GroupWrapper(group));
|
||||||
renderTemplate(env, GetGroupSubCommand.TEMPLATE);
|
renderTemplate(env, GetGroupSubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ public class ModifyRepositorySubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
handler.modify(repository);
|
handler.modify(repository);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("repository", new RepositoryWrapper(config, repository));
|
env.put("repository", new RepositoryWrapper(config, repository));
|
||||||
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);
|
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class ModifyUserSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
handler.modify(user);
|
handler.modify(user);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("user", new UserWrapper(user));
|
env.put("user", new UserWrapper(user));
|
||||||
renderTemplate(env, GetUserSubCommand.TEMPLATE);
|
renderTemplate(env, GetUserSubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -111,14 +111,14 @@ public abstract class PermissionSubCommand extends TemplateSubCommand
|
|||||||
|
|
||||||
if (permissions == null)
|
if (permissions == null)
|
||||||
{
|
{
|
||||||
permissions = new ArrayList<Permission>();
|
permissions = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
modifyPermissions(permissions);
|
modifyPermissions(permissions);
|
||||||
repository.setPermissions(permissions);
|
repository.setPermissions(permissions);
|
||||||
handler.modify(repository);
|
handler.modify(repository);
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
|
|
||||||
env.put("repository", new RepositoryWrapper(config, repository));
|
env.put("repository", new RepositoryWrapper(config, repository));
|
||||||
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);
|
renderTemplate(env, GetRepositorySubCommand.TEMPLATE);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class SubCommandHandler
|
|||||||
*/
|
*/
|
||||||
private SubCommandHandler()
|
private SubCommandHandler()
|
||||||
{
|
{
|
||||||
subCommands = new HashMap<String, CommandDescriptor>();
|
subCommands = new HashMap<>();
|
||||||
loadSubCommands();
|
loadSubCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ public class SubCommandHandler
|
|||||||
public List<CommandDescriptor> getDescriptors()
|
public List<CommandDescriptor> getDescriptors()
|
||||||
{
|
{
|
||||||
List<CommandDescriptor> descs =
|
List<CommandDescriptor> descs =
|
||||||
new ArrayList<CommandDescriptor>(subCommands.values());
|
new ArrayList<>(subCommands.values());
|
||||||
|
|
||||||
Collections.sort(descs);
|
Collections.sort(descs);
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class ScmClientConfig
|
|||||||
*/
|
*/
|
||||||
private ScmClientConfig()
|
private ScmClientConfig()
|
||||||
{
|
{
|
||||||
this.serverConfigMap = new HashMap<String, ServerConfig>();
|
this.serverConfigMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class XmlConfigAdapter
|
|||||||
@Override
|
@Override
|
||||||
public XmlConfigSet marshal(Map<String, ServerConfig> map) throws Exception
|
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())
|
for (Map.Entry<String, ServerConfig> e : map.entrySet())
|
||||||
{
|
{
|
||||||
@@ -86,7 +86,7 @@ public class XmlConfigAdapter
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, ServerConfig> unmarshal(XmlConfigSet set) throws Exception
|
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)
|
for (XmlConfigElement e : set)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public final class WrapperUtil
|
|||||||
*/
|
*/
|
||||||
public static List<GroupWrapper> wrapGroups(Collection<Group> groups)
|
public static List<GroupWrapper> wrapGroups(Collection<Group> groups)
|
||||||
{
|
{
|
||||||
List<GroupWrapper> wrappers = new ArrayList<GroupWrapper>();
|
List<GroupWrapper> wrappers = new ArrayList<>();
|
||||||
|
|
||||||
for (Group g : groups)
|
for (Group g : groups)
|
||||||
{
|
{
|
||||||
@@ -95,7 +95,7 @@ public final class WrapperUtil
|
|||||||
public static List<RepositoryWrapper> wrapRepositories(ServerConfig config,
|
public static List<RepositoryWrapper> wrapRepositories(ServerConfig config,
|
||||||
Collection<Repository> repositories)
|
Collection<Repository> repositories)
|
||||||
{
|
{
|
||||||
List<RepositoryWrapper> wrappers = new ArrayList<RepositoryWrapper>();
|
List<RepositoryWrapper> wrappers = new ArrayList<>();
|
||||||
|
|
||||||
for (Repository r : repositories)
|
for (Repository r : repositories)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ public final class WrapperUtil
|
|||||||
*/
|
*/
|
||||||
public static List<UserWrapper> wrapUsers(Collection<User> users)
|
public static List<UserWrapper> wrapUsers(Collection<User> users)
|
||||||
{
|
{
|
||||||
List<UserWrapper> wrappers = new ArrayList<UserWrapper>();
|
List<UserWrapper> wrappers = new ArrayList<>();
|
||||||
|
|
||||||
for (User u : users)
|
for (User u : users)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public class JerseyClientRepositoryBrowser implements ClientRepositoryBrowser
|
|||||||
BrowserResult result = response.getEntity(BrowserResult.class);
|
BrowserResult result = response.getEntity(BrowserResult.class);
|
||||||
|
|
||||||
AssertUtil.assertIsNotNull(result);
|
AssertUtil.assertIsNotNull(result);
|
||||||
files = new ArrayList<FileObjectWrapper>();
|
files = new ArrayList<>();
|
||||||
|
|
||||||
List<FileObject> foList = result.getFiles();
|
List<FileObject> foList = result.getFiles();
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public final class IterableQueue<T> implements Iterable<T>
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.trace("create queue iterator");
|
logger.trace("create queue iterator");
|
||||||
iterator = new QueueIterator<T>(this);
|
iterator = new QueueIterator<>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return iterator;
|
return iterator;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class LimitedSortedSet<E> extends ForwardingSortedSet<E>
|
|||||||
*/
|
*/
|
||||||
public LimitedSortedSet(int maxSize)
|
public LimitedSortedSet(int maxSize)
|
||||||
{
|
{
|
||||||
this.sortedSet = new TreeSet<E>();
|
this.sortedSet = new TreeSet<>();
|
||||||
this.maxSize = maxSize;
|
this.maxSize = maxSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,5 +183,5 @@ public abstract class AbstractResourceProcessor implements ResourceProcessor
|
|||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private Map<String, String> variableMap = new HashMap<String, String>();
|
private Map<String, String> variableMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class INIConfiguration
|
|||||||
*/
|
*/
|
||||||
public INIConfiguration()
|
public INIConfiguration()
|
||||||
{
|
{
|
||||||
this.sectionMap = new LinkedHashMap<String, INISection>();
|
this.sectionMap = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class INISection
|
|||||||
public INISection(String name)
|
public INISection(String name)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.parameters = new LinkedHashMap<String, String>();
|
this.parameters = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ public class PluginCenter implements Serializable
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
@XmlElement(name = "plugin")
|
@XmlElement(name = "plugin")
|
||||||
@XmlElementWrapper(name = "plugins")
|
@XmlElementWrapper(name = "plugins")
|
||||||
private Set<PluginInformation> plugins = new HashSet<PluginInformation>();
|
private Set<PluginInformation> plugins = new HashSet<>();
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
@XmlElement(name = "repository")
|
@XmlElement(name = "repository")
|
||||||
@XmlElementWrapper(name = "repositories")
|
@XmlElementWrapper(name = "repositories")
|
||||||
private Set<PluginRepository> repositories = new HashSet<PluginRepository>();
|
private Set<PluginRepository> repositories = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class PluginCondition implements Cloneable, Serializable
|
|||||||
|
|
||||||
if (Util.isNotEmpty(os))
|
if (Util.isNotEmpty(os))
|
||||||
{
|
{
|
||||||
clone.setOs(new ArrayList<String>(os));
|
clone.setOs(new ArrayList<>(os));
|
||||||
}
|
}
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class PluginInformation
|
|||||||
|
|
||||||
if (Util.isNotEmpty(screenshots))
|
if (Util.isNotEmpty(screenshots))
|
||||||
{
|
{
|
||||||
clone.setScreenshots(new ArrayList<String>(screenshots));
|
clone.setScreenshots(new ArrayList<>(screenshots));
|
||||||
}
|
}
|
||||||
|
|
||||||
clone.setState(state);
|
clone.setState(state);
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public abstract class AbstractRepositoryHandler<C extends SimpleRepositoryConfig
|
|||||||
private void fireConfigChanged()
|
private void fireConfigChanged()
|
||||||
{
|
{
|
||||||
ScmEventBus.getInstance().post(
|
ScmEventBus.getInstance().post(
|
||||||
new RepositoryHandlerConfigChangedEvent<C>(config));
|
new RepositoryHandlerConfigChangedEvent<>(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ public class Changeset extends BasicPropertiesAware
|
|||||||
{
|
{
|
||||||
if (branches == null)
|
if (branches == null)
|
||||||
{
|
{
|
||||||
branches = new ArrayList<String>();
|
branches = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return branches;
|
return branches;
|
||||||
@@ -286,7 +286,7 @@ public class Changeset extends BasicPropertiesAware
|
|||||||
{
|
{
|
||||||
if (parents == null)
|
if (parents == null)
|
||||||
{
|
{
|
||||||
parents = new ArrayList<String>();
|
parents = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return parents;
|
return parents;
|
||||||
@@ -302,7 +302,7 @@ public class Changeset extends BasicPropertiesAware
|
|||||||
{
|
{
|
||||||
if (tags == null)
|
if (tags == null)
|
||||||
{
|
{
|
||||||
tags = new ArrayList<String>();
|
tags = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ public class PreProcessorUtil
|
|||||||
EscapeUtil.escape(blameLine);
|
EscapeUtil.escape(blameLine);
|
||||||
|
|
||||||
PreProcessorHandler<BlameLine> handler =
|
PreProcessorHandler<BlameLine> handler =
|
||||||
new PreProcessorHandler<BlameLine>(blameLinePreProcessorFactorySet,
|
new PreProcessorHandler<>(blameLinePreProcessorFactorySet,
|
||||||
blameLinePreProcessorSet, repository);
|
blameLinePreProcessorSet, repository);
|
||||||
|
|
||||||
handler.callPreProcessors(blameLine);
|
handler.callPreProcessors(blameLine);
|
||||||
handler.callPreProcessorFactories(blameLine);
|
handler.callPreProcessorFactories(blameLine);
|
||||||
@@ -154,8 +154,8 @@ public class PreProcessorUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
PreProcessorHandler<BlameLine> handler =
|
PreProcessorHandler<BlameLine> handler =
|
||||||
new PreProcessorHandler<BlameLine>(blameLinePreProcessorFactorySet,
|
new PreProcessorHandler<>(blameLinePreProcessorFactorySet,
|
||||||
blameLinePreProcessorSet, repository);
|
blameLinePreProcessorSet, repository);
|
||||||
|
|
||||||
handler.callPreProcessors(blameResult.getBlameLines());
|
handler.callPreProcessors(blameResult.getBlameLines());
|
||||||
handler.callPreProcessorFactories(blameResult.getBlameLines());
|
handler.callPreProcessorFactories(blameResult.getBlameLines());
|
||||||
@@ -198,8 +198,8 @@ public class PreProcessorUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
PreProcessorHandler<Changeset> handler =
|
PreProcessorHandler<Changeset> handler =
|
||||||
new PreProcessorHandler<Changeset>(changesetPreProcessorFactorySet,
|
new PreProcessorHandler<>(changesetPreProcessorFactorySet,
|
||||||
changesetPreProcessorSet, repository);
|
changesetPreProcessorSet, repository);
|
||||||
|
|
||||||
handler.callPreProcessors(changeset);
|
handler.callPreProcessors(changeset);
|
||||||
handler.callPreProcessorFactories(changeset);
|
handler.callPreProcessorFactories(changeset);
|
||||||
@@ -242,8 +242,8 @@ public class PreProcessorUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
PreProcessorHandler<FileObject> handler =
|
PreProcessorHandler<FileObject> handler =
|
||||||
new PreProcessorHandler<FileObject>(fileObjectPreProcessorFactorySet,
|
new PreProcessorHandler<>(fileObjectPreProcessorFactorySet,
|
||||||
fileObjectPreProcessorSet, repository);
|
fileObjectPreProcessorSet, repository);
|
||||||
|
|
||||||
handler.callPreProcessors(result);
|
handler.callPreProcessors(result);
|
||||||
handler.callPreProcessorFactories(result);
|
handler.callPreProcessorFactories(result);
|
||||||
@@ -274,8 +274,8 @@ public class PreProcessorUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
PreProcessorHandler<Changeset> handler =
|
PreProcessorHandler<Changeset> handler =
|
||||||
new PreProcessorHandler<Changeset>(changesetPreProcessorFactorySet,
|
new PreProcessorHandler<>(changesetPreProcessorFactorySet,
|
||||||
changesetPreProcessorSet, repository);
|
changesetPreProcessorSet, repository);
|
||||||
|
|
||||||
handler.callPreProcessors(result);
|
handler.callPreProcessors(result);
|
||||||
handler.callPreProcessorFactories(result);
|
handler.callPreProcessorFactories(result);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public final class RepositoryUtil
|
|||||||
public static List<File> searchRepositoryDirectories(File directory,
|
public static List<File> searchRepositoryDirectories(File directory,
|
||||||
String... names)
|
String... names)
|
||||||
{
|
{
|
||||||
List<File> repositories = new ArrayList<File>();
|
List<File> repositories = new ArrayList<>();
|
||||||
|
|
||||||
searchRepositoryDirectories(repositories, directory, Arrays.asList(names));
|
searchRepositoryDirectories(repositories, directory, Arrays.asList(names));
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ public final class RepositoryUtil
|
|||||||
String... directoryNames)
|
String... directoryNames)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
List<String> repositories = new ArrayList<String>();
|
List<String> repositories = new ArrayList<>();
|
||||||
List<File> repositoryFiles = searchRepositoryDirectories(baseDirectory,
|
List<File> repositoryFiles = searchRepositoryDirectories(baseDirectory,
|
||||||
directoryNames);
|
directoryNames);
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public final class SearchUtil
|
|||||||
public static <T> Collection<T> search(SearchRequest searchRequest,
|
public static <T> Collection<T> search(SearchRequest searchRequest,
|
||||||
Collection<T> collection, TransformFilter<T> filter)
|
Collection<T> collection, TransformFilter<T> filter)
|
||||||
{
|
{
|
||||||
List<T> items = new ArrayList<T>();
|
List<T> items = new ArrayList<>();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ public final class IOUtil
|
|||||||
public static List<String> searchAll(String[] path, String cmd,
|
public static List<String> searchAll(String[] path, String cmd,
|
||||||
String checkParameter)
|
String checkParameter)
|
||||||
{
|
{
|
||||||
List<String> cmds = new ArrayList<String>();
|
List<String> cmds = new ArrayList<>();
|
||||||
|
|
||||||
if (isCommandAvailable(cmd, checkParameter))
|
if (isCommandAvailable(cmd, checkParameter))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public final class LinkTextParser
|
|||||||
public static String parseText(String content)
|
public static String parseText(String content)
|
||||||
{
|
{
|
||||||
Matcher m = REGEX_URL.matcher(content);
|
Matcher m = REGEX_URL.matcher(content);
|
||||||
List<Token> tokens = new ArrayList<Token>();
|
List<Token> tokens = new ArrayList<>();
|
||||||
int position = 0;
|
int position = 0;
|
||||||
String tokenContent = null;
|
String tokenContent = null;
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public final class ServiceUtil
|
|||||||
*/
|
*/
|
||||||
public static <T> List<T> getServices(Class<T> type)
|
public static <T> List<T> getServices(Class<T> type)
|
||||||
{
|
{
|
||||||
List<T> result = new ArrayList<T>();
|
List<T> result = new ArrayList<>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -262,8 +262,8 @@ public final class Util
|
|||||||
Comparator<T> comparator, CollectionAppender<T> appender, int start,
|
Comparator<T> comparator, CollectionAppender<T> appender, int start,
|
||||||
int limit)
|
int limit)
|
||||||
{
|
{
|
||||||
List<T> result = new ArrayList<T>();
|
List<T> result = new ArrayList<>();
|
||||||
List<T> valueList = new ArrayList<T>(values);
|
List<T> valueList = new ArrayList<>(values);
|
||||||
|
|
||||||
if (comparator != null)
|
if (comparator != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class EnvList
|
|||||||
*/
|
*/
|
||||||
public EnvList()
|
public EnvList()
|
||||||
{
|
{
|
||||||
envMap = new HashMap<String, String>();
|
envMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +77,7 @@ public class EnvList
|
|||||||
*/
|
*/
|
||||||
public EnvList(EnvList l)
|
public EnvList(EnvList l)
|
||||||
{
|
{
|
||||||
envMap = new HashMap<String, String>(l.envMap);
|
envMap = new HashMap<>(l.envMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
@@ -470,13 +470,13 @@ public class BufferedHttpServletResponse extends HttpServletResponseWrapper
|
|||||||
private ByteArrayPrintWriter pw = null;
|
private ByteArrayPrintWriter pw = null;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private Set<Cookie> cookies = new HashSet<Cookie>();
|
private Set<Cookie> cookies = new HashSet<>();
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private int statusCode = HttpServletResponse.SC_OK;
|
private int statusCode = HttpServletResponse.SC_OK;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private Map<String, String> headers = new LinkedHashMap<String, String>();
|
private Map<String, String> headers = new LinkedHashMap<>();
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private String statusMessage;
|
private String statusMessage;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class XmlMapStringAdapter
|
|||||||
public Map<String, String> unmarshal(XmlMapStringElement[] elements)
|
public Map<String, String> unmarshal(XmlMapStringElement[] elements)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
Map<String, String> map = new HashMap<String, String>();
|
Map<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
if (elements != null)
|
if (elements != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class XmlSetStringAdapter extends XmlAdapter<String, Set<String>>
|
|||||||
@Override
|
@Override
|
||||||
public Set<String> unmarshal(String rawString) throws Exception
|
public Set<String> unmarshal(String rawString) throws Exception
|
||||||
{
|
{
|
||||||
Set<String> tokens = new HashSet<String>();
|
Set<String> tokens = new HashSet<>();
|
||||||
|
|
||||||
for (String token : rawString.split(","))
|
for (String token : rawString.split(","))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class IterableQueueTest
|
|||||||
@Test(expected = IllegalStateException.class)
|
@Test(expected = IllegalStateException.class)
|
||||||
public void testDuplicatedEndReached()
|
public void testDuplicatedEndReached()
|
||||||
{
|
{
|
||||||
IterableQueue<String> queue = new IterableQueue<String>();
|
IterableQueue<String> queue = new IterableQueue<>();
|
||||||
|
|
||||||
queue.endReached();
|
queue.endReached();
|
||||||
queue.endReached();
|
queue.endReached();
|
||||||
@@ -76,7 +76,7 @@ public class IterableQueueTest
|
|||||||
@Test
|
@Test
|
||||||
public void testIterator()
|
public void testIterator()
|
||||||
{
|
{
|
||||||
IterableQueue<String> queue = new IterableQueue<String>();
|
IterableQueue<String> queue = new IterableQueue<>();
|
||||||
|
|
||||||
assertEquals(QueueIterator.class, queue.iterator().getClass());
|
assertEquals(QueueIterator.class, queue.iterator().getClass());
|
||||||
queue.endReached();
|
queue.endReached();
|
||||||
@@ -120,7 +120,7 @@ public class IterableQueueTest
|
|||||||
@Test(expected = IllegalStateException.class)
|
@Test(expected = IllegalStateException.class)
|
||||||
public void testPushEndReached()
|
public void testPushEndReached()
|
||||||
{
|
{
|
||||||
IterableQueue<String> queue = new IterableQueue<String>();
|
IterableQueue<String> queue = new IterableQueue<>();
|
||||||
|
|
||||||
queue.push("a");
|
queue.push("a");
|
||||||
queue.endReached();
|
queue.endReached();
|
||||||
@@ -134,7 +134,7 @@ public class IterableQueueTest
|
|||||||
@Test
|
@Test
|
||||||
public void testSingleConsumer()
|
public void testSingleConsumer()
|
||||||
{
|
{
|
||||||
final IterableQueue<Integer> queue = new IterableQueue<Integer>();
|
final IterableQueue<Integer> queue = new IterableQueue<>();
|
||||||
|
|
||||||
new Thread(new IntegerProducer(queue, false, 100)).start();
|
new Thread(new IntegerProducer(queue, false, 100)).start();
|
||||||
assertResult(Lists.newArrayList(queue), 100);
|
assertResult(Lists.newArrayList(queue), 100);
|
||||||
@@ -176,12 +176,12 @@ public class IterableQueueTest
|
|||||||
ExecutorService executor = Executors.newFixedThreadPool(threads);
|
ExecutorService executor = Executors.newFixedThreadPool(threads);
|
||||||
List<Future<List<Integer>>> futures = Lists.newArrayList();
|
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++)
|
for (int i = 0; i < consumer; i++)
|
||||||
{
|
{
|
||||||
Future<List<Integer>> future =
|
Future<List<Integer>> future =
|
||||||
executor.submit(new CallableQueueCollector<Integer>(queue));
|
executor.submit(new CallableQueueCollector<>(queue));
|
||||||
|
|
||||||
futures.add(future);
|
futures.add(future);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class TemplateEngineFactoryTest
|
|||||||
assertTrue(engines.contains(engine1));
|
assertTrue(engines.contains(engine1));
|
||||||
assertTrue(engines.contains(engine2));
|
assertTrue(engines.contains(engine2));
|
||||||
|
|
||||||
Set<TemplateEngine> ce = new HashSet<TemplateEngine>();
|
Set<TemplateEngine> ce = new HashSet<>();
|
||||||
|
|
||||||
ce.add(engine1);
|
ce.add(engine1);
|
||||||
factory = new TemplateEngineFactory(ce, engine2);
|
factory = new TemplateEngineFactory(ce, engine2);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class WUIModelUrlProviderTest extends ModelUrlProviderTestBase
|
|||||||
*/
|
*/
|
||||||
public WUIModelUrlProviderTest()
|
public WUIModelUrlProviderTest()
|
||||||
{
|
{
|
||||||
modelMap = new HashMap<String, String>();
|
modelMap = new HashMap<>();
|
||||||
modelMap.put(MODEL_REPOSITORY, "repositoryPanel");
|
modelMap.put(MODEL_REPOSITORY, "repositoryPanel");
|
||||||
modelMap.put(MODEL_USERS, "userPanel");
|
modelMap.put(MODEL_USERS, "userPanel");
|
||||||
modelMap.put(MODEL_GROUPS, "groupPanel");
|
modelMap.put(MODEL_GROUPS, "groupPanel");
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ public class XmlGroupDatabase implements XmlDatabase<Group>
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
@XmlJavaTypeAdapter(XmlGroupMapAdapter.class)
|
@XmlJavaTypeAdapter(XmlGroupMapAdapter.class)
|
||||||
@XmlElement(name = "groups")
|
@XmlElement(name = "groups")
|
||||||
private Map<String, Group> groupMap = new LinkedHashMap<String, Group>();
|
private Map<String, Group> groupMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private Long lastModified;
|
private Long lastModified;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class XmlGroupList implements Iterable<Group>
|
|||||||
*/
|
*/
|
||||||
public XmlGroupList(Map<String, Group> groupMap)
|
public XmlGroupList(Map<String, Group> groupMap)
|
||||||
{
|
{
|
||||||
this.groups = new LinkedList<Group>(groupMap.values());
|
this.groups = new LinkedList<>(groupMap.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class XmlGroupMapAdapter
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, Group> unmarshal(XmlGroupList groups) throws Exception
|
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)
|
for (Group group : groups)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -298,6 +298,5 @@ public class XmlRepositoryDatabase implements XmlDatabase<Repository>
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
@XmlJavaTypeAdapter(XmlRepositoryMapAdapter.class)
|
@XmlJavaTypeAdapter(XmlRepositoryMapAdapter.class)
|
||||||
@XmlElement(name = "repositories")
|
@XmlElement(name = "repositories")
|
||||||
private Map<String, Repository> repositoryMap = new LinkedHashMap<String,
|
private Map<String, Repository> repositoryMap = new LinkedHashMap<>();
|
||||||
Repository>();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class XmlRepositoryList implements Iterable<Repository>
|
|||||||
*/
|
*/
|
||||||
public XmlRepositoryList(Map<String, Repository> repositoryMap)
|
public XmlRepositoryList(Map<String, Repository> repositoryMap)
|
||||||
{
|
{
|
||||||
this.repositories = new LinkedList<Repository>(repositoryMap.values());
|
this.repositories = new LinkedList<>(repositoryMap.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ public class XmlRepositoryMapAdapter
|
|||||||
public Map<String, Repository> unmarshal(XmlRepositoryList repositories)
|
public Map<String, Repository> unmarshal(XmlRepositoryList repositories)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
Map<String, Repository> repositoryMap = new LinkedHashMap<String,
|
Map<String, Repository> repositoryMap = new LinkedHashMap<>();
|
||||||
Repository>();
|
|
||||||
|
|
||||||
for (Repository repository : repositories)
|
for (Repository repository : repositories)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -436,8 +436,8 @@ public class JAXBConfigurationEntryStore<V> implements ConfigurationEntryStore<V
|
|||||||
writer.writeEndElement();
|
writer.writeEndElement();
|
||||||
|
|
||||||
// value
|
// value
|
||||||
JAXBElement<V> je = new JAXBElement<V>(QName.valueOf(TAG_VALUE), type,
|
JAXBElement<V> je = new JAXBElement<>(QName.valueOf(TAG_VALUE), type,
|
||||||
e.getValue());
|
e.getValue());
|
||||||
|
|
||||||
m.marshal(je, writer);
|
m.marshal(je, writer);
|
||||||
|
|
||||||
|
|||||||
@@ -102,9 +102,9 @@ public class JAXBConfigurationEntryStoreFactory
|
|||||||
type, name);
|
type, name);
|
||||||
|
|
||||||
//J-
|
//J-
|
||||||
return new JAXBConfigurationEntryStore<T>(
|
return new JAXBConfigurationEntryStore<>(
|
||||||
new File(directory,name.concat(StoreConstants.FILE_EXTENSION)),
|
new File(directory, name.concat(StoreConstants.FILE_EXTENSION)),
|
||||||
keyGenerator,
|
keyGenerator,
|
||||||
type
|
type
|
||||||
);
|
);
|
||||||
//J+
|
//J+
|
||||||
|
|||||||
@@ -202,5 +202,5 @@ public class XmlUserDatabase implements XmlDatabase<User>
|
|||||||
/** Field description */
|
/** Field description */
|
||||||
@XmlJavaTypeAdapter(XmlUserMapAdapter.class)
|
@XmlJavaTypeAdapter(XmlUserMapAdapter.class)
|
||||||
@XmlElement(name = "users")
|
@XmlElement(name = "users")
|
||||||
private Map<String, User> userMap = new LinkedHashMap<String, User>();
|
private Map<String, User> userMap = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class XmlUserList implements Iterable<User>
|
|||||||
*/
|
*/
|
||||||
public XmlUserList(Map<String, User> userMap)
|
public XmlUserList(Map<String, User> userMap)
|
||||||
{
|
{
|
||||||
this.users = new LinkedList<User>(userMap.values());
|
this.users = new LinkedList<>(userMap.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class XmlUserMapAdapter
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, User> unmarshal(XmlUserList users) throws Exception
|
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)
|
for (User user : users)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ public class GitChangesetConverter implements Closeable
|
|||||||
|
|
||||||
if (Util.isNotEmpty(parents))
|
if (Util.isNotEmpty(parents))
|
||||||
{
|
{
|
||||||
parentList = new ArrayList<String>();
|
parentList = new ArrayList<>();
|
||||||
|
|
||||||
for (RevCommit parent : parents)
|
for (RevCommit parent : parents)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,8 +71,7 @@ public final class GitSubModuleParser
|
|||||||
*/
|
*/
|
||||||
public static Map<String, SubRepository> parse(String content)
|
public static Map<String, SubRepository> parse(String content)
|
||||||
{
|
{
|
||||||
Map<String, SubRepository> subRepositories = new HashMap<String,
|
Map<String, SubRepository> subRepositories = new HashMap<>();
|
||||||
SubRepository>();
|
|
||||||
Scanner scanner = new Scanner(content);
|
Scanner scanner = new Scanner(content);
|
||||||
SubRepository repository = null;
|
SubRepository repository = null;
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class GitBlameCommand extends AbstractGitCommand implements BlameCommand
|
|||||||
request.getPath()));
|
request.getPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BlameLine> blameLines = new ArrayList<BlameLine>();
|
List<BlameLine> blameLines = new ArrayList<>();
|
||||||
int total = gitBlameResult.getResultContents().size();
|
int total = gitBlameResult.getResultContents().size();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public class HgPackageReader
|
|||||||
*/
|
*/
|
||||||
private void filterPackage(HgPackages packages)
|
private void filterPackage(HgPackages packages)
|
||||||
{
|
{
|
||||||
List<HgPackage> pkgList = new ArrayList<HgPackage>();
|
List<HgPackage> pkgList = new ArrayList<>();
|
||||||
|
|
||||||
for (HgPackage pkg : packages)
|
for (HgPackage pkg : packages)
|
||||||
{
|
{
|
||||||
@@ -228,7 +228,7 @@ public class HgPackageReader
|
|||||||
if (packages == null)
|
if (packages == null)
|
||||||
{
|
{
|
||||||
packages = new HgPackages();
|
packages = new HgPackages();
|
||||||
packages.setPackages(new ArrayList<HgPackage>());
|
packages.setPackages(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
return packages;
|
return packages;
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public class WindowsHgInstaller extends AbstractHgInstaller
|
|||||||
*/
|
*/
|
||||||
private List<String> getInstallations(String[] registryKeys)
|
private List<String> getInstallations(String[] registryKeys)
|
||||||
{
|
{
|
||||||
List<String> installations = new ArrayList<String>();
|
List<String> installations = new ArrayList<>();
|
||||||
|
|
||||||
for (String registryKey : registryKeys)
|
for (String registryKey : registryKeys)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public class AbstractHgHandler
|
|||||||
*/
|
*/
|
||||||
protected Process createHgProcess(String... args) throws IOException
|
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
|
throws IOException, RepositoryException
|
||||||
{
|
{
|
||||||
return getResultFromScript(resultType, script,
|
return getResultFromScript(resultType, script,
|
||||||
new HashMap<String, String>());
|
new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,7 +315,7 @@ public class AbstractHgHandler
|
|||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
HgConfig config = handler.getConfig();
|
HgConfig config = handler.getConfig();
|
||||||
List<String> cmdList = new ArrayList<String>();
|
List<String> cmdList = new ArrayList<>();
|
||||||
|
|
||||||
cmdList.add(cmd);
|
cmdList.add(cmd);
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class HgLogCommand extends AbstractCommand implements LogCommand
|
|||||||
{
|
{
|
||||||
|
|
||||||
// empty repository
|
// empty repository
|
||||||
result = new ChangesetPagingResult(0, new ArrayList<Changeset>());
|
result = new ChangesetPagingResult(0, new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public abstract class UserManagerTestBase
|
|||||||
throws UserException, IOException, InterruptedException
|
throws UserException, IOException, InterruptedException
|
||||||
{
|
{
|
||||||
int initialSize = manager.getAll().size();
|
int initialSize = manager.getAll().size();
|
||||||
List<MultiThreadTester> testers = new ArrayList<MultiThreadTester>();
|
List<MultiThreadTester> testers = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < THREAD_COUNT; i++)
|
for (int i = 0; i < THREAD_COUNT; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class UriExtensionsConfig extends PackagesResourceConfig
|
|||||||
{
|
{
|
||||||
if (mediaTypeMap == null)
|
if (mediaTypeMap == null)
|
||||||
{
|
{
|
||||||
mediaTypeMap = new HashMap<String, MediaType>();
|
mediaTypeMap = new HashMap<>();
|
||||||
mediaTypeMap.put(EXTENSION_JSON, MediaType.APPLICATION_JSON_TYPE);
|
mediaTypeMap.put(EXTENSION_JSON, MediaType.APPLICATION_JSON_TYPE);
|
||||||
mediaTypeMap.put(EXTENSION_XML, MediaType.APPLICATION_XML_TYPE);
|
mediaTypeMap.put(EXTENSION_XML, MediaType.APPLICATION_XML_TYPE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ public class RepositoryImportResource
|
|||||||
{
|
{
|
||||||
SecurityUtils.getSubject().checkRole(Role.ADMIN);
|
SecurityUtils.getSubject().checkRole(Role.ADMIN);
|
||||||
|
|
||||||
List<Repository> repositories = new ArrayList<Repository>();
|
List<Repository> repositories = new ArrayList<>();
|
||||||
|
|
||||||
importFromDirectory(repositories, type);
|
importFromDirectory(repositories, type);
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ public class RepositoryImportResource
|
|||||||
|
|
||||||
logger.info("start directory import for all supported repository types");
|
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())
|
for (Type t : findImportableTypes())
|
||||||
{
|
{
|
||||||
@@ -628,7 +628,7 @@ public class RepositoryImportResource
|
|||||||
*/
|
*/
|
||||||
private List<Type> findImportableTypes()
|
private List<Type> findImportableTypes()
|
||||||
{
|
{
|
||||||
List<Type> types = new ArrayList<Type>();
|
List<Type> types = new ArrayList<>();
|
||||||
Collection<Type> handlerTypes = manager.getTypes();
|
Collection<Type> handlerTypes = manager.getTypes();
|
||||||
|
|
||||||
for (Type t : handlerTypes)
|
for (Type t : handlerTypes)
|
||||||
|
|||||||
@@ -1028,7 +1028,7 @@ public class RepositoryResource extends AbstractManagerResource<Repository, Repo
|
|||||||
{
|
{
|
||||||
if (repository.getPermissions() == null)
|
if (repository.getPermissions() == null)
|
||||||
{
|
{
|
||||||
repository.setPermissions(new ArrayList<Permission>());
|
repository.setPermissions(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ public class SearchResource
|
|||||||
// create user searchhandler
|
// create user searchhandler
|
||||||
Cache<String, SearchResults> userCache = cacheManager.getCache(CACHE_USER);
|
Cache<String, SearchResults> userCache = cacheManager.getCache(CACHE_USER);
|
||||||
|
|
||||||
this.userSearchHandler = new SearchHandler<User>(userCache, userManager);
|
this.userSearchHandler = new SearchHandler<>(userCache, userManager);
|
||||||
|
|
||||||
// create group searchhandler
|
// create group searchhandler
|
||||||
Cache<String, SearchResults> groupCache =
|
Cache<String, SearchResults> groupCache =
|
||||||
cacheManager.getCache(CACHE_GROUP);
|
cacheManager.getCache(CACHE_GROUP);
|
||||||
|
|
||||||
this.groupSearchHandler = new SearchHandler<Group>(groupCache,
|
this.groupSearchHandler = new SearchHandler<>(groupCache,
|
||||||
groupManager);
|
groupManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class GuavaCacheManager
|
|||||||
logger.debug(
|
logger.debug(
|
||||||
"cache {} does not exists, creating a new instance from default configuration: {}",
|
"cache {} does not exists, creating a new instance from default configuration: {}",
|
||||||
name, defaultConfiguration);
|
name, defaultConfiguration);
|
||||||
cache = new GuavaCache<K, V>(defaultConfiguration, name);
|
cache = new GuavaCache<>(defaultConfiguration, name);
|
||||||
cacheMap.put(name, cache);
|
cacheMap.put(name, cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class MultiParentClassLoader extends ClassLoader
|
|||||||
public MultiParentClassLoader(Collection<? extends ClassLoader> parents)
|
public MultiParentClassLoader(Collection<? extends ClassLoader> parents)
|
||||||
{
|
{
|
||||||
super(null);
|
super(null);
|
||||||
this.parents = new CopyOnWriteArrayList<ClassLoader>(parents);
|
this.parents = new CopyOnWriteArrayList<>(parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public final class UberClassLoader extends ClassLoader
|
|||||||
|
|
||||||
if (clazz != null)
|
if (clazz != null)
|
||||||
{
|
{
|
||||||
cache.put(name, new WeakReference<Class<?>>(clazz));
|
cache.put(name, new WeakReference<>(clazz));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class ErrorServlet extends HttpServlet
|
|||||||
{
|
{
|
||||||
writer = response.getWriter();
|
writer = response.getWriter();
|
||||||
|
|
||||||
Map<String, Object> env = new HashMap<String, Object>();
|
Map<String, Object> env = new HashMap<>();
|
||||||
String error = Util.EMPTY_STRING;
|
String error = Util.EMPTY_STRING;
|
||||||
|
|
||||||
if (context.getStartupError() != null)
|
if (context.getStartupError() != null)
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class TemplateServlet extends HttpServlet
|
|||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException
|
throws ServletException, IOException
|
||||||
{
|
{
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
String contextPath = request.getContextPath();
|
String contextPath = request.getContextPath();
|
||||||
|
|
||||||
params.put("contextPath", contextPath);
|
params.put("contextPath", contextPath);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class GetRepositoriesITCase extends AbstractAdminITCaseBase
|
|||||||
@Parameters
|
@Parameters
|
||||||
public static Collection<String[]> createParameters()
|
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[] { "git" });
|
||||||
params.add(new String[] { "svn" });
|
params.add(new String[] { "svn" });
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
group.setName("group-a");
|
group.setName("group-a");
|
||||||
group.setDescription("group a");
|
group.setDescription("group a");
|
||||||
|
|
||||||
List<String> members = new ArrayList<String>();
|
List<String> members = new ArrayList<>();
|
||||||
|
|
||||||
members.add("slarti");
|
members.add("slarti");
|
||||||
members.add("marvin");
|
members.add("marvin");
|
||||||
@@ -110,7 +110,7 @@ public class GroupITCase extends AbstractAdminITCaseBase
|
|||||||
group.setName("group-b");
|
group.setName("group-b");
|
||||||
group.setDescription("group b");
|
group.setDescription("group b");
|
||||||
|
|
||||||
List<String> members = new ArrayList<String>();
|
List<String> members = new ArrayList<>();
|
||||||
|
|
||||||
members.add("slarti");
|
members.add("slarti");
|
||||||
members.add("dent");
|
members.add("dent");
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class RepositoryTypeITCaseBase
|
|||||||
@Parameters
|
@Parameters
|
||||||
public static Collection<String[]> createParameters()
|
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[] { "git" });
|
||||||
params.add(new String[] { "svn" });
|
params.add(new String[] { "svn" });
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ public class DefaultAdvancedHttpClientTest
|
|||||||
public void setUp()
|
public void setUp()
|
||||||
{
|
{
|
||||||
configuration = new ScmConfiguration();
|
configuration = new ScmConfiguration();
|
||||||
transformers = new HashSet<ContentTransformer>();
|
transformers = new HashSet<>();
|
||||||
client = new TestingAdvacedHttpClient(configuration, transformers);
|
client = new TestingAdvacedHttpClient(configuration, transformers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class DefaultUberWebResourceLoaderTest extends WebResourceLoaderTestBase
|
|||||||
|
|
||||||
DefaultUberWebResourceLoader resourceLoader =
|
DefaultUberWebResourceLoader resourceLoader =
|
||||||
new DefaultUberWebResourceLoader(servletContext,
|
new DefaultUberWebResourceLoader(servletContext,
|
||||||
new ArrayList<PluginWrapper>());
|
new ArrayList<>());
|
||||||
|
|
||||||
resourceLoader.getCache().put("/myresource", GITHUB);
|
resourceLoader.getCache().put("/myresource", GITHUB);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ public class DefaultUberWebResourceLoaderTest extends WebResourceLoaderTestBase
|
|||||||
|
|
||||||
WebResourceLoader resourceLoader =
|
WebResourceLoader resourceLoader =
|
||||||
new DefaultUberWebResourceLoader(servletContext,
|
new DefaultUberWebResourceLoader(servletContext,
|
||||||
new ArrayList<PluginWrapper>());
|
new ArrayList<>());
|
||||||
URL resource = resourceLoader.getResource("/myresource");
|
URL resource = resourceLoader.getResource("/myresource");
|
||||||
|
|
||||||
assertSame(SCM_MANAGER, resource);
|
assertSame(SCM_MANAGER, resource);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class PluginTreeTest
|
|||||||
public void testPluginConditionFailed() throws IOException
|
public void testPluginConditionFailed() throws IOException
|
||||||
{
|
{
|
||||||
PluginCondition condition = new PluginCondition("999",
|
PluginCondition condition = new PluginCondition("999",
|
||||||
new ArrayList<String>(), "hit");
|
new ArrayList<>(), "hit");
|
||||||
Plugin plugin = new Plugin(2, createInfo("a", "b", "1"), null, condition,
|
Plugin plugin = new Plugin(2, createInfo("a", "b", "1"), null, condition,
|
||||||
false, null);
|
false, null);
|
||||||
ExplodedSmp smp = createSmp(plugin);
|
ExplodedSmp smp = createSmp(plugin);
|
||||||
|
|||||||
Reference in New Issue
Block a user