one step closer to eager method resolving jk_new_structure
authorhlopkmar
Thu, 09 Feb 2012 22:24:01 +0000
branchjk_new_structure
changeset 1353 2968f8acb434
parent 1352 f54e9aa94648
child 1354 d55b6a30d906
one step closer to eager method resolving
src/JavaByteCodeProcessor.st
src/JavaFieldRef2.st
src/JavaInterfaceMethodRef2.st
src/JavaMethod.st
src/JavaMethodRef2.st
src/JavaRef2.st
src/JavaResolver.st
src/JavaVM.st
src/extensions.st
--- a/src/JavaByteCodeProcessor.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaByteCodeProcessor.st	Thu Feb 09 22:24:01 2012 +0000
@@ -2485,6 +2485,11 @@
     "Created: / 22-03-2011 / 14:49:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
+handleNativeMethod
+
+    "Created: / 09-02-2012 / 22:47:03 / mh <hlopik@gmail.com>"
+!
+
 initializeContextArgsFrom: argArray 
     1 to: numArgs do: [:idx | context at: idx put: (argArray at: idx). ]
 
@@ -2504,18 +2509,18 @@
 
 process: aMethod receiver: aReceiver arguments: args 
     | argArray |
-
-    aMethod isAbstract 
-        ifTrue: 
-            [ ('Processing abstract method ' , aMethod displayString) infoPrintCR.
-            ^ self handleAbstractMethod. ].
-    args size ~~ aMethod javaNumArgs 
-        ifTrue: [ self error: 'bad number of arguments' ].
-    aMethod isStatic 
-        ifTrue: [ argArray := args ]
-        ifFalse: 
-            [ argArray := OrderedCollection with: aReceiver.
-            args ifNotNil: [ argArray addAll: args. ]. ].
+    aMethod isAbstract ifTrue: [
+      
+        ^ self handleAbstractMethod.
+    ].
+    aMethod isNative ifTrue: [ ^ self handleNativeMethod ].
+    args size ~~ aMethod javaNumArgs ifTrue: [
+        self error: 'bad number of arguments'
+    ].
+    aMethod isStatic ifTrue: [ argArray := args ] ifFalse: [
+        argArray := OrderedCollection with: aReceiver.
+        args ifNotNil: [ argArray addAll: args. ].
+    ].
     numArgs := argArray size.
     numVars := aMethod numVars.
     method := aMethod.
@@ -2536,6 +2541,7 @@
     "Modified: / 24-02-2011 / 11:09:07 / Marcel Hlopko <hlopik@gmail.com>"
     "Created: / 17-03-2011 / 17:25:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 31-03-2011 / 16:38:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Modified: / 09-02-2012 / 22:51:38 / mh <hlopik@gmail.com>"
 !
 
 switch: op 
--- a/src/JavaFieldRef2.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaFieldRef2.st	Thu Feb 09 22:24:01 2012 +0000
@@ -104,11 +104,11 @@
     "Modified: / 08-12-2011 / 13:37:05 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
-findResolvedValue
+findResolvedValue: doClassInit
     valueCache := JavaResolver uniqueInstance 
-                resolveFieldIndentifiedByRef: self.    
+                resolveFieldIndentifiedByRef: self.
     valueCache isStatic ifTrue: [ classCache := valueCache javaClass ] ifFalse: [
-        classCache := (constantPool at: classRefIndex) resolve
+        classCache := (constantPool at: classRefIndex) resolve: doClassInit.
     ].
     classCache ifNil: [ self breakPoint: #mh ].
     self resolveOffset.
@@ -117,6 +117,7 @@
     nameAndTypeCache ifNil: [ self breakPoint: #mh ].
 
     "Modified: / 07-12-2011 / 21:52:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Created: / 09-02-2012 / 23:09:18 / mh <hlopik@gmail.com>"
 !
 
 findStaticOffset
--- a/src/JavaInterfaceMethodRef2.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaInterfaceMethodRef2.st	Thu Feb 09 22:24:01 2012 +0000
@@ -73,6 +73,20 @@
     nameAndTypeCache ifNil: [ self breakPoint: #mh ].
 
     "Modified: / 18-05-2011 / 12:44:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+!
+
+findResolvedValue: doClassInit
+    "Resolve reference and set valueCache."
+    
+    valueCache := JavaResolver uniqueInstance 
+                resolveInterfaceMethodIdentifiedByRef: self.
+    classCache := (constantPool at: classRefIndex) resolve: doClassInit.
+    classCache ifNil: [ self breakPoint: #mh ].
+    nameAndTypeCache := (constantPool at: nameAndTypeIndex) resolve.
+    nameAndTypeCache ifNil: [ self breakPoint: #mh ].
+
+    "Modified: / 18-05-2011 / 12:44:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Created: / 09-02-2012 / 23:10:44 / mh <hlopik@gmail.com>"
 ! !
 
 !JavaInterfaceMethodRef2 methodsFor:'queries'!
--- a/src/JavaMethod.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaMethod.st	Thu Feb 09 22:24:01 2012 +0000
@@ -1607,6 +1607,14 @@
 
 !JavaMethod methodsFor:'initialization'!
 
+resolve
+"resolves all references used in this methods body"
+
+JavaByteCodePreresolver preresolve: self.
+
+    "Created: / 09-02-2012 / 20:59:22 / mh <hlopik@gmail.com>"
+!
+
 setAccessFlags:flags
     accessFlags := flags.
 
--- a/src/JavaMethodRef2.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaMethodRef2.st	Thu Feb 09 22:24:01 2012 +0000
@@ -77,17 +77,18 @@
     "Modified: / 07-12-2011 / 21:07:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-findResolvedValue
+findResolvedValue: doClassInit
     "Resolve reference and set valueCache."
     
     valueCache := JavaResolver uniqueInstance 
                 resolveMethodIndentifiedByRef: self.
-    classCache := (constantPool at: classRefIndex) resolve.
+    classCache := (constantPool at: classRefIndex) resolve: doClassInit.
     classCache ifNil: [ self breakPoint: #mh ].
     nameAndTypeCache := (constantPool at: nameAndTypeIndex) resolve.
-   nameAndTypeCache ifNil: [self breakPoint: #mh].
+    nameAndTypeCache ifNil: [ self breakPoint: #mh ].
 
     "Modified: / 18-05-2011 / 12:44:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Created: / 09-02-2012 / 23:10:32 / mh <hlopik@gmail.com>"
 ! !
 
 !JavaMethodRef2 methodsFor:'queries'!
--- a/src/JavaRef2.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaRef2.st	Thu Feb 09 22:24:01 2012 +0000
@@ -171,9 +171,15 @@
 !
 
 findResolvedValue
-    "raise an error: must be redefined in concrete subclass(es)"
+    self findResolvedValue: true.
+
+    "Modified: / 09-02-2012 / 23:10:09 / mh <hlopik@gmail.com>"
+!
 
-    ^ self subclassResponsibility
+findResolvedValue:arg
+    self shouldImplement
+
+    "Created: / 09-02-2012 / 23:08:15 / mh <hlopik@gmail.com>"
 ! !
 
 !JavaRef2 methodsFor:'queries'!
@@ -225,6 +231,19 @@
     "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 !
 
+resolve: doClassInit
+    "
+     Do it all method - resolves current reference and returns expected element (JavaMethod, JavaField etc.)
+     Hides implementation details of the way of dealing with invalidation etc. User should not need to call anything
+     else."
+    
+    self isResolved ifFalse: [ self findResolvedValue: doClassInit ].
+    ^ valueCache.
+
+    "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+    "Created: / 09-02-2012 / 23:08:15 / mh <hlopik@gmail.com>"
+!
+
 resolveStatic
     "
      Do it all method - resolves current reference and returns expected element (JavaMethod, JavaField etc.)
--- a/src/JavaResolver.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaResolver.st	Thu Feb 09 22:24:01 2012 +0000
@@ -617,16 +617,20 @@
      of a protected field access or method invocation (the target must be of class
      D or a subtype of D). That requirement is checked as part of the verification
      process (ยง5.4.1); it is not part of link-time access control."
-
     "JV@2011-05-24: Temporary hack, since access checking
      is somewhat broken. Marcle should fix it :-)"
-    OperatingSystem getLoginName = 'jv' ifTrue:[^true].
+    
+    OperatingSystem getLoginName = 'jv' ifTrue: [ ^ true ].
     
-  ^ self checkPermissionsForMethodOrField: aJavaMethod from: accessingJavaClass to: resolvedJavaClass.
+    (self 
+        checkPermissionsForMethodOrField: aJavaMethod
+        from: accessingJavaClass
+        to: resolvedJavaClass) ifTrue: [ ^ true.] ifFalse: [self breakPoint:#mh. ^true].
 
     "Created: / 11-04-2011 / 20:20:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 14-04-2011 / 14:20:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 24-05-2011 / 14:06:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 09-02-2012 / 23:15:48 / mh <hlopik@gmail.com>"
 !
 
 lookupMethodIfAlreadyResolved: aJavaMethodRef 
--- a/src/JavaVM.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/JavaVM.st	Thu Feb 09 22:24:01 2012 +0000
@@ -4433,6 +4433,13 @@
     "Modified: / 12-08-2011 / 19:08:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+_java_awt_Button_initIDs: nativeContext
+
+    <javanative: 'java/awt/Button' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:54:34 / mh <hlopik@gmail.com>"
+!
+
 _java_awt_Color_initIDs: nativeContext
 
     <javanative: 'java/awt/Color' name: 'initIDs()V'>
@@ -4460,6 +4467,20 @@
     "Modified: / 12-08-2011 / 19:09:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+_java_awt_Cursor_initIDs: nativeContext
+
+    <javanative: 'java/awt/Cursor' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:54:49 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_Dialog_initIDs: nativeContext
+
+    <javanative: 'java/awt/Dialog' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:54:09 / mh <hlopik@gmail.com>"
+!
+
 _java_awt_Dimension_initIDs: nativeContext
 
     <javanative: 'java/awt/Dimension' name: 'initIDs'>
@@ -4473,9 +4494,51 @@
 
     <javanative: 'java/awt/Event' name: 'initIDs()V'>
 
+    "Modified: / 09-02-2012 / 22:53:11 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_FontMetrics_initIDs: nativeContext
+
+    <javanative: 'java/awt/FontMetrics' name: 'initIDs()V'>
+
     ^ UnimplementedNativeMethodSignal raise
 !
 
+_java_awt_Frame_initIDs: nativeContext
+
+    <javanative: 'java/awt/Frame' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:53:52 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_Insets_initIDs: nativeContext
+
+    <javanative: 'java/awt/Insets' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:54:54 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_KeyboardFocusManager_initIDs: nativeContext
+
+    <javanative: 'java/awt/KeyboardFocusManager' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:55:04 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_MenuComponent_initIDs: nativeContext
+
+    <javanative: 'java/awt/MenuComponent' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:53:22 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_MenuItem_initIDs: nativeContext
+
+    <javanative: 'java/awt/MenuItem' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:54:40 / mh <hlopik@gmail.com>"
+!
+
 _java_awt_Rectangle_initIDs: nativeContext
 
     <javanative: 'java/awt/Rectangle' name: 'initIDs()V'>
@@ -4492,6 +4555,36 @@
         "/ introduced with jdk1.2 ... (sigh)
 
     "Created: / 27.1.1998 / 19:53:50 / cg"
+!
+
+_java_awt_Window_initIDs: nativeContext
+
+    <javanative: 'java/awt/Window' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:53:47 / mh <hlopik@gmail.com>"
+! !
+
+!JavaVM class methodsFor:'native - java.awt.event'!
+
+_java_awt_event_InputEvent_initIDs: nativeContext
+
+    <javanative: 'java/awt/event/InputEvent' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:53:27 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_event_KeyEvent_initIDs: nativeContext
+
+    <javanative: 'java/awt/event/KeyEvent' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:53:33 / mh <hlopik@gmail.com>"
+!
+
+_java_awt_event_MouseEvent_initIDs: nativeContext
+
+    <javanative: 'java/awt/event/MouseEvent' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:53:40 / mh <hlopik@gmail.com>"
 ! !
 
 !JavaVM class methodsFor:'native - java.io'!
@@ -6118,6 +6211,27 @@
     "Created: / 10-08-2011 / 15:20:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+_java_lang_Compiler_disable: nativeContext
+
+    <javanative: 'java/lang/Compiler' name: 'disable()V'>
+
+    "Modified: / 09-02-2012 / 22:56:44 / mh <hlopik@gmail.com>"
+!
+
+_java_lang_Compiler_enable: nativeContext
+
+    <javanative: 'java/lang/Compiler' name: 'enable()V'>
+
+    "Modified: / 09-02-2012 / 22:57:15 / mh <hlopik@gmail.com>"
+!
+
+_java_lang_Compiler_registerNatives: nativeContext
+
+    <javanative: 'java/lang/Compiler' name: 'registerNatives()V'>
+
+    "Modified: / 09-02-2012 / 22:56:37 / mh <hlopik@gmail.com>"
+!
+
 _java_lang_Double_doubleToRawLongBits: aJavaContext
 
     <javanative: 'java/lang/Double' name: 'doubleToRawLongBits'>
@@ -14861,6 +14975,22 @@
     "Modified: / 04-11-2011 / 21:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!JavaVM class methodsFor:'native - sun.font'!
+
+_sun_font_FontManager_initIDs: nativeContext
+
+    <javanative: 'sun/font/FontManager' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:56:51 / mh <hlopik@gmail.com>"
+!
+
+_sun_font_StrikeCache_getGlyphCacheDescription: nativeContext
+
+    <javanative: 'sun/font/StrikeCache' name: 'getGlyphCacheDescription([J)V'>
+
+    "Modified: / 09-02-2012 / 22:57:08 / mh <hlopik@gmail.com>"
+! !
+
 !JavaVM class methodsFor:'native - sun.io'!
 
 _sun_io_Win32ErrorMode_setErrorMode: nativeContext
@@ -14878,7 +15008,7 @@
 
     <javanative: 'sun/java2d/Disposer' name: 'initIDs()V'>
 
-    ^ UnimplementedNativeMethodSignal raise
+    "Modified: / 09-02-2012 / 22:54:59 / mh <hlopik@gmail.com>"
 ! !
 
 !JavaVM class methodsFor:'native - sun.java2d.cmm.lcms'!
@@ -14948,6 +15078,15 @@
     "Modified: / 09-12-2011 / 18:56:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!JavaVM class methodsFor:'native - sun.java2d.pipe'!
+
+_sun_java2d_pipe_Region_initIDs: nativeContext
+
+    <javanative: 'sun/java2d/pipe/Region' name: 'initIDs()V'>
+
+    "Modified: / 09-02-2012 / 22:55:09 / mh <hlopik@gmail.com>"
+! !
+
 !JavaVM class methodsFor:'native - sun.management'!
 
 _sun_management_MemoryImpl_getMemoryManagers0: nativeContext
--- a/src/extensions.st	Tue Jan 24 23:56:08 2012 +0000
+++ b/src/extensions.st	Thu Feb 09 22:24:01 2012 +0000
@@ -1,6 +1,69 @@
-"{ Package: 'stx:libjava' }"
+"{ Package: 'stx:libjava' }"!
+
+!Boolean class methodsFor:'queries'!
+
+isJavaPrimitiveType
+
+    ^true
+
+    "Created: / 25-02-2011 / 08:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Boolean class methodsFor:'queries'!
+
+javaArrayClass
+    ^ BooleanArray
+
+    "Created: / 25-02-2011 / 08:27:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Boolean class methodsFor:'autoboxing support'!
+
+javaBox: anObject
+    | wrapper |
+
+    wrapper := (JavaVM classForName: 'java.lang.Boolean') new.
+    wrapper perform: #'<init>(Z)V' with: anObject.
+    ^ wrapper
+
+    "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Boolean class methodsFor:'accessing'!
 
-!
+javaName
+
+    ^'boolean'.
+
+    "Modified: / 25-02-2011 / 18:58:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Boolean class methodsFor:'autoboxing support'!
+
+javaUnbox: object onError: errorBlock
+
+    | value |
+
+    (object class name = 'java/lang/Boolean') ifFalse:[
+        errorBlock value.
+    ].
+    value := object instVarNamed: #value.
+    (value ~~ 0 and:[value ~~ 1]) ifTrue:[
+        errorBlock value.
+    ].
+    ^value
+
+    "Created: / 22-11-2011 / 11:52:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Boolean class methodsFor:'autoboxing support'!
+
+javaUnwrap: zeroOrOne
+
+    ^zeroOrOne == 1
+
+    "Created: / 10-12-2011 / 20:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
 !BooleanArray methodsFor:'queries'!
 
@@ -10,6 +73,168 @@
 
     "Created: / 31-05-2011 / 16:07:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!BooleanArray class methodsFor:'testing'!
+
+isInterface
+
+    ^false
+! !
+
+!BooleanArray class methodsFor:'queries'!
+
+isJavaArrayClass
+
+    ^true
+
+    "Created: / 20-12-2010 / 22:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!BooleanArray class methodsFor:'queries'!
+
+isJavaReferenceType
+
+    "Java arrays are reference types"
+    ^true
+
+    "Created: / 20-12-2010 / 22:30:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!BooleanArray class methodsFor:'accessing-java'!
+
+javaArrayClass
+    ^ JavaArray javaArrayClassFor: self
+
+    "Created: / 06-12-2011 / 17:29:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!BooleanArray class methodsFor:'accessing-java'!
+
+javaComponentClass
+
+    ^Boolean
+
+    "Created: / 20-12-2010 / 22:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!BooleanArray class methodsFor:'accessing'!
+
+javaName
+
+    ^'[Z'.
+
+    "Modified: / 31-08-2011 / 23:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ByteArray class methodsFor:'testing'!
+
+isInterface
+
+    ^false
+! !
+
+!ByteArray class methodsFor:'queries'!
+
+isJavaArrayClass
+
+    ^true
+
+    "Created: / 05-02-2011 / 22:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ByteArray class methodsFor:'queries'!
+
+isJavaReferenceType
+
+    "Java arrays are reference types"
+    ^true
+
+    "Created: / 20-12-2010 / 22:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ByteArray class methodsFor:'accessing-java'!
+
+javaArrayClass
+
+    ^JavaArray javaArrayClassFor: self
+
+    "Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ByteArray class methodsFor:'accessing-java'!
+
+javaComponentClass
+
+    ^JavaByte
+
+    "Created: / 20-12-2010 / 22:05:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ByteArray class methodsFor:'accessing'!
+
+javaName
+
+    ^'[B'.
+
+    "Modified: / 25-02-2011 / 19:02:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Character class methodsFor:'queries'!
+
+isJavaPrimitiveType
+
+    ^true
+
+    "Created: / 20-12-2010 / 22:18:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Character class methodsFor:'accessing'!
+
+javaArrayClass
+    ^ String
+
+    "Created: / 11-02-2011 / 10:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Character class methodsFor:'autoboxing support'!
+
+javaBox: anObject
+    | wrapper |
+
+    wrapper := (JavaVM classForName: 'java.lang.Character') new.
+    wrapper perform: #'<init>(C)V' with: anObject codePoint.
+    ^ wrapper
+
+    "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Character class methodsFor:'accessing'!
+
+javaName
+
+    ^'char'.
+
+    "Modified: / 25-02-2011 / 18:58:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Character class methodsFor:'autoboxing support'!
+
+javaUnbox: object onError: errorBlock
+
+    | value |
+
+    (object class name = 'java/lang/Character') ifFalse:[
+        errorBlock value.
+    ].
+    value := object instVarNamed: #value.
+    (value between: 0 and: 255) ifFalse:[
+        errorBlock value.
+    ].
+    ^value
+
+    "Created: / 22-11-2011 / 11:52:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asDottedJavaClassName
@@ -34,6 +259,7 @@
     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Created: / 30-10-2011 / 17:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asInternalJavaClassName
@@ -45,6 +271,7 @@
     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 30-10-2011 / 17:40:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asJavaComponentClassName
@@ -58,6 +285,7 @@
     ].
     ^ componentClassName.
 ! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asJavaishClassName
@@ -69,6 +297,7 @@
     "Created: / 21-10-2011 / 12:33:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 30-10-2011 / 17:41:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asNiceJavaClassName
@@ -79,6 +308,7 @@
     niceName := niceName asString copyReplaceAll: $/ with: $..
     ^ niceName.
 ! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asSTXInternalJavaClassName
@@ -93,6 +323,7 @@
     ].
     ^internalName.
 ! !
+
 !CharacterArray methodsFor:'java conversions'!
 
 asSlashedJavaClassName
@@ -110,537 +341,19 @@
     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Created: / 30-10-2011 / 17:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray methodsFor:'java queries'!
 
 isJavaArrayDescriptor
 ^ self startsWith:$[.
 ! !
+
 !CharacterArray methodsFor:'java queries'!
 
 isJavaPrimitiveTypeDescriptor
     ^ (self size = 1 and: [ JavaDescriptor baseTypes includesKey: self first ]).
 ! !
-!Delay methodsFor:'delaying'!
 
-waitWithState:state
-    "suspend the current process until either the relative time delta
-     has passed (if millisecondDelta is non-nil), or the absolute millisecondTime
-     has been reached (if resumptionTime non-nil)."
-    
-    | wasBlocked  currentDelta  dueTime  now  then |
-    isInterrupted := false.
-    millisecondDelta notNil ifTrue: [
-        now := OperatingSystem getMillisecondTime.
-        currentDelta := millisecondDelta rounded.
-        currentDelta > 16r0fffffff ifTrue: [
-            "NOTE: the microsecondTime is increasing monotonically,
-                   while millisecondTime is wrapping at 16r1fffffff.
-                   So use the microsecondTime to check when we are finished"
-            dueTime := OperatingSystem getMicrosecondTime + (currentDelta * 1000).
-            currentDelta := 16r0fffffff.
-        ].
-        then := OperatingSystem millisecondTimeAdd: now and: currentDelta.
-    ] ifFalse: [ then := resumptionTime. ].
-    wasBlocked := OperatingSystem blockInterrupts.
-    [
-        [
-            Processor signal: delaySemaphore atMilliseconds: then.
-            Processor activeProcess state: state.
-            delaySemaphore wait.
-        ] doWhile: [
-            (dueTime notNil 
-                and: [
-                    isInterrupted not 
-                        and: [ (currentDelta := dueTime - OperatingSystem getMicrosecondTime) > 0 ]
-                ]) 
-                    ifTrue: [
-                        currentDelta := (currentDelta // 1000) min: 16r0fffffff.
-                        now := OperatingSystem getMillisecondTime.
-                        then := OperatingSystem millisecondTimeAdd: now and: currentDelta.
-                        true.
-                    ]
-                    ifFalse: [ false ]
-        ].
-    ] ensure: [ wasBlocked ifFalse: [ OperatingSystem unblockInterrupts ]. ]
-
-    "
-     Transcript showCR:'1'.
-     (Delay forSeconds:10) wait.
-     Transcript showCR:'2'."
-
-    "Modified: / 26-02-1997 / 15:21:35 / cg"
-    "Modified: / 18-04-1997 / 11:56:46 / stefan"
-    "Created: / 30-11-2011 / 13:38:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Object methodsFor:'testing'!
-
-isJavaArray
-
-    ^self class isJavaArrayClass
-
-    "Created: / 19-12-2010 / 17:05:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Object methodsFor:'testing'!
-
-isJavaNameAndType
-    "return true, if given object represents name and type struct in java constant pool"
-
-    ^ false.
-
-    "Created: / 10-05-2011 / 12:21:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Object methodsFor:'testing'!
-
-isJavaPackage
-    "return true, if the receiver is a java package.
-     False is returned here - the method is only redefined in JavaPackage."
-
-    ^ false
-
-    "Created: / 09-08-2011 / 09:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Object methodsFor:'testing'!
-
-isJavaRef
-"return true, if given object represents reference in java constant pool"
-^ false.
-
-    "Created: / 08-04-2011 / 16:12:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Object methodsFor:'testing'!
-
-isJavaWrapperClass
-    "return true, if this is a java wrapper class, i.e, java.lang.Integer, java.lang.Boolean etc."
-
-    ^ false
-
-    "Created: / 01-01-2012 / 17:25:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Object methodsFor:'autoboxing support'!
-
-javaBox: anObject
-
-    ^anObject
-
-    "Created: / 15-08-2011 / 10:52:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Object methodsFor:'autoboxing support'!
-
-javaUnwrap: anObject
-    "Unwraps the objects. Possibly call on the wrapped class"
-
-    ^anObject
-
-    "Created: / 10-12-2011 / 19:51:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Object methodsFor:'autoboxing support'!
-
-javaUnwrapFrom: javaType
-    ^ self.
-
-    "Created: / 10-12-2011 / 19:51:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Created: / 30-12-2011 / 15:22:06 / kursjan <kursjan@fit.cvut.cz>"
-! !
-!Object methodsFor:'autoboxing support'!
-
-javaWrap: anObject
-    "Wraps the receiver into corresponding Java object"
-
-    ^anObject
-
-    "Created: / 26-12-2011 / 00:57:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Process methodsFor:'Java protocol'!
-
-clearInterrupted
-    JavaVM threadInterrupts at: self put: false.
-
-    "Created: / 30-11-2011 / 10:44:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Process methodsFor:'Java protocol'!
-
-isInterrupted
-
-    ^ JavaVM threadInterrupts at: self
-        ifAbsent: [ JavaVM threadInterrupts at: self put: false. ]
-
-    "Created: / 30-11-2011 / 12:12:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Process methodsFor:'queries'!
-
-isSleeping
-    "return true, iff the receiver is sleeping on Delay"
-    
-    ^ (state == #sleep)
-
-    "Created: / 30-11-2011 / 13:35:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Process methodsFor:'queries'!
-
-isWaiting
-    "return true, iff the receiver is waiting on semaphore or something"
-
-    ^ (state == #wait)
-
-    "Created: / 20-11-2011 / 20:55:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Process methodsFor:'Java protocol'!
-
-javaInterrupt
-    self isWaiting ifTrue: [
-        self 
-            interruptWith: [
-                JavaVM 
-                    throwInterruptedException: 'thread has been interrupted during wait'.
-                self terminate
-            ]
-    ] ifFalse: [
-        self isSleeping ifTrue: [
-      
-            self 
-                interruptWith: [
-                    JavaVM 
-                        throwInterruptedException: 'thread has been interrupted during sleep'.
-                    self terminate
-                ]
-        ] ifFalse: [ self setInterrupted. ]
-    ]
-
-    "Created: / 30-11-2011 / 13:35:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Process methodsFor:'Java protocol'!
-
-setInterrupted
-
-    JavaVM threadInterrupts at: self put: true.
-
-    "Created: / 30-11-2011 / 10:44:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!Set methodsFor:'javaProtocol'!
-
-java__contains:anObject
-         ^ self contains: [:el | anObject = el ] 
-! !
-!SmallInteger methodsFor:'autoboxing'!
-
-javaUnwrapFrom: javaType
-    javaType = #boolean ifTrue: [
-        ^ self = 1
-    ].
-    ^ self
-
-    "Created: / 30-12-2011 / 15:22:52 / kursjan <kursjan@fit.cvut.cz>"
-! !
-!String methodsFor:'converting'!
-
-asArrayOfSubstringsSeparatedBy:aSeparator
-    "Modified version of asArrayOfSubstrings"
-
-    |substrings start end|
-
-    substrings := OrderedCollection new.
-    start := 1.
-    [start <= self size] whileTrue:[
-	(self at:start) = aSeparator ifFalse:[
-	    end := start + 1.
-	    [
-		end <= self size and:[(self at:end) ~= aSeparator]
-	    ] whileTrue:[end := end + 1].
-	    substrings add:(self copyFrom:start to:end - 1).
-	    start := end - 1
-	].
-	start := start + 1
-    ].
-    ^ substrings asArray
-
-    "Created: / 07-02-2011 / 11:18:03 / Marcel Hlopko <hlopik@gmail.com>"
-    "Modified: / 08-02-2011 / 01:08:15 / Marcel Hlopko <hlopik@gmail.com>"
-! !
-!UserPreferences methodsFor:'accessing-java-devel'!
-
-javaTestsDirectory
-    ^ self at: #javaTestsDirectory
-	ifAbsent:
-	    [ | nm |
-
-	    nm := OperatingSystem getLoginName.
-	     "Default path for Jan"
-	    (nm = 'jv' and:[OperatingSystem isUNIXlike])
-		ifTrue:
-		    [ '/home/jv/Projects/libjava/sources/libjava/branches/jk_new_structure/tests' ]
-		ifFalse:
-		    [ "Default path for Jan (the other one :-)"
-		    nm = 'jk'
-			ifTrue: [ 'path for Jan' ]
-			ifFalse:
-			    [ "Default path for Marcel"
-			    nm = 'm'
-				ifTrue: [ '/home/m/Projects/libjava/branches/jk_new_structure/tests' ]
-				ifFalse:
-				    [ | "Look into package dir" p |
-
-				    (p := (Smalltalk getPackageDirectoryForPackage: 'stx:libjava') asFilename
-						/ 'tests') exists
-					ifTrue: [ p pathName ]
-					ifFalse:
-					    [ | "Try the environment variable (used by Hudson)" p |
-
-					    (p := OperatingSystem getEnvironment: 'LIBJAVA_TESTS') notNil
-						ifTrue: [ p ]
-						ifFalse:
-						    [ "No default, trigger an error"
-						    self error: 'No tests path specified' ] ] ] ] ] ]
-
-    "
-	UserPreferences current javaTestsDirectory"
-
-    "Created: / 07-05-2011 / 17:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 07-05-2011 / 20:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 12-05-2011 / 15:54:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!UserPreferences methodsFor:'accessing-java-devel'!
-
-javaTestsDirectory: aStringOrFilename
-
-    self at:#javaTestsDirectory put: aStringOrFilename asString.
-
-    "Created: / 07-05-2011 / 17:45:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!WrappedMethod methodsFor:'accessing'!
-
-descriptor
-    "Returns descriptor object (for wrapped Java methods)"
-
-    | orig |
-    orig := self originalMethod.
-    ^(orig respondsTo: #descriptor) ifTrue:[
-        orig descriptor
-    ] ifFalse:[
-        self doesNotUnderstand: (Message selector: #descriptor)
-    ]
-
-    "Created: / 16-12-2011 / 20:03:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!WrappedMethod methodsFor:'queries'!
-
-isAbstract
-
-    ^self originalMethod isAbstract.
-
-    "Created: / 04-12-2011 / 11:24:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!ZipArchive methodsFor:'reading - java support'!
-
-nextBytes: bytesToRead of: zmember startingAt: pos into: b startingAt: off
-
-    file position0Based: zmember fileStart + startOfArchive + pos.
-    ^ file nextBytes: bytesToRead into: b startingAt: off.
-
-    "Created: / 01-05-2011 / 16:21:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Boolean class methodsFor:'queries'!
-
-isJavaPrimitiveType
-
-    ^true
-
-    "Created: / 25-02-2011 / 08:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Boolean class methodsFor:'queries'!
-
-javaArrayClass
-    ^ BooleanArray
-
-    "Created: / 25-02-2011 / 08:27:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Boolean class methodsFor:'autoboxing support'!
-
-javaBox: anObject
-    | wrapper |
-
-    wrapper := (JavaVM classForName: 'java.lang.Boolean') new.
-    wrapper perform: #'<init>(Z)V' with: anObject.
-    ^ wrapper
-
-    "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Boolean class methodsFor:'accessing'!
-
-javaName
-
-    ^'boolean'.
-
-    "Modified: / 25-02-2011 / 18:58:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Boolean class methodsFor:'autoboxing support'!
-
-javaUnbox: object onError: errorBlock
-
-    | value |
-
-    (object class name = 'java/lang/Boolean') ifFalse:[
-        errorBlock value.
-    ].
-    value := object instVarNamed: #value.
-    (value ~~ 0 and:[value ~~ 1]) ifTrue:[
-        errorBlock value.
-    ].
-    ^value
-
-    "Created: / 22-11-2011 / 11:52:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Boolean class methodsFor:'autoboxing support'!
-
-javaUnwrap: zeroOrOne
-
-    ^zeroOrOne == 1
-
-    "Created: / 10-12-2011 / 20:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!BooleanArray class methodsFor:'testing'!
-
-isInterface
-
-    ^false
-! !
-!BooleanArray class methodsFor:'queries'!
-
-isJavaArrayClass
-
-    ^true
-
-    "Created: / 20-12-2010 / 22:47:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!BooleanArray class methodsFor:'queries'!
-
-isJavaReferenceType
-
-    "Java arrays are reference types"
-    ^true
-
-    "Created: / 20-12-2010 / 22:30:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!BooleanArray class methodsFor:'accessing-java'!
-
-javaArrayClass
-    ^ JavaArray javaArrayClassFor: self
-
-    "Created: / 06-12-2011 / 17:29:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-! !
-!BooleanArray class methodsFor:'accessing-java'!
-
-javaComponentClass
-
-    ^Boolean
-
-    "Created: / 20-12-2010 / 22:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!BooleanArray class methodsFor:'accessing'!
-
-javaName
-
-    ^'[Z'.
-
-    "Modified: / 31-08-2011 / 23:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!ByteArray class methodsFor:'testing'!
-
-isInterface
-
-    ^false
-! !
-!ByteArray class methodsFor:'queries'!
-
-isJavaArrayClass
-
-    ^true
-
-    "Created: / 05-02-2011 / 22:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!ByteArray class methodsFor:'queries'!
-
-isJavaReferenceType
-
-    "Java arrays are reference types"
-    ^true
-
-    "Created: / 20-12-2010 / 22:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!ByteArray class methodsFor:'accessing-java'!
-
-javaArrayClass
-
-    ^JavaArray javaArrayClassFor: self
-
-    "Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!ByteArray class methodsFor:'accessing-java'!
-
-javaComponentClass
-
-    ^JavaByte
-
-    "Created: / 20-12-2010 / 22:05:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!ByteArray class methodsFor:'accessing'!
-
-javaName
-
-    ^'[B'.
-
-    "Modified: / 25-02-2011 / 19:02:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Character class methodsFor:'queries'!
-
-isJavaPrimitiveType
-
-    ^true
-
-    "Created: / 20-12-2010 / 22:18:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Character class methodsFor:'accessing'!
-
-javaArrayClass
-    ^ String
-
-    "Created: / 11-02-2011 / 10:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Character class methodsFor:'autoboxing support'!
-
-javaBox: anObject
-    | wrapper |
-
-    wrapper := (JavaVM classForName: 'java.lang.Character') new.
-    wrapper perform: #'<init>(C)V' with: anObject codePoint.
-    ^ wrapper
-
-    "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Character class methodsFor:'accessing'!
-
-javaName
-
-    ^'char'.
-
-    "Modified: / 25-02-2011 / 18:58:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-!Character class methodsFor:'autoboxing support'!
-
-javaUnbox: object onError: errorBlock
-
-    | value |
-
-    (object class name = 'java/lang/Character') ifFalse:[
-        errorBlock value.
-    ].
-    value := object instVarNamed: #value.
-    (value between: 0 and: 255) ifFalse:[
-        errorBlock value.
-    ].
-    ^value
-
-    "Created: / 22-11-2011 / 11:52:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
 !CharacterArray class methodsFor:'encoding & decoding'!
 
 decodeFromJavaUTF8: bytes
@@ -734,6 +447,7 @@
     "Modified: / 13-03-2011 / 15:52:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 09-12-2011 / 19:49:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray class methodsFor:'instance creation'!
 
 fromJavaUTF8Bytes:aByteCollection
@@ -761,6 +475,7 @@
 
     "Created: / 23-12-2010 / 09:01:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -769,6 +484,7 @@
 
     "Created: / 05-02-2011 / 22:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray class methodsFor:'accessing-java'!
 
 javaArrayClass
@@ -778,6 +494,7 @@
     "Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 10-08-2011 / 13:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !CharacterArray class methodsFor:'accessing-java'!
 
 javaComponentClass
@@ -786,12 +503,67 @@
 
     "Created: / 20-12-2010 / 22:05:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!Delay methodsFor:'delaying'!
+
+waitWithState:state
+    "suspend the current process until either the relative time delta
+     has passed (if millisecondDelta is non-nil), or the absolute millisecondTime
+     has been reached (if resumptionTime non-nil)."
+    
+    | wasBlocked  currentDelta  dueTime  now  then |
+    isInterrupted := false.
+    millisecondDelta notNil ifTrue: [
+        now := OperatingSystem getMillisecondTime.
+        currentDelta := millisecondDelta rounded.
+        currentDelta > 16r0fffffff ifTrue: [
+            "NOTE: the microsecondTime is increasing monotonically,
+                   while millisecondTime is wrapping at 16r1fffffff.
+                   So use the microsecondTime to check when we are finished"
+            dueTime := OperatingSystem getMicrosecondTime + (currentDelta * 1000).
+            currentDelta := 16r0fffffff.
+        ].
+        then := OperatingSystem millisecondTimeAdd: now and: currentDelta.
+    ] ifFalse: [ then := resumptionTime. ].
+    wasBlocked := OperatingSystem blockInterrupts.
+    [
+        [
+            Processor signal: delaySemaphore atMilliseconds: then.
+            Processor activeProcess state: state.
+            delaySemaphore wait.
+        ] doWhile: [
+            (dueTime notNil 
+                and: [
+                    isInterrupted not 
+                        and: [ (currentDelta := dueTime - OperatingSystem getMicrosecondTime) > 0 ]
+                ]) 
+                    ifTrue: [
+                        currentDelta := (currentDelta // 1000) min: 16r0fffffff.
+                        now := OperatingSystem getMillisecondTime.
+                        then := OperatingSystem millisecondTimeAdd: now and: currentDelta.
+                        true.
+                    ]
+                    ifFalse: [ false ]
+        ].
+    ] ensure: [ wasBlocked ifFalse: [ OperatingSystem unblockInterrupts ]. ]
+
+    "
+     Transcript showCR:'1'.
+     (Delay forSeconds:10) wait.
+     Transcript showCR:'2'."
+
+    "Modified: / 26-02-1997 / 15:21:35 / cg"
+    "Modified: / 18-04-1997 / 11:56:46 / stefan"
+    "Created: / 30-11-2011 / 13:38:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
 !DoubleArray class methodsFor:'testing'!
 
 isInterface
 
     ^false
 ! !
+
 !DoubleArray class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -800,6 +572,7 @@
 
     "Created: / 20-12-2010 / 22:47:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !DoubleArray class methodsFor:'queries'!
 
 isJavaReferenceType
@@ -809,6 +582,7 @@
 
     "Created: / 20-12-2010 / 22:30:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !DoubleArray class methodsFor:'accessing-java'!
 
 javaArrayClass
@@ -816,6 +590,7 @@
 
     "Created: / 06-12-2011 / 17:28:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
+
 !DoubleArray class methodsFor:'accessing-java'!
 
 javaComponentClass
@@ -824,6 +599,7 @@
 
     "Created: / 20-12-2010 / 22:06:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !DoubleArray class methodsFor:'accessing'!
 
 javaName
@@ -832,6 +608,7 @@
 
     "Modified: / 25-02-2011 / 19:03:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Float class methodsFor:'queries'!
 
 isJavaPrimitiveType
@@ -840,6 +617,7 @@
 
     "Created: / 06-02-2011 / 17:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Float class methodsFor:'accessing'!
 
 javaArrayClass
@@ -847,6 +625,7 @@
 
     "Created: / 11-02-2011 / 10:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Float class methodsFor:'autoboxing support'!
 
 javaBox: anObject
@@ -858,6 +637,7 @@
 
     "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Float class methodsFor:'accessing'!
 
 javaName
@@ -866,12 +646,14 @@
 
     "Modified: / 25-02-2011 / 18:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !FloatArray class methodsFor:'testing'!
 
 isInterface
 
     ^false
 ! !
+
 !FloatArray class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -880,6 +662,7 @@
 
     "Created: / 20-12-2010 / 22:47:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !FloatArray class methodsFor:'queries'!
 
 isJavaReferenceType
@@ -889,6 +672,7 @@
 
     "Created: / 20-12-2010 / 22:30:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !FloatArray class methodsFor:'accessing-java'!
 
 javaArrayClass
@@ -896,6 +680,7 @@
 
     "Created: / 06-12-2011 / 17:29:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
+
 !FloatArray class methodsFor:'accessing-java'!
 
 javaComponentClass
@@ -904,6 +689,7 @@
 
     "Created: / 20-12-2010 / 22:06:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !FloatArray class methodsFor:'accessing'!
 
 javaName
@@ -912,6 +698,7 @@
 
     "Modified: / 25-02-2011 / 19:03:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaClassBrowserIcon
@@ -937,6 +724,7 @@
 LC(4VE!!XMS02B%]YVU%YDP,#NC$;NS 1@!!EYVU%YVU$QERT+KB,%EQEYVU%YVU%YVU\F@0PCBE]YVU%YVU%YVU%YVU%YVU%YVU%YVP@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[108 168 129 51 130 77 54 131 79 64 137 88 66 139 90 70 143 94 84 152 106 90 155 112 92 156 113 130 179 146 36 118 62 46 124 70 51 129 75 57 134 80 88 156 109 93 158 113 99 162 119 129 178 144 162 201 174 45 124 68 46 125 69 47 125 70 48 126 70 51 129 73 75 146 96 74 144 94 119 174 135 50 128 71 54 132 74 59 135 79 63 137 82 142 189 154 62 136 79 62 136 80 62 135 80 70 142 87 71 143 88 82 150 98 107 167 122 143 190 154 195 221 201 226 239 229 82 150 96 86 154 100 86 153 100 93 156 106 171 207 179 188 216 194 84 151 97 87 153 100 88 153 100 94 156 106 218 234 221 230 241 232 82 150 94 241 247 242 96 160 105 124 178 132 121 174 129 133 184 140 140 188 147 240 247 241 89 153 97 104 164 111 97 160 103 96 158 102 158 198 161 220 234 221 103 162 106 109 166 112 119 174 120 128 179 128 123 177 122 121 174 119 135 184 133 129 179 125 225 239 224 145 190 140 179 210 176 188 217 185 190 218 187 159 199 154 160 199 155 187 216 183 194 220 191 198 222 195 176 208 171 201 208 199 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@_0C? _?C?>O?8??#?>O?8??#?>G?0O>@_0@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaExceptionBrowserIcon
@@ -962,6 +750,7 @@
 D!!HRD!!HRA $IA!!HRD!!HRD!!HRD!!HRD $MA@$RD!!HRD!!HRD!!HRD!!HNCPPND!!HRD!!HRD!!HRD!!HRA 8NA!!HRD!!HRD!!HRD!!HRD!!HRD!!HRD @@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[40 98 150 81 128 170 110 150 185 194 211 226 255 223 95 255 234 145 228 221 192 218 204 156 184 149 37 190 156 40 188 153 39 255 226 134 180 143 35 255 223 127 170 130 30 207 167 62 254 215 119 254 207 108 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A0@G@@\<A30GO@\<G30^O@@<@A @@@@<@C0@O@@<@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaPrivateClassBrowserIcon
@@ -987,6 +776,7 @@
 GR43L@HGA TFA0I!!XVE!!XQHMB0$CW54@@E<AXVE!!XVE!!XVE!!AE!!XVE!!XAFE!!XVE!!XVE!!XP HB@ HB@!!!!XVE!!XVE!!XVE!!XVE!!XVE!!XP@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[231 96 97 200 41 48 200 48 52 200 41 49 200 29 44 242 77 92 241 77 92 245 118 128 200 25 42 152 195 167 51 130 77 64 137 88 70 143 94 84 152 106 90 155 112 126 179 144 129 181 146 155 198 169 205 226 212 36 118 62 46 124 70 51 129 75 57 134 80 93 158 113 99 162 119 162 201 174 166 204 178 45 124 68 46 125 69 47 125 70 48 126 70 51 129 73 75 146 96 74 144 94 119 174 135 216 233 221 50 128 71 54 132 74 59 135 79 63 137 82 155 198 166 62 136 79 62 136 80 62 135 80 70 142 87 82 150 98 107 167 122 143 190 154 164 203 173 195 221 201 226 239 229 86 154 100 171 207 179 188 216 194 84 151 97 94 156 106 218 234 221 82 150 94 241 247 242 96 160 105 124 178 132 121 174 129 167 204 172 89 153 97 104 164 111 97 160 103 96 158 102 158 198 161 220 234 221 103 162 106 109 166 112 119 174 120 128 179 128 123 177 122 121 174 119 135 184 133 129 179 125 225 239 224 145 190 140 179 210 176 188 217 185 190 218 187 159 199 154 160 199 155 187 216 183 194 220 191 198 222 195 176 208 171 231 147 139 201 67 60 201 71 62 201 62 58 246 146 142 231 96 96 245 124 124 237 131 131 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?>_?8??!!?>C?8@? C>@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaPrivateEnumBrowserIcon
@@ -1012,6 +802,7 @@
 C!!4 BPHGA TFA0IDQDQDQC\_E3PCPS<@@DDAQDQDQDQDQDQDAC(:N#(:BDQDQDQDQDQDQ@ HB@ HB@!!DQDQDQDQDQDQDQDQDQDQDQ@@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[231 96 97 200 41 48 200 48 52 200 41 49 200 29 44 242 77 92 241 77 92 245 118 128 200 25 42 217 201 182 219 204 186 230 219 206 140 89 32 142 92 36 142 93 37 143 93 38 144 94 39 144 95 40 145 96 41 146 97 43 147 99 45 147 100 47 148 101 48 149 103 50 152 107 56 153 108 57 154 109 60 155 111 62 158 115 67 158 116 68 159 117 69 160 118 71 161 119 73 163 123 77 165 125 81 165 126 81 166 127 83 169 131 88 170 133 91 176 141 102 178 144 106 180 147 110 185 154 119 186 156 122 187 157 124 190 161 129 194 167 137 199 174 146 204 182 157 206 184 160 209 188 165 212 193 172 213 195 174 214 196 176 216 199 180 225 211 196 226 213 199 231 220 208 231 147 139 201 67 60 201 71 62 201 62 58 246 146 142 231 96 96 245 124 124 237 131 131 255 254 254 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?>_?8??!!?>C?8@? C>@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaPrivateInterfaceBrowserIcon
@@ -1037,6 +828,7 @@
 JS\PO HGA TFA0IQTUEQTTPWMA<CS44@@D<ATUEQTUEQTUEQAD!!HRD!!HBEEQTUEQTUEQTP HB@ HB@!!QTUEQTUEQTUEQTUEQTUEQTP@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[231 96 97 200 41 48 200 48 52 200 41 49 200 29 44 242 77 92 241 77 92 245 118 128 200 25 42 197 188 224 215 209 233 112 94 176 111 93 174 114 96 177 113 95 176 115 97 177 117 100 177 120 102 180 125 108 184 125 108 183 130 114 185 143 128 194 151 136 198 149 135 197 158 145 203 156 143 201 159 146 203 165 153 207 168 156 208 168 156 207 167 155 205 171 160 209 174 164 209 220 215 236 226 222 240 85 66 159 90 71 159 93 74 164 90 72 159 89 71 158 92 73 160 94 75 164 93 74 161 93 75 161 97 79 167 96 79 166 97 79 166 98 80 167 98 80 165 96 79 162 101 83 168 101 84 169 108 91 173 107 91 172 111 94 174 117 100 178 131 116 188 137 122 191 134 120 187 139 125 191 138 124 190 142 128 193 154 142 199 161 149 204 167 156 207 174 165 210 181 172 216 185 176 218 204 198 228 94 78 161 105 89 172 174 165 212 231 147 139 201 67 60 201 71 62 201 62 58 246 146 142 231 96 96 245 124 124 237 131 131 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?>_?8??!!?>C?8@? C>@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaProtectedClassBrowserIcon
@@ -1062,6 +854,7 @@
 EBL*I5!!_XVE!!XU=WX6M#X0(D@PHIW&A XFAVX6M#X6M#X6M#X6M\XFA]X6M#X6M#X6M#X6M#X5-[X6M#X6M#X6M#X6M#X6M#X6M#X0@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[51 130 77 64 137 88 66 139 90 70 143 94 84 152 106 90 155 112 126 179 144 129 181 146 155 198 169 180 212 191 205 226 212 36 118 62 46 124 70 51 129 75 57 134 80 79 149 101 93 158 113 99 162 119 45 124 68 46 125 69 47 125 70 48 126 70 75 146 96 74 144 94 83 151 103 109 168 126 119 174 135 216 233 221 50 128 71 59 135 79 63 137 82 144 191 156 62 136 80 62 135 80 70 142 87 82 150 98 107 167 122 143 190 154 150 194 161 164 203 173 195 221 201 226 239 229 86 154 100 188 216 194 84 151 97 94 156 106 218 234 221 82 150 94 241 247 242 84 151 94 96 160 105 124 178 132 121 174 129 167 204 172 89 153 97 104 164 111 97 160 103 96 158 102 158 198 161 220 234 221 109 166 112 119 174 120 128 179 128 123 177 122 121 174 119 135 184 133 129 179 125 225 239 224 145 190 140 179 210 176 188 217 185 190 218 187 159 199 154 160 199 155 187 216 183 194 220 191 198 222 195 176 208 171 255 242 176 255 233 145 255 234 145 183 147 37 190 156 40 187 152 39 187 153 39 255 230 152 174 135 31 179 141 34 178 141 34 184 147 36 255 222 125 167 126 28 170 129 29 170 130 30 174 135 32 254 219 140 254 222 150 254 207 108 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?<_?8??1??C?8@O@@X@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaProtectedEnumBrowserIcon
@@ -1087,6 +880,7 @@
 FB\*E@(QD1LSD1DIQ4]GQ4P)HBE@DAHRD!!HHQ4]GQ4]GQ4]GQ4\ND!!HOQ4]GQ4]GQ4]GQ4]GQ04MQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ0@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[255 242 176 255 233 145 255 234 145 183 147 37 190 156 40 187 152 39 187 153 39 255 230 152 174 135 31 179 141 34 178 141 34 184 147 36 255 222 125 167 126 28 170 129 29 170 130 30 174 135 32 254 219 140 254 222 150 254 207 108 217 201 182 219 204 186 140 89 32 142 92 36 142 93 37 143 93 38 144 94 39 144 95 40 145 96 41 147 99 45 147 100 47 148 101 48 149 103 50 151 104 53 152 107 56 153 108 57 154 109 60 155 111 62 158 115 67 158 116 68 159 117 69 160 118 71 161 119 73 163 123 77 165 125 81 165 126 81 166 127 83 169 131 88 170 133 91 176 141 102 178 144 106 180 147 110 182 150 114 185 154 119 186 156 122 187 157 124 190 161 129 192 164 133 194 167 137 199 174 146 204 182 157 206 184 160 209 188 165 211 192 170 213 194 173 212 193 172 214 196 176 216 199 180 225 211 196 231 220 208 255 254 254 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?<_?8??1??C?8@O@@X@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaProtectedInterfaceBrowserIcon
@@ -1112,6 +906,7 @@
 H3DGF4-RUEQTUEIJU%YVU#4NK"\XTUMST5MIU%YVU%YVU%YVU%YOT5MPU%YVU%YVU%YVU%YVU$9NU%YVU%YVU%YVU%YVU%YVU%YVU @@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[197 188 224 215 209 233 112 94 176 111 93 174 114 96 177 113 95 176 115 97 177 117 100 177 120 102 180 125 108 184 125 108 183 130 114 185 143 128 194 151 136 198 149 135 197 158 145 203 156 143 201 159 146 203 165 153 207 167 155 207 168 156 208 168 156 207 167 155 205 171 160 209 178 167 213 174 164 209 177 167 212 183 173 216 220 215 236 226 222 240 85 66 159 93 74 164 90 72 159 89 71 158 92 73 160 94 75 164 93 74 161 93 75 161 97 79 167 96 79 166 97 79 166 98 80 167 98 80 165 96 79 162 101 83 168 101 84 169 108 91 173 107 91 172 111 94 174 117 100 178 131 116 188 137 122 191 134 120 187 139 125 191 138 124 190 142 128 193 161 149 204 169 159 207 174 165 210 181 172 216 185 176 218 204 198 228 94 78 161 105 89 172 174 165 212 255 242 176 255 233 145 255 234 145 183 147 37 190 156 40 187 152 39 187 153 39 255 230 152 174 135 31 179 141 34 178 141 34 184 147 36 255 222 125 167 126 28 170 129 29 170 130 30 174 135 32 254 219 140 254 222 150 254 207 108 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?<_?8??1??C?8@O@@X@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaPublicClassBrowserIcon
@@ -1139,6 +934,7 @@
 
     "Created: / 23-10-2011 / 14:41:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaPublicEnumBrowserIcon
@@ -1164,6 +960,7 @@
 @!!HVEQXR@"P0LC@0LC@0LB8TB00KFB80LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0LC@0L@@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[140 89 32 142 92 36 142 93 37 143 93 38 144 94 39 144 95 40 145 96 41 146 97 43 147 99 45 147 100 47 148 101 48 149 103 50 151 104 53 152 107 56 153 108 57 154 109 60 155 111 62 158 115 67 158 116 68 159 117 69 160 118 71 161 119 72 161 119 73 163 123 77 164 124 79 165 125 81 165 126 81 166 127 83 169 131 88 170 133 91 175 139 100 176 141 102 178 144 106 180 147 110 182 150 114 185 154 119 186 156 122 187 157 124 190 161 129 192 164 133 194 167 137 199 174 146 204 182 157 206 184 160 209 188 165 216 199 180 225 211 196 255 254 254 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?<_?0?>A?0C>@@@@@@@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaPublicInterfaceBrowserIcon
@@ -1189,6 +986,7 @@
 HSPHB@ 4HQMCP4MCP4MCP38OK2X/DC9CP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP4MCP0@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[197 188 224 197 189 222 215 209 233 112 94 176 111 93 174 114 96 177 113 95 176 115 97 177 117 100 177 120 102 180 125 108 184 125 108 183 130 114 185 143 128 194 151 136 198 149 135 197 152 138 199 158 145 203 156 143 201 159 146 203 162 150 204 165 153 207 168 156 208 174 164 209 177 167 212 220 215 236 226 222 240 85 66 159 90 71 159 93 74 164 90 72 159 89 71 158 92 73 160 94 75 164 93 74 161 92 74 160 93 75 161 97 79 167 96 79 166 97 79 166 98 80 167 100 82 168 98 80 165 96 79 162 100 82 167 101 83 168 101 84 169 108 91 173 107 91 172 108 92 172 113 96 177 111 94 174 117 100 178 131 116 188 137 122 191 134 120 187 139 125 191 138 124 190 142 128 193 161 149 204 174 165 210 185 176 218 204 198 228 94 78 161 105 89 172 174 165 212 255 255 255 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C>@_<C?8_?1??G?<_?1??G?<_?0?>A?0C>@@@@@@@@@b') ; yourself); yourself]
 ! !
+
 !GenericToolbarIconLibrary class methodsFor:'image specs-tools-SystemBrowser-java'!
 
 javaRuntimeExceptionBrowserIcon
@@ -1214,6 +1012,7 @@
 D1LSD1LSBP8NBQLSD1LSD1LSD1LSD08QDP8SD1LSD1LSD1LSD1LGDQDGD1LSD1LSD1LSD1LSB@\GBALSD1LSD1LSD1LSD1LSD1LSD0@@@@@@@@@@@@@@@@@@
 @@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[244 120 123 200 39 47 244 102 111 243 103 111 243 88 99 242 87 99 233 164 170 200 25 42 242 197 202 244 208 212 40 98 150 81 128 170 110 150 185 194 211 226 201 71 62 246 146 142 201 58 56 246 136 134 246 135 135 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A0@G@@\<A30GO@\<G30^O@@<@A @@@@<@C0@O@@<@@@b') ; yourself); yourself]
 ! !
+
 !Integer class methodsFor:'queries'!
 
 isJavaPrimitiveType
@@ -1222,6 +1021,7 @@
 
     "Created: / 11-02-2011 / 11:12:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Integer class methodsFor:'accessing'!
 
 javaArrayClass
@@ -1229,6 +1029,7 @@
 
     "Created: / 11-02-2011 / 10:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Integer class methodsFor:'autoboxing support'!
 
 javaBox: anObject
@@ -1240,6 +1041,7 @@
 
     "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Integer class methodsFor:'accessing'!
 
 javaName
@@ -1248,6 +1050,7 @@
 
     "Modified: / 25-02-2011 / 18:59:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Integer class methodsFor:'autoboxing support'!
 
 javaUnbox: object onError: errorBlock
@@ -1258,6 +1061,7 @@
 
     "Created: / 25-11-2011 / 19:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Integer class methodsFor:'autoboxing support'!
 
 javaUnbox: object onError: errorBlock min: min max: max
@@ -1279,6 +1083,7 @@
 
     "Created: / 22-11-2011 / 11:43:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !LargeInteger class methodsFor:'queries'!
 
 isJavaPrimitiveType
@@ -1287,6 +1092,7 @@
 
     "Created: / 04-02-2011 / 11:55:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !LargeInteger class methodsFor:'accessing'!
 
 javaArrayClass
@@ -1294,6 +1100,7 @@
 
     "Created: / 11-02-2011 / 10:51:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !LargeInteger class methodsFor:'autoboxing support'!
 
 javaBox: anObject
@@ -1305,6 +1112,7 @@
 
     "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !LargeInteger class methodsFor:'accessing'!
 
 javaName
@@ -1313,6 +1121,7 @@
 
     "Modified: / 25-02-2011 / 18:59:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !LargeInteger class methodsFor:'autoboxing support'!
 
 javaUnbox: object onError: errorBlock
@@ -1331,6 +1140,94 @@
 
     "Created: / 22-11-2011 / 11:45:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!Object methodsFor:'testing'!
+
+isJavaArray
+
+    ^self class isJavaArrayClass
+
+    "Created: / 19-12-2010 / 17:05:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Object methodsFor:'testing'!
+
+isJavaNameAndType
+    "return true, if given object represents name and type struct in java constant pool"
+
+    ^ false.
+
+    "Created: / 10-05-2011 / 12:21:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Object methodsFor:'testing'!
+
+isJavaPackage
+    "return true, if the receiver is a java package.
+     False is returned here - the method is only redefined in JavaPackage."
+
+    ^ false
+
+    "Created: / 09-08-2011 / 09:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Object methodsFor:'testing'!
+
+isJavaRef
+"return true, if given object represents reference in java constant pool"
+^ false.
+
+    "Created: / 08-04-2011 / 16:12:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Object methodsFor:'testing'!
+
+isJavaWrapperClass
+    "return true, if this is a java wrapper class, i.e, java.lang.Integer, java.lang.Boolean etc."
+
+    ^ false
+
+    "Created: / 01-01-2012 / 17:25:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Object methodsFor:'autoboxing support'!
+
+javaBox: anObject
+
+    ^anObject
+
+    "Created: / 15-08-2011 / 10:52:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Object methodsFor:'autoboxing support'!
+
+javaUnwrap: anObject
+    "Unwraps the objects. Possibly call on the wrapped class"
+
+    ^anObject
+
+    "Created: / 10-12-2011 / 19:51:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!Object methodsFor:'autoboxing support'!
+
+javaUnwrapFrom: javaType
+    ^ self.
+
+    "Created: / 10-12-2011 / 19:51:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 30-12-2011 / 15:22:06 / kursjan <kursjan@fit.cvut.cz>"
+! !
+
+!Object methodsFor:'autoboxing support'!
+
+javaWrap: anObject
+    "Wraps the receiver into corresponding Java object"
+
+    ^anObject
+
+    "Created: / 26-12-2011 / 00:57:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !Object class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -1339,6 +1236,7 @@
 
     "Created: / 19-12-2010 / 17:05:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Object class methodsFor:'queries'!
 
 isJavaClassType
@@ -1347,6 +1245,7 @@
 
     "Created: / 11-02-2011 / 08:08:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Object class methodsFor:'queries'!
 
 isJavaPrimitiveType
@@ -1355,6 +1254,7 @@
 
     "Created: / 20-12-2010 / 21:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Object class methodsFor:'queries'!
 
 isJavaReferenceType
@@ -1363,6 +1263,7 @@
 
     "Created: / 20-12-2010 / 21:52:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !Object class methodsFor:'queries'!
 
 isJavaType
@@ -1371,6 +1272,79 @@
 
     "Created: / 20-12-2010 / 21:52:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!Process methodsFor:'Java protocol'!
+
+clearInterrupted
+    JavaVM threadInterrupts at: self put: false.
+
+    "Created: / 30-11-2011 / 10:44:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Process methodsFor:'Java protocol'!
+
+isInterrupted
+
+    ^ JavaVM threadInterrupts at: self
+        ifAbsent: [ JavaVM threadInterrupts at: self put: false. ]
+
+    "Created: / 30-11-2011 / 12:12:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Process methodsFor:'queries'!
+
+isSleeping
+    "return true, iff the receiver is sleeping on Delay"
+    
+    ^ (state == #sleep)
+
+    "Created: / 30-11-2011 / 13:35:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Process methodsFor:'queries'!
+
+isWaiting
+    "return true, iff the receiver is waiting on semaphore or something"
+
+    ^ (state == #wait)
+
+    "Created: / 20-11-2011 / 20:55:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Process methodsFor:'Java protocol'!
+
+javaInterrupt
+    self isWaiting ifTrue: [
+        self 
+            interruptWith: [
+                JavaVM 
+                    throwInterruptedException: 'thread has been interrupted during wait'.
+                self terminate
+            ]
+    ] ifFalse: [
+        self isSleeping ifTrue: [
+      
+            self 
+                interruptWith: [
+                    JavaVM 
+                        throwInterruptedException: 'thread has been interrupted during sleep'.
+                    self terminate
+                ]
+        ] ifFalse: [ self setInterrupted. ]
+    ]
+
+    "Created: / 30-11-2011 / 13:35:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!Process methodsFor:'Java protocol'!
+
+setInterrupted
+
+    JavaVM threadInterrupts at: self put: true.
+
+    "Created: / 30-11-2011 / 10:44:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
 !ProjectDefinition class methodsFor:'description - java'!
 
 javaClassPath
@@ -1382,6 +1356,7 @@
 
     "Created: / 13-12-2011 / 23:48:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !ProjectDefinition class methodsFor:'description - java'!
 
 javaSourcePath
@@ -1392,6 +1367,13 @@
 
     "Created: / 13-12-2011 / 23:49:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!Set methodsFor:'javaProtocol'!
+
+java__contains:anObject
+         ^ self contains: [:el | anObject = el ] 
+! !
+
 !ShortFloat class methodsFor:'queries'!
 
 isJavaPrimitiveType
@@ -1400,6 +1382,7 @@
 
     "Created: / 06-02-2011 / 17:21:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !ShortFloat class methodsFor:'accessing'!
 
 javaArrayClass
@@ -1407,6 +1390,7 @@
 
     "Created: / 11-02-2011 / 10:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !ShortFloat class methodsFor:'autoboxing support'!
 
 javaBox: anObject
@@ -1418,6 +1402,7 @@
 
     "Created: / 16-08-2011 / 09:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !ShortFloat class methodsFor:'accessing'!
 
 javaName
@@ -1426,12 +1411,14 @@
 
     "Modified: / 25-02-2011 / 18:59:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedIntegerArray class methodsFor:'testing'!
 
 isInterface
 
     ^false
 ! !
+
 !SignedIntegerArray class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -1440,6 +1427,7 @@
 
     "Created: / 06-02-2011 / 15:16:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedIntegerArray class methodsFor:'accessing-java'!
 
 javaArrayClass
@@ -1449,6 +1437,7 @@
     "Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 10-08-2011 / 22:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedIntegerArray class methodsFor:'accessing'!
 
 javaComponentClass
@@ -1457,6 +1446,7 @@
 
     "Created: / 25-06-2011 / 08:38:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedIntegerArray class methodsFor:'accessing'!
 
 javaName
@@ -1465,12 +1455,14 @@
 
     "Modified: / 25-02-2011 / 19:03:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedLongIntegerArray class methodsFor:'testing'!
 
 isInterface
 
     ^false
 ! !
+
 !SignedLongIntegerArray class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -1479,6 +1471,7 @@
 
     "Created: / 20-12-2010 / 22:47:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedLongIntegerArray class methodsFor:'queries'!
 
 isJavaReferenceType
@@ -1488,6 +1481,7 @@
 
     "Created: / 20-12-2010 / 22:30:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedLongIntegerArray class methodsFor:'accessing-java'!
 
 javaArrayClass
@@ -1497,6 +1491,7 @@
     "Modified: / 10-08-2011 / 22:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 26-08-2011 / 18:29:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedLongIntegerArray class methodsFor:'accessing'!
 
 javaComponentClass
@@ -1505,6 +1500,7 @@
 
     "Modified: / 25-06-2011 / 08:38:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !SignedLongIntegerArray class methodsFor:'accessing'!
 
 javaName
@@ -1513,6 +1509,44 @@
 
     "Modified: / 25-02-2011 / 19:03:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!SmallInteger methodsFor:'autoboxing'!
+
+javaUnwrapFrom: javaType
+    javaType = #boolean ifTrue: [
+        ^ self = 1
+    ].
+    ^ self
+
+    "Created: / 30-12-2011 / 15:22:52 / kursjan <kursjan@fit.cvut.cz>"
+! !
+
+!String methodsFor:'converting'!
+
+asArrayOfSubstringsSeparatedBy:aSeparator
+    "Modified version of asArrayOfSubstrings"
+
+    |substrings start end|
+
+    substrings := OrderedCollection new.
+    start := 1.
+    [start <= self size] whileTrue:[
+	(self at:start) = aSeparator ifFalse:[
+	    end := start + 1.
+	    [
+		end <= self size and:[(self at:end) ~= aSeparator]
+	    ] whileTrue:[end := end + 1].
+	    substrings add:(self copyFrom:start to:end - 1).
+	    start := end - 1
+	].
+	start := start + 1
+    ].
+    ^ substrings asArray
+
+    "Created: / 07-02-2011 / 11:18:03 / Marcel Hlopko <hlopik@gmail.com>"
+    "Modified: / 08-02-2011 / 01:08:15 / Marcel Hlopko <hlopik@gmail.com>"
+! !
+
 !UndefinedObject class methodsFor:'queries'!
 
 isJavaPrimitiveType
@@ -1523,6 +1557,7 @@
 
     "Created: / 21-12-2010 / 22:52:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !UndefinedObject class methodsFor:'accessing'!
 
 javaName
@@ -1531,12 +1566,66 @@
 
     "Modified: / 25-02-2011 / 18:59:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
+!UserPreferences methodsFor:'accessing-java-devel'!
+
+javaTestsDirectory
+    ^ self at: #javaTestsDirectory
+	ifAbsent:
+	    [ | nm |
+
+	    nm := OperatingSystem getLoginName.
+	     "Default path for Jan"
+	    (nm = 'jv' and:[OperatingSystem isUNIXlike])
+		ifTrue:
+		    [ '/home/jv/Projects/libjava/sources/libjava/branches/jk_new_structure/tests' ]
+		ifFalse:
+		    [ "Default path for Jan (the other one :-)"
+		    nm = 'jk'
+			ifTrue: [ 'path for Jan' ]
+			ifFalse:
+			    [ "Default path for Marcel"
+			    nm = 'm'
+				ifTrue: [ '/home/m/Projects/libjava/branches/jk_new_structure/tests' ]
+				ifFalse:
+				    [ | "Look into package dir" p |
+
+				    (p := (Smalltalk getPackageDirectoryForPackage: 'stx:libjava') asFilename
+						/ 'tests') exists
+					ifTrue: [ p pathName ]
+					ifFalse:
+					    [ | "Try the environment variable (used by Hudson)" p |
+
+					    (p := OperatingSystem getEnvironment: 'LIBJAVA_TESTS') notNil
+						ifTrue: [ p ]
+						ifFalse:
+						    [ "No default, trigger an error"
+						    self error: 'No tests path specified' ] ] ] ] ] ]
+
+    "
+	UserPreferences current javaTestsDirectory"
+
+    "Created: / 07-05-2011 / 17:43:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-05-2011 / 20:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 12-05-2011 / 15:54:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+! !
+
+!UserPreferences methodsFor:'accessing-java-devel'!
+
+javaTestsDirectory: aStringOrFilename
+
+    self at:#javaTestsDirectory put: aStringOrFilename asString.
+
+    "Created: / 07-05-2011 / 17:45:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !WordArray class methodsFor:'testing'!
 
 isInterface
 
     ^false
 ! !
+
 !WordArray class methodsFor:'queries'!
 
 isJavaArrayClass
@@ -1545,6 +1634,7 @@
 
     "Created: / 20-12-2010 / 22:47:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !WordArray class methodsFor:'queries'!
 
 isJavaReferenceType
@@ -1554,6 +1644,7 @@
 
     "Created: / 20-12-2010 / 22:30:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !WordArray class methodsFor:'accessing-java'!
 
 javaArrayClass
@@ -1563,6 +1654,7 @@
     "Created: / 11-06-2011 / 23:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 10-08-2011 / 22:46:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !WordArray class methodsFor:'accessing-java'!
 
 javaComponentClass
@@ -1571,6 +1663,7 @@
 
     "Created: / 20-12-2010 / 22:13:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
+
 !WordArray class methodsFor:'accessing'!
 
 javaName
@@ -1578,8 +1671,44 @@
 
     "Modified: / 06-12-2011 / 16:43:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
 ! !
+
+!WrappedMethod methodsFor:'accessing'!
+
+descriptor
+    "Returns descriptor object (for wrapped Java methods)"
+
+    | orig |
+    orig := self originalMethod.
+    ^(orig respondsTo: #descriptor) ifTrue:[
+        orig descriptor
+    ] ifFalse:[
+        self doesNotUnderstand: (Message selector: #descriptor)
+    ]
+
+    "Created: / 16-12-2011 / 20:03:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!WrappedMethod methodsFor:'queries'!
+
+isAbstract
+
+    ^self originalMethod isAbstract.
+
+    "Created: / 04-12-2011 / 11:24:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ZipArchive methodsFor:'reading - java support'!
+
+nextBytes: bytesToRead of: zmember startingAt: pos into: b startingAt: off
+
+    file position0Based: zmember fileStart + startOfArchive + pos.
+    ^ file nextBytes: bytesToRead into: b startingAt: off.
+
+    "Created: / 01-05-2011 / 16:21:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !stx_libjava class methodsFor:'documentation'!
 
 extensionsVersion_SVN
     ^ '$Id$'
-! !
+! !
\ No newline at end of file