1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-27 21:23:20 +00:00

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

View File

@ -651,7 +651,7 @@ public class FileSystem
} }
} }
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 ) synchronized( m_openFiles )
{ {
@ -729,7 +729,7 @@ public class FileSystem
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
}; };
return (IMountedFileNormal) openFile( file, reader ); return openFile( file, reader );
} }
return null; return null;
} }
@ -781,7 +781,7 @@ public class FileSystem
writer.flush(); writer.flush();
} }
}; };
return (IMountedFileNormal) openFile( file, writer ); return openFile( file, writer );
} }
return null; return null;
} }
@ -819,7 +819,7 @@ public class FileSystem
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
}; };
return (IMountedFileBinary) openFile( file, stream ); return openFile( file, stream );
} }
return null; return null;
} }
@ -857,7 +857,7 @@ public class FileSystem
stream.flush(); stream.flush();
} }
}; };
return (IMountedFileBinary) openFile( file, stream ); return openFile( file, stream );
} }
return null; return null;
} }