--- a/src/JavaClassReader.st Fri May 13 12:34:01 2011 +0000
+++ b/src/JavaClassReader.st Fri May 13 15:28:12 2011 +0000
@@ -1627,23 +1627,28 @@
!
readConstant_Asciz
- |len string|
-
- len := inStream nextUnsignedShortMSB:msb.
- string := String new:len.
- inStream nextBytes:len into:string startingAt:1.
-
- Verbose ifTrue:[Transcript show:'asciz; string= '; showCR:string].
-
+ | len string |
+self halt.
+ len := inStream nextUnsignedShortMSB: msb.
+ string := String new: len.
+ inStream
+ nextBytes: len
+ into: string
+ startingAt: 1.
+ Verbose
+ ifTrue:
+ [ Transcript
+ show: 'asciz; string= ';
+ showCR: string ].
^ string
"
JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/AddButton.class'
- JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'
- "
-
- "Created: 15.4.1996 / 15:15:35 / cg"
- "Modified: 15.4.1996 / 16:33:45 / cg"
+ JavaClassReader readFile:'/phys/ibm3/hotjava/classes/browser/Alignable.class'"
+
+ "Created: / 15-04-1996 / 15:15:35 / cg"
+ "Modified: / 15-04-1996 / 16:33:45 / cg"
+ "Modified: / 13-05-2011 / 17:10:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
readConstant_Class
@@ -1905,66 +1910,78 @@
!
readConstant_String
- |tag string_index chars jString|
-
- string_index := inStream nextUnsignedShortMSB:msb.
-
- Verbose ifTrue:[Transcript show:'string; index= '; showCR:string_index].
-
+ | tag string_index chars jString |
+self halt.
+ string_index := inStream nextUnsignedShortMSB: msb.
+ Verbose
+ ifTrue:
+ [ Transcript
+ show: 'string; index= ';
+ showCR: string_index ].
+
"/ resolve here if possible
- string_index < constSlot ifTrue:[
- Java java_lang_String notNil ifTrue:[
- chars := (constants at:string_index).
- chars isString ifFalse:[
- self halt:'should not happen'
- ].
- jString := Java as_String:chars.
- ^ jString.
- ]
- ].
-
+
+ string_index < constSlot
+ ifTrue:
+ [ Java java_lang_String notNil
+ ifTrue:
+ [ chars := (constants at: string_index).
+ chars isString ifFalse: [ self halt: 'should not happen' ].
+ jString := Java as_String: chars.
+ ^ jString. ] ].
^ JavaUnresolvedStringConstant
- pool:constants
- poolIndex:constSlot
- stringIndex:string_index
+ pool: constants
+ poolIndex: constSlot
+ stringIndex: string_index
"
Verbose := true.
- JavaClassReader readFile:'/phys/ibm3/java/lib/java/lang/System.class'
- "
-
- "Created: / 15.4.1996 / 15:20:33 / cg"
- "Modified: / 7.5.1998 / 11:42:45 / cg"
+ JavaClassReader readFile:'/phys/ibm3/java/lib/java/lang/System.class'"
+
+ "Created: / 15-04-1996 / 15:20:33 / cg"
+ "Modified: / 07-05-1998 / 11:42:45 / cg"
+ "Modified: / 13-05-2011 / 17:09:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
readConstant_Unicode
- |len string ascii|
-
- len := inStream nextUnsignedShortMSB:msb.
- string := TwoByteString new:len.
- 1 to:len do:[:idx |
- ascii := inStream nextUnsignedShortMSB:msb.
- string at:idx put:(Character value:ascii).
- ].
-
- Verbose ifTrue:[Transcript show:'asciz; unicodeString= '; showCR:string].
-
+ | len string ascii |
+self halt.
+ len := inStream nextUnsignedShortMSB: msb.
+ string := TwoByteString new: len.
+ 1 to: len
+ do:
+ [:idx |
+ ascii := inStream nextUnsignedShortMSB: msb.
+ string at: idx put: (Character value: ascii). ].
+ Verbose
+ ifTrue:
+ [ Transcript
+ show: 'asciz; unicodeString= ';
+ showCR: string ].
^ string
+
+ "Modified: / 13-05-2011 / 17:09:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
readConstant_Utf8
- |len bytes string|
-
- len := inStream nextUnsignedShortMSB:msb.
- bytes := ByteArray new:len.
- inStream nextBytes:len into:bytes startingAt:1.
- string := CharacterArray fromJavaUTF8Bytes:bytes.
-
- Verbose ifTrue:[Transcript show:'asciz; string= '; showCR:string].
-
+ | len bytes string |
+self halt.
+ len := inStream nextUnsignedShortMSB: msb.
+ bytes := ByteArray new: len.
+ inStream
+ nextBytes: len
+ into: bytes
+ startingAt: 1.
+ string := CharacterArray fromJavaUTF8Bytes: bytes.
+ Verbose
+ ifTrue:
+ [ Transcript
+ show: 'asciz; string= ';
+ showCR: string ].
^ string
"Modified: / 19-10-2010 / 12:38:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 13-05-2011 / 17:09:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !
!JavaClassReader methodsFor:'file reading - constants-ST'!
@@ -2036,49 +2053,54 @@
!
readConstant_ST_String
- |tag string_index chars|
-
- string_index := inStream nextUnsignedShortMSB:msb.
-
- Verbose ifTrue:[Transcript show:'string; index= '; showCR:string_index].
-
+ | tag string_index chars |
+self halt.
+ string_index := inStream nextUnsignedShortMSB: msb.
+ Verbose
+ ifTrue:
+ [ Transcript
+ show: 'string; index= ';
+ showCR: string_index ].
+
"/ resolve here if possible
- string_index < constSlot ifTrue:[
- chars := (constants at:string_index).
- ^ chars
- ].
-
+
+ string_index < constSlot
+ ifTrue:
+ [ chars := (constants at: string_index).
+ ^ chars ].
^ JavaUnresolvedSTStringConstant
- pool:constants
- poolIndex:constSlot
- stringIndex:string_index
-
- "Modified: / 7.5.1998 / 11:48:28 / cg"
- "Created: / 7.5.1998 / 11:49:55 / cg"
+ pool: constants
+ poolIndex: constSlot
+ stringIndex: string_index
+
+ "Created: / 07-05-1998 / 11:49:55 / cg"
+ "Modified: / 13-05-2011 / 17:10:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
!
readConstant_ST_Symbol
- |tag string_index chars|
-
- string_index := inStream nextUnsignedShortMSB:msb.
-
- Verbose ifTrue:[Transcript show:'symbol; index= '; showCR:string_index].
-
+ | tag string_index chars |
+self halt.
+ string_index := inStream nextUnsignedShortMSB: msb.
+ Verbose
+ ifTrue:
+ [ Transcript
+ show: 'symbol; index= ';
+ showCR: string_index ].
+
"/ resolve here if possible
- string_index < constSlot ifTrue:[
- chars := (constants at:string_index).
- chars isString ifFalse:[
- self halt:'should not happen'
- ].
- ^ chars asSymbol
- ].
-
+
+ string_index < constSlot
+ ifTrue:
+ [ chars := (constants at: string_index).
+ chars isString ifFalse: [ self halt: 'should not happen' ].
+ ^ chars asSymbol ].
^ JavaUnresolvedSTSymbolConstant
- pool:constants
- poolIndex:constSlot
- stringIndex:string_index
-
- "Modified: / 7.5.1998 / 11:48:28 / cg"
+ pool: constants
+ poolIndex: constSlot
+ stringIndex: string_index
+
+ "Modified: / 07-05-1998 / 11:48:28 / cg"
+ "Modified: / 13-05-2011 / 17:10:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
! !
!JavaClassReader methodsFor:'file reading - fields'!