mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-24 01:09:48 +01:00
fix/suppress compiler warnings
This commit is contained in:
@@ -116,6 +116,7 @@ public final class I18nMessages
|
||||
*
|
||||
* @return instance of message class
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public synchronized static <T> T get(Class<T> msgClass, Locale locale)
|
||||
{
|
||||
CacheKey ck = new CacheKey(locale, msgClass);
|
||||
|
||||
@@ -35,11 +35,6 @@ package sonia.scm.repository;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.HandlerEventType;
|
||||
import sonia.scm.event.ScmEventBus;
|
||||
import sonia.scm.util.AssertUtil;
|
||||
@@ -54,12 +49,6 @@ import sonia.scm.util.AssertUtil;
|
||||
public abstract class AbstractRepositoryManager implements RepositoryManager
|
||||
{
|
||||
|
||||
/** the logger for AbstractRepositoryManager */
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(AbstractRepositoryManager.class);
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Sends a {@link RepositoryHookEvent} to each registered
|
||||
* {@link RepositoryHook} and sends the {@link RepositoryHookEvent} to
|
||||
|
||||
@@ -59,6 +59,7 @@ public class ScmModuleTest
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testUnmarshall()
|
||||
{
|
||||
URL resource = Resources.getResource("sonia/scm/plugin/module.xml");
|
||||
|
||||
@@ -75,10 +75,11 @@ public final class ClassLoaders
|
||||
* @throws DependencyResolutionRequiredException
|
||||
* @throws MalformedURLException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static ClassLoader createRuntimeClassLoader(MavenProject project)
|
||||
throws DependencyResolutionRequiredException, MalformedURLException
|
||||
{
|
||||
Set<URL> urls = new HashSet<URL>();
|
||||
Set<URL> urls = new HashSet<>();
|
||||
|
||||
append(urls, project.getRuntimeClasspathElements());
|
||||
append(urls, project.getCompileClasspathElements());
|
||||
|
||||
@@ -59,6 +59,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class SvnBlameHandler implements ISVNAnnotateHandler
|
||||
{
|
||||
|
||||
@@ -230,7 +231,7 @@ public class SvnBlameHandler implements ISVNAnnotateHandler
|
||||
private final List<BlameLine> blameLines;
|
||||
|
||||
/** Field description */
|
||||
private final Map<Long, String> descriptionCache = new HashMap<Long, String>();
|
||||
private final Map<Long, String> descriptionCache = new HashMap<>();
|
||||
|
||||
/** Field description */
|
||||
private final String path;
|
||||
|
||||
@@ -270,6 +270,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
|
||||
*
|
||||
* @throws SVNException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private ChangesetPagingResult getChangesets(SVNRepository repo,
|
||||
long startRevision, long endRevision, int start, int limit, String[] path)
|
||||
throws SVNException
|
||||
|
||||
@@ -48,6 +48,7 @@ import java.util.Map;
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.17
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class MapCacheManager
|
||||
implements CacheManager, org.apache.shiro.cache.CacheManager
|
||||
{
|
||||
@@ -94,6 +95,5 @@ public class MapCacheManager
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
@SuppressWarnings("unchecked")
|
||||
private final Map<String, MapCache> cacheMap = Maps.newHashMap();
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.tmatesoft.svn.core.internal.util.SVNURLUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -93,7 +94,7 @@ public class SvnRepositoryClient extends AbstractRepositoryClient
|
||||
client = SVNClientManager.newInstance(options);
|
||||
}
|
||||
|
||||
remoteRepositoryURL = SVNURL.parseURIDecoded(remoteRepository);
|
||||
remoteRepositoryURL = SVNURL.parseURIEncoded(remoteRepository);
|
||||
DAVRepositoryFactory.setup();
|
||||
}
|
||||
|
||||
|
||||
@@ -660,6 +660,7 @@ public abstract class AbstractManagerResource<T extends ModelObject,
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public int compare(Object o1, Object o2)
|
||||
{
|
||||
return super.compare(o1, o2) * -1;
|
||||
|
||||
@@ -258,6 +258,7 @@ public class DefaultPluginLoader implements PluginLoader
|
||||
* @throws IOException
|
||||
* @throws JAXBException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> Set<T> getInstalled(ClassLoader classLoader, JAXBContext context,
|
||||
String path)
|
||||
throws IOException, JAXBException
|
||||
|
||||
@@ -59,6 +59,7 @@ import javax.ws.rs.ext.Provider;
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public final class ExtensionBinder
|
||||
{
|
||||
|
||||
|
||||
@@ -34,8 +34,11 @@ package sonia.scm.cache;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.io.ByteSource;
|
||||
import com.google.common.io.CharSource;
|
||||
import com.google.common.io.Files;
|
||||
import com.google.common.io.Resources;
|
||||
|
||||
@@ -168,7 +171,8 @@ public class CacheConfigurationTestLoader implements CacheConfigurationLoader
|
||||
|
||||
URL manual = getResource(manualConfiguration);
|
||||
|
||||
Files.copy(Resources.newInputStreamSupplier(manual), file);
|
||||
ByteSource source = Resources.asByteSource(manual);
|
||||
source.copyTo(Files.asByteSink(file));
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
|
||||
@@ -72,6 +72,7 @@ public class MultiParentClassLoaderTest
|
||||
classLoader = new MultiParentClassLoader(parent1, parent2);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test(expected = ClassNotFoundException.class)
|
||||
public void testClassNotFoundException() throws ClassNotFoundException
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user