diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java index 08df4ab5f178..edfe659e67a0 100644 --- a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -301,8 +301,7 @@ public class JavaSdkImpl extends JavaSdk { @Override public boolean isValidSdkHome(String path) { - return checkForJdk(new File(path)) && - (!JrtFileSystem.isModularJdk(path) || JrtFileSystem.isSupported()); + return checkForJdk(new File(path)); } @Override diff --git a/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtFileSystemImpl.java b/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtFileSystemImpl.java index 42d2b05f70e9..3a17077e8c16 100644 --- a/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtFileSystemImpl.java +++ b/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtFileSystemImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ public class JrtFileSystemImpl extends JrtFileSystem { String homePath = extractLocalPath(extractRootPath(entryFile.getPath())); ArchiveHandler handler = myHandlers.get(homePath); if (handler == null) { - handler = isSupported() ? new JrtHandler(homePath) : new JrtHandlerStub(homePath); + handler = new JrtHandler(homePath); myHandlers.put(homePath, handler); ApplicationManager.getApplication().invokeLater( () -> LocalFileSystem.getInstance().refreshAndFindFileByPath(homePath + "/release"), diff --git a/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java b/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java index dae6bdc222fb..33985e670373 100644 --- a/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java +++ b/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package com.intellij.openapi.vfs.impl.jrt; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.vfs.impl.ArchiveHandler; import com.intellij.reference.SoftReference; -import com.intellij.util.ArrayUtil; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NotNull; @@ -117,22 +116,4 @@ class JrtHandler extends ArchiveHandler { Path path = getFileSystem().getPath("/modules/" + relativePath); return Files.readAllBytes(path); } -} - -class JrtHandlerStub extends ArchiveHandler { - public JrtHandlerStub(@NotNull String path) { - super(path); - } - - @NotNull - @Override - protected Map createEntriesMap() { - return Collections.emptyMap(); - } - - @NotNull - @Override - public byte[] contentsToByteArray(@NotNull String relativePath) { - return ArrayUtil.EMPTY_BYTE_ARRAY; - } } \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/openapi/vfs/JrtFileSystemTest.java b/java/java-tests/testSrc/com/intellij/openapi/vfs/JrtFileSystemTest.java index 2c372a26870d..bc8392d9db8a 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/vfs/JrtFileSystemTest.java +++ b/java/java-tests/testSrc/com/intellij/openapi/vfs/JrtFileSystemTest.java @@ -16,24 +16,24 @@ package com.intellij.openapi.vfs; import com.intellij.JavaTestUtil; -import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.vfs.jrt.JrtFileSystem; import com.intellij.testFramework.fixtures.BareTestFixtureTestCase; import com.intellij.testFramework.rules.TempDirectory; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.file.*; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assume.assumeTrue; public class JrtFileSystemTest extends BareTestFixtureTestCase { @Rule public TempDirectory myTempDir = new TempDirectory(); @@ -42,11 +42,6 @@ public class JrtFileSystemTest extends BareTestFixtureTestCase { private Path myTempPath; private VirtualFile myRoot; - @BeforeClass - public static void setUpClass() { - assumeTrue("skipped: java=" + SystemInfo.JAVA_VERSION, JrtFileSystem.isSupported()); - } - @Before public void setUp() throws IOException { myTestData = Paths.get(JavaTestUtil.getJavaTestDataPath(), "jrt"); diff --git a/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java b/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java index d3916e602634..4a1e8d566c05 100644 --- a/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java +++ b/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ */ package com.intellij.openapi.vfs.jrt; -import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.vfs.StandardFileSystems; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.ArchiveFileSystem; @@ -29,12 +28,6 @@ public abstract class JrtFileSystem extends ArchiveFileSystem { public static final String PROTOCOL_PREFIX = StandardFileSystems.JRT_PROTOCOL_PREFIX; public static final String SEPARATOR = URLUtil.JAR_SEPARATOR; - private static final boolean SUPPORTED = SystemInfo.isJavaVersionAtLeast("1.8"); - - public static boolean isSupported() { - return SUPPORTED; - } - public static boolean isModularJdk(@NotNull String homePath) { return new File(homePath, "lib/jrt-fs.jar").isFile() || new File(homePath, "jrt-fs.jar").isFile(); }