Skip to content

Commit b0c49f9

Browse files
committed
Use Win32Handler native file-system handler by default on Windows
This is done in preparation for the removal of the JNI based native LocalFileHandler for Windows. This increases the number of users (and therefore testers) but still makes it easily possible to revert to the old implementation if regressions are found.
1 parent e26b036 commit b0c49f9

File tree

3 files changed

+6
-15
lines changed
  • resources

3 files changed

+6
-15
lines changed

resources/bundles/org.eclipse.core.filesystem/src/org/eclipse/core/internal/filesystem/local/LocalFileNativesManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
* <p>Dispatches methods backed by native code to the appropriate platform specific
2929
* implementation depending on a library provided by a fragment. Failing this it tries
3030
* to use Java 7 NIO/2 API's.</p>
31-
*
32-
* <p>Use of native libraries can be disabled by adding -Declipse.filesystem.useNatives=false
31+
*
32+
* <p>Use of native libraries can be disabled by adding -Declipse.filesystem.useNatives=false
3333
* to VM arguments.</p>
34-
*
34+
*
3535
* <p>Please notice that the native implementation is significantly faster than the non-native
36-
* one. The BenchFileStore test runs 3.1 times faster on Linux with the native code than
36+
* one. The BenchFileStore test runs 3.1 times faster on Linux with the native code than
3737
* without it.</p>
3838
*/
3939
public class LocalFileNativesManager {
40-
public static final boolean PROPERTY_USE_NATIVE_DEFAULT = true;
40+
public static final boolean PROPERTY_USE_NATIVE_DEFAULT = Platform.OS.isWindows() ? false : true;
4141
public static final String PROPERTY_USE_NATIVES = "eclipse.filesystem.useNatives"; //$NON-NLS-1$
4242
private static NativeHandler HANDLER;
4343

@@ -54,7 +54,7 @@ public static void reset() {
5454

5555
/**
5656
* Try to set the usage of natives to the provided value
57-
* @return <code>true</code> if natives are used as result of this call <code>false</code> otherwhise
57+
* @return <code>true</code> if natives are used as result of this call <code>false</code> otherwise
5858
*/
5959
public static boolean setUsingNative(boolean useNatives) {
6060
boolean nativesAreUsed;

resources/tests/org.eclipse.core.tests.filesystem.feature/feature.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
arch="x86_64"
2626
version="0.0.0"/>
2727

28-
<plugin
29-
id="org.eclipse.core.filesystem.win32.x86_64"
30-
os="win32"
31-
arch="x86_64"
32-
version="0.0.0"/>
33-
3428
<plugin
3529
id="org.eclipse.core.filesystem.macosx"
3630
os="macosx"

resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_530868.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace;
1717
import static org.eclipse.core.tests.resources.ResourceTestUtil.createTestMonitor;
1818
import static org.junit.Assert.assertNotEquals;
19-
import static org.junit.Assert.assertTrue;
2019
import static org.junit.Assume.assumeFalse;
2120

2221
import java.io.ByteArrayInputStream;
@@ -64,8 +63,6 @@ public void setUp() throws Exception {
6463
public void testMillisecondResolution() throws Exception {
6564
assumeFalse("not relevant on Mac, as it does not have milliseconds resolution", OS.isMac());
6665
try {
67-
assertTrue("can only run if native provider can be enabled", LocalFileNativesManager.setUsingNative(true));
68-
6966
/*
7067
* Run 3 times in case we have seconds resolution due to a bug, but by chance we
7168
* happened to modify the file in-between two seconds.

0 commit comments

Comments
 (0)