1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 16:47:56 +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

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