Skip to content

Commit 55b6146

Browse files
committed
Fix compilation issues.
These seem to be regularly deleted by IDEs running on different JDKs. If you see a warning, please find the correct syntax to silence it rather than deleting the cast.
1 parent 6a10ba5 commit 55b6146

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/chem/ZipChemCompProvider.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ private synchronized ChemComp getFromZip(String recordName) {
206206
final String filename = "chemcomp/" + recordName + ".cif.gz";
207207

208208
// try with resources block to read from the filesystem.
209-
try (FileSystem fs = FileSystems.newFileSystem(m_zipFile, null)) {
209+
// Don't remove the (ClassLoader) cast! It is required for openjdk 11.
210+
try (FileSystem fs = FileSystems.newFileSystem(m_zipFile, (ClassLoader)null)) {
210211
Path cif = fs.getPath(filename);
211212

212213
if (Files.exists(cif)) {
@@ -255,7 +256,8 @@ private synchronized boolean addToZipFileSystem(Path zipFile, File[] files, Path
255256
*/
256257

257258
// Copy in each file.
258-
try (FileSystem zipfs = FileSystems.newFileSystem(zipFile, null)) {
259+
// Don't remove the (ClassLoader) cast! It is required for openjdk 11.
260+
try (FileSystem zipfs = FileSystems.newFileSystem(zipFile, (ClassLoader)null)) {
259261
Files.createDirectories(pathWithinArchive);
260262
for (File f : files) {
261263
if (!f.isDirectory() && f.exists()) {

0 commit comments

Comments
 (0)