Merge tag 'upstream/1.5'
Upstream version 1.5
Emmanuel Bourg
8 years ago
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., | |
4 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Lesser General Public License instead.) You can apply it to | |
18 | your programs, too. | |
19 | ||
20 | When we speak of free software, we are referring to freedom, not | |
21 | price. Our General Public Licenses are designed to make sure that you | |
22 | have the freedom to distribute copies of free software (and charge for | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
31 | ||
32 | For example, if you distribute copies of such a program, whether | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
54 | ||
55 | The precise terms and conditions for copying, distribution and | |
56 | modification follow. | |
57 | ||
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
194 | this License. | |
195 | ||
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
199 | otherwise) that contradict the conditions of this License, they do not | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
238 | be similar in spirit to the present version, but may differ in detail to | |
239 | address new problems or concerns. | |
240 | ||
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
282 | ||
283 | If you develop a new program, and you want it to be of the greatest | |
284 | possible use to the public, the best way to achieve this is to make it | |
285 | free software which everyone can redistribute and change under these terms. | |
286 | ||
287 | To do so, attach the following notices to the program. It is safest | |
288 | to attach them to the start of each source file to most effectively | |
289 | convey the exclusion of warranty; and each file should have at least | |
290 | the "copyright" line and a pointer to where the full notice is found. | |
291 | ||
292 | <one line to give the program's name and a brief idea of what it does.> | |
293 | Copyright (C) <year> <name of author> | |
294 | ||
295 | This program is free software; you can redistribute it and/or modify | |
296 | it under the terms of the GNU General Public License as published by | |
297 | the Free Software Foundation; either version 2 of the License, or | |
298 | (at your option) any later version. | |
299 | ||
300 | This program is distributed in the hope that it will be useful, | |
301 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
303 | GNU General Public License for more details. | |
304 | ||
305 | You should have received a copy of the GNU General Public License along | |
306 | with this program; if not, write to the Free Software Foundation, Inc., | |
307 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
308 | ||
309 | Also add information on how to contact you by electronic and paper mail. | |
310 | ||
311 | If the program is interactive, make it output a short notice like this | |
312 | when it starts in an interactive mode: | |
313 | ||
314 | Gnomovision version 69, Copyright (C) year name of author | |
315 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
316 | This is free software, and you are welcome to redistribute it | |
317 | under certain conditions; type `show c' for details. | |
318 | ||
319 | The hypothetical commands `show w' and `show c' should show the appropriate | |
320 | parts of the General Public License. Of course, the commands you use may | |
321 | be called something other than `show w' and `show c'; they could even be | |
322 | mouse-clicks or menu items--whatever suits your program. | |
323 | ||
324 | You should also get your employer (if you work as a programmer) or your | |
325 | school, if any, to sign a "copyright disclaimer" for the program, if | |
326 | necessary. Here is a sample; alter the names: | |
327 | ||
328 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
329 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
330 | ||
331 | <signature of Ty Coon>, 1 April 1989 | |
332 | Ty Coon, President of Vice | |
333 | ||
334 | This General Public License does not permit incorporating your program into | |
335 | proprietary programs. If your program is a subroutine library, you may | |
336 | consider it more useful to permit linking proprietary applications with the | |
337 | library. If this is what you want to do, use the GNU Lesser General | |
338 | Public License instead of this License. |
0 | 0 | |
1 | 1 | Copyright (C) 2011 Institute for System Programming, RAS |
2 | Copyright (C) 2011-2015 Andrey Ponomarenko's ABI Laboratory | |
2 | Copyright (C) 2011-2016 Andrey Ponomarenko's ABI Laboratory | |
3 | 3 | |
4 | 4 | All rights reserved. |
5 | 5 | |
7 | 7 | RELEASE INFORMATION |
8 | 8 | |
9 | 9 | Project: Java API Compliance Checker (Java ACC) |
10 | Version: 1.4.3 | |
11 | Date: 2015-11-20 | |
10 | Version: 1.5 | |
11 | Date: 2016-03-24 | |
12 | 12 | |
13 | 13 | |
14 | 14 | This file explains how to install and setup environment |
19 | 19 | |
20 | 20 | 1. Requirements for Linux, FreeBSD and Mac OS X |
21 | 21 | 2. Requirements for MS Windows |
22 | 3. Configuring and Installing | |
23 | 4. Running the Tool | |
22 | 3. Configure and Install | |
23 | 4. Usage | |
24 | 24 | 5. Advanced Usage |
25 | 25 | |
26 | 26 | |
40 | 40 | |
41 | 41 | |
42 | 42 | |
43 | 3. CONFIGURING AND INSTALLING | |
44 | ============================= | |
43 | 3. CONFIGURE AND INSTALL | |
44 | ======================== | |
45 | 45 | |
46 | 46 | This command will install an japi-compliance-checker program in the |
47 | 47 | PREFIX/bin system directory: |
54 | 54 | |
55 | 55 | |
56 | 56 | |
57 | 4. RUNNING THE TOOL | |
58 | =================== | |
57 | 4. USAGE | |
58 | ======== | |
59 | 59 | |
60 | 60 | 1. japi-compliance-checker OLD.jar NEW.jar |
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | 64 | 5. ADVANCED USAGE |
65 | =================== | |
65 | ================= | |
66 | ||
66 | 67 | 1. Create XML-descriptors for two versions |
67 | 68 | of a library (OLD.xml and NEW.xml): |
68 | 69 | <version> |
0 | GNU LESSER GENERAL PUBLIC LICENSE | |
1 | Version 2.1, February 1999 | |
2 | ||
3 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. | |
4 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | [This is the first released version of the Lesser GPL. It also counts | |
9 | as the successor of the GNU Library Public License, version 2, hence | |
10 | the version number 2.1.] | |
11 | ||
12 | Preamble | |
13 | ||
14 | The licenses for most software are designed to take away your | |
15 | freedom to share and change it. By contrast, the GNU General Public | |
16 | Licenses are intended to guarantee your freedom to share and change | |
17 | free software--to make sure the software is free for all its users. | |
18 | ||
19 | This license, the Lesser General Public License, applies to some | |
20 | specially designated software packages--typically libraries--of the | |
21 | Free Software Foundation and other authors who decide to use it. You | |
22 | can use it too, but we suggest you first think carefully about whether | |
23 | this license or the ordinary General Public License is the better | |
24 | strategy to use in any particular case, based on the explanations below. | |
25 | ||
26 | When we speak of free software, we are referring to freedom of use, | |
27 | not price. Our General Public Licenses are designed to make sure that | |
28 | you have the freedom to distribute copies of free software (and charge | |
29 | for this service if you wish); that you receive source code or can get | |
30 | it if you want it; that you can change the software and use pieces of | |
31 | it in new free programs; and that you are informed that you can do | |
32 | these things. | |
33 | ||
34 | To protect your rights, we need to make restrictions that forbid | |
35 | distributors to deny you these rights or to ask you to surrender these | |
36 | rights. These restrictions translate to certain responsibilities for | |
37 | you if you distribute copies of the library or if you modify it. | |
38 | ||
39 | For example, if you distribute copies of the library, whether gratis | |
40 | or for a fee, you must give the recipients all the rights that we gave | |
41 | you. You must make sure that they, too, receive or can get the source | |
42 | code. If you link other code with the library, you must provide | |
43 | complete object files to the recipients, so that they can relink them | |
44 | with the library after making changes to the library and recompiling | |
45 | it. And you must show them these terms so they know their rights. | |
46 | ||
47 | We protect your rights with a two-step method: (1) we copyright the | |
48 | library, and (2) we offer you this license, which gives you legal | |
49 | permission to copy, distribute and/or modify the library. | |
50 | ||
51 | To protect each distributor, we want to make it very clear that | |
52 | there is no warranty for the free library. Also, if the library is | |
53 | modified by someone else and passed on, the recipients should know | |
54 | that what they have is not the original version, so that the original | |
55 | author's reputation will not be affected by problems that might be | |
56 | introduced by others. | |
57 | ||
58 | Finally, software patents pose a constant threat to the existence of | |
59 | any free program. We wish to make sure that a company cannot | |
60 | effectively restrict the users of a free program by obtaining a | |
61 | restrictive license from a patent holder. Therefore, we insist that | |
62 | any patent license obtained for a version of the library must be | |
63 | consistent with the full freedom of use specified in this license. | |
64 | ||
65 | Most GNU software, including some libraries, is covered by the | |
66 | ordinary GNU General Public License. This license, the GNU Lesser | |
67 | General Public License, applies to certain designated libraries, and | |
68 | is quite different from the ordinary General Public License. We use | |
69 | this license for certain libraries in order to permit linking those | |
70 | libraries into non-free programs. | |
71 | ||
72 | When a program is linked with a library, whether statically or using | |
73 | a shared library, the combination of the two is legally speaking a | |
74 | combined work, a derivative of the original library. The ordinary | |
75 | General Public License therefore permits such linking only if the | |
76 | entire combination fits its criteria of freedom. The Lesser General | |
77 | Public License permits more lax criteria for linking other code with | |
78 | the library. | |
79 | ||
80 | We call this license the "Lesser" General Public License because it | |
81 | does Less to protect the user's freedom than the ordinary General | |
82 | Public License. It also provides other free software developers Less | |
83 | of an advantage over competing non-free programs. These disadvantages | |
84 | are the reason we use the ordinary General Public License for many | |
85 | libraries. However, the Lesser license provides advantages in certain | |
86 | special circumstances. | |
87 | ||
88 | For example, on rare occasions, there may be a special need to | |
89 | encourage the widest possible use of a certain library, so that it becomes | |
90 | a de-facto standard. To achieve this, non-free programs must be | |
91 | allowed to use the library. A more frequent case is that a free | |
92 | library does the same job as widely used non-free libraries. In this | |
93 | case, there is little to gain by limiting the free library to free | |
94 | software only, so we use the Lesser General Public License. | |
95 | ||
96 | In other cases, permission to use a particular library in non-free | |
97 | programs enables a greater number of people to use a large body of | |
98 | free software. For example, permission to use the GNU C Library in | |
99 | non-free programs enables many more people to use the whole GNU | |
100 | operating system, as well as its variant, the GNU/Linux operating | |
101 | system. | |
102 | ||
103 | Although the Lesser General Public License is Less protective of the | |
104 | users' freedom, it does ensure that the user of a program that is | |
105 | linked with the Library has the freedom and the wherewithal to run | |
106 | that program using a modified version of the Library. | |
107 | ||
108 | The precise terms and conditions for copying, distribution and | |
109 | modification follow. Pay close attention to the difference between a | |
110 | "work based on the library" and a "work that uses the library". The | |
111 | former contains code derived from the library, whereas the latter must | |
112 | be combined with the library in order to run. | |
113 | ||
114 | GNU LESSER GENERAL PUBLIC LICENSE | |
115 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
116 | ||
117 | 0. This License Agreement applies to any software library or other | |
118 | program which contains a notice placed by the copyright holder or | |
119 | other authorized party saying it may be distributed under the terms of | |
120 | this Lesser General Public License (also called "this License"). | |
121 | Each licensee is addressed as "you". | |
122 | ||
123 | A "library" means a collection of software functions and/or data | |
124 | prepared so as to be conveniently linked with application programs | |
125 | (which use some of those functions and data) to form executables. | |
126 | ||
127 | The "Library", below, refers to any such software library or work | |
128 | which has been distributed under these terms. A "work based on the | |
129 | Library" means either the Library or any derivative work under | |
130 | copyright law: that is to say, a work containing the Library or a | |
131 | portion of it, either verbatim or with modifications and/or translated | |
132 | straightforwardly into another language. (Hereinafter, translation is | |
133 | included without limitation in the term "modification".) | |
134 | ||
135 | "Source code" for a work means the preferred form of the work for | |
136 | making modifications to it. For a library, complete source code means | |
137 | all the source code for all modules it contains, plus any associated | |
138 | interface definition files, plus the scripts used to control compilation | |
139 | and installation of the library. | |
140 | ||
141 | Activities other than copying, distribution and modification are not | |
142 | covered by this License; they are outside its scope. The act of | |
143 | running a program using the Library is not restricted, and output from | |
144 | such a program is covered only if its contents constitute a work based | |
145 | on the Library (independent of the use of the Library in a tool for | |
146 | writing it). Whether that is true depends on what the Library does | |
147 | and what the program that uses the Library does. | |
148 | ||
149 | 1. You may copy and distribute verbatim copies of the Library's | |
150 | complete source code as you receive it, in any medium, provided that | |
151 | you conspicuously and appropriately publish on each copy an | |
152 | appropriate copyright notice and disclaimer of warranty; keep intact | |
153 | all the notices that refer to this License and to the absence of any | |
154 | warranty; and distribute a copy of this License along with the | |
155 | Library. | |
156 | ||
157 | You may charge a fee for the physical act of transferring a copy, | |
158 | and you may at your option offer warranty protection in exchange for a | |
159 | fee. | |
160 | ||
161 | 2. You may modify your copy or copies of the Library or any portion | |
162 | of it, thus forming a work based on the Library, and copy and | |
163 | distribute such modifications or work under the terms of Section 1 | |
164 | above, provided that you also meet all of these conditions: | |
165 | ||
166 | a) The modified work must itself be a software library. | |
167 | ||
168 | b) You must cause the files modified to carry prominent notices | |
169 | stating that you changed the files and the date of any change. | |
170 | ||
171 | c) You must cause the whole of the work to be licensed at no | |
172 | charge to all third parties under the terms of this License. | |
173 | ||
174 | d) If a facility in the modified Library refers to a function or a | |
175 | table of data to be supplied by an application program that uses | |
176 | the facility, other than as an argument passed when the facility | |
177 | is invoked, then you must make a good faith effort to ensure that, | |
178 | in the event an application does not supply such function or | |
179 | table, the facility still operates, and performs whatever part of | |
180 | its purpose remains meaningful. | |
181 | ||
182 | (For example, a function in a library to compute square roots has | |
183 | a purpose that is entirely well-defined independent of the | |
184 | application. Therefore, Subsection 2d requires that any | |
185 | application-supplied function or table used by this function must | |
186 | be optional: if the application does not supply it, the square | |
187 | root function must still compute square roots.) | |
188 | ||
189 | These requirements apply to the modified work as a whole. If | |
190 | identifiable sections of that work are not derived from the Library, | |
191 | and can be reasonably considered independent and separate works in | |
192 | themselves, then this License, and its terms, do not apply to those | |
193 | sections when you distribute them as separate works. But when you | |
194 | distribute the same sections as part of a whole which is a work based | |
195 | on the Library, the distribution of the whole must be on the terms of | |
196 | this License, whose permissions for other licensees extend to the | |
197 | entire whole, and thus to each and every part regardless of who wrote | |
198 | it. | |
199 | ||
200 | Thus, it is not the intent of this section to claim rights or contest | |
201 | your rights to work written entirely by you; rather, the intent is to | |
202 | exercise the right to control the distribution of derivative or | |
203 | collective works based on the Library. | |
204 | ||
205 | In addition, mere aggregation of another work not based on the Library | |
206 | with the Library (or with a work based on the Library) on a volume of | |
207 | a storage or distribution medium does not bring the other work under | |
208 | the scope of this License. | |
209 | ||
210 | 3. You may opt to apply the terms of the ordinary GNU General Public | |
211 | License instead of this License to a given copy of the Library. To do | |
212 | this, you must alter all the notices that refer to this License, so | |
213 | that they refer to the ordinary GNU General Public License, version 2, | |
214 | instead of to this License. (If a newer version than version 2 of the | |
215 | ordinary GNU General Public License has appeared, then you can specify | |
216 | that version instead if you wish.) Do not make any other change in | |
217 | these notices. | |
218 | ||
219 | Once this change is made in a given copy, it is irreversible for | |
220 | that copy, so the ordinary GNU General Public License applies to all | |
221 | subsequent copies and derivative works made from that copy. | |
222 | ||
223 | This option is useful when you wish to copy part of the code of | |
224 | the Library into a program that is not a library. | |
225 | ||
226 | 4. You may copy and distribute the Library (or a portion or | |
227 | derivative of it, under Section 2) in object code or executable form | |
228 | under the terms of Sections 1 and 2 above provided that you accompany | |
229 | it with the complete corresponding machine-readable source code, which | |
230 | must be distributed under the terms of Sections 1 and 2 above on a | |
231 | medium customarily used for software interchange. | |
232 | ||
233 | If distribution of object code is made by offering access to copy | |
234 | from a designated place, then offering equivalent access to copy the | |
235 | source code from the same place satisfies the requirement to | |
236 | distribute the source code, even though third parties are not | |
237 | compelled to copy the source along with the object code. | |
238 | ||
239 | 5. A program that contains no derivative of any portion of the | |
240 | Library, but is designed to work with the Library by being compiled or | |
241 | linked with it, is called a "work that uses the Library". Such a | |
242 | work, in isolation, is not a derivative work of the Library, and | |
243 | therefore falls outside the scope of this License. | |
244 | ||
245 | However, linking a "work that uses the Library" with the Library | |
246 | creates an executable that is a derivative of the Library (because it | |
247 | contains portions of the Library), rather than a "work that uses the | |
248 | library". The executable is therefore covered by this License. | |
249 | Section 6 states terms for distribution of such executables. | |
250 | ||
251 | When a "work that uses the Library" uses material from a header file | |
252 | that is part of the Library, the object code for the work may be a | |
253 | derivative work of the Library even though the source code is not. | |
254 | Whether this is true is especially significant if the work can be | |
255 | linked without the Library, or if the work is itself a library. The | |
256 | threshold for this to be true is not precisely defined by law. | |
257 | ||
258 | If such an object file uses only numerical parameters, data | |
259 | structure layouts and accessors, and small macros and small inline | |
260 | functions (ten lines or less in length), then the use of the object | |
261 | file is unrestricted, regardless of whether it is legally a derivative | |
262 | work. (Executables containing this object code plus portions of the | |
263 | Library will still fall under Section 6.) | |
264 | ||
265 | Otherwise, if the work is a derivative of the Library, you may | |
266 | distribute the object code for the work under the terms of Section 6. | |
267 | Any executables containing that work also fall under Section 6, | |
268 | whether or not they are linked directly with the Library itself. | |
269 | ||
270 | 6. As an exception to the Sections above, you may also combine or | |
271 | link a "work that uses the Library" with the Library to produce a | |
272 | work containing portions of the Library, and distribute that work | |
273 | under terms of your choice, provided that the terms permit | |
274 | modification of the work for the customer's own use and reverse | |
275 | engineering for debugging such modifications. | |
276 | ||
277 | You must give prominent notice with each copy of the work that the | |
278 | Library is used in it and that the Library and its use are covered by | |
279 | this License. You must supply a copy of this License. If the work | |
280 | during execution displays copyright notices, you must include the | |
281 | copyright notice for the Library among them, as well as a reference | |
282 | directing the user to the copy of this License. Also, you must do one | |
283 | of these things: | |
284 | ||
285 | a) Accompany the work with the complete corresponding | |
286 | machine-readable source code for the Library including whatever | |
287 | changes were used in the work (which must be distributed under | |
288 | Sections 1 and 2 above); and, if the work is an executable linked | |
289 | with the Library, with the complete machine-readable "work that | |
290 | uses the Library", as object code and/or source code, so that the | |
291 | user can modify the Library and then relink to produce a modified | |
292 | executable containing the modified Library. (It is understood | |
293 | that the user who changes the contents of definitions files in the | |
294 | Library will not necessarily be able to recompile the application | |
295 | to use the modified definitions.) | |
296 | ||
297 | b) Use a suitable shared library mechanism for linking with the | |
298 | Library. A suitable mechanism is one that (1) uses at run time a | |
299 | copy of the library already present on the user's computer system, | |
300 | rather than copying library functions into the executable, and (2) | |
301 | will operate properly with a modified version of the library, if | |
302 | the user installs one, as long as the modified version is | |
303 | interface-compatible with the version that the work was made with. | |
304 | ||
305 | c) Accompany the work with a written offer, valid for at | |
306 | least three years, to give the same user the materials | |
307 | specified in Subsection 6a, above, for a charge no more | |
308 | than the cost of performing this distribution. | |
309 | ||
310 | d) If distribution of the work is made by offering access to copy | |
311 | from a designated place, offer equivalent access to copy the above | |
312 | specified materials from the same place. | |
313 | ||
314 | e) Verify that the user has already received a copy of these | |
315 | materials or that you have already sent this user a copy. | |
316 | ||
317 | For an executable, the required form of the "work that uses the | |
318 | Library" must include any data and utility programs needed for | |
319 | reproducing the executable from it. However, as a special exception, | |
320 | the materials to be distributed need not include anything that is | |
321 | normally distributed (in either source or binary form) with the major | |
322 | components (compiler, kernel, and so on) of the operating system on | |
323 | which the executable runs, unless that component itself accompanies | |
324 | the executable. | |
325 | ||
326 | It may happen that this requirement contradicts the license | |
327 | restrictions of other proprietary libraries that do not normally | |
328 | accompany the operating system. Such a contradiction means you cannot | |
329 | use both them and the Library together in an executable that you | |
330 | distribute. | |
331 | ||
332 | 7. You may place library facilities that are a work based on the | |
333 | Library side-by-side in a single library together with other library | |
334 | facilities not covered by this License, and distribute such a combined | |
335 | library, provided that the separate distribution of the work based on | |
336 | the Library and of the other library facilities is otherwise | |
337 | permitted, and provided that you do these two things: | |
338 | ||
339 | a) Accompany the combined library with a copy of the same work | |
340 | based on the Library, uncombined with any other library | |
341 | facilities. This must be distributed under the terms of the | |
342 | Sections above. | |
343 | ||
344 | b) Give prominent notice with the combined library of the fact | |
345 | that part of it is a work based on the Library, and explaining | |
346 | where to find the accompanying uncombined form of the same work. | |
347 | ||
348 | 8. You may not copy, modify, sublicense, link with, or distribute | |
349 | the Library except as expressly provided under this License. Any | |
350 | attempt otherwise to copy, modify, sublicense, link with, or | |
351 | distribute the Library is void, and will automatically terminate your | |
352 | rights under this License. However, parties who have received copies, | |
353 | or rights, from you under this License will not have their licenses | |
354 | terminated so long as such parties remain in full compliance. | |
355 | ||
356 | 9. You are not required to accept this License, since you have not | |
357 | signed it. However, nothing else grants you permission to modify or | |
358 | distribute the Library or its derivative works. These actions are | |
359 | prohibited by law if you do not accept this License. Therefore, by | |
360 | modifying or distributing the Library (or any work based on the | |
361 | Library), you indicate your acceptance of this License to do so, and | |
362 | all its terms and conditions for copying, distributing or modifying | |
363 | the Library or works based on it. | |
364 | ||
365 | 10. Each time you redistribute the Library (or any work based on the | |
366 | Library), the recipient automatically receives a license from the | |
367 | original licensor to copy, distribute, link with or modify the Library | |
368 | subject to these terms and conditions. You may not impose any further | |
369 | restrictions on the recipients' exercise of the rights granted herein. | |
370 | You are not responsible for enforcing compliance by third parties with | |
371 | this License. | |
372 | ||
373 | 11. If, as a consequence of a court judgment or allegation of patent | |
374 | infringement or for any other reason (not limited to patent issues), | |
375 | conditions are imposed on you (whether by court order, agreement or | |
376 | otherwise) that contradict the conditions of this License, they do not | |
377 | excuse you from the conditions of this License. If you cannot | |
378 | distribute so as to satisfy simultaneously your obligations under this | |
379 | License and any other pertinent obligations, then as a consequence you | |
380 | may not distribute the Library at all. For example, if a patent | |
381 | license would not permit royalty-free redistribution of the Library by | |
382 | all those who receive copies directly or indirectly through you, then | |
383 | the only way you could satisfy both it and this License would be to | |
384 | refrain entirely from distribution of the Library. | |
385 | ||
386 | If any portion of this section is held invalid or unenforceable under any | |
387 | particular circumstance, the balance of the section is intended to apply, | |
388 | and the section as a whole is intended to apply in other circumstances. | |
389 | ||
390 | It is not the purpose of this section to induce you to infringe any | |
391 | patents or other property right claims or to contest validity of any | |
392 | such claims; this section has the sole purpose of protecting the | |
393 | integrity of the free software distribution system which is | |
394 | implemented by public license practices. Many people have made | |
395 | generous contributions to the wide range of software distributed | |
396 | through that system in reliance on consistent application of that | |
397 | system; it is up to the author/donor to decide if he or she is willing | |
398 | to distribute software through any other system and a licensee cannot | |
399 | impose that choice. | |
400 | ||
401 | This section is intended to make thoroughly clear what is believed to | |
402 | be a consequence of the rest of this License. | |
403 | ||
404 | 12. If the distribution and/or use of the Library is restricted in | |
405 | certain countries either by patents or by copyrighted interfaces, the | |
406 | original copyright holder who places the Library under this License may add | |
407 | an explicit geographical distribution limitation excluding those countries, | |
408 | so that distribution is permitted only in or among countries not thus | |
409 | excluded. In such case, this License incorporates the limitation as if | |
410 | written in the body of this License. | |
411 | ||
412 | 13. The Free Software Foundation may publish revised and/or new | |
413 | versions of the Lesser General Public License from time to time. | |
414 | Such new versions will be similar in spirit to the present version, | |
415 | but may differ in detail to address new problems or concerns. | |
416 | ||
417 | Each version is given a distinguishing version number. If the Library | |
418 | specifies a version number of this License which applies to it and | |
419 | "any later version", you have the option of following the terms and | |
420 | conditions either of that version or of any later version published by | |
421 | the Free Software Foundation. If the Library does not specify a | |
422 | license version number, you may choose any version ever published by | |
423 | the Free Software Foundation. | |
424 | ||
425 | 14. If you wish to incorporate parts of the Library into other free | |
426 | programs whose distribution conditions are incompatible with these, | |
427 | write to the author to ask for permission. For software which is | |
428 | copyrighted by the Free Software Foundation, write to the Free | |
429 | Software Foundation; we sometimes make exceptions for this. Our | |
430 | decision will be guided by the two goals of preserving the free status | |
431 | of all derivatives of our free software and of promoting the sharing | |
432 | and reuse of software generally. | |
433 | ||
434 | NO WARRANTY | |
435 | ||
436 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | |
437 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | |
438 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | |
439 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | |
440 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | |
441 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
442 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | |
443 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | |
444 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
445 | ||
446 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | |
447 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | |
448 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | |
449 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | |
450 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | |
451 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | |
452 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | |
453 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | |
454 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | |
455 | DAMAGES. | |
456 | ||
457 | END OF TERMS AND CONDITIONS | |
458 | ||
459 | How to Apply These Terms to Your New Libraries | |
460 | ||
461 | If you develop a new library, and you want it to be of the greatest | |
462 | possible use to the public, we recommend making it free software that | |
463 | everyone can redistribute and change. You can do so by permitting | |
464 | redistribution under these terms (or, alternatively, under the terms of the | |
465 | ordinary General Public License). | |
466 | ||
467 | To apply these terms, attach the following notices to the library. It is | |
468 | safest to attach them to the start of each source file to most effectively | |
469 | convey the exclusion of warranty; and each file should have at least the | |
470 | "copyright" line and a pointer to where the full notice is found. | |
471 | ||
472 | <one line to give the library's name and a brief idea of what it does.> | |
473 | Copyright (C) <year> <name of author> | |
474 | ||
475 | This library is free software; you can redistribute it and/or | |
476 | modify it under the terms of the GNU Lesser General Public | |
477 | License as published by the Free Software Foundation; either | |
478 | version 2.1 of the License, or (at your option) any later version. | |
479 | ||
480 | This library is distributed in the hope that it will be useful, | |
481 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
482 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
483 | Lesser General Public License for more details. | |
484 | ||
485 | You should have received a copy of the GNU Lesser General Public | |
486 | License along with this library; if not, write to the Free Software | |
487 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
488 | ||
489 | Also add information on how to contact you by electronic and paper mail. | |
490 | ||
491 | You should also get your employer (if you work as a programmer) or your | |
492 | school, if any, to sign a "copyright disclaimer" for the library, if | |
493 | necessary. Here is a sample; alter the names: | |
494 | ||
495 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | |
496 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | |
497 | ||
498 | <signature of Ty Coon>, 1 April 1990 | |
499 | Ty Coon, President of Vice | |
500 | ||
501 | That's all there is to it! |
0 | 0 | This program is free software. You may use, redistribute and/or modify it |
1 | under the terms of either the GNU General Public License (GPL) or the GNU | |
2 | Lesser General Public License (LGPL). | |
3 | ||
4 | --------------------------------------------------------------------------- | |
5 | ||
6 | GNU GENERAL PUBLIC LICENSE | |
7 | Version 2, June 1991 | |
8 | ||
9 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., | |
10 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
11 | Everyone is permitted to copy and distribute verbatim copies | |
12 | of this license document, but changing it is not allowed. | |
13 | ||
14 | Preamble | |
15 | ||
16 | The licenses for most software are designed to take away your | |
17 | freedom to share and change it. By contrast, the GNU General Public | |
18 | License is intended to guarantee your freedom to share and change free | |
19 | software--to make sure the software is free for all its users. This | |
20 | General Public License applies to most of the Free Software | |
21 | Foundation's software and to any other program whose authors commit to | |
22 | using it. (Some other Free Software Foundation software is covered by | |
23 | the GNU Lesser General Public License instead.) You can apply it to | |
24 | your programs, too. | |
25 | ||
26 | When we speak of free software, we are referring to freedom, not | |
27 | price. Our General Public Licenses are designed to make sure that you | |
28 | have the freedom to distribute copies of free software (and charge for | |
29 | this service if you wish), that you receive source code or can get it | |
30 | if you want it, that you can change the software or use pieces of it | |
31 | in new free programs; and that you know you can do these things. | |
32 | ||
33 | To protect your rights, we need to make restrictions that forbid | |
34 | anyone to deny you these rights or to ask you to surrender the rights. | |
35 | These restrictions translate to certain responsibilities for you if you | |
36 | distribute copies of the software, or if you modify it. | |
37 | ||
38 | For example, if you distribute copies of such a program, whether | |
39 | gratis or for a fee, you must give the recipients all the rights that | |
40 | you have. You must make sure that they, too, receive or can get the | |
41 | source code. And you must show them these terms so they know their | |
42 | rights. | |
43 | ||
44 | We protect your rights with two steps: (1) copyright the software, and | |
45 | (2) offer you this license which gives you legal permission to copy, | |
46 | distribute and/or modify the software. | |
47 | ||
48 | Also, for each author's protection and ours, we want to make certain | |
49 | that everyone understands that there is no warranty for this free | |
50 | software. If the software is modified by someone else and passed on, we | |
51 | want its recipients to know that what they have is not the original, so | |
52 | that any problems introduced by others will not reflect on the original | |
53 | authors' reputations. | |
54 | ||
55 | Finally, any free program is threatened constantly by software | |
56 | patents. We wish to avoid the danger that redistributors of a free | |
57 | program will individually obtain patent licenses, in effect making the | |
58 | program proprietary. To prevent this, we have made it clear that any | |
59 | patent must be licensed for everyone's free use or not licensed at all. | |
60 | ||
61 | The precise terms and conditions for copying, distribution and | |
62 | modification follow. | |
63 | ||
64 | GNU GENERAL PUBLIC LICENSE | |
65 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
66 | ||
67 | 0. This License applies to any program or other work which contains | |
68 | a notice placed by the copyright holder saying it may be distributed | |
69 | under the terms of this General Public License. The "Program", below, | |
70 | refers to any such program or work, and a "work based on the Program" | |
71 | means either the Program or any derivative work under copyright law: | |
72 | that is to say, a work containing the Program or a portion of it, | |
73 | either verbatim or with modifications and/or translated into another | |
74 | language. (Hereinafter, translation is included without limitation in | |
75 | the term "modification".) Each licensee is addressed as "you". | |
76 | ||
77 | Activities other than copying, distribution and modification are not | |
78 | covered by this License; they are outside its scope. The act of | |
79 | running the Program is not restricted, and the output from the Program | |
80 | is covered only if its contents constitute a work based on the | |
81 | Program (independent of having been made by running the Program). | |
82 | Whether that is true depends on what the Program does. | |
83 | ||
84 | 1. You may copy and distribute verbatim copies of the Program's | |
85 | source code as you receive it, in any medium, provided that you | |
86 | conspicuously and appropriately publish on each copy an appropriate | |
87 | copyright notice and disclaimer of warranty; keep intact all the | |
88 | notices that refer to this License and to the absence of any warranty; | |
89 | and give any other recipients of the Program a copy of this License | |
90 | along with the Program. | |
91 | ||
92 | You may charge a fee for the physical act of transferring a copy, and | |
93 | you may at your option offer warranty protection in exchange for a fee. | |
94 | ||
95 | 2. You may modify your copy or copies of the Program or any portion | |
96 | of it, thus forming a work based on the Program, and copy and | |
97 | distribute such modifications or work under the terms of Section 1 | |
98 | above, provided that you also meet all of these conditions: | |
99 | ||
100 | a) You must cause the modified files to carry prominent notices | |
101 | stating that you changed the files and the date of any change. | |
102 | ||
103 | b) You must cause any work that you distribute or publish, that in | |
104 | whole or in part contains or is derived from the Program or any | |
105 | part thereof, to be licensed as a whole at no charge to all third | |
106 | parties under the terms of this License. | |
107 | ||
108 | c) If the modified program normally reads commands interactively | |
109 | when run, you must cause it, when started running for such | |
110 | interactive use in the most ordinary way, to print or display an | |
111 | announcement including an appropriate copyright notice and a | |
112 | notice that there is no warranty (or else, saying that you provide | |
113 | a warranty) and that users may redistribute the program under | |
114 | these conditions, and telling the user how to view a copy of this | |
115 | License. (Exception: if the Program itself is interactive but | |
116 | does not normally print such an announcement, your work based on | |
117 | the Program is not required to print an announcement.) | |
118 | ||
119 | These requirements apply to the modified work as a whole. If | |
120 | identifiable sections of that work are not derived from the Program, | |
121 | and can be reasonably considered independent and separate works in | |
122 | themselves, then this License, and its terms, do not apply to those | |
123 | sections when you distribute them as separate works. But when you | |
124 | distribute the same sections as part of a whole which is a work based | |
125 | on the Program, the distribution of the whole must be on the terms of | |
126 | this License, whose permissions for other licensees extend to the | |
127 | entire whole, and thus to each and every part regardless of who wrote it. | |
128 | ||
129 | Thus, it is not the intent of this section to claim rights or contest | |
130 | your rights to work written entirely by you; rather, the intent is to | |
131 | exercise the right to control the distribution of derivative or | |
132 | collective works based on the Program. | |
133 | ||
134 | In addition, mere aggregation of another work not based on the Program | |
135 | with the Program (or with a work based on the Program) on a volume of | |
136 | a storage or distribution medium does not bring the other work under | |
137 | the scope of this License. | |
138 | ||
139 | 3. You may copy and distribute the Program (or a work based on it, | |
140 | under Section 2) in object code or executable form under the terms of | |
141 | Sections 1 and 2 above provided that you also do one of the following: | |
142 | ||
143 | a) Accompany it with the complete corresponding machine-readable | |
144 | source code, which must be distributed under the terms of Sections | |
145 | 1 and 2 above on a medium customarily used for software interchange; or, | |
146 | ||
147 | b) Accompany it with a written offer, valid for at least three | |
148 | years, to give any third party, for a charge no more than your | |
149 | cost of physically performing source distribution, a complete | |
150 | machine-readable copy of the corresponding source code, to be | |
151 | distributed under the terms of Sections 1 and 2 above on a medium | |
152 | customarily used for software interchange; or, | |
153 | ||
154 | c) Accompany it with the information you received as to the offer | |
155 | to distribute corresponding source code. (This alternative is | |
156 | allowed only for noncommercial distribution and only if you | |
157 | received the program in object code or executable form with such | |
158 | an offer, in accord with Subsection b above.) | |
159 | ||
160 | The source code for a work means the preferred form of the work for | |
161 | making modifications to it. For an executable work, complete source | |
162 | code means all the source code for all modules it contains, plus any | |
163 | associated interface definition files, plus the scripts used to | |
164 | control compilation and installation of the executable. However, as a | |
165 | special exception, the source code distributed need not include | |
166 | anything that is normally distributed (in either source or binary | |
167 | form) with the major components (compiler, kernel, and so on) of the | |
168 | operating system on which the executable runs, unless that component | |
169 | itself accompanies the executable. | |
170 | ||
171 | If distribution of executable or object code is made by offering | |
172 | access to copy from a designated place, then offering equivalent | |
173 | access to copy the source code from the same place counts as | |
174 | distribution of the source code, even though third parties are not | |
175 | compelled to copy the source along with the object code. | |
176 | ||
177 | 4. You may not copy, modify, sublicense, or distribute the Program | |
178 | except as expressly provided under this License. Any attempt | |
179 | otherwise to copy, modify, sublicense or distribute the Program is | |
180 | void, and will automatically terminate your rights under this License. | |
181 | However, parties who have received copies, or rights, from you under | |
182 | this License will not have their licenses terminated so long as such | |
183 | parties remain in full compliance. | |
184 | ||
185 | 5. You are not required to accept this License, since you have not | |
186 | signed it. However, nothing else grants you permission to modify or | |
187 | distribute the Program or its derivative works. These actions are | |
188 | prohibited by law if you do not accept this License. Therefore, by | |
189 | modifying or distributing the Program (or any work based on the | |
190 | Program), you indicate your acceptance of this License to do so, and | |
191 | all its terms and conditions for copying, distributing or modifying | |
192 | the Program or works based on it. | |
193 | ||
194 | 6. Each time you redistribute the Program (or any work based on the | |
195 | Program), the recipient automatically receives a license from the | |
196 | original licensor to copy, distribute or modify the Program subject to | |
197 | these terms and conditions. You may not impose any further | |
198 | restrictions on the recipients' exercise of the rights granted herein. | |
199 | You are not responsible for enforcing compliance by third parties to | |
200 | this License. | |
201 | ||
202 | 7. If, as a consequence of a court judgment or allegation of patent | |
203 | infringement or for any other reason (not limited to patent issues), | |
204 | conditions are imposed on you (whether by court order, agreement or | |
205 | otherwise) that contradict the conditions of this License, they do not | |
206 | excuse you from the conditions of this License. If you cannot | |
207 | distribute so as to satisfy simultaneously your obligations under this | |
208 | License and any other pertinent obligations, then as a consequence you | |
209 | may not distribute the Program at all. For example, if a patent | |
210 | license would not permit royalty-free redistribution of the Program by | |
211 | all those who receive copies directly or indirectly through you, then | |
212 | the only way you could satisfy both it and this License would be to | |
213 | refrain entirely from distribution of the Program. | |
214 | ||
215 | If any portion of this section is held invalid or unenforceable under | |
216 | any particular circumstance, the balance of the section is intended to | |
217 | apply and the section as a whole is intended to apply in other | |
218 | circumstances. | |
219 | ||
220 | It is not the purpose of this section to induce you to infringe any | |
221 | patents or other property right claims or to contest validity of any | |
222 | such claims; this section has the sole purpose of protecting the | |
223 | integrity of the free software distribution system, which is | |
224 | implemented by public license practices. Many people have made | |
225 | generous contributions to the wide range of software distributed | |
226 | through that system in reliance on consistent application of that | |
227 | system; it is up to the author/donor to decide if he or she is willing | |
228 | to distribute software through any other system and a licensee cannot | |
229 | impose that choice. | |
230 | ||
231 | This section is intended to make thoroughly clear what is believed to | |
232 | be a consequence of the rest of this License. | |
233 | ||
234 | 8. If the distribution and/or use of the Program is restricted in | |
235 | certain countries either by patents or by copyrighted interfaces, the | |
236 | original copyright holder who places the Program under this License | |
237 | may add an explicit geographical distribution limitation excluding | |
238 | those countries, so that distribution is permitted only in or among | |
239 | countries not thus excluded. In such case, this License incorporates | |
240 | the limitation as if written in the body of this License. | |
241 | ||
242 | 9. The Free Software Foundation may publish revised and/or new versions | |
243 | of the General Public License from time to time. Such new versions will | |
244 | be similar in spirit to the present version, but may differ in detail to | |
245 | address new problems or concerns. | |
246 | ||
247 | Each version is given a distinguishing version number. If the Program | |
248 | specifies a version number of this License which applies to it and "any | |
249 | later version", you have the option of following the terms and conditions | |
250 | either of that version or of any later version published by the Free | |
251 | Software Foundation. If the Program does not specify a version number of | |
252 | this License, you may choose any version ever published by the Free Software | |
253 | Foundation. | |
254 | ||
255 | 10. If you wish to incorporate parts of the Program into other free | |
256 | programs whose distribution conditions are different, write to the author | |
257 | to ask for permission. For software which is copyrighted by the Free | |
258 | Software Foundation, write to the Free Software Foundation; we sometimes | |
259 | make exceptions for this. Our decision will be guided by the two goals | |
260 | of preserving the free status of all derivatives of our free software and | |
261 | of promoting the sharing and reuse of software generally. | |
262 | ||
263 | NO WARRANTY | |
264 | ||
265 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
266 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
267 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
268 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
269 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
270 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
271 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
272 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
273 | REPAIR OR CORRECTION. | |
274 | ||
275 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
276 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
277 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
278 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
279 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
280 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
281 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
282 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
283 | POSSIBILITY OF SUCH DAMAGES. | |
284 | ||
285 | END OF TERMS AND CONDITIONS | |
286 | ||
287 | How to Apply These Terms to Your New Programs | |
288 | ||
289 | If you develop a new program, and you want it to be of the greatest | |
290 | possible use to the public, the best way to achieve this is to make it | |
291 | free software which everyone can redistribute and change under these terms. | |
292 | ||
293 | To do so, attach the following notices to the program. It is safest | |
294 | to attach them to the start of each source file to most effectively | |
295 | convey the exclusion of warranty; and each file should have at least | |
296 | the "copyright" line and a pointer to where the full notice is found. | |
297 | ||
298 | <one line to give the program's name and a brief idea of what it does.> | |
299 | Copyright (C) <year> <name of author> | |
300 | ||
301 | This program is free software; you can redistribute it and/or modify | |
302 | it under the terms of the GNU General Public License as published by | |
303 | the Free Software Foundation; either version 2 of the License, or | |
304 | (at your option) any later version. | |
305 | ||
306 | This program is distributed in the hope that it will be useful, | |
307 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
308 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
309 | GNU General Public License for more details. | |
310 | ||
311 | You should have received a copy of the GNU General Public License along | |
312 | with this program; if not, write to the Free Software Foundation, Inc., | |
313 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
314 | ||
315 | Also add information on how to contact you by electronic and paper mail. | |
316 | ||
317 | If the program is interactive, make it output a short notice like this | |
318 | when it starts in an interactive mode: | |
319 | ||
320 | Gnomovision version 69, Copyright (C) year name of author | |
321 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
322 | This is free software, and you are welcome to redistribute it | |
323 | under certain conditions; type `show c' for details. | |
324 | ||
325 | The hypothetical commands `show w' and `show c' should show the appropriate | |
326 | parts of the General Public License. Of course, the commands you use may | |
327 | be called something other than `show w' and `show c'; they could even be | |
328 | mouse-clicks or menu items--whatever suits your program. | |
329 | ||
330 | You should also get your employer (if you work as a programmer) or your | |
331 | school, if any, to sign a "copyright disclaimer" for the program, if | |
332 | necessary. Here is a sample; alter the names: | |
333 | ||
334 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
335 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
336 | ||
337 | <signature of Ty Coon>, 1 April 1989 | |
338 | Ty Coon, President of Vice | |
339 | ||
340 | This General Public License does not permit incorporating your program into | |
341 | proprietary programs. If your program is a subroutine library, you may | |
342 | consider it more useful to permit linking proprietary applications with the | |
343 | library. If this is what you want to do, use the GNU Lesser General | |
344 | Public License instead of this License. | |
345 | ||
346 | --------------------------------------------------------------------------- | |
347 | ||
348 | GNU LIBRARY GENERAL PUBLIC LICENSE | |
349 | Version 2, June 1991 | |
350 | ||
351 | Copyright (C) 1991 Free Software Foundation, Inc. | |
352 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
353 | Everyone is permitted to copy and distribute verbatim copies | |
354 | of this license document, but changing it is not allowed. | |
355 | ||
356 | [This is the first released version of the library GPL. It is | |
357 | numbered 2 because it goes with version 2 of the ordinary GPL.] | |
358 | ||
359 | Preamble | |
360 | ||
361 | The licenses for most software are designed to take away your | |
362 | freedom to share and change it. By contrast, the GNU General Public | |
363 | Licenses are intended to guarantee your freedom to share and change | |
364 | free software--to make sure the software is free for all its users. | |
365 | ||
366 | This license, the Library General Public License, applies to some | |
367 | specially designated Free Software Foundation software, and to any | |
368 | other libraries whose authors decide to use it. You can use it for | |
369 | your libraries, too. | |
370 | ||
371 | When we speak of free software, we are referring to freedom, not | |
372 | price. Our General Public Licenses are designed to make sure that you | |
373 | have the freedom to distribute copies of free software (and charge for | |
374 | this service if you wish), that you receive source code or can get it | |
375 | if you want it, that you can change the software or use pieces of it | |
376 | in new free programs; and that you know you can do these things. | |
377 | ||
378 | To protect your rights, we need to make restrictions that forbid | |
379 | anyone to deny you these rights or to ask you to surrender the rights. | |
380 | These restrictions translate to certain responsibilities for you if | |
381 | you distribute copies of the library, or if you modify it. | |
382 | ||
383 | For example, if you distribute copies of the library, whether gratis | |
384 | or for a fee, you must give the recipients all the rights that we gave | |
385 | you. You must make sure that they, too, receive or can get the source | |
386 | code. If you link a program with the library, you must provide | |
387 | complete object files to the recipients so that they can relink them | |
388 | with the library, after making changes to the library and recompiling | |
389 | it. And you must show them these terms so they know their rights. | |
390 | ||
391 | Our method of protecting your rights has two steps: (1) copyright | |
392 | the library, and (2) offer you this license which gives you legal | |
393 | permission to copy, distribute and/or modify the library. | |
394 | ||
395 | Also, for each distributor's protection, we want to make certain | |
396 | that everyone understands that there is no warranty for this free | |
397 | library. If the library is modified by someone else and passed on, we | |
398 | want its recipients to know that what they have is not the original | |
399 | version, so that any problems introduced by others will not reflect on | |
400 | the original authors' reputations. | |
401 | ||
402 | Finally, any free program is threatened constantly by software | |
403 | patents. We wish to avoid the danger that companies distributing free | |
404 | software will individually obtain patent licenses, thus in effect | |
405 | transforming the program into proprietary software. To prevent this, | |
406 | we have made it clear that any patent must be licensed for everyone's | |
407 | free use or not licensed at all. | |
408 | ||
409 | Most GNU software, including some libraries, is covered by the ordinary | |
410 | GNU General Public License, which was designed for utility programs. This | |
411 | license, the GNU Library General Public License, applies to certain | |
412 | designated libraries. This license is quite different from the ordinary | |
413 | one; be sure to read it in full, and don't assume that anything in it is | |
414 | the same as in the ordinary license. | |
415 | ||
416 | The reason we have a separate public license for some libraries is that | |
417 | they blur the distinction we usually make between modifying or adding to a | |
418 | program and simply using it. Linking a program with a library, without | |
419 | changing the library, is in some sense simply using the library, and is | |
420 | analogous to running a utility program or application program. However, in | |
421 | a textual and legal sense, the linked executable is a combined work, a | |
422 | derivative of the original library, and the ordinary General Public License | |
423 | treats it as such. | |
424 | ||
425 | Because of this blurred distinction, using the ordinary General | |
426 | Public License for libraries did not effectively promote software | |
427 | sharing, because most developers did not use the libraries. We | |
428 | concluded that weaker conditions might promote sharing better. | |
429 | ||
430 | However, unrestricted linking of non-free programs would deprive the | |
431 | users of those programs of all benefit from the free status of the | |
432 | libraries themselves. This Library General Public License is intended to | |
433 | permit developers of non-free programs to use free libraries, while | |
434 | preserving your freedom as a user of such programs to change the free | |
435 | libraries that are incorporated in them. (We have not seen how to achieve | |
436 | this as regards changes in header files, but we have achieved it as regards | |
437 | changes in the actual functions of the Library.) The hope is that this | |
438 | will lead to faster development of free libraries. | |
439 | ||
440 | The precise terms and conditions for copying, distribution and | |
441 | modification follow. Pay close attention to the difference between a | |
442 | "work based on the library" and a "work that uses the library". The | |
443 | former contains code derived from the library, while the latter only | |
444 | works together with the library. | |
445 | ||
446 | Note that it is possible for a library to be covered by the ordinary | |
447 | General Public License rather than by this special one. | |
448 | ||
449 | GNU LIBRARY GENERAL PUBLIC LICENSE | |
450 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
451 | ||
452 | 0. This License Agreement applies to any software library which | |
453 | contains a notice placed by the copyright holder or other authorized | |
454 | party saying it may be distributed under the terms of this Library | |
455 | General Public License (also called "this License"). Each licensee is | |
456 | addressed as "you". | |
457 | ||
458 | A "library" means a collection of software functions and/or data | |
459 | prepared so as to be conveniently linked with application programs | |
460 | (which use some of those functions and data) to form executables. | |
461 | ||
462 | The "Library", below, refers to any such software library or work | |
463 | which has been distributed under these terms. A "work based on the | |
464 | Library" means either the Library or any derivative work under | |
465 | copyright law: that is to say, a work containing the Library or a | |
466 | portion of it, either verbatim or with modifications and/or translated | |
467 | straightforwardly into another language. (Hereinafter, translation is | |
468 | included without limitation in the term "modification".) | |
469 | ||
470 | "Source code" for a work means the preferred form of the work for | |
471 | making modifications to it. For a library, complete source code means | |
472 | all the source code for all modules it contains, plus any associated | |
473 | interface definition files, plus the scripts used to control compilation | |
474 | and installation of the library. | |
475 | ||
476 | Activities other than copying, distribution and modification are not | |
477 | covered by this License; they are outside its scope. The act of | |
478 | running a program using the Library is not restricted, and output from | |
479 | such a program is covered only if its contents constitute a work based | |
480 | on the Library (independent of the use of the Library in a tool for | |
481 | writing it). Whether that is true depends on what the Library does | |
482 | and what the program that uses the Library does. | |
483 | ||
484 | 1. You may copy and distribute verbatim copies of the Library's | |
485 | complete source code as you receive it, in any medium, provided that | |
486 | you conspicuously and appropriately publish on each copy an | |
487 | appropriate copyright notice and disclaimer of warranty; keep intact | |
488 | all the notices that refer to this License and to the absence of any | |
489 | warranty; and distribute a copy of this License along with the | |
490 | Library. | |
491 | ||
492 | You may charge a fee for the physical act of transferring a copy, | |
493 | and you may at your option offer warranty protection in exchange for a | |
494 | fee. | |
495 | ||
496 | 2. You may modify your copy or copies of the Library or any portion | |
497 | of it, thus forming a work based on the Library, and copy and | |
498 | distribute such modifications or work under the terms of Section 1 | |
499 | above, provided that you also meet all of these conditions: | |
500 | ||
501 | a) The modified work must itself be a software library. | |
502 | ||
503 | b) You must cause the files modified to carry prominent notices | |
504 | stating that you changed the files and the date of any change. | |
505 | ||
506 | c) You must cause the whole of the work to be licensed at no | |
507 | charge to all third parties under the terms of this License. | |
508 | ||
509 | d) If a facility in the modified Library refers to a function or a | |
510 | table of data to be supplied by an application program that uses | |
511 | the facility, other than as an argument passed when the facility | |
512 | is invoked, then you must make a good faith effort to ensure that, | |
513 | in the event an application does not supply such function or | |
514 | table, the facility still operates, and performs whatever part of | |
515 | its purpose remains meaningful. | |
516 | ||
517 | (For example, a function in a library to compute square roots has | |
518 | a purpose that is entirely well-defined independent of the | |
519 | application. Therefore, Subsection 2d requires that any | |
520 | application-supplied function or table used by this function must | |
521 | be optional: if the application does not supply it, the square | |
522 | root function must still compute square roots.) | |
523 | ||
524 | These requirements apply to the modified work as a whole. If | |
525 | identifiable sections of that work are not derived from the Library, | |
526 | and can be reasonably considered independent and separate works in | |
527 | themselves, then this License, and its terms, do not apply to those | |
528 | sections when you distribute them as separate works. But when you | |
529 | distribute the same sections as part of a whole which is a work based | |
530 | on the Library, the distribution of the whole must be on the terms of | |
531 | this License, whose permissions for other licensees extend to the | |
532 | entire whole, and thus to each and every part regardless of who wrote | |
533 | it. | |
534 | ||
535 | Thus, it is not the intent of this section to claim rights or contest | |
536 | your rights to work written entirely by you; rather, the intent is to | |
537 | exercise the right to control the distribution of derivative or | |
538 | collective works based on the Library. | |
539 | ||
540 | In addition, mere aggregation of another work not based on the Library | |
541 | with the Library (or with a work based on the Library) on a volume of | |
542 | a storage or distribution medium does not bring the other work under | |
543 | the scope of this License. | |
544 | ||
545 | 3. You may opt to apply the terms of the ordinary GNU General Public | |
546 | License instead of this License to a given copy of the Library. To do | |
547 | this, you must alter all the notices that refer to this License, so | |
548 | that they refer to the ordinary GNU General Public License, version 2, | |
549 | instead of to this License. (If a newer version than version 2 of the | |
550 | ordinary GNU General Public License has appeared, then you can specify | |
551 | that version instead if you wish.) Do not make any other change in | |
552 | these notices. | |
553 | ||
554 | Once this change is made in a given copy, it is irreversible for | |
555 | that copy, so the ordinary GNU General Public License applies to all | |
556 | subsequent copies and derivative works made from that copy. | |
557 | ||
558 | This option is useful when you wish to copy part of the code of | |
559 | the Library into a program that is not a library. | |
560 | ||
561 | 4. You may copy and distribute the Library (or a portion or | |
562 | derivative of it, under Section 2) in object code or executable form | |
563 | under the terms of Sections 1 and 2 above provided that you accompany | |
564 | it with the complete corresponding machine-readable source code, which | |
565 | must be distributed under the terms of Sections 1 and 2 above on a | |
566 | medium customarily used for software interchange. | |
567 | ||
568 | If distribution of object code is made by offering access to copy | |
569 | from a designated place, then offering equivalent access to copy the | |
570 | source code from the same place satisfies the requirement to | |
571 | distribute the source code, even though third parties are not | |
572 | compelled to copy the source along with the object code. | |
573 | ||
574 | 5. A program that contains no derivative of any portion of the | |
575 | Library, but is designed to work with the Library by being compiled or | |
576 | linked with it, is called a "work that uses the Library". Such a | |
577 | work, in isolation, is not a derivative work of the Library, and | |
578 | therefore falls outside the scope of this License. | |
579 | ||
580 | However, linking a "work that uses the Library" with the Library | |
581 | creates an executable that is a derivative of the Library (because it | |
582 | contains portions of the Library), rather than a "work that uses the | |
583 | library". The executable is therefore covered by this License. | |
584 | Section 6 states terms for distribution of such executables. | |
585 | ||
586 | When a "work that uses the Library" uses material from a header file | |
587 | that is part of the Library, the object code for the work may be a | |
588 | derivative work of the Library even though the source code is not. | |
589 | Whether this is true is especially significant if the work can be | |
590 | linked without the Library, or if the work is itself a library. The | |
591 | threshold for this to be true is not precisely defined by law. | |
592 | ||
593 | If such an object file uses only numerical parameters, data | |
594 | structure layouts and accessors, and small macros and small inline | |
595 | functions (ten lines or less in length), then the use of the object | |
596 | file is unrestricted, regardless of whether it is legally a derivative | |
597 | work. (Executables containing this object code plus portions of the | |
598 | Library will still fall under Section 6.) | |
599 | ||
600 | Otherwise, if the work is a derivative of the Library, you may | |
601 | distribute the object code for the work under the terms of Section 6. | |
602 | Any executables containing that work also fall under Section 6, | |
603 | whether or not they are linked directly with the Library itself. | |
604 | ||
605 | 6. As an exception to the Sections above, you may also compile or | |
606 | link a "work that uses the Library" with the Library to produce a | |
607 | work containing portions of the Library, and distribute that work | |
608 | under terms of your choice, provided that the terms permit | |
609 | modification of the work for the customer's own use and reverse | |
610 | engineering for debugging such modifications. | |
611 | ||
612 | You must give prominent notice with each copy of the work that the | |
613 | Library is used in it and that the Library and its use are covered by | |
614 | this License. You must supply a copy of this License. If the work | |
615 | during execution displays copyright notices, you must include the | |
616 | copyright notice for the Library among them, as well as a reference | |
617 | directing the user to the copy of this License. Also, you must do one | |
618 | of these things: | |
619 | ||
620 | a) Accompany the work with the complete corresponding | |
621 | machine-readable source code for the Library including whatever | |
622 | changes were used in the work (which must be distributed under | |
623 | Sections 1 and 2 above); and, if the work is an executable linked | |
624 | with the Library, with the complete machine-readable "work that | |
625 | uses the Library", as object code and/or source code, so that the | |
626 | user can modify the Library and then relink to produce a modified | |
627 | executable containing the modified Library. (It is understood | |
628 | that the user who changes the contents of definitions files in the | |
629 | Library will not necessarily be able to recompile the application | |
630 | to use the modified definitions.) | |
631 | ||
632 | b) Accompany the work with a written offer, valid for at | |
633 | least three years, to give the same user the materials | |
634 | specified in Subsection 6a, above, for a charge no more | |
635 | than the cost of performing this distribution. | |
636 | ||
637 | c) If distribution of the work is made by offering access to copy | |
638 | from a designated place, offer equivalent access to copy the above | |
639 | specified materials from the same place. | |
640 | ||
641 | d) Verify that the user has already received a copy of these | |
642 | materials or that you have already sent this user a copy. | |
643 | ||
644 | For an executable, the required form of the "work that uses the | |
645 | Library" must include any data and utility programs needed for | |
646 | reproducing the executable from it. However, as a special exception, | |
647 | the source code distributed need not include anything that is normally | |
648 | distributed (in either source or binary form) with the major | |
649 | components (compiler, kernel, and so on) of the operating system on | |
650 | which the executable runs, unless that component itself accompanies | |
651 | the executable. | |
652 | ||
653 | It may happen that this requirement contradicts the license | |
654 | restrictions of other proprietary libraries that do not normally | |
655 | accompany the operating system. Such a contradiction means you cannot | |
656 | use both them and the Library together in an executable that you | |
657 | distribute. | |
658 | ||
659 | 7. You may place library facilities that are a work based on the | |
660 | Library side-by-side in a single library together with other library | |
661 | facilities not covered by this License, and distribute such a combined | |
662 | library, provided that the separate distribution of the work based on | |
663 | the Library and of the other library facilities is otherwise | |
664 | permitted, and provided that you do these two things: | |
665 | ||
666 | a) Accompany the combined library with a copy of the same work | |
667 | based on the Library, uncombined with any other library | |
668 | facilities. This must be distributed under the terms of the | |
669 | Sections above. | |
670 | ||
671 | b) Give prominent notice with the combined library of the fact | |
672 | that part of it is a work based on the Library, and explaining | |
673 | where to find the accompanying uncombined form of the same work. | |
674 | ||
675 | 8. You may not copy, modify, sublicense, link with, or distribute | |
676 | the Library except as expressly provided under this License. Any | |
677 | attempt otherwise to copy, modify, sublicense, link with, or | |
678 | distribute the Library is void, and will automatically terminate your | |
679 | rights under this License. However, parties who have received copies, | |
680 | or rights, from you under this License will not have their licenses | |
681 | terminated so long as such parties remain in full compliance. | |
682 | ||
683 | 9. You are not required to accept this License, since you have not | |
684 | signed it. However, nothing else grants you permission to modify or | |
685 | distribute the Library or its derivative works. These actions are | |
686 | prohibited by law if you do not accept this License. Therefore, by | |
687 | modifying or distributing the Library (or any work based on the | |
688 | Library), you indicate your acceptance of this License to do so, and | |
689 | all its terms and conditions for copying, distributing or modifying | |
690 | the Library or works based on it. | |
691 | ||
692 | 10. Each time you redistribute the Library (or any work based on the | |
693 | Library), the recipient automatically receives a license from the | |
694 | original licensor to copy, distribute, link with or modify the Library | |
695 | subject to these terms and conditions. You may not impose any further | |
696 | restrictions on the recipients' exercise of the rights granted herein. | |
697 | You are not responsible for enforcing compliance by third parties to | |
698 | this License. | |
699 | ||
700 | 11. If, as a consequence of a court judgment or allegation of patent | |
701 | infringement or for any other reason (not limited to patent issues), | |
702 | conditions are imposed on you (whether by court order, agreement or | |
703 | otherwise) that contradict the conditions of this License, they do not | |
704 | excuse you from the conditions of this License. If you cannot | |
705 | distribute so as to satisfy simultaneously your obligations under this | |
706 | License and any other pertinent obligations, then as a consequence you | |
707 | may not distribute the Library at all. For example, if a patent | |
708 | license would not permit royalty-free redistribution of the Library by | |
709 | all those who receive copies directly or indirectly through you, then | |
710 | the only way you could satisfy both it and this License would be to | |
711 | refrain entirely from distribution of the Library. | |
712 | ||
713 | If any portion of this section is held invalid or unenforceable under any | |
714 | particular circumstance, the balance of the section is intended to apply, | |
715 | and the section as a whole is intended to apply in other circumstances. | |
716 | ||
717 | It is not the purpose of this section to induce you to infringe any | |
718 | patents or other property right claims or to contest validity of any | |
719 | such claims; this section has the sole purpose of protecting the | |
720 | integrity of the free software distribution system which is | |
721 | implemented by public license practices. Many people have made | |
722 | generous contributions to the wide range of software distributed | |
723 | through that system in reliance on consistent application of that | |
724 | system; it is up to the author/donor to decide if he or she is willing | |
725 | to distribute software through any other system and a licensee cannot | |
726 | impose that choice. | |
727 | ||
728 | This section is intended to make thoroughly clear what is believed to | |
729 | be a consequence of the rest of this License. | |
730 | ||
731 | 12. If the distribution and/or use of the Library is restricted in | |
732 | certain countries either by patents or by copyrighted interfaces, the | |
733 | original copyright holder who places the Library under this License may add | |
734 | an explicit geographical distribution limitation excluding those countries, | |
735 | so that distribution is permitted only in or among countries not thus | |
736 | excluded. In such case, this License incorporates the limitation as if | |
737 | written in the body of this License. | |
738 | ||
739 | 13. The Free Software Foundation may publish revised and/or new | |
740 | versions of the Library General Public License from time to time. | |
741 | Such new versions will be similar in spirit to the present version, | |
742 | but may differ in detail to address new problems or concerns. | |
743 | ||
744 | Each version is given a distinguishing version number. If the Library | |
745 | specifies a version number of this License which applies to it and | |
746 | "any later version", you have the option of following the terms and | |
747 | conditions either of that version or of any later version published by | |
748 | the Free Software Foundation. If the Library does not specify a | |
749 | license version number, you may choose any version ever published by | |
750 | the Free Software Foundation. | |
751 | ||
752 | 14. If you wish to incorporate parts of the Library into other free | |
753 | programs whose distribution conditions are incompatible with these, | |
754 | write to the author to ask for permission. For software which is | |
755 | copyrighted by the Free Software Foundation, write to the Free | |
756 | Software Foundation; we sometimes make exceptions for this. Our | |
757 | decision will be guided by the two goals of preserving the free status | |
758 | of all derivatives of our free software and of promoting the sharing | |
759 | and reuse of software generally. | |
760 | ||
761 | NO WARRANTY | |
762 | ||
763 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | |
764 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | |
765 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | |
766 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | |
767 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | |
768 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
769 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | |
770 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | |
771 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
772 | ||
773 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | |
774 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | |
775 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | |
776 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | |
777 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | |
778 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | |
779 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | |
780 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | |
781 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | |
782 | DAMAGES. | |
783 | ||
784 | END OF TERMS AND CONDITIONS | |
785 | ||
786 | How to Apply These Terms to Your New Libraries | |
787 | ||
788 | If you develop a new library, and you want it to be of the greatest | |
789 | possible use to the public, we recommend making it free software that | |
790 | everyone can redistribute and change. You can do so by permitting | |
791 | redistribution under these terms (or, alternatively, under the terms of the | |
792 | ordinary General Public License). | |
793 | ||
794 | To apply these terms, attach the following notices to the library. It is | |
795 | safest to attach them to the start of each source file to most effectively | |
796 | convey the exclusion of warranty; and each file should have at least the | |
797 | "copyright" line and a pointer to where the full notice is found. | |
798 | ||
799 | <one line to give the library's name and a brief idea of what it does.> | |
800 | Copyright (C) <year> <name of author> | |
801 | ||
802 | This library is free software; you can redistribute it and/or | |
803 | modify it under the terms of the GNU Library General Public | |
804 | License as published by the Free Software Foundation; either | |
805 | version 2 of the License, or (at your option) any later version. | |
806 | ||
807 | This library is distributed in the hope that it will be useful, | |
808 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
809 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
810 | Library General Public License for more details. | |
811 | ||
812 | You should have received a copy of the GNU Library General Public | |
813 | License along with this library; if not, write to the Free | |
814 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
815 | ||
816 | Also add information on how to contact you by electronic and paper mail. | |
817 | ||
818 | You should also get your employer (if you work as a programmer) or your | |
819 | school, if any, to sign a "copyright disclaimer" for the library, if | |
820 | necessary. Here is a sample; alter the names: | |
821 | ||
822 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | |
823 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | |
824 | ||
825 | <signature of Ty Coon>, 1 April 1990 | |
826 | Ty Coon, President of Vice | |
827 | ||
828 | That's all there is to it! | |
1 | under the terms of either GPL 2.0+ or LGPL 2.1+. |
0 | 0 | NAME: |
1 | Java API Compliance Checker (Java ACC) - a tool for checking backward binary and source-level compatibility of a Java library API. | |
1 | Java API Compliance Checker (Java APICC) - a tool for checking backward binary and source-level compatibility of a Java library API. | |
2 | 2 | |
3 | 3 | The tool checks classes declarations of old and new versions and analyzes changes that may break compatibility: removed methods, removed class fields, added abstract methods, etc. The tool is intended for developers of software libraries and Linux maintainers who are interested in ensuring backward compatibility. |
4 | 4 |
0 | 0 | #!/usr/bin/perl |
1 | 1 | ########################################################################### |
2 | # Java API Compliance Checker (Java ACC) 1.4.3 | |
2 | # Java API Compliance Checker (Java APICC) 1.5 | |
3 | 3 | # A tool for checking backward compatibility of a Java library API |
4 | 4 | # |
5 | 5 | # Written by Andrey Ponomarenko |
6 | # LinkedIn: http://www.linkedin.com/pub/andrey-ponomarenko/67/366/818 | |
7 | 6 | # |
8 | 7 | # Copyright (C) 2011 Institute for System Programming, RAS |
9 | # Copyright (C) 2011-2015 Andrey Ponomarenko's ABI Laboratory | |
8 | # Copyright (C) 2011-2016 Andrey Ponomarenko's ABI Laboratory | |
10 | 9 | # |
11 | 10 | # PLATFORMS |
12 | 11 | # ========= |
44 | 43 | use Data::Dumper; |
45 | 44 | use Config; |
46 | 45 | |
47 | my $TOOL_VERSION = "1.4.3"; | |
48 | my $API_DUMP_VERSION = "1.0"; | |
46 | my $TOOL_VERSION = "1.5"; | |
47 | my $API_DUMP_VERSION = "2.0"; | |
49 | 48 | my $API_DUMP_MAJOR = majorVersion($API_DUMP_VERSION); |
50 | 49 | |
51 | 50 | my ($Help, $ShowVersion, %Descriptor, $TargetLibraryName, $CheckSeparately, |
55 | 54 | $SourceReportPath, $Debug, $Quick, $SortDump, $SkipDeprecated, $SkipClassesList, |
56 | 55 | $ShowAccess, $AffectLimit, $JdkPath, $SkipInternal, $HideTemplates, |
57 | 56 | $HidePackages, $ShowPackages, $Minimal, $AnnotationsListPath, |
58 | $SkipPackagesList); | |
57 | $SkipPackagesList, $OutputDumpPath, $AllAffected); | |
59 | 58 | |
60 | 59 | my $CmdName = get_filename($0); |
61 | 60 | my $OSgroup = get_OSgroup(); |
93 | 92 | "Wiki"=>"http://ispras.linuxbase.org/index.php/Java_API_Compliance_Checker" |
94 | 93 | ); |
95 | 94 | |
96 | my $ShortUsage = "Java API Compliance Checker (Java ACC) $TOOL_VERSION | |
95 | my $ShortUsage = "Java API Compliance Checker (Java APICC) $TOOL_VERSION | |
97 | 96 | A tool for checking backward compatibility of a Java library API |
98 | Copyright (C) 2015 Andrey Ponomarenko's ABI Laboratory | |
97 | Copyright (C) 2016 Andrey Ponomarenko's ABI Laboratory | |
99 | 98 | License: GNU LGPL or GNU GPL |
100 | 99 | |
101 | 100 | Usage: $CmdName [options] |
138 | 137 | "d2|new|n=s" => \$Descriptor{2}{"Path"}, |
139 | 138 | # extra options |
140 | 139 | "client|app=s" => \$ClientPath, |
141 | "binary!" => \$BinaryOnly, | |
142 | "source!" => \$SourceOnly, | |
143 | "v1|version1=s" => \$TargetVersion{1}, | |
140 | "binary|bin!" => \$BinaryOnly, | |
141 | "source|src!" => \$SourceOnly, | |
142 | "v1|version1|vnum=s" => \$TargetVersion{1}, | |
144 | 143 | "v2|version2=s" => \$TargetVersion{2}, |
145 | 144 | "s|strict!" => \$StrictCompat, |
146 | 145 | "keep-internal!" => \$KeepInternal, |
152 | 151 | "skip-classes=s" => \$SkipClassesList, |
153 | 152 | "skip-packages=s" => \$SkipPackagesList, |
154 | 153 | "short" => \$ShortMode, |
154 | "dump-path=s" => \$OutputDumpPath, | |
155 | 155 | "report-path=s" => \$OutputReportPath, |
156 | 156 | "bin-report-path=s" => \$BinaryReportPath, |
157 | 157 | "src-report-path=s" => \$SourceReportPath, |
164 | 164 | # other options |
165 | 165 | "test!" => \$TestSystem, |
166 | 166 | "debug!" => \$Debug, |
167 | "title|l-full|lib-full=s" => \$TargetTitle, | |
167 | "title=s" => \$TargetTitle, | |
168 | 168 | "jdk-path=s" => \$JdkPath, |
169 | "all-affected!" => \$AllAffected, | |
169 | 170 | # deprecated |
170 | 171 | "minimal!" => \$Minimal, |
171 | 172 | "hide-packages!" => \$HidePackages |
197 | 198 | Check backward compatibility of a Java library API |
198 | 199 | |
199 | 200 | DESCRIPTION: |
200 | Java API Compliance Checker (Java ACC) is a tool for checking backward | |
201 | Java API Compliance Checker (Java APICC) is a tool for checking backward | |
201 | 202 | binary/source compatibility of a Java library API. The tool checks classes |
202 | 203 | declarations of old and new versions and analyzes changes that may break |
203 | 204 | compatibility: removed class members, added abstract methods, etc. Breakage |
206 | 207 | new one. Breakage of the source compatibility may result in recompilation |
207 | 208 | errors with a new library version. |
208 | 209 | |
209 | Java ACC is intended for library developers and operating system maintainers | |
210 | Java APICC is intended for library developers and operating system maintainers | |
210 | 211 | who are interested in ensuring backward compatibility (i.e. allow old clients |
211 | 212 | to run or to be recompiled with a new version of a library). |
212 | 213 | |
266 | 267 | ... |
267 | 268 | |
268 | 269 | 3. API dump generated by -dump option |
269 | 4. Directory with Java ARchives | |
270 | 5. Comma separated list of Java ARchives | |
271 | 6. Comma separated list of directories with Java ARchives | |
272 | 270 | |
273 | 271 | If you are using 1, 4-6 descriptor types then you should |
274 | 272 | specify version numbers with -v1 and -v2 options too. |
284 | 282 | This option allows to specify the client Java ARchive that should be |
285 | 283 | checked for portability to the new library version. |
286 | 284 | |
287 | -binary | |
285 | -binary|-bin | |
288 | 286 | Show \"Binary\" compatibility problems only. |
289 | 287 | Generate report to \"bin_compat_report.html\". |
290 | 288 | |
291 | -source | |
289 | -source|-src | |
292 | 290 | Show \"Source\" compatibility problems only. |
293 | 291 | Generate report to \"src_compat_report.html\". |
294 | 292 | |
303 | 301 | |
304 | 302 | -v2|-version2 NUM |
305 | 303 | Specify 2nd library version outside the descriptor. |
304 | ||
305 | -vnum NUM | |
306 | Specify the library version in the generated API dump. | |
306 | 307 | |
307 | 308 | -s|-strict |
308 | 309 | Treat all API compatibility warnings as problems. |
349 | 350 | |
350 | 351 | -short PATH |
351 | 352 | Generate short report without 'Added Methods' section. |
353 | ||
354 | -dump-path PATH | |
355 | Specify a *.api.$AR_EXT or *.api file path where to generate an API dump. | |
356 | Default: | |
357 | abi_dumps/LIB_NAME/LIB_NAME_VERSION.api.$AR_EXT | |
352 | 358 | |
353 | 359 | -report-path PATH |
354 | 360 | Path to compatibility report. |
659 | 665 | my %SkippedPackage; |
660 | 666 | |
661 | 667 | #Report |
662 | my %Type_MaxPriority; | |
668 | my %TypeChanges; | |
663 | 669 | |
664 | 670 | #Recursion locks |
665 | 671 | my @RecurSymlink; |
673 | 679 | my %CompatProblems; |
674 | 680 | my %TotalAffected; |
675 | 681 | |
682 | #Speedup | |
683 | my %TypeProblemsIndex; | |
684 | ||
676 | 685 | #Rerort |
677 | 686 | my $ContentID = 1; |
678 | my $ContentSpanStart = "<span class=\"section\" onclick=\"javascript:showContent(this, 'CONTENT_ID')\">\n"; | |
679 | my $ContentSpanStart_Affected = "<span class=\"section_affected\" onclick=\"javascript:showContent(this, 'CONTENT_ID')\">\n"; | |
687 | my $ContentSpanStart = "<span class=\"section\" onclick=\"showContent(this, 'CONTENT_ID')\">\n"; | |
688 | my $ContentSpanStart_Affected = "<span class=\"section_affected\" onclick=\"showContent(this, 'CONTENT_ID')\">\n"; | |
680 | 689 | my $ContentSpanEnd = "</span>\n"; |
681 | 690 | my $ContentDivStart = "<div id=\"CONTENT_ID\" style=\"display:none;\">\n"; |
682 | 691 | my $ContentDivEnd = "</div>\n"; |
1053 | 1062 | { |
1054 | 1063 | my $Path = $_[0]; |
1055 | 1064 | return "" if(not $Path or not -e $Path); |
1065 | ||
1066 | if(isDumpFile($Path)) { | |
1067 | return $Path; | |
1068 | } | |
1069 | ||
1056 | 1070 | $Path = get_abs_path($Path); |
1057 | 1071 | $Path = path_format($Path, $OSgroup); |
1058 | 1072 | my ($Dir, $FileName) = separate_path($Path); |
1192 | 1206 | sub findFieldPair($$) |
1193 | 1207 | { |
1194 | 1208 | my ($Field_Pos, $Pair_Type) = @_; |
1195 | foreach my $Pair_Name (keys(%{$Pair_Type->{"Fields"}})) | |
1209 | foreach my $Pair_Name (sort keys(%{$Pair_Type->{"Fields"}})) | |
1196 | 1210 | { |
1197 | 1211 | if(defined $Pair_Type->{"Fields"}{$Pair_Name}) |
1198 | 1212 | { |
1211 | 1225 | "Safe"=>-1 |
1212 | 1226 | ); |
1213 | 1227 | |
1214 | sub maxSeverity($$) | |
1215 | { | |
1216 | my ($S1, $S2) = @_; | |
1217 | if(cmpSeverities($S1, $S2)) { | |
1218 | return $S1; | |
1219 | } | |
1220 | else { | |
1221 | return $S2; | |
1222 | } | |
1223 | } | |
1224 | ||
1225 | sub cmpSeverities($$) | |
1226 | { | |
1227 | my ($S1, $S2) = @_; | |
1228 | if(not $S1) { | |
1229 | return 0; | |
1230 | } | |
1231 | elsif(not $S2) { | |
1232 | return 1; | |
1233 | } | |
1234 | return ($Severity_Val{$S1}>$Severity_Val{$S2}); | |
1235 | } | |
1236 | ||
1237 | 1228 | sub getProblemSeverity($$$$) |
1238 | 1229 | { |
1239 | 1230 | my ($Level, $Kind, $TypeName, $Target) = @_; |
1344 | 1335 | sub mergeTypes($$) |
1345 | 1336 | { |
1346 | 1337 | my ($Type1_Id, $Type2_Id) = @_; |
1347 | return () if(not $Type1_Id or not $Type2_Id); | |
1348 | my (%Sub_SubProblems, %SubProblems) = (); | |
1349 | return %{$Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}} if($Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}); | |
1338 | return {} if(not $Type1_Id or not $Type2_Id); | |
1339 | ||
1340 | if(defined $Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}) | |
1341 | { # already merged | |
1342 | return $Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}; | |
1343 | } | |
1344 | ||
1350 | 1345 | my %Type1 = get_Type($Type1_Id, 1); |
1351 | 1346 | my %Type2 = get_Type($Type2_Id, 2); |
1352 | 1347 | if(isRecurType($Type1_Id, $Type2_Id)) |
1353 | 1348 | { # do not follow to recursive declarations |
1354 | return (); | |
1355 | } | |
1356 | return () if(not $Type1{"Name"} or not $Type2{"Name"}); | |
1357 | return () if(not $Type1{"Archive"} or not $Type2{"Archive"}); | |
1358 | return () if($Type1{"Name"} ne $Type2{"Name"}); | |
1359 | return () if(skip_package($Type1{"Package"}, 1)); | |
1349 | return {}; | |
1350 | } | |
1351 | return {} if(not $Type1{"Name"} or not $Type2{"Name"}); | |
1352 | return {} if(not $Type1{"Archive"} or not $Type2{"Archive"}); | |
1353 | return {} if($Type1{"Name"} ne $Type2{"Name"}); | |
1354 | return {} if(skip_package($Type1{"Package"}, 1)); | |
1355 | ||
1360 | 1356 | $CheckedTypes{$Type1{"Name"}} = 1; |
1357 | ||
1358 | my %SubProblems = (); | |
1359 | ||
1361 | 1360 | if($Type1{"BaseType"} and $Type2{"BaseType"}) |
1362 | 1361 | { # check base type (arrays) |
1363 | 1362 | return mergeTypes($Type1{"BaseType"}, $Type2{"BaseType"}); |
1364 | 1363 | } |
1365 | return () if($Type2{"Type"}!~/(class|interface)/); | |
1364 | ||
1365 | if($Type2{"Type"}!~/(class|interface)/) { | |
1366 | return {}; | |
1367 | } | |
1368 | ||
1366 | 1369 | if($Type1{"Type"} eq "class" and not $Class_Constructed{1}{$Type1_Id}) |
1367 | 1370 | { # class cannot be constructed or inherited by clients |
1368 | return (); | |
1369 | } | |
1371 | return {}; | |
1372 | } | |
1373 | ||
1370 | 1374 | if($Type1{"Type"} eq "class" |
1371 | 1375 | and $Type2{"Type"} eq "interface") |
1372 | 1376 | { |
1373 | 1377 | %{$SubProblems{"Class_Became_Interface"}{""}}=( |
1374 | 1378 | "Type_Name"=>$Type1{"Name"} ); |
1375 | %{$Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}} = %SubProblems; | |
1376 | pop(@RecurTypes); | |
1377 | return %SubProblems; | |
1379 | ||
1380 | return ($Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id} = \%SubProblems); | |
1378 | 1381 | } |
1379 | 1382 | if($Type1{"Type"} eq "interface" |
1380 | 1383 | and $Type2{"Type"} eq "class") |
1381 | 1384 | { |
1382 | 1385 | %{$SubProblems{"Interface_Became_Class"}{""}}=( |
1383 | 1386 | "Type_Name"=>$Type1{"Name"} ); |
1384 | %{$Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}} = %SubProblems; | |
1385 | pop(@RecurTypes); | |
1386 | return %SubProblems; | |
1387 | ||
1388 | return ($Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id} = \%SubProblems); | |
1387 | 1389 | } |
1388 | 1390 | if(not $Type1{"Final"} |
1389 | 1391 | and $Type2{"Final"}) |
1398 | 1400 | %{$SubProblems{"Class_Became_Abstract"}{""}}=( |
1399 | 1401 | "Type_Name"=>$Type1{"Name"} ); |
1400 | 1402 | } |
1403 | ||
1401 | 1404 | pushType($Type1_Id, $Type2_Id); |
1405 | ||
1402 | 1406 | foreach my $AddedMethod (keys(%{$AddedMethod_Abstract{$Type1{"Name"}}})) |
1403 | 1407 | { |
1404 | 1408 | if($Type1{"Type"} eq "class") |
1406 | 1410 | if($Type1{"Abstract"}) |
1407 | 1411 | { |
1408 | 1412 | my $Add_Effect = ""; |
1409 | if(my @InvokedBy = keys(%{$MethodInvoked{2}{$AddedMethod}})) | |
1413 | if(my @InvokedBy = sort keys(%{$MethodInvoked{2}{$AddedMethod}})) | |
1410 | 1414 | { |
1411 | 1415 | my $MFirst = $InvokedBy[0]; |
1412 | 1416 | $Add_Effect = " Added abstract method is called in 2nd library version by the method ".black_Name($MFirst, 1)." and may not be implemented by old clients."; |
1428 | 1432 | else |
1429 | 1433 | { |
1430 | 1434 | my $Add_Effect = ""; |
1431 | if(my @InvokedBy = keys(%{$MethodInvoked{2}{$AddedMethod}})) | |
1435 | if(my @InvokedBy = sort keys(%{$MethodInvoked{2}{$AddedMethod}})) | |
1432 | 1436 | { |
1433 | 1437 | my $MFirst = $InvokedBy[0]; |
1434 | 1438 | $Add_Effect = " Added abstract method is called in 2nd library version by the method ".black_Name($MFirst, 1)." and may not be implemented by old clients."; |
1474 | 1478 | and keys(%{$Class_AbstractMethods{2}{$SuperClass2{"Name"}}})) |
1475 | 1479 | { |
1476 | 1480 | my $Add_Effect = ""; |
1477 | if(my @Invoked = keys(%{$ClassMethod_AddedInvoked{$Type1{"Name"}}})) | |
1481 | if(my @Invoked = sort keys(%{$ClassMethod_AddedInvoked{$Type1{"Name"}}})) | |
1478 | 1482 | { |
1479 | 1483 | my $MFirst = $Invoked[0]; |
1480 | 1484 | my $MSignature = unmangle($MFirst); |
1525 | 1529 | or $SuperInterface=~/\Ajava\./) |
1526 | 1530 | { |
1527 | 1531 | my $Add_Effect = ""; |
1528 | if(my @Invoked = keys(%{$ClassMethod_AddedInvoked{$Type1{"Name"}}})) | |
1532 | if(my @Invoked = sort keys(%{$ClassMethod_AddedInvoked{$Type1{"Name"}}})) | |
1529 | 1533 | { |
1530 | 1534 | my $MFirst = $Invoked[0]; |
1531 | 1535 | my $MSignature = unmangle($MFirst); |
1553 | 1557 | if($Type1{"Abstract"} and $Type2{"Abstract"}) |
1554 | 1558 | { |
1555 | 1559 | my $Add_Effect = ""; |
1556 | if(my @Invoked = keys(%{$ClassMethod_AddedInvoked{$Type1{"Name"}}})) | |
1560 | if(my @Invoked = sort keys(%{$ClassMethod_AddedInvoked{$Type1{"Name"}}})) | |
1557 | 1561 | { |
1558 | 1562 | my $MFirst = $Invoked[0]; |
1559 | 1563 | my $MSignature = unmangle($MFirst); |
1601 | 1605 | } |
1602 | 1606 | } |
1603 | 1607 | } |
1604 | foreach my $Field_Name (keys(%{$Type1{"Fields"}})) | |
1608 | ||
1609 | foreach my $Field_Name (sort keys(%{$Type1{"Fields"}})) | |
1605 | 1610 | {# check older fields |
1606 | 1611 | my $Access1 = $Type1{"Fields"}{$Field_Name}{"Access"}; |
1607 | next if($Access1=~/private/); | |
1612 | if($Access1=~/private/) { | |
1613 | next; | |
1614 | } | |
1615 | ||
1608 | 1616 | my $Field_Pos1 = $Type1{"Fields"}{$Field_Name}{"Pos"}; |
1609 | 1617 | my $FieldType1_Id = $Type1{"Fields"}{$Field_Name}{"Type"}; |
1610 | 1618 | my %FieldType1 = get_Type($FieldType1_Id, 1); |
1619 | ||
1611 | 1620 | if(not $Type2{"Fields"}{$Field_Name}) |
1612 | 1621 | {# removed fields |
1613 | 1622 | my $StraightPair_Name = findFieldPair($Field_Pos1, \%Type2); |
1714 | 1723 | "Old_Value"=>$Access1, |
1715 | 1724 | "New_Value"=>$Access2 ); |
1716 | 1725 | } |
1726 | ||
1717 | 1727 | my $Value1 = get_ConstantValue($Type1{"Fields"}{$Field_Name}{"Value"}, $FieldType1{"Name"}); |
1718 | 1728 | my $Value2 = get_ConstantValue($Type2{"Fields"}{$Field_Name}{"Value"}, $FieldType2{"Name"}); |
1729 | ||
1719 | 1730 | if($Value1 ne $Value2) |
1720 | 1731 | { |
1721 | 1732 | if($Value1 and $Value2) |
1732 | 1743 | } |
1733 | 1744 | } |
1734 | 1745 | } |
1735 | %Sub_SubProblems = detectTypeChange($FieldType1_Id, $FieldType2_Id, "Field"); | |
1736 | foreach my $Sub_SubProblemType (keys(%Sub_SubProblems)) | |
1746 | ||
1747 | my %Sub_SubChanges = detectTypeChange($FieldType1_Id, $FieldType2_Id, "Field"); | |
1748 | foreach my $Sub_SubProblemType (keys(%Sub_SubChanges)) | |
1737 | 1749 | { |
1738 | 1750 | %{$SubProblems{$Sub_SubProblemType}{$Field_Name}}=( |
1739 | 1751 | "Target"=>$Field_Name, |
1740 | "Type_Name"=>$Type1{"Name"} ); | |
1741 | foreach my $Attr (keys(%{$Sub_SubProblems{$Sub_SubProblemType}})) | |
1742 | { | |
1743 | $SubProblems{$Sub_SubProblemType}{$Field_Name}{$Attr} = $Sub_SubProblems{$Sub_SubProblemType}{$Attr}; | |
1744 | } | |
1745 | } | |
1752 | "Type_Name"=>$Type1{"Name"}); | |
1753 | ||
1754 | foreach my $Attr (keys(%{$Sub_SubChanges{$Sub_SubProblemType}})) | |
1755 | { | |
1756 | $SubProblems{$Sub_SubProblemType}{$Field_Name}{$Attr} = $Sub_SubChanges{$Sub_SubProblemType}{$Attr}; | |
1757 | } | |
1758 | } | |
1759 | ||
1746 | 1760 | if($FieldType1_Id and $FieldType2_Id) |
1747 | 1761 | { # check field type change |
1748 | %Sub_SubProblems = mergeTypes($FieldType1_Id, $FieldType2_Id); | |
1749 | foreach my $Sub_SubProblemType (keys(%Sub_SubProblems)) | |
1750 | { | |
1751 | foreach my $Sub_SubLocation (keys(%{$Sub_SubProblems{$Sub_SubProblemType}})) | |
1762 | my $Sub_SubProblems = mergeTypes($FieldType1_Id, $FieldType2_Id); | |
1763 | my %DupProblems = (); | |
1764 | ||
1765 | foreach my $Sub_SubProblemType (sort keys(%{$Sub_SubProblems})) | |
1766 | { | |
1767 | foreach my $Sub_SubLocation (sort {length($a)<=>length($b)} sort keys(%{$Sub_SubProblems->{$Sub_SubProblemType}})) | |
1752 | 1768 | { |
1769 | if(not defined $AllAffected) | |
1770 | { | |
1771 | if(defined $DupProblems{$Sub_SubProblems->{$Sub_SubProblemType}{$Sub_SubLocation}}) { | |
1772 | next; | |
1773 | } | |
1774 | } | |
1775 | ||
1753 | 1776 | my $NewLocation = ($Sub_SubLocation)?$Field_Name.".".$Sub_SubLocation:$Field_Name; |
1754 | foreach my $Attr (keys(%{$Sub_SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}})) | |
1777 | $SubProblems{$Sub_SubProblemType}{$NewLocation} = $Sub_SubProblems->{$Sub_SubProblemType}{$Sub_SubLocation}; | |
1778 | ||
1779 | if(not defined $AllAffected) | |
1755 | 1780 | { |
1756 | $SubProblems{$Sub_SubProblemType}{$NewLocation}{$Attr} = $Sub_SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}{$Attr}; | |
1781 | $DupProblems{$Sub_SubProblems->{$Sub_SubProblemType}{$Sub_SubLocation}} = 1; | |
1757 | 1782 | } |
1758 | 1783 | } |
1759 | 1784 | } |
1760 | } | |
1761 | } | |
1785 | %DupProblems = (); | |
1786 | } | |
1787 | } | |
1788 | ||
1762 | 1789 | foreach my $Field_Name (sort keys(%{$Type2{"Fields"}})) |
1763 | 1790 | { # check added fields |
1764 | next if($Type2{"Fields"}{$Field_Name}{"Access"}=~/private/); | |
1791 | if($Type2{"Fields"}{$Field_Name}{"Access"}=~/private/) { | |
1792 | next; | |
1793 | } | |
1765 | 1794 | my $FieldPos2 = $Type2{"Fields"}{$Field_Name}{"Pos"}; |
1766 | 1795 | my $FieldType2_Id = $Type2{"Fields"}{$Field_Name}{"Type"}; |
1767 | 1796 | my %FieldType2 = get_Type($FieldType2_Id, 2); |
1797 | ||
1768 | 1798 | if(not $Type1{"Fields"}{$Field_Name}) |
1769 | 1799 | {# added fields |
1770 | 1800 | my $StraightPair_Name = findFieldPair($FieldPos2, \%Type1); |
1790 | 1820 | } |
1791 | 1821 | } |
1792 | 1822 | } |
1793 | %{$Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id}} = %SubProblems; | |
1823 | ||
1794 | 1824 | pop(@RecurTypes); |
1795 | return %SubProblems; | |
1825 | return ($Cache{"mergeTypes"}{$Type1_Id}{$Type2_Id} = \%SubProblems); | |
1796 | 1826 | } |
1797 | 1827 | |
1798 | 1828 | sub unmangle($) |
2094 | 2124 | if(not defined $MethodInfo{$MethodVersion}{$Method} |
2095 | 2125 | or $MethodInfo{$MethodVersion}{$Method}{"Abstract"}) |
2096 | 2126 | { |
2097 | if(my @SuperInterfaces = keys(%{$TypeInfo{$ClassVersion}{$ClassId}{"SuperInterface"}})) { | |
2127 | if(my @SuperInterfaces = sort keys(%{$TypeInfo{$ClassVersion}{$ClassId}{"SuperInterface"}})) { | |
2098 | 2128 | push(@Search, @SuperInterfaces); |
2099 | 2129 | } |
2100 | 2130 | } |
2116 | 2146 | my ($Method, $ClassName, $ClassVersion) = @_; |
2117 | 2147 | my $TargetSuffix = get_MSuffix($Method); |
2118 | 2148 | my $TargetShortName = get_MShort($Method); |
2119 | foreach my $Candidate (keys(%{$Class_Methods{$ClassVersion}{$ClassName}})) | |
2120 | {# search for method with the same parameters suffix | |
2149 | foreach my $Candidate (sort keys(%{$Class_Methods{$ClassVersion}{$ClassName}})) | |
2150 | { # search for method with the same parameters suffix | |
2121 | 2151 | next if($MethodInfo{$ClassVersion}{$Candidate}{"Constructor"}); |
2122 | 2152 | if($TargetSuffix eq get_MSuffix($Candidate)) |
2123 | 2153 | { |
2148 | 2178 | |
2149 | 2179 | sub mergeMethods() |
2150 | 2180 | { |
2151 | my %SubProblems = (); | |
2152 | 2181 | foreach my $Method (sort keys(%{$MethodInfo{1}})) |
2153 | 2182 | { # compare methods |
2154 | 2183 | next if(not defined $MethodInfo{2}{$Method}); |
2303 | 2332 | } |
2304 | 2333 | } |
2305 | 2334 | } |
2306 | foreach my $ParamPos (sort {int($a) <=> int($b)} keys(%{$MethodInfo{1}{$Method}{"Param"}})) | |
2307 | { # checking parameters | |
2308 | mergeParameters($Method, $ParamPos, $ParamPos); | |
2309 | } | |
2335 | ||
2336 | if(defined $MethodInfo{1}{$Method}{"Param"}) | |
2337 | { | |
2338 | foreach my $ParamPos (sort {int($a) <=> int($b)} keys(%{$MethodInfo{1}{$Method}{"Param"}})) | |
2339 | { # checking parameters | |
2340 | mergeParameters($Method, $ParamPos, $ParamPos); | |
2341 | } | |
2342 | } | |
2343 | ||
2310 | 2344 | # check object type |
2311 | 2345 | my $ObjectType1_Id = $MethodInfo{1}{$Method}{"Class"}; |
2312 | 2346 | my $ObjectType2_Id = $MethodInfo{2}{$Method}{"Class"}; |
2313 | 2347 | if($ObjectType1_Id and $ObjectType2_Id) |
2314 | 2348 | { |
2315 | @RecurTypes = (); | |
2316 | %SubProblems = mergeTypes($ObjectType1_Id, $ObjectType2_Id); | |
2317 | foreach my $SubProblemType (keys(%SubProblems)) | |
2318 | { | |
2319 | foreach my $SubLocation (keys(%{$SubProblems{$SubProblemType}})) | |
2349 | my $SubProblems = mergeTypes($ObjectType1_Id, $ObjectType2_Id); | |
2350 | foreach my $SubProblemType (keys(%{$SubProblems})) | |
2351 | { | |
2352 | foreach my $SubLocation (keys(%{$SubProblems->{$SubProblemType}})) | |
2320 | 2353 | { |
2321 | 2354 | my $NewLocation = ($SubLocation)?"this.".$SubLocation:"this"; |
2322 | @{$CompatProblems{$Method}{$SubProblemType}{$NewLocation}}{keys(%{$SubProblems{$SubProblemType}{$SubLocation}})} = values %{$SubProblems{$SubProblemType}{$SubLocation}}; | |
2355 | $CompatProblems{$Method}{$SubProblemType}{$NewLocation} = $SubProblems->{$SubProblemType}{$SubLocation}; | |
2323 | 2356 | } |
2324 | 2357 | } |
2325 | 2358 | } |
2328 | 2361 | my $ReturnType2_Id = $MethodInfo{2}{$Method}{"Return"}; |
2329 | 2362 | if($ReturnType1_Id and $ReturnType2_Id) |
2330 | 2363 | { |
2331 | @RecurTypes = (); | |
2332 | %SubProblems = mergeTypes($ReturnType1_Id, $ReturnType2_Id); | |
2333 | foreach my $SubProblemType (keys(%SubProblems)) | |
2334 | { | |
2335 | foreach my $SubLocation (keys(%{$SubProblems{$SubProblemType}})) | |
2364 | my $SubProblems = mergeTypes($ReturnType1_Id, $ReturnType2_Id); | |
2365 | foreach my $SubProblemType (keys(%{$SubProblems})) | |
2366 | { | |
2367 | foreach my $SubLocation (keys(%{$SubProblems->{$SubProblemType}})) | |
2336 | 2368 | { |
2337 | 2369 | my $NewLocation = ($SubLocation)?"retval.".$SubLocation:"retval"; |
2338 | @{$CompatProblems{$Method}{$SubProblemType}{$NewLocation}}{keys(%{$SubProblems{$SubProblemType}{$SubLocation}})} = values %{$SubProblems{$SubProblemType}{$SubLocation}}; | |
2370 | $CompatProblems{$Method}{$SubProblemType}{$NewLocation} = $SubProblems->{$SubProblemType}{$SubLocation}; | |
2339 | 2371 | } |
2340 | 2372 | } |
2341 | 2373 | } |
2345 | 2377 | sub mergeParameters($$$) |
2346 | 2378 | { |
2347 | 2379 | my ($Method, $ParamPos1, $ParamPos2) = @_; |
2348 | return if(not $Method or not defined $MethodInfo{1}{$Method}{"Param"} | |
2349 | or not defined $MethodInfo{2}{$Method}{"Param"}); | |
2380 | if(not $Method or not defined $MethodInfo{1}{$Method}{"Param"} | |
2381 | or not defined $MethodInfo{2}{$Method}{"Param"}) { | |
2382 | return; | |
2383 | } | |
2384 | ||
2350 | 2385 | my $ParamType1_Id = $MethodInfo{1}{$Method}{"Param"}{$ParamPos1}{"Type"}; |
2386 | my $ParamType2_Id = $MethodInfo{2}{$Method}{"Param"}{$ParamPos2}{"Type"}; | |
2387 | ||
2388 | if(not $ParamType1_Id or not $ParamType2_Id) { | |
2389 | return; | |
2390 | } | |
2391 | ||
2351 | 2392 | my $Parameter_Name = $MethodInfo{1}{$Method}{"Param"}{$ParamPos1}{"Name"}; |
2352 | my $ParamType2_Id = $MethodInfo{2}{$Method}{"Param"}{$ParamPos2}{"Type"}; | |
2353 | return if(not $ParamType1_Id or not $ParamType2_Id); | |
2354 | 2393 | my $Parameter_Location = ($Parameter_Name)?$Parameter_Name:showPos($ParamPos1)." Parameter"; |
2355 | 2394 | |
2356 | 2395 | # checking type declaration changes |
2357 | my %SubProblems = mergeTypes($ParamType1_Id, $ParamType2_Id); | |
2358 | foreach my $SubProblemType (keys(%SubProblems)) | |
2359 | { | |
2360 | foreach my $SubLocation (keys(%{$SubProblems{$SubProblemType}})) | |
2396 | my $SubProblems = mergeTypes($ParamType1_Id, $ParamType2_Id); | |
2397 | foreach my $SubProblemType (keys(%{$SubProblems})) | |
2398 | { | |
2399 | foreach my $SubLocation (keys(%{$SubProblems->{$SubProblemType}})) | |
2361 | 2400 | { |
2362 | 2401 | my $NewLocation = ($SubLocation)?$Parameter_Location.".".$SubLocation:$Parameter_Location; |
2363 | %{$CompatProblems{$Method}{$SubProblemType}{$NewLocation}}=( | |
2364 | "Parameter_Type_Name"=>get_TypeName($ParamType1_Id, 1), | |
2365 | "Parameter_Position"=>$ParamPos1, | |
2366 | "Parameter_Name"=>$Parameter_Name); | |
2367 | @{$CompatProblems{$Method}{$SubProblemType}{$NewLocation}}{keys(%{$SubProblems{$SubProblemType}{$SubLocation}})} = values %{$SubProblems{$SubProblemType}{$SubLocation}}; | |
2402 | $CompatProblems{$Method}{$SubProblemType}{$NewLocation} = $SubProblems->{$SubProblemType}{$SubLocation}; | |
2368 | 2403 | } |
2369 | 2404 | } |
2370 | 2405 | } |
2447 | 2482 | } |
2448 | 2483 | |
2449 | 2484 | # settings |
2450 | my ($Full, $Html, $Italic, $Color, $Target) = (0, 0, 0, 0, undef); | |
2485 | my ($Full, $Html, $Italic, $Color, | |
2486 | $ShowParams, $ShowClass, $ShowAttr, $Target) = (0, 0, 0, 0, 0, 0, 0, undef); | |
2451 | 2487 | |
2452 | 2488 | if($Kind=~/Full/) { |
2453 | 2489 | $Full = 1; |
2462 | 2498 | $Color = 1; |
2463 | 2499 | } |
2464 | 2500 | if($Kind=~/Target=(\d+)/) { |
2465 | $Target = 1; | |
2501 | $Target = $1; | |
2502 | } | |
2503 | if($Kind=~/Param/) { | |
2504 | $ShowParams = 1; | |
2505 | } | |
2506 | if($Kind=~/Class/) { | |
2507 | $ShowClass = 1; | |
2508 | } | |
2509 | if($Kind=~/Attr/) { | |
2510 | $ShowAttr = 1; | |
2466 | 2511 | } |
2467 | 2512 | |
2468 | 2513 | my $Signature = $MethodInfo{$LibVersion}{$Method}{"ShortName"}; |
2469 | if($Full) | |
2514 | if($Full or $ShowClass) | |
2470 | 2515 | { |
2471 | 2516 | my $Class = get_TypeName($MethodInfo{$LibVersion}{$Method}{"Class"}, $LibVersion); |
2472 | 2517 | |
2481 | 2526 | $Signature = $Class.".".$Signature; |
2482 | 2527 | } |
2483 | 2528 | my @Params = (); |
2484 | foreach my $PPos (sort {int($a)<=>int($b)} | |
2485 | keys(%{$MethodInfo{$LibVersion}{$Method}{"Param"}})) | |
2486 | { | |
2487 | my $PTid = $MethodInfo{$LibVersion}{$Method}{"Param"}{$PPos}{"Type"}; | |
2488 | if(my $PTName = get_TypeName($PTid, $LibVersion)) | |
2489 | { | |
2490 | if($HideTemplates) { | |
2491 | $PTName=~s/<.*>//g; | |
2492 | } | |
2493 | ||
2494 | if(not $ShowPackages) { | |
2495 | $PTName=~s/(\A|\<\s*|\,\s*)[a-z0-9\.]+\./$1/g; | |
2496 | } | |
2497 | ||
2498 | if($Html) { | |
2499 | $PTName = htmlSpecChars($PTName); | |
2500 | } | |
2501 | ||
2502 | if($Full) | |
2503 | { | |
2504 | my $PName = $MethodInfo{$LibVersion}{$Method}{"Param"}{$PPos}{"Name"}; | |
2529 | ||
2530 | if(defined $MethodInfo{$LibVersion}{$Method}{"Param"}) | |
2531 | { | |
2532 | foreach my $PPos (sort {int($a)<=>int($b)} | |
2533 | keys(%{$MethodInfo{$LibVersion}{$Method}{"Param"}})) | |
2534 | { | |
2535 | my $PTid = $MethodInfo{$LibVersion}{$Method}{"Param"}{$PPos}{"Type"}; | |
2536 | if(my $PTName = get_TypeName($PTid, $LibVersion)) | |
2537 | { | |
2538 | if($HideTemplates) { | |
2539 | $PTName=~s/<.*>//g; | |
2540 | } | |
2505 | 2541 | |
2506 | if($Html) | |
2542 | if(not $ShowPackages) { | |
2543 | $PTName=~s/(\A|\<\s*|\,\s*)[a-z0-9\.]+\./$1/g; | |
2544 | } | |
2545 | ||
2546 | if($Html) { | |
2547 | $PTName = htmlSpecChars($PTName); | |
2548 | } | |
2549 | ||
2550 | if($Full or $ShowParams) | |
2507 | 2551 | { |
2508 | my $Style = "param"; | |
2509 | if(defined $Target and $Target==$PPos) { | |
2510 | $Style = "focus_p"; | |
2511 | } | |
2512 | elsif($Color) { | |
2513 | $Style = "color_p"; | |
2552 | my $PName = $MethodInfo{$LibVersion}{$Method}{"Param"}{$PPos}{"Name"}; | |
2553 | ||
2554 | if($Html) | |
2555 | { | |
2556 | my $Style = "param"; | |
2557 | ||
2558 | if(defined $Target | |
2559 | and $Target==$PPos) { | |
2560 | $PName = "<span class='focus_p'>$PName</span>"; | |
2561 | } | |
2562 | elsif($Color) { | |
2563 | $PName = "<span class='color_p'>$PName</span>"; | |
2564 | } | |
2565 | else { | |
2566 | $PName = "<i>$PName</i>"; | |
2567 | } | |
2514 | 2568 | } |
2515 | 2569 | |
2516 | $PName = "<span class=\'$Style\'>$PName</span>"; | |
2517 | } | |
2518 | ||
2519 | push(@Params, $PTName." ".$PName); | |
2520 | } | |
2521 | else { | |
2522 | push(@Params, $PTName); | |
2523 | } | |
2524 | } | |
2525 | } | |
2570 | push(@Params, $PTName." ".$PName); | |
2571 | } | |
2572 | else { | |
2573 | push(@Params, $PTName); | |
2574 | } | |
2575 | } | |
2576 | } | |
2577 | } | |
2578 | ||
2526 | 2579 | if($Html) |
2527 | 2580 | { |
2528 | 2581 | $Signature .= " "; |
2539 | 2592 | |
2540 | 2593 | $Name .= $Params[$Pos]; |
2541 | 2594 | |
2542 | $Name = "<span class='nowrap'>".$Name."</span>"; | |
2595 | $Name = "<span>".$Name."</span>"; | |
2543 | 2596 | |
2544 | 2597 | if($Pos==$#Params) { |
2545 | 2598 | $Name .= " )"; |
2559 | 2612 | else { |
2560 | 2613 | $Signature .= "(".join(", ", @Params).")"; |
2561 | 2614 | } |
2562 | if($Full) | |
2615 | ||
2616 | if($Full or $ShowAttr) | |
2563 | 2617 | { |
2564 | 2618 | if($MethodInfo{$LibVersion}{$Method}{"Static"}) { |
2565 | 2619 | $Signature .= " [static]"; |
2567 | 2621 | elsif($MethodInfo{$LibVersion}{$Method}{"Abstract"}) { |
2568 | 2622 | $Signature .= " [abstract]"; |
2569 | 2623 | } |
2570 | ||
2624 | } | |
2625 | ||
2626 | if($Full) | |
2627 | { | |
2571 | 2628 | if($ShowAccess) |
2572 | 2629 | { |
2573 | 2630 | if(my $Access = $MethodInfo{$LibVersion}{$Method}{"Access"}) |
2577 | 2634 | } |
2578 | 2635 | } |
2579 | 2636 | } |
2637 | ||
2580 | 2638 | if(my $ReturnId = $MethodInfo{$LibVersion}{$Method}{"Return"}) |
2581 | 2639 | { |
2582 | 2640 | my $RName = get_TypeName($ReturnId, $LibVersion); |
2603 | 2661 | $Signature .= " *DEPRECATED*"; |
2604 | 2662 | } |
2605 | 2663 | } |
2664 | } | |
2665 | ||
2666 | $Signature=~s/java\.lang\.//g; | |
2667 | ||
2668 | if($Html) | |
2669 | { | |
2670 | $Signature=~s!(\[static\]|\[abstract\]|\[public\]|\[private\]|\[protected\])!<span class='attr'>$1</span>!g; | |
2606 | 2671 | |
2607 | $Signature=~s/java\.lang\.//g; | |
2672 | if(not $SkipDeprecated) { | |
2673 | $Signature=~s!(\*deprecated\*)!<span class='deprecated'>$1</span>!ig; | |
2674 | } | |
2608 | 2675 | |
2609 | if($Html) | |
2610 | { | |
2611 | $Signature=~s!(\[static\]|\[abstract\]|\[public\]|\[private\]|\[protected\])!<span class='attr'>$1</span>!g; | |
2612 | ||
2613 | if(not $SkipDeprecated) { | |
2614 | $Signature=~s!(\*deprecated\*)!<span class='deprecated'>$1</span>!ig; | |
2615 | } | |
2616 | } | |
2617 | } | |
2618 | ||
2619 | if($Html) | |
2620 | { | |
2621 | 2676 | $Signature=~s!\[\]![ ]!g; |
2622 | 2677 | $Signature=~s!operator=!operator =!g; |
2623 | 2678 | } |
2922 | 2977 | return $CheckedArchives; |
2923 | 2978 | } |
2924 | 2979 | |
2925 | sub get_TypeProblems_Count($$$) | |
2926 | { | |
2927 | my ($TypeChanges, $TargetSeverity, $Level) = @_; | |
2980 | sub get_TypeProblems_Count($$) | |
2981 | { | |
2982 | my ($TargetSeverity, $Level) = @_; | |
2928 | 2983 | my $Type_Problems_Count = 0; |
2929 | foreach my $Type_Name (sort keys(%{$TypeChanges})) | |
2984 | ||
2985 | foreach my $Type_Name (sort keys(%{$TypeChanges{$Level}})) | |
2930 | 2986 | { |
2931 | 2987 | my %Kinds_Target = (); |
2932 | foreach my $Kind (sort keys(%{$TypeChanges->{$Type_Name}})) | |
2933 | { | |
2934 | foreach my $Location (sort keys(%{$TypeChanges->{$Type_Name}{$Kind}})) | |
2935 | { | |
2936 | my $Target = $TypeChanges->{$Type_Name}{$Kind}{$Location}{"Target"}; | |
2937 | my $Priority = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
2938 | next if($Priority ne $TargetSeverity); | |
2988 | foreach my $Kind (sort keys(%{$TypeChanges{$Level}{$Type_Name}})) | |
2989 | { | |
2990 | foreach my $Location (sort keys(%{$TypeChanges{$Level}{$Type_Name}{$Kind}})) | |
2991 | { | |
2992 | my $Target = $TypeChanges{$Level}{$Type_Name}{$Kind}{$Location}{"Target"}; | |
2993 | my $Severity = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
2994 | ||
2995 | if($Severity ne $TargetSeverity) { | |
2996 | next; | |
2997 | } | |
2998 | ||
2939 | 2999 | if($Kinds_Target{$Kind}{$Target}) { |
2940 | 3000 | next; |
2941 | 3001 | } |
2942 | if(cmpSeverities($Type_MaxPriority{$Level}{$Type_Name}{$Kind}{$Target}, $Priority)) | |
2943 | { # select a problem with the highest priority | |
2944 | next; | |
2945 | } | |
3002 | ||
2946 | 3003 | $Kinds_Target{$Kind}{$Target} = 1; |
2947 | 3004 | $Type_Problems_Count += 1; |
2948 | 3005 | } |
2949 | 3006 | } |
2950 | 3007 | } |
3008 | ||
2951 | 3009 | return $Type_Problems_Count; |
2952 | 3010 | } |
2953 | 3011 | |
3005 | 3063 | my $Level = $_[0]; |
3006 | 3064 | my ($Added, $Removed, $M_Problems_High, $M_Problems_Medium, $M_Problems_Low, |
3007 | 3065 | $T_Problems_High, $T_Problems_Medium, $T_Problems_Low, $M_Other, $T_Other) = (0,0,0,0,0,0,0,0,0,0); |
3066 | ||
3008 | 3067 | %{$RESULT{$Level}} = ( |
3009 | 3068 | "Problems"=>0, |
3010 | 3069 | "Warnings"=>0, |
3011 | 3070 | "Affected"=>0 ); |
3071 | ||
3012 | 3072 | foreach my $Method (sort keys(%CompatProblems)) |
3013 | 3073 | { |
3014 | 3074 | foreach my $Kind (sort keys(%{$CompatProblems{$Method}})) |
3019 | 3079 | { |
3020 | 3080 | my $Type_Name = $CompatProblems{$Method}{$Kind}{$Location}{"Type_Name"}; |
3021 | 3081 | my $Target = $CompatProblems{$Method}{$Kind}{$Location}{"Target"}; |
3022 | my $Priority = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
3082 | my $Severity = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
3023 | 3083 | if($Kind eq "Added_Method") |
3024 | 3084 | { |
3025 | 3085 | if($Level eq "Source") |
3039 | 3099 | } |
3040 | 3100 | } |
3041 | 3101 | $Removed+=1; |
3042 | $TotalAffected{$Level}{$Method} = $Priority; | |
3102 | $TotalAffected{$Level}{$Method} = $Severity; | |
3043 | 3103 | } |
3044 | 3104 | else |
3045 | 3105 | { |
3046 | if($Priority eq "Safe") { | |
3106 | if($Severity eq "Safe") { | |
3047 | 3107 | $M_Other += 1; |
3048 | 3108 | } |
3049 | elsif($Priority eq "High") { | |
3109 | elsif($Severity eq "High") { | |
3050 | 3110 | $M_Problems_High+=1; |
3051 | 3111 | } |
3052 | elsif($Priority eq "Medium") { | |
3112 | elsif($Severity eq "Medium") { | |
3053 | 3113 | $M_Problems_Medium+=1; |
3054 | 3114 | } |
3055 | elsif($Priority eq "Low") { | |
3115 | elsif($Severity eq "Low") { | |
3056 | 3116 | $M_Problems_Low+=1; |
3057 | 3117 | } |
3058 | if(($Priority ne "Low" or $StrictCompat) | |
3059 | and $Priority ne "Safe") { | |
3060 | $TotalAffected{$Level}{$Method} = $Priority; | |
3118 | if(($Severity ne "Low" or $StrictCompat) | |
3119 | and $Severity ne "Safe") { | |
3120 | $TotalAffected{$Level}{$Method} = $Severity; | |
3061 | 3121 | } |
3062 | 3122 | } |
3063 | 3123 | } |
3064 | 3124 | } |
3065 | 3125 | } |
3066 | 3126 | } |
3067 | my %TypeChanges = (); | |
3127 | ||
3128 | my %MethodTypeIndex = (); | |
3129 | my %SeverityIndex = (); | |
3130 | ||
3068 | 3131 | foreach my $Method (sort keys(%CompatProblems)) |
3069 | 3132 | { |
3070 | foreach my $Kind (sort keys(%{$CompatProblems{$Method}})) | |
3133 | my @Kinds = sort keys(%{$CompatProblems{$Method}}); | |
3134 | foreach my $Kind (@Kinds) | |
3071 | 3135 | { |
3072 | 3136 | if($TypeProblems_Kind{$Level}{$Kind}) |
3073 | 3137 | { |
3074 | foreach my $Location (sort keys(%{$CompatProblems{$Method}{$Kind}})) | |
3138 | my @Locs = sort {length($a)<=>length($b)} sort keys(%{$CompatProblems{$Method}{$Kind}}); | |
3139 | foreach my $Location (@Locs) | |
3075 | 3140 | { |
3076 | 3141 | my $Type_Name = $CompatProblems{$Method}{$Kind}{$Location}{"Type_Name"}; |
3077 | 3142 | my $Target = $CompatProblems{$Method}{$Kind}{$Location}{"Target"}; |
3078 | my $Priority = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
3079 | if(cmpSeverities($Type_MaxPriority{$Level}{$Type_Name}{$Kind}{$Target}, $Priority)) | |
3080 | { # select a problem with the highest priority | |
3143 | ||
3144 | if(defined $MethodTypeIndex{$Method}{$Type_Name}{$Kind}{$Target}) | |
3145 | { # one location for one type and target | |
3081 | 3146 | next; |
3082 | 3147 | } |
3083 | if(($Priority ne "Low" or $StrictCompat) | |
3084 | and $Priority ne "Safe") { | |
3085 | $TotalAffected{$Level}{$Method} = maxSeverity($TotalAffected{$Level}{$Method}, $Priority); | |
3148 | $MethodTypeIndex{$Method}{$Type_Name}{$Kind}{$Target} = 1; | |
3149 | $TypeChanges{$Level}{$Type_Name}{$Kind}{$Location} = $CompatProblems{$Method}{$Kind}{$Location}; | |
3150 | ||
3151 | my $Severity = undef; | |
3152 | if(defined $SeverityIndex{$Type_Name}{$Kind}{$Target}) { | |
3153 | $Severity = $SeverityIndex{$Type_Name}{$Kind}{$Target}; | |
3086 | 3154 | } |
3087 | %{$TypeChanges{$Type_Name}{$Kind}{$Location}} = %{$CompatProblems{$Method}{$Kind}{$Location}}; | |
3088 | $Type_MaxPriority{$Level}{$Type_Name}{$Kind}{$Target} = maxSeverity($Type_MaxPriority{$Level}{$Type_Name}{$Kind}{$Target}, $Priority); | |
3089 | } | |
3090 | } | |
3091 | } | |
3092 | } | |
3093 | $T_Problems_High = get_TypeProblems_Count(\%TypeChanges, "High", $Level); | |
3094 | $T_Problems_Medium = get_TypeProblems_Count(\%TypeChanges, "Medium", $Level); | |
3095 | $T_Problems_Low = get_TypeProblems_Count(\%TypeChanges, "Low", $Level); | |
3096 | $T_Other = get_TypeProblems_Count(\%TypeChanges, "Safe", $Level); | |
3097 | ||
3155 | else { | |
3156 | $Severity = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
3157 | } | |
3158 | ||
3159 | if(($Severity ne "Low" or $StrictCompat) | |
3160 | and $Severity ne "Safe") | |
3161 | { | |
3162 | if(my $Sev = $TotalAffected{$Level}{$Method}) | |
3163 | { | |
3164 | if($Severity_Val{$Severity}>$Severity_Val{$Sev}) { | |
3165 | $TotalAffected{$Level}{$Method} = $Severity; | |
3166 | } | |
3167 | } | |
3168 | else { | |
3169 | $TotalAffected{$Level}{$Method} = $Severity; | |
3170 | } | |
3171 | } | |
3172 | } | |
3173 | } | |
3174 | } | |
3175 | } | |
3176 | ||
3177 | %MethodTypeIndex = (); # clear memory | |
3178 | %SeverityIndex = (); # clear memory | |
3179 | ||
3180 | ||
3181 | $T_Problems_High = get_TypeProblems_Count("High", $Level); | |
3182 | $T_Problems_Medium = get_TypeProblems_Count("Medium", $Level); | |
3183 | $T_Problems_Low = get_TypeProblems_Count("Low", $Level); | |
3184 | $T_Other = get_TypeProblems_Count("Safe", $Level); | |
3185 | ||
3098 | 3186 | # changed and removed public symbols |
3099 | 3187 | my $SCount = keys(%CheckedMethods); |
3100 | 3188 | if($SCount) |
3143 | 3231 | |
3144 | 3232 | my $Checked_Archives_Link = "0"; |
3145 | 3233 | $Checked_Archives_Link = "<a href='#Checked_Archives' style='color:Blue;'>".keys(%{$LibArchives{1}})."</a>" if(keys(%{$LibArchives{1}})>0); |
3146 | $TestResults .= "<tr><th>Total Java ARchives</th><td>$Checked_Archives_Link</td></tr>"; | |
3147 | ||
3148 | $TestResults .= "<tr><th>Total Methods / Classes</th><td>".keys(%CheckedMethods)." / ".keys(%{$LibClasses{1}})."</td></tr>"; # keys(%CheckedTypes) | |
3149 | ||
3150 | my $Verdict = ""; | |
3234 | ||
3235 | $TestResults .= "<tr><th>Total JARs</th><td>$Checked_Archives_Link</td></tr>\n"; | |
3236 | $TestResults .= "<tr><th>Total Methods / Classes</th><td>".keys(%CheckedMethods)." / ".keys(%{$LibClasses{1}})."</td></tr>\n"; # keys(%CheckedTypes) | |
3237 | ||
3151 | 3238 | $RESULT{$Level}{"Problems"} += $Removed+$M_Problems_High+$T_Problems_High+$T_Problems_Medium+$M_Problems_Medium; |
3152 | 3239 | if($StrictCompat) { |
3153 | 3240 | $RESULT{$Level}{"Problems"}+=$T_Problems_Low+$M_Problems_Low; |
3155 | 3242 | else { |
3156 | 3243 | $RESULT{$Level}{"Warnings"}+=$T_Problems_Low+$M_Problems_Low; |
3157 | 3244 | } |
3158 | if($RESULT{$Level}{"Problems"}) { | |
3159 | $Verdict = "<span style='color:Red;'><b>Incompatible</b></span>"; | |
3160 | } | |
3161 | else { | |
3162 | $Verdict = "<span style='color:Green;'><b>Compatible</b></span>"; | |
3163 | } | |
3245 | ||
3164 | 3246 | my $META_DATA = "kind:".lc($Level).";"; |
3165 | 3247 | $META_DATA .= $RESULT{$Level}{"Problems"}?"verdict:incompatible;":"verdict:compatible;"; |
3166 | $TestResults .= "<tr><th>Verdict</th>"; | |
3167 | if($RESULT{$Level}{"Problems"}) { | |
3168 | $TestResults .= "<td><span style='color:Red;'><b>Incompatible<br/>(".$RESULT{$Level}{"Affected"}."%)</b></span></td>"; | |
3169 | } | |
3170 | else { | |
3171 | $TestResults .= "<td><span style='color:Green;'><b>Compatible</b></span></td>"; | |
3172 | } | |
3248 | $TestResults .= "<tr><th>Compatibility</th>\n"; | |
3249 | ||
3250 | my $BC_Rate = 100 - $RESULT{$Level}{"Affected"}; | |
3251 | ||
3252 | if($RESULT{$Level}{"Problems"}) | |
3253 | { | |
3254 | my $Cl = "incompatible"; | |
3255 | if($BC_Rate>=90) { | |
3256 | $Cl = "warning"; | |
3257 | } | |
3258 | elsif($BC_Rate>=80) { | |
3259 | $Cl = "almost_compatible"; | |
3260 | } | |
3261 | ||
3262 | $TestResults .= "<td class=\'$Cl\'>".$BC_Rate."%</td>\n"; | |
3263 | } | |
3264 | else | |
3265 | { | |
3266 | $TestResults .= "<td class=\'compatible\'>100%</td>\n"; | |
3267 | } | |
3268 | ||
3173 | 3269 | $TestResults .= "</tr>\n"; |
3174 | 3270 | $TestResults .= "</table>\n"; |
3175 | 3271 | |
3308 | 3404 | { |
3309 | 3405 | foreach my $Kind (sort keys(%{$CompatProblems{$Method}})) |
3310 | 3406 | { |
3311 | if($Kind eq "Added_Method") { | |
3407 | if($Kind eq "Added_Method") | |
3408 | { | |
3312 | 3409 | my $ArchiveName = $MethodInfo{2}{$Method}{"Archive"}; |
3313 | 3410 | my $ClassName = get_ShortName($MethodInfo{2}{$Method}{"Class"}, 2); |
3314 | 3411 | if($Level eq "Source") |
3459 | 3556 | my $ClassName_Full = get_TypeName($MethodInfo{1}{$Method}{"Class"}, 1); |
3460 | 3557 | my $MethodProblemsReport = ""; |
3461 | 3558 | my $ProblemNum = 1; |
3462 | foreach my $Kind (keys(%{$CompatProblems{$Method}})) | |
3559 | foreach my $Kind (sort keys(%{$CompatProblems{$Method}})) | |
3463 | 3560 | { |
3464 | foreach my $Location (keys(%{$CompatProblems{$Method}{$Kind}})) | |
3561 | foreach my $Location (sort keys(%{$CompatProblems{$Method}{$Kind}})) | |
3465 | 3562 | { |
3466 | 3563 | my %Problems = %{$CompatProblems{$Method}{$Kind}{$Location}}; |
3467 | 3564 | my $Type_Name = $Problems{"Type_Name"}; |
3473 | 3570 | my ($Change, $Effect) = ("", ""); |
3474 | 3571 | my $Old_Value = htmlSpecChars($Problems{"Old_Value"}); |
3475 | 3572 | my $New_Value = htmlSpecChars($Problems{"New_Value"}); |
3476 | my $Parameter_Position = $Problems{"Parameter_Position"}; | |
3477 | my $Parameter_Position_Str = showPos($Parameter_Position); | |
3573 | ||
3478 | 3574 | if($Kind eq "Method_Became_Static") |
3479 | 3575 | { |
3480 | 3576 | $Change = "Method became <b>static</b>.\n"; |
3609 | 3705 | } |
3610 | 3706 | } |
3611 | 3707 | if($ARCHIVE_CLASS_REPORT) { |
3612 | $METHOD_PROBLEMS .= "<span class='jar'>$ArchiveName</span>, <span class='cname'>$ClassName</span><br/>\n".$ARCHIVE_CLASS_REPORT."<br/>"; | |
3708 | $METHOD_PROBLEMS .= "<span class='jar'>$ArchiveName</span>, <span class='cname'>$ClassName.class</span><br/>\n".$ARCHIVE_CLASS_REPORT."<br/>"; | |
3613 | 3709 | } |
3614 | 3710 | } |
3615 | 3711 | } |
3628 | 3724 | sub get_Report_TypeProblems($$) |
3629 | 3725 | { |
3630 | 3726 | my ($TargetSeverity, $Level) = @_; |
3631 | my ($TYPE_PROBLEMS, %TypeArchive, %TypeChanges) = (); | |
3632 | ||
3633 | foreach my $Method (sort keys(%CompatProblems)) | |
3634 | { | |
3635 | foreach my $Kind (sort keys(%{$CompatProblems{$Method}})) | |
3636 | { | |
3637 | if($TypeProblems_Kind{$Level}{$Kind}) | |
3638 | { | |
3639 | foreach my $Location (sort keys(%{$CompatProblems{$Method}{$Kind}})) | |
3640 | { | |
3641 | my $Type_Name = $CompatProblems{$Method}{$Kind}{$Location}{"Type_Name"}; | |
3642 | my $Target = $CompatProblems{$Method}{$Kind}{$Location}{"Target"}; | |
3643 | my $Severity = getProblemSeverity($Level, $Kind, $Type_Name, $Target); | |
3644 | if($Severity eq "Safe" | |
3645 | and $TargetSeverity ne "Safe") { | |
3646 | next; | |
3647 | } | |
3648 | if(cmpSeverities($Type_MaxPriority{$Level}{$Type_Name}{$Kind}{$Target}, $Severity)) | |
3649 | {# select a problem with the highest priority | |
3650 | next; | |
3651 | } | |
3652 | %{$TypeChanges{$Type_Name}{$Kind}{$Location}} = %{$CompatProblems{$Method}{$Kind}{$Location}}; | |
3653 | my $ArchiveName = $TypeInfo{1}{$TName_Tid{1}{$Type_Name}}{"Archive"}; | |
3654 | $TypeArchive{$ArchiveName}{$Type_Name} = 1; | |
3655 | } | |
3656 | } | |
3657 | } | |
3658 | } | |
3659 | ||
3660 | my @Methods = sort {lc($tr_name{$a}) cmp lc($tr_name{$b})} keys(%CompatProblems); | |
3727 | my ($TYPE_PROBLEMS, %TypeArchive) = (); | |
3728 | ||
3729 | foreach my $TypeName (keys(%{$TypeChanges{$Level}})) | |
3730 | { | |
3731 | my $ArchiveName = $TypeInfo{1}{$TName_Tid{1}{$TypeName}}{"Archive"}; | |
3732 | $TypeArchive{$ArchiveName}{$TypeName} = 1; | |
3733 | } | |
3661 | 3734 | |
3662 | 3735 | my $Problems_Number = 0; |
3663 | 3736 | foreach my $ArchiveName (sort {lc($a) cmp lc($b)} keys(%TypeArchive)) |
3676 | 3749 | my $TypeId = $TName_Tid{1}{$TypeName}; |
3677 | 3750 | my $ProblemNum = 1; |
3678 | 3751 | my ($TypeProblemsReport, %Kinds_Locations, %Kinds_Target) = (); |
3679 | foreach my $Kind (sort keys(%{$TypeChanges{$TypeName}})) | |
3752 | foreach my $Kind (sort keys(%{$TypeChanges{$Level}{$TypeName}})) | |
3680 | 3753 | { |
3681 | foreach my $Location (sort keys(%{$TypeChanges{$TypeName}{$Kind}})) | |
3754 | foreach my $Location (sort keys(%{$TypeChanges{$Level}{$TypeName}{$Kind}})) | |
3682 | 3755 | { |
3683 | my $Target = $TypeChanges{$TypeName}{$Kind}{$Location}{"Target"}; | |
3684 | my $Priority = getProblemSeverity($Level, $Kind, $TypeName, $Target); | |
3685 | if($Priority ne $TargetSeverity) { | |
3756 | my $Target = $TypeChanges{$Level}{$TypeName}{$Kind}{$Location}{"Target"}; | |
3757 | my $Severity = getProblemSeverity($Level, $Kind, $TypeName, $Target); | |
3758 | ||
3759 | if($Severity ne $TargetSeverity) { | |
3686 | 3760 | next; |
3687 | 3761 | } |
3762 | ||
3688 | 3763 | $Kinds_Locations{$Kind}{$Location} = 1; |
3689 | 3764 | my ($Change, $Effect) = ("", ""); |
3690 | my %Problems = %{$TypeChanges{$TypeName}{$Kind}{$Location}}; | |
3691 | next if($Kinds_Target{$Kind}{$Target}); | |
3765 | my %Problems = %{$TypeChanges{$Level}{$TypeName}{$Kind}{$Location}}; | |
3766 | ||
3767 | if($Kinds_Target{$Kind}{$Target}) { | |
3768 | next; | |
3769 | } | |
3692 | 3770 | $Kinds_Target{$Kind}{$Target} = 1; |
3771 | ||
3693 | 3772 | my $Old_Value = $Problems{"Old_Value"}; |
3694 | 3773 | my $New_Value = $Problems{"New_Value"}; |
3695 | 3774 | my $Field_Type = $Problems{"Field_Type"}; |
3891 | 3970 | elsif($Kind eq "Class_Added_Field") |
3892 | 3971 | { |
3893 | 3972 | $Change = "Field <b>$Target</b> has been added to this class."; |
3894 | if($Level eq "Binary") { | |
3895 | $Effect = "No effect.<br/><b>NOTE</b>: A static field from a super-interface of a client class may hide an added field (with the same name) inherited from the super-class of a client class and cause <b>IncompatibleClassChangeError</b> exception."; | |
3896 | } | |
3897 | else { | |
3898 | $Effect = "No effect.<br/><b>NOTE</b>: A static field from a super-interface of a client class may hide an added field (with the same name) inherited from the super-class of a client class. Recompilation of a client class may be terminated with the message: reference to <b>$Target</b> is ambiguous."; | |
3973 | if($Level eq "Binary") | |
3974 | { | |
3975 | $Effect = "No effect."; | |
3976 | # $Effect .= "<br/><b>NOTE</b>: A static field from a super-interface of a client class may hide an added field (with the same name) inherited from the super-class of a client class and cause <b>IncompatibleClassChangeError</b> exception."; | |
3977 | } | |
3978 | else | |
3979 | { | |
3980 | $Effect = "No effect."; | |
3981 | # $Effect .= "<br/><b>NOTE</b>: A static field from a super-interface of a client class may hide an added field (with the same name) inherited from the super-class of a client class. Recompilation of a client class may be terminated with the message: reference to <b>$Target</b> is ambiguous."; | |
3899 | 3982 | } |
3900 | 3983 | } |
3901 | 3984 | elsif($Kind eq "Interface_Added_Field") |
4101 | 4184 | my $Affected = ""; |
4102 | 4185 | |
4103 | 4186 | if(not defined $TypeInfo{1}{$TypeId}{"Annotation"}) { |
4104 | $Affected = getAffectedMethods($Level, $TypeName, \%Kinds_Locations, \@Methods); | |
4187 | $Affected = getAffectedMethods($Level, $TypeName, \%Kinds_Locations); | |
4105 | 4188 | } |
4106 | 4189 | |
4107 | 4190 | $NAMESPACE_REPORT .= $ContentSpanStart."<span class='extendable'>[+]</span> ".htmlSpecChars($TypeName)." ($ProblemNum)".$ContentSpanEnd."<br/>\n"; |
4141 | 4224 | return $TYPE_PROBLEMS; |
4142 | 4225 | } |
4143 | 4226 | |
4144 | sub getAffectedMethods($$$$) | |
4145 | { | |
4146 | my ($Level, $Target_TypeName, $Kinds_Locations, $Methods) = @_; | |
4227 | sub getAffectedMethods($$$) | |
4228 | { | |
4229 | my ($Level, $Target_TypeName, $Kinds_Locations) = @_; | |
4230 | ||
4147 | 4231 | my $LIMIT = 10; |
4148 | ||
4149 | if(defined $AffectLimit) | |
4150 | { | |
4232 | if(defined $AffectLimit) { | |
4151 | 4233 | $LIMIT = $AffectLimit; |
4152 | 4234 | } |
4153 | 4235 | elsif(defined $ShortMode) |
4156 | 4238 | $LIMIT = $AffectLimit; |
4157 | 4239 | } |
4158 | 4240 | |
4159 | my %SymSel = (); | |
4241 | my @Kinds = sort keys(%{$Kinds_Locations}); | |
4242 | my %KLocs = (); | |
4243 | foreach my $Kind (@Kinds) | |
4244 | { | |
4245 | my @Locs = sort {$a=~/retval/ cmp $b=~/retval/} sort {length($a)<=>length($b)} sort keys(%{$Kinds_Locations->{$Kind}}); | |
4246 | $KLocs{$Kind} = \@Locs; | |
4247 | } | |
4248 | ||
4160 | 4249 | my %SymLocKind = (); |
4161 | ||
4162 | foreach my $Method (@{$Methods}) | |
4163 | { | |
4164 | foreach my $Kind (keys(%{$Kinds_Locations})) | |
4165 | { | |
4166 | if(not defined $CompatProblems{$Method} | |
4167 | or not defined $CompatProblems{$Method}{$Kind}) { | |
4168 | next; | |
4169 | } | |
4170 | ||
4171 | foreach my $Loc (keys(%{$Kinds_Locations->{$Kind}})) | |
4250 | foreach my $Method (sort keys(%{$TypeProblemsIndex{$Target_TypeName}})) | |
4251 | { | |
4252 | foreach my $Kind (@Kinds) | |
4253 | { | |
4254 | foreach my $Loc (@{$KLocs{$Kind}}) | |
4172 | 4255 | { |
4173 | 4256 | if(not defined $CompatProblems{$Method}{$Kind}{$Loc}) { |
4174 | 4257 | next; |
4180 | 4263 | } |
4181 | 4264 | |
4182 | 4265 | $SymLocKind{$Method}{$Loc}{$Kind} = 1; |
4183 | } | |
4184 | } | |
4185 | } | |
4186 | ||
4266 | last; | |
4267 | } | |
4268 | } | |
4269 | } | |
4270 | ||
4271 | %KLocs = (); # clear | |
4272 | ||
4273 | my %SymSel = (); | |
4274 | my $Num = 0; | |
4187 | 4275 | foreach my $Method (sort keys(%SymLocKind)) |
4188 | 4276 | { |
4189 | 4277 | LOOP: foreach my $Loc (sort {$a=~/retval/ cmp $b=~/retval/} sort {length($a)<=>length($b)} sort keys(%{$SymLocKind{$Method}})) |
4190 | 4278 | { |
4191 | foreach my $Kind (keys(%{$SymLocKind{$Method}{$Loc}})) | |
4279 | foreach my $Kind (sort keys(%{$SymLocKind{$Method}{$Loc}})) | |
4192 | 4280 | { |
4193 | 4281 | $SymSel{$Method}{"Loc"} = $Loc; |
4194 | 4282 | $SymSel{$Method}{"Kind"} = $Kind; |
4195 | ||
4196 | 4283 | last LOOP; |
4197 | 4284 | } |
4198 | 4285 | } |
4286 | ||
4287 | $Num += 1; | |
4288 | ||
4289 | if($Num>=$LIMIT) { | |
4290 | last; | |
4291 | } | |
4199 | 4292 | } |
4200 | 4293 | |
4201 | 4294 | my $Affected = ""; |
4202 | my $Num = 0; | |
4203 | 4295 | |
4204 | 4296 | foreach my $Method (sort {lc($a) cmp lc($b)} keys(%SymSel)) |
4205 | 4297 | { |
4206 | 4298 | my $Kind = $SymSel{$Method}{"Kind"}; |
4207 | 4299 | my $Loc = $SymSel{$Method}{"Loc"}; |
4208 | 4300 | |
4209 | my $Param_Pos = $CompatProblems{$Method}{$Kind}{$Loc}{"Parameter_Position"}; | |
4210 | 4301 | my $Desc = getAffectDesc($Method, $Kind, $Loc, $Level); |
4302 | my $PName = getParamName($Loc); | |
4303 | my $Pos = getParamPos($PName, $Method, 1); | |
4211 | 4304 | |
4212 | $Affected .= "<span class='iname_a'>".get_Signature($Method, 1, "HTML|Italic|Target=".$Param_Pos)."</span><br/>"; | |
4305 | $Affected .= "<span class='iname_a'>".get_Signature($Method, 1, "HTML|Italic|Param|Class|Target=".$Pos)."</span><br/>"; | |
4213 | 4306 | $Affected .= "<div class='affect'>".$Desc."</div>\n"; |
4214 | ||
4215 | if($Num>$LIMIT) { | |
4216 | last; | |
4217 | } | |
4218 | ||
4219 | $Num += 1; | |
4220 | } | |
4221 | ||
4222 | if(keys(%SymSel)>$LIMIT) { | |
4223 | $Affected .= " ...<br/>"; # and others ... | |
4307 | } | |
4308 | ||
4309 | if(keys(%SymLocKind)>$LIMIT) { | |
4310 | $Affected .= " <b>...</b>\n<br/>\n"; # and others ... | |
4224 | 4311 | } |
4225 | 4312 | |
4226 | 4313 | $Affected = "<div class='affected'>".$Affected."</div>"; |
4227 | 4314 | if($Affected) |
4228 | 4315 | { |
4229 | 4316 | $Affected = $ContentDivStart.$Affected.$ContentDivEnd; |
4230 | $Affected = $ContentSpanStart_Affected."[+] affected methods (".keys(%SymSel).")".$ContentSpanEnd.$Affected; | |
4231 | } | |
4317 | $Affected = $ContentSpanStart_Affected."[+] affected methods (".keys(%SymLocKind).")".$ContentSpanEnd.$Affected; | |
4318 | } | |
4319 | ||
4232 | 4320 | return ($Affected); |
4233 | 4321 | } |
4234 | 4322 | |
4238 | 4326 | my %Affect = %{$CompatProblems{$Method}{$Kind}{$Location}}; |
4239 | 4327 | my $New_Value = $Affect{"New_Value"}; |
4240 | 4328 | my $Type_Name = $Affect{"Type_Name"}; |
4241 | my $Parameter_Name = $Affect{"Parameter_Name"}; | |
4242 | my $Parameter_Position_Str = showPos($Affect{"Parameter_Position"}); | |
4243 | 4329 | my @Sentence_Parts = (); |
4244 | 4330 | |
4245 | 4331 | $Location=~s/\.[^.]+?\Z//; |
4287 | 4373 | my $PPos = getParamPos($PName, $Method, 1); |
4288 | 4374 | |
4289 | 4375 | if($Location=~/\./) { |
4290 | push(@Sentence_Parts, "Field \'".htmlSpecChars($Location)."\' in $Parameter_Position_Str parameter"); | |
4376 | push(@Sentence_Parts, "Field \'".htmlSpecChars($Location)."\' in ".showPos($PPos)." parameter"); | |
4291 | 4377 | } |
4292 | 4378 | else { |
4293 | push(@Sentence_Parts, "$Parameter_Position_Str parameter"); | |
4294 | } | |
4295 | if($Parameter_Name) { | |
4296 | push(@Sentence_Parts, "\'$Parameter_Name\'"); | |
4379 | push(@Sentence_Parts, showPos($PPos)." parameter"); | |
4380 | } | |
4381 | if($PName) { | |
4382 | push(@Sentence_Parts, "\'$PName\'"); | |
4297 | 4383 | } |
4298 | 4384 | |
4299 | $TypeID = $MInfo{"Param"}{$PPos}{"Type"}; | |
4385 | if(defined $MInfo{"Param"}) { | |
4386 | $TypeID = $MInfo{"Param"}{$PPos}{"Type"}; | |
4387 | } | |
4300 | 4388 | } |
4301 | 4389 | push(@Sentence_Parts, " of this$ABSTRACT_M method"); |
4302 | 4390 | |
4484 | 4572 | span.sym_p { |
4485 | 4573 | font-weight:normal; |
4486 | 4574 | white-space:normal; |
4575 | } | |
4576 | span.sym_p span { | |
4577 | white-space:nowrap; | |
4487 | 4578 | } |
4488 | 4579 | span.attr { |
4489 | 4580 | color:Black; |
4565 | 4656 | } |
4566 | 4657 | span.focus_p { |
4567 | 4658 | font-style:italic; |
4568 | color:Red; | |
4659 | background-color:#FFCCCC; | |
4569 | 4660 | } |
4570 | 4661 | span.nowrap { |
4571 | 4662 | white-space:nowrap; |
4582 | 4673 | td.new { |
4583 | 4674 | background-color:#C6DEFF; |
4584 | 4675 | } |
4676 | ||
4677 | td.compatible { | |
4678 | background-color:#CCFFCC; | |
4679 | } | |
4680 | td.almost_compatible { | |
4681 | background-color:#FFDAA3; | |
4682 | } | |
4683 | td.incompatible { | |
4684 | background-color:#FFCCCC; | |
4685 | } | |
4686 | ||
4585 | 4687 | .top_ref { |
4586 | 4688 | font-size:0.69em; |
4587 | 4689 | } |
6336 | 6438 | if($CurrentMethod) |
6337 | 6439 | { |
6338 | 6440 | if(defined $MethodInfo{$LibVersion}{$CurrentMethod} |
6441 | and defined $MethodInfo{$LibVersion}{$CurrentMethod}{"Param"} | |
6339 | 6442 | and defined $MethodInfo{$LibVersion}{$CurrentMethod}{"Param"}{$ParamPos} |
6340 | 6443 | and defined $MethodInfo{$LibVersion}{$CurrentMethod}{"Param"}{$ParamPos}{"Type"}) |
6341 | 6444 | { |
6873 | 6976 | |
6874 | 6977 | sub isDump($) |
6875 | 6978 | { |
6876 | if(get_filename($_[0])=~/\A(.+)\.api(\Q.tar.gz\E|\Q.zip\E|)\Z/) | |
6979 | if($_[0]=~/\A(.+)\.(api|dump|apidump)(\Q.tar.gz\E|\Q.zip\E|)\Z/) | |
6877 | 6980 | { # returns a name of package |
6878 | 6981 | return $1; |
6879 | 6982 | } |
6880 | 6983 | return 0; |
6881 | 6984 | } |
6882 | 6985 | |
6986 | sub isDumpFile($) | |
6987 | { | |
6988 | if($_[0]=~/\.(api|dump|apidump)\Z/) | |
6989 | { | |
6990 | return 1; | |
6991 | } | |
6992 | return 0; | |
6993 | } | |
6994 | ||
6883 | 6995 | sub read_API_Dump($$) |
6884 | 6996 | { |
6885 | 6997 | my ($LibVersion, $Path) = @_; |
6886 | 6998 | return if(not $LibVersion or not -e $Path); |
6887 | my $FileName = unpackDump($Path); | |
6888 | if($FileName!~/\.api\Z/) { | |
6999 | ||
7000 | my $FilePath = unpackDump($Path); | |
7001 | if(not isDumpFile($FilePath)) { | |
6889 | 7002 | exitStatus("Invalid_Dump", "specified API dump \'$Path\' is not valid, try to recreate it"); |
6890 | 7003 | } |
6891 | my $Content = readFile($FileName); | |
6892 | unlink($FileName); | |
7004 | my $Content = readFile($FilePath); | |
7005 | rmtree($TMP_DIR."/unpack"); | |
7006 | ||
6893 | 7007 | if($Content!~/};\s*\Z/) { |
6894 | 7008 | exitStatus("Invalid_Dump", "specified API dump \'$Path\' is not valid, try to recreate it"); |
6895 | 7009 | } |
6918 | 7032 | } |
6919 | 7033 | } |
6920 | 7034 | } |
6921 | $MethodInfo{$LibVersion} = $LibraryAPI->{"MethodInfo"}; | |
7035 | my $MInfo = $LibraryAPI->{"MethodInfo"}; | |
7036 | foreach my $M_Id (keys(%{$MInfo})) | |
7037 | { | |
7038 | my $Name = $MInfo->{$M_Id}{"Name"}; | |
7039 | $MethodInfo{$LibVersion}{$Name} = $MInfo->{$M_Id}; | |
7040 | } | |
7041 | ||
6922 | 7042 | foreach my $Method (keys(%{$MethodInfo{$LibVersion}})) |
6923 | 7043 | { |
6924 | 7044 | if(my $ClassId = $MethodInfo{$LibVersion}{$Method}{"Class"} |
6934 | 7054 | if(keys(%{$LibArchives{$LibVersion}})) { |
6935 | 7055 | $Descriptor{$LibVersion}{"Archives"}="OK"; |
6936 | 7056 | } |
6937 | $Descriptor{$LibVersion}{"Version"} = $LibraryAPI->{"Version"}; | |
6938 | $Descriptor{$LibVersion}{"Dump"}=1; | |
7057 | $Descriptor{$LibVersion}{"Version"} = $LibraryAPI->{"LibraryVersion"}; | |
7058 | $Descriptor{$LibVersion}{"Dump"} = 1; | |
6939 | 7059 | } |
6940 | 7060 | |
6941 | 7061 | sub createDescriptor($$) |
7029 | 7149 | if($VerNum) |
7030 | 7150 | { |
7031 | 7151 | $TargetVersion{$LibVersion} = $VerNum; |
7032 | printMsg("WARNING", "set ".($LibVersion==1?"1st":"2nd")." version number to $VerNum (use -v$LibVersion option to change it)"); | |
7152 | if($DumpAPI) { | |
7153 | printMsg("WARNING", "set version number to $VerNum (use -vnum option to change it)"); | |
7154 | } | |
7155 | else { | |
7156 | printMsg("WARNING", "set ".($LibVersion==1?"1st":"2nd")." version number to $VerNum (use -v$LibVersion option to change it)"); | |
7157 | } | |
7033 | 7158 | return $TargetVersion{$LibVersion}; |
7034 | 7159 | } |
7035 | 7160 | } |
7281 | 7406 | } |
7282 | 7407 | if($JoinReport) |
7283 | 7408 | { |
7284 | printMsg("INFO", "see detailed report:\n ".getReportPath("Join")); | |
7409 | printMsg("INFO", "report: ".getReportPath("Join")); | |
7285 | 7410 | } |
7286 | 7411 | elsif($DoubleReport) |
7287 | 7412 | { # default |
7288 | printMsg("INFO", "see detailed reports:\n ".getReportPath("Binary")."\n ".getReportPath("Source")); | |
7413 | printMsg("INFO", "\nreport (BC): ".getReportPath("Binary")); | |
7414 | printMsg("INFO", "report (SC): ".getReportPath("Source")); | |
7289 | 7415 | } |
7290 | 7416 | elsif($BinaryOnly) |
7291 | 7417 | { # --binary |
7292 | printMsg("INFO", "see detailed report:\n ".getReportPath("Binary")); | |
7418 | printMsg("INFO", "report: ".getReportPath("Binary")); | |
7293 | 7419 | } |
7294 | 7420 | elsif($SourceOnly) |
7295 | 7421 | { # --source |
7296 | printMsg("INFO", "see detailed report:\n ".getReportPath("Source")); | |
7422 | printMsg("INFO", "report: ".getReportPath("Source")); | |
7297 | 7423 | } |
7298 | 7424 | } |
7299 | 7425 | |
7360 | 7486 | sub createArchive($$) |
7361 | 7487 | { |
7362 | 7488 | my ($Path, $To) = @_; |
7489 | if(not $To) { | |
7490 | $To = "."; | |
7491 | } | |
7363 | 7492 | if(not $Path or not -e $Path |
7364 | 7493 | or not -d $To) { |
7365 | 7494 | return ""; |
7436 | 7565 | } |
7437 | 7566 | if(defined $ShowVersion) |
7438 | 7567 | { |
7439 | printMsg("INFO", "Java API Compliance Checker (Java ACC) $TOOL_VERSION\nCopyright (C) 2015 Andrey Ponomarenko's ABI Laboratory\nLicense: LGPL or GPL <http://www.gnu.org/licenses/>\nThis program is free software: you can redistribute it and/or modify it.\n\nWritten by Andrey Ponomarenko."); | |
7568 | printMsg("INFO", "Java API Compliance Checker (Java APICC) $TOOL_VERSION\nCopyright (C) 2016 Andrey Ponomarenko's ABI Laboratory\nLicense: LGPL or GPL <http://www.gnu.org/licenses/>\nThis program is free software: you can redistribute it and/or modify it.\n\nWritten by Andrey Ponomarenko."); | |
7440 | 7569 | exit(0); |
7441 | 7570 | } |
7442 | 7571 | if(defined $DumpVersion) |
7571 | 7700 | exitStatus("Access_Error", "can't access \'$Part\'"); |
7572 | 7701 | } |
7573 | 7702 | } |
7703 | ||
7574 | 7704 | detect_default_paths(); |
7575 | 7705 | checkVersionNum(1, $DumpAPI); |
7706 | ||
7576 | 7707 | my $TarCmd = get_CmdPath("tar"); |
7577 | 7708 | if(not $TarCmd) { |
7578 | 7709 | exitStatus("Not_Found", "can't find \"tar\""); |
7587 | 7718 | if(not $Descriptor{1}{"Archives"}) { |
7588 | 7719 | exitStatus("Error", "descriptor does not contain Java ARchives"); |
7589 | 7720 | } |
7721 | ||
7590 | 7722 | initLogging(1); |
7591 | 7723 | readArchives(1); |
7592 | my %LibraryAPI = (); | |
7724 | ||
7593 | 7725 | printMsg("INFO", "creating library API dump ..."); |
7594 | $LibraryAPI{"MethodInfo"} = $MethodInfo{1}; | |
7595 | $LibraryAPI{"TypeInfo"} = $TypeInfo{1}; | |
7596 | $LibraryAPI{"Version"} = $Descriptor{1}{"Version"}; | |
7597 | $LibraryAPI{"Library"} = $TargetLibraryName; | |
7598 | $LibraryAPI{"API_DUMP_VERSION"} = $API_DUMP_VERSION; | |
7599 | $LibraryAPI{"TOOL_VERSION"} = $TOOL_VERSION; | |
7726 | ||
7727 | my $MInfo = {}; | |
7728 | my $MNum = 0; | |
7729 | foreach my $Method (sort keys(%{$MethodInfo{1}})) | |
7730 | { | |
7731 | $MInfo->{$MNum} = $MethodInfo{1}{$Method}; | |
7732 | $MInfo->{$MNum}{"Name"} = $Method; | |
7733 | ||
7734 | $MNum+=1; | |
7735 | } | |
7736 | ||
7737 | my %API = ( | |
7738 | "MethodInfo" => $MInfo, | |
7739 | "TypeInfo" => $TypeInfo{1}, | |
7740 | "LibraryVersion" => $Descriptor{1}{"Version"}, | |
7741 | "LibraryName" => $TargetLibraryName, | |
7742 | "Language" => "Java", | |
7743 | "API_DUMP_VERSION" => $API_DUMP_VERSION, | |
7744 | "JAPI_COMPLIANCE_CHECKER_VERSION" => $TOOL_VERSION | |
7745 | ); | |
7746 | ||
7600 | 7747 | my $DumpPath = "api_dumps/$TargetLibraryName/".$TargetLibraryName."_".$Descriptor{1}{"Version"}.".api.".$AR_EXT; |
7601 | if(not $DumpPath=~s/\Q.$AR_EXT\E\Z//g) { | |
7602 | exitStatus("Error", "the dump path (-dump-path option) should be a path to a *.$AR_EXT file"); | |
7603 | } | |
7748 | if($OutputDumpPath) | |
7749 | { # user defined path | |
7750 | $DumpPath = $OutputDumpPath; | |
7751 | } | |
7752 | ||
7753 | my $Archive = ($DumpPath=~s/\Q.$AR_EXT\E\Z//g); | |
7754 | ||
7604 | 7755 | my ($DDir, $DName) = separate_path($DumpPath); |
7605 | 7756 | my $DPath = $TMP_DIR."/".$DName; |
7757 | if(not $Archive) { | |
7758 | $DPath = $DumpPath; | |
7759 | } | |
7760 | ||
7606 | 7761 | mkpath($DDir); |
7607 | writeFile($DPath, Dumper(\%LibraryAPI)); | |
7762 | ||
7763 | open(DUMP, ">", $DPath) || die ("can't open file \'$DPath\': $!\n"); | |
7764 | print DUMP Dumper(\%API); | |
7765 | close(DUMP); | |
7766 | ||
7608 | 7767 | if(not -s $DPath) { |
7609 | 7768 | exitStatus("Error", "can't create API dump because something is going wrong with the Data::Dumper module"); |
7610 | 7769 | } |
7611 | my $Pkg = createArchive($DPath, $DDir); | |
7612 | printMsg("INFO", "library API has been dumped to:\n $Pkg"); | |
7613 | printMsg("INFO", "you can transfer this dump everywhere and use instead of the ".$Descriptor{1}{"Version"}." version descriptor"); | |
7770 | ||
7771 | if($Archive) { | |
7772 | $DumpPath = createArchive($DPath, $DDir); | |
7773 | } | |
7774 | ||
7775 | if($OutputDumpPath) { | |
7776 | printMsg("INFO", "dump path: $OutputDumpPath"); | |
7777 | } | |
7778 | else { | |
7779 | printMsg("INFO", "dump path: $DumpPath"); | |
7780 | } | |
7614 | 7781 | exit(0); |
7615 | 7782 | } |
7616 | 7783 | if(not $Descriptor{1}{"Path"}) { |
7683 | 7850 | |
7684 | 7851 | printMsg("INFO", "comparing classes ..."); |
7685 | 7852 | mergeClasses(); |
7686 | ||
7687 | 7853 | mergeMethods(); |
7854 | ||
7855 | foreach my $M (keys(%CompatProblems)) | |
7856 | { | |
7857 | foreach my $K (keys(%{$CompatProblems{$M}})) | |
7858 | { | |
7859 | foreach my $L (keys(%{$CompatProblems{$M}{$K}})) | |
7860 | { | |
7861 | if(my $T = $CompatProblems{$M}{$K}{$L}{"Type_Name"}) { | |
7862 | $TypeProblemsIndex{$T}{$M} = 1; | |
7863 | } | |
7864 | } | |
7865 | } | |
7866 | } | |
7867 | ||
7688 | 7868 | printReport(); |
7869 | ||
7689 | 7870 | if($RESULT{"Source"}{"Problems"} + $RESULT{"Binary"}{"Problems"}) { |
7690 | 7871 | exit($ERROR_CODE{"Incompatible"}); |
7691 | 7872 | } |