author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 18 Apr 2013 17:46:56 +0200 | |
branch | development |
changeset 2522 | 88de19714cfb |
parent 2429 | ebece4dcaab9 |
child 2711 | a00302fe5083 |
permissions | -rw-r--r-- |
749 | 1 |
" |
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
3 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
4 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
5 |
|
749 | 6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
7 |
SWING Research Group, Czech Technical University in Prague |
|
8 |
||
9 |
This software is furnished under a license and may be used |
|
10 |
only in accordance with the terms of that license and with the |
|
11 |
inclusion of the above copyright notice. This software may not |
|
12 |
be provided or otherwise made available to, or used by, any |
|
13 |
other person. No title to or ownership of the software is |
|
14 |
hereby transferred. |
|
15 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
16 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
17 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
18 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
19 |
as of 1.9.2010 |
749 | 20 |
" |
21 |
"{ Package: 'stx:libjava' }" |
|
22 |
||
23 |
Object subclass:#JavaSourceCodeCache |
|
24 |
instanceVariableNames:'parsedCodes' |
|
25 |
classVariableNames:'parsedCode' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Languages-Java-Support' |
|
28 |
! |
|
29 |
||
30 |
JavaSourceCodeCache class instanceVariableNames:'instance' |
|
31 |
||
32 |
" |
|
33 |
No other class instance variables are inherited by this class. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
!JavaSourceCodeCache class methodsFor:'documentation'! |
|
38 |
||
39 |
copyright |
|
40 |
" |
|
41 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
42 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
43 |
New code and modifications done at SWING Research Group [1]: |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
44 |
|
749 | 45 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko |
46 |
SWING Research Group, Czech Technical University in Prague |
|
47 |
||
48 |
This software is furnished under a license and may be used |
|
49 |
only in accordance with the terms of that license and with the |
|
50 |
inclusion of the above copyright notice. This software may not |
|
51 |
be provided or otherwise made available to, or used by, any |
|
52 |
other person. No title to or ownership of the software is |
|
53 |
hereby transferred. |
|
54 |
||
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
55 |
[1] Code written at SWING Research Group contains a signature |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
56 |
of one of the above copright owners. For exact set of such code, |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
57 |
see the differences between this version and version stx:libjava |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
58 |
as of 1.9.2010 |
749 | 59 |
|
60 |
" |
|
61 |
! ! |
|
62 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
63 |
|
749 | 64 |
!JavaSourceCodeCache class methodsFor:'instance creation'! |
65 |
||
66 |
new |
|
67 |
instance isNil ifTrue: [ instance := self basicNew initialize ]. |
|
68 |
^ instance |
|
69 |
||
70 |
"Created: / 13-12-2010 / 13:56:31 / Jan Kurs <kurs.jan@post.cz>" |
|
71 |
! ! |
|
72 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
73 |
|
749 | 74 |
!JavaSourceCodeCache methodsFor:'adding & removing'! |
75 |
||
76 |
flush |
|
77 |
self parsedCodes removeAll. |
|
78 |
||
79 |
"Created: / 17-12-2010 / 16:32:49 / Jan Kurs <kurs.jan@post.cz>" |
|
80 |
! ! |
|
81 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
82 |
|
749 | 83 |
!JavaSourceCodeCache methodsFor:'initialize'! |
84 |
||
85 |
initialize |
|
86 |
parsedCodes := IdentityDictionary new. |
|
87 |
||
88 |
"Created: / 13-12-2010 / 14:11:49 / Jan Kurs <kurs.jan@post.cz>" |
|
89 |
"Modified: / 17-12-2010 / 13:35:36 / Jan Kurs <kurs.jan@post.cz>" |
|
90 |
! ! |
|
91 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
92 |
|
749 | 93 |
!JavaSourceCodeCache methodsFor:'private - searching'! |
94 |
||
95 |
findMethodLine: javaMethod inMethods: methods |
|
96 |
| bestMatchMethod pos | |
|
97 |
||
98 |
pos := javaMethod firstInstructionLineNumber. |
|
99 |
bestMatchMethod := Plug new respondTo: #startLine with: [^ 0]. |
|
100 |
methods do: [ |
|
101 |
:method | |
|
102 |
method startLine > pos ifTrue: [ |
|
103 |
^ bestMatchMethod startLine |
|
104 |
]. |
|
105 |
bestMatchMethod := method. |
|
106 |
]. |
|
107 |
^ 0. |
|
108 |
||
109 |
"Created: / 08-01-2011 / 16:10:37 / Jan Kurs <kurs.jan@post.cz>" |
|
110 |
! |
|
111 |
||
112 |
getMethodsFor:class |
|
113 |
^ parsedCodes at: class fullName ifAbsentPut: [ |
|
114 |
[ |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
115 |
JavaParser_Old methodsIn: class source |
749 | 116 |
] on: Exception do: |
117 |
[ |
|
118 |
OrderedCollection new. |
|
119 |
] |
|
120 |
]. |
|
121 |
||
122 |
"Created: / 08-01-2011 / 16:09:47 / Jan Kurs <kurs.jan@post.cz>" |
|
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
123 |
"Modified: / 09-03-2012 / 23:30:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 124 |
! |
125 |
||
126 |
parsedCodes |
|
127 |
^ parsedCodes |
|
128 |
! ! |
|
129 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
130 |
|
749 | 131 |
!JavaSourceCodeCache methodsFor:'queries'! |
132 |
||
133 |
findLineForMethod:javaMethod inClass:javaClass |
|
134 |
| methods mdL | |
|
135 |
methods := self getMethodsFor:javaClass. |
|
136 |
mdL := self findMethodLine:javaMethod inMethods:methods. |
|
137 |
^ mdL |
|
138 |
||
139 |
"Created: / 13-12-2010 / 13:47:26 / Jan Kurs <kurs.jan@post.cz>" |
|
140 |
"Modified: / 08-01-2011 / 16:10:21 / Jan Kurs <kurs.jan@post.cz>" |
|
141 |
! ! |
|
142 |
||
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
143 |
|
749 | 144 |
!JavaSourceCodeCache class methodsFor:'documentation'! |
145 |
||
2249 | 146 |
version_CVS |
2396
fadc6d7a2f5b
Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2353
diff
changeset
|
147 |
^ '$Header: /cvs/stx/stx/libjava/JavaSourceCodeCache.st,v 1.4 2013-02-25 11:15:31 vrany Exp $' |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
148 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
149 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
150 |
version_HG |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
151 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
152 |
^ '$Changeset: <not expanded> $' |
2249 | 153 |
! |
154 |
||
749 | 155 |
version_SVN |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
156 |
^ '§Id§' |
2152 | 157 |
! ! |
2353
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
158 |