Avoid casts with generic type args

This commit is contained in:
Lignum 2017-05-04 23:00:02 +02:00
parent 994dcd9f58
commit 30d191df0b
No known key found for this signature in database
GPG Key ID: E4DE8F54CA0912BA
1 changed files with 5 additions and 5 deletions

View File

@ -651,7 +651,7 @@ private synchronized void copyRecursive( String sourcePath, MountWrapper sourceM
}
}
private synchronized IMountedFile openFile( IMountedFile file, Closeable handle ) throws FileSystemException
private synchronized <T extends IMountedFile> T openFile(T file, Closeable handle) throws FileSystemException
{
synchronized( m_openFiles )
{
@ -729,7 +729,7 @@ public void flush() throws IOException
throw new UnsupportedOperationException();
}
};
return (IMountedFileNormal) openFile( file, reader );
return openFile( file, reader );
}
return null;
}
@ -781,7 +781,7 @@ public void flush() throws IOException
writer.flush();
}
};
return (IMountedFileNormal) openFile( file, writer );
return openFile( file, writer );
}
return null;
}
@ -819,7 +819,7 @@ public void flush() throws IOException
throw new UnsupportedOperationException();
}
};
return (IMountedFileBinary) openFile( file, stream );
return openFile( file, stream );
}
return null;
}
@ -857,7 +857,7 @@ public void flush() throws IOException
stream.flush();
}
};
return (IMountedFileBinary) openFile( file, stream );
return openFile( file, stream );
}
return null;
}