fix/suppress compiler warnings

This commit is contained in:
Sebastian Sdorra
2014-08-19 21:45:23 +02:00
parent babd1be9fc
commit a8d9d8b9b6
13 changed files with 19 additions and 16 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -59,6 +59,7 @@ public class ScmModuleTest
*
*/
@Test
@SuppressWarnings("unchecked")
public void testUnmarshall()
{
URL resource = Resources.getResource("sonia/scm/plugin/module.xml");

View File

@@ -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());

View File

@@ -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;

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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

View File

@@ -59,6 +59,7 @@ import javax.ws.rs.ext.Provider;
*
* @author Sebastian Sdorra
*/
@SuppressWarnings("unchecked")
public final class ExtensionBinder
{

View File

@@ -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)
{

View File

@@ -72,6 +72,7 @@ public class MultiParentClassLoaderTest
classLoader = new MultiParentClassLoader(parent1, parent2);
}
@SuppressWarnings("unchecked")
@Test(expected = ClassNotFoundException.class)
public void testClassNotFoundException() throws ClassNotFoundException
{