Avoid casts with generic type args
This commit is contained in:
parent
994dcd9f58
commit
30d191df0b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue