Fix in native _java_util_zip_ZipFile_open:_:_:_:_:_:. development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 23 Apr 2013 10:01:48 +0100
branchdevelopment
changeset 2548 3c51f38da021
parent 2547 ead869f48c58
child 2549 6ef03f1baa82
Fix in native _java_util_zip_ZipFile_open:_:_:_:_:_:. Use OpenJDK6's implementation as mmap is not yet supported.
JavaNativeMethodImpl_OpenJDK7.st
--- a/JavaNativeMethodImpl_OpenJDK7.st	Tue Apr 23 00:54:23 2013 +0100
+++ b/JavaNativeMethodImpl_OpenJDK7.st	Tue Apr 23 10:01:48 2013 +0100
@@ -11,7 +11,7 @@
 "
 "{ Package: 'stx:libjava' }"
 
-JavaNativeMethodImpl_OpenJDK6 subclass:#'JavaNativeMethodImpl_OpenJDK7'
+JavaNativeMethodImpl_OpenJDK6 subclass:#JavaNativeMethodImpl_OpenJDK7
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:'JavaVMData'
@@ -34,7 +34,6 @@
 "
 ! !
 
-
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - java.io'!
 
 _java_io_FileOutputStream_open: this _: a1 _: a2 
@@ -235,7 +234,6 @@
     ^ JavaVM unimplementedNativeMethodSignal raise
 ! !
 
-
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - java.lang'!
 
 _java_lang_ClassLoader_getCaller: this _: a1 
@@ -311,7 +309,6 @@
     "Modified: / 08-02-2013 / 01:28:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - java.util.zip'!
 
 _java_util_zip_ZipFile_getCommentBytes: this _: jzentry _: a2 
@@ -446,39 +443,17 @@
     "Modified: / 08-02-2013 / 09:45:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-_java_util_zip_ZipFile_open: this _: a1 _: a2 _: a3 _: a4 _: a5 
+_java_util_zip_ZipFile_open: this _: a1 _: a2 _: a3 _: a4 _: usemmap 
 
     <javanative: 'java/util/zip/ZipFile' name: 'open(Ljava/lang/String;IJZ)J'>
 
     "No mmap support for zip files yet, use Open JDK 6 implementation"
 
-    | path  mode  lastModTime  result |
+    ^self _java_util_zip_ZipFile_open: this _: a1 _: a2 _: a3 _: a4
 
-    path := Java as_ST_String: a1.
-    "/(path endsWith:'.jar') ifFalse:[self breakPoint: #jv].
-    mode := a2.
-    lastModTime := a3.
-    result := path asFilename.
-    result ifNil: [ JavaVM throwZipException ].
-    ^[
-        | i zar |
-        zar := ZipArchive readingFrom: result readStream.
-        i := ZipCache indexOf: nil.
-        i ~~ 0 ifTrue:[
-            ZipCache at: i put: zar.
-            i
-        ] ifFalse:[
-            ZipCache add: zar.
-            ZipCache size.
-        ].
-    ] on: Error do:[:ex|
-        JavaVM throwZipException:'Cannot open zip file: ' , ex description
-    ]
-
-    "Modified: / 08-02-2013 / 09:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-04-2013 / 10:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'native - sun.misc'!
 
 _sun_misc_Perf_attach: this _: a1 _: a2 _: a3 
@@ -558,7 +533,6 @@
     ^ JavaVM unimplementedNativeMethodSignal raise
 ! !
 
-
 !JavaNativeMethodImpl_OpenJDK7 class methodsFor:'documentation'!
 
 version_CVS