This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE Dev (Build 201510270002) Operating System = Windows10 running on amd64 Java; VM; Vendor = 1.7.0_45 Runtime = Java HotSpot(TM) 64-Bit Server VM 24.45-b08 In the native support library for windows there is an unnessesay loop that is actually not needed, original reads; JNIEXPORT jlong JNICALL Java_org_netbeans_installer_utils_system_WindowsNativeUtils_getFreeSpace0(JNIEnv* jEnv, jobject jObject, jstring jPath) { WCHAR* path = getWideChars(jEnv, jPath); jlong size = 0; typedef struct int64s { unsigned long Low, High; } int64t; int64t bytes; if (GetDiskFreeSpaceExW(path, (PULARGE_INTEGER) &bytes, NULL, NULL)) { unsigned long h = bytes.High; // workaround of using missing _allmul function // replace multiplication by sum // (2^32 * high + low) = 2^32 + 2^32 + ... (bytes.High times total) + bytes.Low // can be relatively expensive on big sizes (peta bytes and more) while(h > 0) { h--; size+=4294967296L; } size+= bytes.Low; } else { throwException(jEnv, "Native error"); } FREE(path); return size; } Could be rewritten as; JNIEXPORT jlong JNICALL Java_org_netbeans_installer_utils_system_WindowsNativeUtils_getFreeSpace0(JNIEnv* jEnv, jobject jObject, jstring jPath) { WCHAR* path = getWideChars(jEnv, jPath); jlong size = 0; typedef struct int64s { unsigned long Low, High; } int64t; int64t bytes; if (GetDiskFreeSpaceExW(path, (PULARGE_INTEGER) &bytes, NULL, NULL)) { size = (bytes.high << 32) + bytes.low; } else { throwException(jEnv, "Native error"); } FREE(path); return size; } or even simpler; JNIEXPORT jlong JNICALL Java_org_netbeans_installer_utils_system_WindowsNativeUtils_getFreeSpace0(JNIEnv* jEnv, jobject jObject, jstring jPath) { WCHAR* path = getWideChars(jEnv, jPath); jlong size = 0; if (GetDiskFreeSpaceExW(path, (PULARGE_INTEGER) &size, NULL, NULL)==0) { throwException(jEnv, "Native error"); } FREE(path); return size; } This because a jlong is a __int64 as is an ULARGE_INTEGER, the only problem that can occur is that if you have something like a goodzillion petabytes of free diskspace the number returned will be negative as an jlong is signed, but this will be a lot faster.
Sorry, made a typo in the first example, the shift operation should read; size = ((jlong) bytes.High) << 32 + bytes.Low; or there will be a conversion error.