author | Claus Gittinger <cg@exept.de> |
Sun, 23 Feb 2020 14:03:15 +0100 | |
branch | cvs_MAIN |
changeset 3997 | 5bb44f7e1d20 |
parent 3412 | df11bb428463 |
permissions | -rw-r--r-- |
749 | 1 |
" |
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
2 |
COPYRIGHT (c) 1996-2015 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 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
6 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
749 | 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 |
" |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
41 |
COPYRIGHT (c) 1996-2015 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 |
|
3324
a58245c0e83a
Updated copyright notices.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2731
diff
changeset
|
45 |
COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko |
749 | 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 |
||
63 |
!JavaSourceCodeCache class methodsFor:'instance creation'! |
|
64 |
||
65 |
new |
|
66 |
instance isNil ifTrue: [ instance := self basicNew initialize ]. |
|
67 |
^ instance |
|
68 |
||
69 |
"Created: / 13-12-2010 / 13:56:31 / Jan Kurs <kurs.jan@post.cz>" |
|
70 |
! ! |
|
71 |
||
72 |
!JavaSourceCodeCache methodsFor:'adding & removing'! |
|
73 |
||
74 |
flush |
|
75 |
self parsedCodes removeAll. |
|
76 |
||
77 |
"Created: / 17-12-2010 / 16:32:49 / Jan Kurs <kurs.jan@post.cz>" |
|
78 |
! ! |
|
79 |
||
80 |
!JavaSourceCodeCache methodsFor:'initialize'! |
|
81 |
||
82 |
initialize |
|
83 |
parsedCodes := IdentityDictionary new. |
|
84 |
||
85 |
"Created: / 13-12-2010 / 14:11:49 / Jan Kurs <kurs.jan@post.cz>" |
|
86 |
"Modified: / 17-12-2010 / 13:35:36 / Jan Kurs <kurs.jan@post.cz>" |
|
87 |
! ! |
|
88 |
||
89 |
!JavaSourceCodeCache methodsFor:'private - searching'! |
|
90 |
||
91 |
findMethodLine: javaMethod inMethods: methods |
|
92 |
| bestMatchMethod pos | |
|
93 |
||
94 |
pos := javaMethod firstInstructionLineNumber. |
|
95 |
bestMatchMethod := Plug new respondTo: #startLine with: [^ 0]. |
|
96 |
methods do: [ |
|
97 |
:method | |
|
98 |
method startLine > pos ifTrue: [ |
|
99 |
^ bestMatchMethod startLine |
|
100 |
]. |
|
101 |
bestMatchMethod := method. |
|
102 |
]. |
|
103 |
^ 0. |
|
104 |
||
105 |
"Created: / 08-01-2011 / 16:10:37 / Jan Kurs <kurs.jan@post.cz>" |
|
106 |
! |
|
107 |
||
108 |
getMethodsFor:class |
|
109 |
^ parsedCodes at: class fullName ifAbsentPut: [ |
|
110 |
[ |
|
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
|
111 |
JavaParser_Old methodsIn: class source |
749 | 112 |
] on: Exception do: |
113 |
[ |
|
114 |
OrderedCollection new. |
|
115 |
] |
|
116 |
]. |
|
117 |
||
118 |
"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
|
119 |
"Modified: / 09-03-2012 / 23:30:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
749 | 120 |
! |
121 |
||
122 |
parsedCodes |
|
123 |
^ parsedCodes |
|
124 |
! ! |
|
125 |
||
126 |
!JavaSourceCodeCache methodsFor:'queries'! |
|
127 |
||
128 |
findLineForMethod:javaMethod inClass:javaClass |
|
129 |
| methods mdL | |
|
130 |
methods := self getMethodsFor:javaClass. |
|
131 |
mdL := self findMethodLine:javaMethod inMethods:methods. |
|
132 |
^ mdL |
|
133 |
||
134 |
"Created: / 13-12-2010 / 13:47:26 / Jan Kurs <kurs.jan@post.cz>" |
|
135 |
"Modified: / 08-01-2011 / 16:10:21 / Jan Kurs <kurs.jan@post.cz>" |
|
136 |
! ! |
|
137 |
||
138 |
!JavaSourceCodeCache class methodsFor:'documentation'! |
|
139 |
||
2249 | 140 |
version_CVS |
3412
df11bb428463
Merged with mercurial revision 4f3cc813be4 (8 changesets total)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3360
diff
changeset
|
141 |
^ '$Header: /cvs/stx/stx/libjava/JavaSourceCodeCache.st,v 1.7 2015-03-20 12:08:00 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
|
142 |
! |
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
143 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
144 |
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
|
145 |
|
fa7400d022a0
Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2249
diff
changeset
|
146 |
^ '$Changeset: <not expanded> $' |
2249 | 147 |
! |
148 |
||
749 | 149 |
version_SVN |
2731
13f5be2bf83b
Merged d87e89dd5276 and fe83a843a7bf (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
150 |
^ 'Id' |
2152 | 151 |
! ! |
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
|
152 |