diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index c851a0d75a..6a73080f37 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -184,7 +184,8 @@ inline Mapping* map(JNIEnv* e, string_t path) { Mapping* result = 0; - HANDLE file = CreateFileW(path, FILE_READ_DATA, FILE_SHARE_READ, 0, + HANDLE file = CreateFileW(path, FILE_READ_DATA, + FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); if (file != INVALID_HANDLE_VALUE) { unsigned size = GetFileSize(file, 0); diff --git a/classpath/java/net/URLStreamHandler.java b/classpath/java/net/URLStreamHandler.java index 5c72deada1..7beacae25e 100644 --- a/classpath/java/net/URLStreamHandler.java +++ b/classpath/java/net/URLStreamHandler.java @@ -38,7 +38,7 @@ public abstract class URLStreamHandler { host = s.substring(0, slash); } else { host = s.substring(0, colon); - port = Integer.parseInt(s.substring(colon + 1), slash); + port = Integer.parseInt(s.substring(colon + 1, slash)); } s = s.substring(slash + 1); }