Added comments
diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/CoreFileSystemLibrary.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/CoreFileSystemLibrary.java
index ea595e2..040266c 100644
--- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/CoreFileSystemLibrary.java
+++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/localstore/CoreFileSystemLibrary.java
@@ -65,11 +65,15 @@
return new File(fileName).lastModified();
}
public static long getStat(String fileName) {
+ /* Calling String.getBytes() creates a new encoding object and other garbage.
+ * This can be avoided by calling String.getBytes(String encoding) instead.
+ */
if (hasNatives) {
- //try to use the default encoding, avoids creating an encoding object instance
+ //default encoding is unknown or previously failed, use no-arg getBytes().
if (defaultEncoding == null) {
return internalGetStat(fileName.getBytes());
}
+ //try to use the default encoding
try {
return internalGetStat(fileName.getBytes(defaultEncoding));
} catch (java.io.UnsupportedEncodingException e) {