JavaClassRef2.st
author hlopkmar
Sat, 01 Dec 2012 22:06:11 +0000
branchdevelopment
changeset 1851 d74d5dc547f3
parent 1818 2e5ed72e7dfd
child 1864 60a8dc26c8c6
permissions -rw-r--r--
junit tests for param annotations
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
     1
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1073
diff changeset
     3
1155
vranyj1
parents: 1152
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1073
diff changeset
     5
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
     8
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
     9
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    10
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    12
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    13
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    14
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    15
1155
vranyj1
parents: 1152
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    18
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1073
diff changeset
    19
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    20
"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    22
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    23
JavaRef2 subclass:#JavaClassRef2
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
    24
	instanceVariableNames:'nameIndex'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    25
	classVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    26
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    27
	category:'Languages-Java-Reader-Support-new'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    28
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    29
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    30
!JavaClassRef2 class methodsFor:'documentation'!
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    31
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    32
copyright
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    33
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    34
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1073
diff changeset
    35
1155
vranyj1
parents: 1152
diff changeset
    36
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1073
diff changeset
    37
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    38
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    40
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    41
 This software is furnished under a license and may be used
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    42
 only in accordance with the terms of that license and with the
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    44
 be provided or otherwise made available to, or used by, any
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    45
 other person.  No title to or ownership of the software is
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    46
 hereby transferred.
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    47
1155
vranyj1
parents: 1152
diff changeset
    48
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    49
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    50
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1073
diff changeset
    51
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    52
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    53
"
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 814
diff changeset
    54
! !
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    55
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    56
!JavaClassRef2 class methodsFor:'instance creation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    57
771
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
    58
in: aJavaConstantPool withNameAt: nameIndex
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
    59
    ^ self basicNew initializeIn: aJavaConstantPool withNameAt: nameIndex.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    60
771
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
    61
    "Created: / 10-05-2011 / 14:56:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1711
38b4f702653e - JavaRef2
vranyj1
parents: 1372
diff changeset
    62
    "Modified (format): / 28-09-2012 / 23:01:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    63
! !
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    64
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    65
!JavaClassRef2 methodsFor:'accessing'!
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    66
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    67
classLoader
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 772
diff changeset
    68
    self owner ifNil: [ ^ nil ] ifNotNil: [ ^ self owner classLoader ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    69
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    70
    "Created: / 11-04-2011 / 21:52:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
777
e6e61412ae43 refactoring tests.. and more needed
hlopkmar
parents: 772
diff changeset
    71
    "Modified: / 12-05-2011 / 18:32:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    72
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    73
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1062
diff changeset
    74
displayString
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1062
diff changeset
    75
    ^self name.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1062
diff changeset
    76
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1062
diff changeset
    77
    "Created: / 01-11-2011 / 15:29:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1062
diff changeset
    78
!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1062
diff changeset
    79
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    80
fullName
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    81
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    82
    ^self javaClassName
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    83
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    84
    "Created: / 08-04-2011 / 13:48:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    85
    "Modified: / 13-05-2011 / 09:59:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    86
    "Created: / 30-10-2011 / 22:00:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    87
!
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
    88
809
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    89
javaClass
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    90
1038
bf2ece5a5362 Few fixes
vranyj1
parents: 1035
diff changeset
    91
    valueCache isNil ifTrue:[self resolve].
809
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    92
    ^valueCache
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    93
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    94
    "Created: / 22-05-2011 / 14:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    95
!
0fd3dbe06abb Few fixes in resolving.
vranyj1
parents: 786
diff changeset
    96
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    97
javaClassName
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    98
    "return java class name as written in java programs e.g. java.util.String
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
    99
     in case of array, return class name without square brackets"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   100
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   101
    | tmp |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   102
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 809
diff changeset
   103
    tmp := self name copy.
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 809
diff changeset
   104
    [ tmp startsWith: '[' ] whileTrue: [ tmp := tmp copyFrom: 2 ].
786
e3de6a198e63 simple methods are the worst :)
hlopkmar
parents: 785
diff changeset
   105
    tmp := tmp replaceAll: $/ with: $..
785
7811d2e77ca6 aaaargh forgot to delete old code after fixing it.. and wondering why it's not working :)
hlopkmar
parents: 783
diff changeset
   106
    (tmp startsWith: 'L') ifTrue: [ tmp := tmp copyFrom: 2 to: tmp size ].
7811d2e77ca6 aaaargh forgot to delete old code after fixing it.. and wondering why it's not working :)
hlopkmar
parents: 783
diff changeset
   107
    (tmp endsWith: ';') ifTrue: [ tmp := tmp copyFrom: 1 to: tmp size - 1 ].
7811d2e77ca6 aaaargh forgot to delete old code after fixing it.. and wondering why it's not working :)
hlopkmar
parents: 783
diff changeset
   108
    ^ tmp.
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   109
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   110
    "Created: / 08-04-2011 / 18:30:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 809
diff changeset
   111
    "Modified: / 23-05-2011 / 15:30:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   112
!
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   113
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   114
name
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   115
    ^constantPool at: nameIndex.
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   116
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   117
    "Created: / 08-04-2011 / 13:48:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   118
    "Modified: / 13-05-2011 / 09:59:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   119
! !
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   120
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   121
!JavaClassRef2 methodsFor:'array support'!
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   122
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   123
arrayDimensions
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   124
    ^ self name occurrencesOf: $[.
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   125
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   126
    "Created: / 08-04-2011 / 18:42:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   127
    "Modified: / 13-05-2011 / 10:00:15 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   128
!
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   129
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   130
isJavaArrayClassRef
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   131
    ^ self name startsWith: '['.
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   132
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   133
    "Created: / 08-04-2011 / 18:40:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   134
    "Modified: / 13-05-2011 / 10:00:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   135
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   136
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   137
!JavaClassRef2 methodsFor:'comparing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   138
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   139
= anotherJavaClassRef 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   140
    "superclass JavaRef2 says that I am responsible to implement this method"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   141
    
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   142
    anotherJavaClassRef isJavaClassRef ifFalse: [ ^ false ].
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   143
    ^ self name = anotherJavaClassRef name.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   144
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   145
    "Modified: / 08-04-2011 / 13:48:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   146
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   147
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   148
hash
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   149
    ^ self name hash.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   150
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   151
    "Modified: / 13-05-2011 / 10:00:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   152
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   153
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   154
!JavaClassRef2 methodsFor:'initialization'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   155
771
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   156
initializeIn: aJavaConstantPool withNameAt: nameCPIndex
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   157
    nameIndex := nameCPIndex.
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   158
    constantPool := aJavaConstantPool.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   159
    super initialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   160
771
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   161
    "Modified: / 10-05-2011 / 14:57:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   162
! !
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   163
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   164
!JavaClassRef2 methodsFor:'printing & storing'!
915
vranyj1
parents: 912
diff changeset
   165
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   166
printOn:aStream
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   167
    "append a printed representation if the receiver to the argument, aStream"
915
vranyj1
parents: 912
diff changeset
   168
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   169
    super printOn:aStream.
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   170
    aStream nextPut:$(.
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   171
    self name printOn: aStream.
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   172
    aStream nextPut:$).
771
fb8026dda011 Merged with /trunk
vranyj1
parents: 761
diff changeset
   173
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1038
diff changeset
   174
    "Modified: / 30-10-2011 / 21:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   175
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   176
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   177
!JavaClassRef2 methodsFor:'private - resolving'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   178
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   179
findResolvedStaticValue
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   180
    "Resolving static inner classes is not different from resolving any other class, it's only done in different circumstances"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   181
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   182
    ^ self findResolvedValue.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   183
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   184
    "Created: / 28-04-2011 / 21:57:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   185
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   186
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   187
findResolvedValue
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   188
    "Resolve reference and set valueCache."
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   189
    
1035
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1026
diff changeset
   190
    self findResolvedValue: true
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   191
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   192
    "Modified: / 08-04-2011 / 17:39:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1035
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1026
diff changeset
   193
    "Modified: / 21-10-2011 / 10:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   194
!
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   195
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   196
findResolvedValue: doInit
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   197
    "Resolve reference and set valueCache."
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   198
    
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   199
    valueCache := JavaResolver uniqueInstance 
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   200
                resolveClassIndentifiedByRef: self init: doInit.
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   201
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   202
    "Modified: / 08-04-2011 / 17:39:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   203
    "Created: / 12-08-2011 / 22:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   204
! !
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   205
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   206
!JavaClassRef2 methodsFor:'queries'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   207
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 915
diff changeset
   208
isJavaClassOrStringRef
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 915
diff changeset
   209
    ^ true.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 915
diff changeset
   210
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 915
diff changeset
   211
    "Created: / 11-04-2011 / 19:10:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 915
diff changeset
   212
!
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 915
diff changeset
   213
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   214
isJavaClassRef
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   215
^true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   216
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   217
    "Created: / 11-04-2011 / 19:10:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   218
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 758
diff changeset
   219
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   220
!JavaClassRef2 methodsFor:'resolving'!
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   221
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   222
invalidateForClass: internalJavaClassName 
1372
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   223
    "Invalidates receiver iff it refers (even indirectly)
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   224
     to a class ref that has been resolved to given class.
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   225
     Returns true, if the receiver has been invalidated,
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   226
     false otherwise"
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 809
diff changeset
   227
    
1372
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   228
    self name = internalJavaClassName ifTrue: [ 
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   229
        self invalidate.
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   230
        ^ true 
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   231
    ].
778
caa3a009f617 refactoring tests and fixing related bugs, added functionality to constantPool
hlopkmar
parents: 777
diff changeset
   232
    ^ false.
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
   233
814
68df82c46fb0 finally forced myself to refactor tests.. fieldRef tests are ok now.. methodRef to come..
hlopkmar
parents: 809
diff changeset
   234
    "Modified: / 23-05-2011 / 15:21:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1372
dea574a1b6b3 Some initial class reloading support. Not yet finished, just sketched out.
vranyj1
parents: 1155
diff changeset
   235
    "Modified (format): / 21-02-2012 / 10:21:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   236
!
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   237
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   238
resolve
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   239
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   240
    ^self resolve: true
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   241
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   242
    "Created: / 08-04-2011 / 11:30:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 877
diff changeset
   243
    "Created: / 12-08-2011 / 22:18:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   244
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   245
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   246
!JavaClassRef2 class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   248
version_SVN
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   249
    ^ '$Id$'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   250
! !