Skip to content

Commit

Permalink
[RESTEASY-2669] Dealt with a few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
asoldano committed Sep 18, 2020
1 parent f0249f0 commit 97652cc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
Expand Up @@ -72,6 +72,7 @@ public InputStream getInputStream() throws IOException
InputStream bis = new ByteArrayInputStream(byteBuffer, byteBufferOffset, byteBufferLength);
if (tempFile == null)
return bis;
@SuppressWarnings("resource")
InputStream fis = new FileInputStream(tempFile);
return new SequenceInputStream(bis, fis);
}
Expand Down
Expand Up @@ -25,7 +25,7 @@
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "rawtypes"})
@Provider
@Produces("text/plain")
@Consumes("text/plain")
Expand Down
Expand Up @@ -11,6 +11,8 @@
*/
public class FileRangeException extends WebApplicationException
{
private static final long serialVersionUID = -5615796352743435769L;

public FileRangeException(final MediaType mediaType, final File file, final long begin, final long end)
{
super(Response.status(206).entity(new FileRange(file, begin, end)).type(mediaType).build());
Expand Down
Expand Up @@ -43,11 +43,11 @@ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotati
@Context
HttpRequest request;

@SuppressWarnings("unchecked")
@Override
public Form readFrom(Class<Form> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException
{
LogMessages.LOGGER.debugf("Provider : %s, Method : readFrom", getClass().getName());
@SuppressWarnings(value = "unchecked")
MultivaluedMap<String, String> map = null;
if (useContainerParams) {
boolean encoded = FindAnnotation.findAnnotation(annotations, Encoded.class) != null;
Expand Down
Expand Up @@ -89,17 +89,17 @@ public static void registerProviders(ResteasyProviderFactory factory) throws Exc
final String line = entry.getKey();
try
{
Class clazz;
Class<?> clazz;
if (System.getSecurityManager() == null)
{
clazz = Thread.currentThread().getContextClassLoader().loadClass(line);
}
else
{
clazz = AccessController.doPrivileged(new PrivilegedExceptionAction<Class>()
clazz = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>()
{
@Override
public Class run() throws ClassNotFoundException
public Class<?> run() throws ClassNotFoundException
{
return Thread.currentThread().getContextClassLoader().loadClass(line);
}
Expand Down
Expand Up @@ -88,7 +88,7 @@ public Builder comment(String comment)
return this;
}

public Builder data(Class type, Object data)
public Builder data(@SuppressWarnings("rawtypes") Class type, Object data)
{
if (type == null)
{
Expand All @@ -105,7 +105,7 @@ public Builder data(Class type, Object data)
return this;
}

public Builder data(GenericType type, Object data)
public Builder data(@SuppressWarnings("rawtypes") GenericType type, Object data)
{
if (type == null)
{
Expand Down

0 comments on commit 97652cc

Please sign in to comment.