src/JavaUnresolvedStringConstant.st
author vranyj1
Wed, 10 Aug 2011 22:58:10 +0000
branchjk_new_structure
changeset 906 fea23aa2b228
parent 877 f5a5b93e1c78
child 923 b922537eea2a
permissions -rw-r--r--
Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     1
"
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
     7
 license:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    14
 hereby transferred.
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    40
     of one of the above copright owners.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    41
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    42
"{ Package: 'stx:libjava' }"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    43
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    44
JavaUnresolvedConstant subclass:#JavaUnresolvedStringConstant
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:'stringIndex'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    46
	classVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    47
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    48
	category:'Languages-Java-Reader-Support'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    49
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    50
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    51
!JavaUnresolvedStringConstant class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    52
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    53
copyright
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    54
"
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    58
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    60
 license:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    61
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    62
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    63
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    64
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    65
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    66
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    67
 hereby transferred.
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    68
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    70
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    72
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    73
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    74
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    76
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    77
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    78
 conditions:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    79
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    80
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    81
 included in all copies or substantial portions of the Software.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    82
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    91
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    93
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    94
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 752
diff changeset
    95
"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    96
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    97
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    98
!JavaUnresolvedStringConstant class methodsFor:'instance creation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    99
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   100
pool:aPool poolIndex:index stringIndex:stringIndex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   101
    ^ self new 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   102
        pool:aPool poolIndex:index stringIndex:stringIndex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   103
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   104
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   105
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   106
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   107
!JavaUnresolvedStringConstant methodsFor:'accessing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   108
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   109
pool:aPool poolIndex:i stringIndex:string_index
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   110
    constantPool := aPool.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   111
    constantPoolIndex := i.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   112
    stringIndex := string_index.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   113
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   114
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   115
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   116
!JavaUnresolvedStringConstant methodsFor:'resolving'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   117
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   118
preResolve
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   119
    |jString chars|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   120
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   121
    Java java_lang_String notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   122
        chars := (constantPool at:stringIndex).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   123
        chars isString ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   124
            self halt:'should not happen'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   125
        ].
906
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 877
diff changeset
   126
        jString := JavaVM javaStringObjectForString:chars interned:true.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   127
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   128
"/constantPool owner == (Java at:'java/awt/Container') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   129
"/self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   130
"/].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   131
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   132
        constantPool at:constantPoolIndex put:jString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   133
        ^ jString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   134
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   136
    self rememberForResolveWith:'java/lang/String'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   137
    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   138
906
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 877
diff changeset
   139
    "Modified: / 07-08-1997 / 21:17:23 / cg"
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 877
diff changeset
   140
    "Modified: / 10-08-2011 / 23:28:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   141
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   142
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   143
!JavaUnresolvedStringConstant class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   144
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   145
version
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   146
    ^ '$Id$'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   147
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   148
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   149
version_SVN
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   150
    ^ '$Id$'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   151
! !