src/JavaConstantPool.st
author vranyj1
Tue, 18 Oct 2011 15:52:12 +0000
branchjk_new_structure
changeset 1022 38b710d7dfbc
parent 923 b922537eea2a
child 1152 040cba55a7d2
permissions -rw-r--r--
svn properties fixed
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: 778
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
     3
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
     4
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
     5
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
     6
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
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: 778
diff changeset
    15
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    16
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    17
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    18
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    19
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    20
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    21
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    22
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    23
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    24
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    25
 conditions:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    26
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    27
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    28
 included in all copies or substantial portions of the Software.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    29
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    30
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    31
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    32
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    33
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    34
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    35
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    36
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    37
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    38
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    39
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
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
Array variableSubclass:#JavaConstantPool
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    45
	instanceVariableNames:'owner'
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
    46
	classVariableNames:'ConstantPools'
752
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
!JavaConstantPool 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: 778
diff changeset
    55
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    56
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    57
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    58
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    59
 Parts of the code written by Claus Gittinger are under following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
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: 778
diff changeset
    68
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    69
 Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    70
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    71
 Permission is hereby granted, free of charge, to any person
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    72
 obtaining a copy of this software and associated documentation
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    73
 files (the 'Software'), to deal in the Software without
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    74
 restriction, including without limitation the rights to use,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    75
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    76
 copies of the Software, and to permit persons to whom the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    77
 Software is furnished to do so, subject to the following
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    78
 conditions:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    79
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    80
 The above copyright notice and this permission notice shall be
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
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: 778
diff changeset
    83
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    84
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    85
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    86
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    87
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    88
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    89
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    90
 OTHER DEALINGS IN THE SOFTWARE.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    91
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    92
 [1] Code written at SWING Research Group contain a signature
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    93
     of one of the above copright owners.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
diff changeset
    94
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 778
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
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
    98
!JavaConstantPool class methodsFor:'initialization'!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
    99
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   100
initialize
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   101
    ConstantPools := OrderedCollection new: 1000.
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   102
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   103
    "Modified: / 08-04-2011 / 17:28:07 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   104
    "Modified: / 09-04-2011 / 09:25:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   105
! !
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   106
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   107
!JavaConstantPool class methodsFor:'instance creation'!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   108
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   109
new: size 
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   110
    "return an initialized instance"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   111
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   112
    ^ ConstantPools add: ((super new: size)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   113
                initialize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   114
                yourself).
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   115
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   116
    "Created: / 08-04-2011 / 16:56:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   117
    "Modified: / 09-04-2011 / 09:24:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   118
    "Modified: / 11-04-2011 / 18:46:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   119
! !
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   120
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   121
!JavaConstantPool class methodsFor:'accessing'!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   122
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   123
allConstantPools
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   124
    "linked list of all constant pools in system"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   125
    ^ ConstantPools.
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   126
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   127
    "Created: / 08-04-2011 / 16:53:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   128
    "Modified: / 09-04-2011 / 09:24:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   129
!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   130
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   131
allConstantPools: anOorderedCollection 
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   132
    "linked list of all constant pools in system"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   133
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   134
    ConstantPools := anOorderedCollection.
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   135
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   136
    "Created: / 08-04-2011 / 17:07:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   137
    "Modified: / 09-04-2011 / 09:24:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   138
    "Modified: / 11-04-2011 / 18:47:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   139
! !
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   140
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   141
!JavaConstantPool class methodsFor:'special'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   142
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   143
invalidateForClass: internalJavaClassName 
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   144
    "Only alias, everybody calls invalidateForClass so why not me :)"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   145
    
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   146
    ^self invalidateReferencesToClass: internalJavaClassName.
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   147
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   148
    "Created: / 08-04-2011 / 16:52:52 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   149
!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   150
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   151
invalidateReferencesToClass: internalJavaClassName 
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 757
diff changeset
   152
    "Go over all constant pools and call invalidateForClass on all 
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 757
diff changeset
   153
     references. (usable when given class was unloaded etc)"
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 757
diff changeset
   154
    ConstantPools do: [:each | each invalidateForClass: internalJavaClassName].
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   155
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   156
    "Created: / 08-04-2011 / 16:09:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   157
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   158
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   159
!JavaConstantPool methodsFor:'accessing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   160
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   161
owner
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   162
    "return owner"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   163
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   164
    ^ owner
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   165
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   166
    "Created: 28.6.1996 / 21:12:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   167
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   169
owner:something
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   170
    "set owner"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   172
    owner := something.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   173
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   174
    "Created: 28.6.1996 / 21:12:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   175
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   176
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   177
!JavaConstantPool methodsFor:'adding'!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   178
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   179
at: classRefIndex putClassRefWithNameAt: classNameIndex 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   180
    self at: classRefIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   181
        put: (JavaClassRef2 in: self withNameAt: classNameIndex).
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   182
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   183
    "Created: / 13-05-2011 / 09:48:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   184
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   185
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   186
at: fieldRefIndex putFieldRefWithClassAt: classRefIndex andNameAndTypeAt: nameAndTypeIndex 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   187
    self at: fieldRefIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   188
        put: (JavaFieldRef2 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   189
                in: self
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   190
                withNameAndTypeAt: nameAndTypeIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   191
                andClassAt: classRefIndex).
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   192
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   193
    "Created: / 13-05-2011 / 09:08:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   194
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   195
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   196
at: interfaceMethodRefIndex putInterfaceMethodRefWithClassAt: classRefIndex andNameAndTypeAt: nameAndTypeIndex 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   197
    self at: interfaceMethodRefIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   198
        put: (JavaInterfaceMethodRef2 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   199
                in: self
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   200
                withNameAndTypeAt: nameAndTypeIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   201
                andClassAt: classRefIndex).
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   202
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   203
    "Created: / 13-05-2011 / 09:08:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   204
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   205
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   206
at: methodRefIndex putMethodRefWithClassAt: classRefIndex andNameAndTypeAt: nameAndTypeIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   207
    self at: methodRefIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   208
        put: (JavaMethodRef2 in: self withNameAndTypeAt: nameAndTypeIndex andClassAt:classRefIndex).
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   209
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   210
    "Created: / 13-05-2011 / 09:07:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   211
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   212
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   213
at: nameAndTypeIndex putNameAndTypeWithNameAt: nameIndex andDescriptorAt: descriptorIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   214
    self at: nameAndTypeIndex
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   215
        put: (JavaNameAndType2 in: self withNameAt: nameIndex andDescriptorAt: descriptorIndex).
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   216
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   217
    "Created: / 13-05-2011 / 09:05:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   218
! !
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   219
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   220
!JavaConstantPool methodsFor:'initialization'!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   221
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   222
initialize
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   223
    "Invoked when a new instance is created."
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   224
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   225
    "/ please change as required (and remove this comment)
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   226
    "/ owner := nil.
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   227
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   228
    "/ super initialize.   -- commented since inherited method does nothing
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   229
! !
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   230
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   231
!JavaConstantPool methodsFor:'printing & storing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   232
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   233
displayString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   234
    owner isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   235
        ^ '*** unowned ConstantPool'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   236
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   237
    ^ 'ConstantPool of ' , owner fullName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   238
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   239
    "Created: 28.6.1996 / 21:13:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   240
    "Modified: 28.6.1996 / 21:20:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   241
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   243
!JavaConstantPool methodsFor:'queries'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   244
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   245
refersToMethod:aJavaMethod
878
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   246
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   247
    self error: 'JV@2011-07-26: Update to new resolving scheme!!'.
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   248
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   249
    self do:[:constItem |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   250
        (constItem == aJavaMethod) ifTrue:[^ true].
878
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   251
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   252
    ].
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   253
    ^ false
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   254
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   255
    "Created: / 29-07-1997 / 17:39:19 / cg"
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   256
    "Modified: / 26-07-2011 / 18:00:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   257
!
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   258
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   259
refersToMethodNamed:aJavaMethodName
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   260
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   261
    self error: 'JV@2011-07-26: Update to new resolving scheme!!'.
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   262
    
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   263
    self do:[:constItem |
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   264
        (constItem isKindOf:JavaMethod) ifTrue:[
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   265
            constItem name = aJavaMethodName ifTrue:[^ true].
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   266
        ] ifFalse:[
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   267
            
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   268
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   269
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   270
    ^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   271
878
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   272
    "Created: / 29-07-1997 / 17:39:24 / cg"
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   273
    "Modified: / 16-10-1998 / 01:22:02 / cg"
b972cc489a01 Cleanup phase 2: Unused *Ref and *UnresolvedConstant removed.
vranyj1
parents: 877
diff changeset
   274
    "Modified: / 26-07-2011 / 17:54:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   275
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   276
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   277
!JavaConstantPool methodsFor:'special'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   278
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   279
classReferencesDo:aBlock
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   280
    self do:[:constItem |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   281
        constItem isJavaClass ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   282
            aBlock value:constItem
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   283
        ] 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   284
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   285
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   286
    "Modified: / 7.8.1997 / 19:17:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   287
    "Created: / 4.1.1998 / 00:40:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   288
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   289
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   290
invalidateAll 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   291
    "go over all entries and call invalidate on all references"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   292
    
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   293
    self do: 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   294
            [:entry | 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   295
            entry isJavaRef 
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   296
                ifTrue: [ entry invalidate] ].
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   297
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   298
    "Created: / 13-05-2011 / 09:37:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   299
!
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 772
diff changeset
   300
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   301
invalidateForClass: internalJavaClassName
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   302
"go over all entries and call invalidateForClass on all references"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   303
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   304
self do: [:entry | entry isJavaRef ifTrue:[entry invalidateForClass: internalJavaClassName]].
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   305
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   306
    "Created: / 08-04-2011 / 16:11:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   307
!
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   308
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   309
updateClassRefsFrom:oldClass to:newClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   310
owner == oldClass ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   311
    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   312
    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   313
].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   315
    self keysAndValuesDo:[:index :constItem |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   316
        |nameIndex|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   317
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   318
        constItem == oldClass ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   319
            self at:index put:newClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   320
        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   321
            (constItem isNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   322
            or:[constItem isNumber]) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   323
                constItem isString ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   324
                    "/ nothing done ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   325
                ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   326
                    (constItem isMemberOf:(Java java_lang_String)) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   327
                        "/ nothing done ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   328
                    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   329
                        constItem isBehavior ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   330
                            constItem updateClassRefsFrom:oldClass to:newClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   331
                        ] ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   332
                            constItem isJavaClass ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   333
                                constItem fullName = oldClass fullName ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   334
                                    'JAVA: class update by name [in pool].' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   335
                                    newClass isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   336
                                        "/ mhm - must find a slot for the classes name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   337
                                        nameIndex := -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   338
                                        self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   339
                                            at:index
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   340
                                            put:(JavaUnresolvedClassConstant
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   341
                                                    pool:self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   342
                                                    poolIndex:index
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   343
                                                    nameIndex:nameIndex)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   344
                                    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   345
                                        self at:index put:newClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   346
                                    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   347
                                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   348
                            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   349
                        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   350
                    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   351
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   352
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   353
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   354
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   355
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   356
    "Modified: / 4.2.1998 / 22:12:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   357
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   358
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   359
!JavaConstantPool class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   360
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   361
version
1022
38b710d7dfbc svn properties fixed
vranyj1
parents: 923
diff changeset
   362
    ^ '$Id$'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   363
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   365
version_SVN
1022
38b710d7dfbc svn properties fixed
vranyj1
parents: 923
diff changeset
   366
    ^ '$Id$'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   367
! !
757
b98b1cd769c0 JavaConstantPool: bug fix: JavaConstanPool new: size did not return a constant pool
vranyj1
parents: 752
diff changeset
   368
923
b922537eea2a Merged with CVS version
vranyj1
parents: 878
diff changeset
   369
JavaConstantPool initialize!