Codebase list groovy / 17d97f8
New upstream version 2.4.21 Markus Koschany 3 years ago
24 changed file(s) with 536 addition(s) and 191 deletion(s). Raw diff Collapse all Expand all
146146 }
147147
148148 ext {
149 antVersion = '1.9.4'
149 antVersion = '1.9.15'
150150 asmVersion = '7.2'
151151 antlrVersion = '2.7.7'
152152 coberturaVersion = '1.9.4.1'
2828 'benchmark',
2929 'subprojects/*/target',
3030 'buildSrc/target',
31 '**/build',
3132 buildDir.path,
3233 'classes/**',
3334 'cruise/**',
4243 'out',
4344 'artifactory.properties', // generated by the CI server
4445 'gradle.properties.gz', // generated by the CI server
46 '.github', // used by Github/actions
4547 '**/*.iml', // used by Intellij IDEA
4648 '**/*.ipr', // used by Intellij IDEA
4749 '**/*.iws', // used by Intellij IDEA
50 '.idea', // used by Intellij IDEA
4851 '.settings', // used by Eclipse
4952 '.gradle', // used by Gradle
5053 'buildSrc/.gradle' // used by Gradle
523526 include 'asm-license.txt'
524527 include 'hamcrest-license.txt'
525528 include 'jline2-license.txt'
529 include 'jsp-api-license.txt'
526530 include 'jsr166y-license.txt'
527531 include 'jsr223-license.txt'
528532 include 'junit-license.txt'
533 include 'servlet-api-license.txt'
529534 include 'xstream-license.txt'
530535 }
531536 into('embeddable') {
1212 # See the License for the specific language governing permissions and
1313 # limitations under the License.
1414
15 groovyVersion = 2.4.20
15 groovyVersion = 2.4.21
1616 # bundle version format: major('.'minor('.'micro('.'qualifier)?)?)? (first 3 only digits)
17 groovyBundleVersion = 2.4.20
17 groovyBundleVersion = 2.4.21
1818
1919 gradle_version=2.14.1
2020
242242
243243 ------------------------------------------------------------------------
244244
245 javax.servlet.jsp-api License (for groovy-servlet module)
246
247 This product bundles the javax.servlet.jsp-api jar in binary form
248 which is available under the CDDL 1.1 license:
249 licenses/jsp-api-license.txt
250
251 ------------------------------------------------------------------------
252
245253 JSR166y License (optionally used by the optional GPars dependency)
246254
247255 This product bundles the jsr166y jar (containing works from
279287
280288 ------------------------------------------------------------------------
281289
290 javax.servlet.jsp-api License (for groovy-servlet module)
291
292 This product bundles the javax.servlet-api jar in binary form
293 which is available under the CDDL 1.0 license:
294 licenses/servlet-api-license.txt
295
296 ------------------------------------------------------------------------
297
282298 XStream License (optional dependency when serializing AST as XML)
283299
284300 This product bundles the XStream jar, which is available under a
242242
243243 ------------------------------------------------------------------------
244244
245 javax.servlet.jsp-api License (for groovy-servlet module)
246
247 This product bundles the javax.servlet.jsp-api jar in binary form
248 which is available under the CDDL 1.1 license:
249 licenses/jsp-api-license.txt
250
251 ------------------------------------------------------------------------
252
245253 JSR166y License (optionally used by the optional GPars dependency)
246254
247255 This product bundles the jsr166y jar (containing works from
279287
280288 ------------------------------------------------------------------------
281289
290 javax.servlet.jsp-api License (for groovy-servlet module)
291
292 This product bundles the javax.servlet-api jar in binary form
293 which is available under the CDDL 1.0 license:
294 licenses/servlet-api-license.txt
295
296 ------------------------------------------------------------------------
297
282298 XStream License (optional dependency when serializing AST as XML)
283299
284300 This product bundles the XStream jar, which is available under a
0 javax.servlet.jsp-api License (for groovy-servlet module)
1
2 This product bundles the javax.servlet.jsp-api jar in binary form
3 which is available under the CDDL 1.1 license:
4 licenses/jsp-api-license.txt
0 COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
1
2 1. Definitions.
3
4 1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications.
5
6 1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
7
8 1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
9
10 1.4. Executable. means the Covered Software in any form other than Source Code.
11
12 1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License.
13
14 1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
15
16 1.7. License. means this document.
17
18 1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
19
20 1.9. Modifications. means the Source Code and Executable form of any of the following:
21
22 A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
23
24 B. Any new file that contains any part of the Original Software or previous Modification; or
25
26 C. Any new file that is contributed or otherwise made available under the terms of this License.
27
28 1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License.
29
30 1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
31
32 1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
33
34 1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
35
36 2. License Grants.
37
38 2.1. The Initial Developer Grant.
39
40 Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
41
42 (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
43
44 (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
45
46 (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
47
48 (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
49
50 2.2. Contributor Grant.
51
52 Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
53
54 (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
55
56 (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
57
58 (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
59
60 (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
61
62 3. Distribution Obligations.
63
64 3.1. Availability of Source Code.
65 Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
66
67 3.2. Modifications.
68 The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
69
70 3.3. Required Notices.
71 You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
72
73 3.4. Application of Additional Terms.
74 You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
75
76 3.5. Distribution of Executable Versions.
77 You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
78
79 3.6. Larger Works.
80 You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
81
82 4. Versions of the License.
83
84 4.1. New Versions.
85 Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
86
87 4.2. Effect of New Versions.
88 You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
89
90 4.3. Modified Versions.
91 When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
92
93 5. DISCLAIMER OF WARRANTY.
94
95 COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
96
97 6. TERMINATION.
98
99 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
100
101 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
102
103 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
104
105 7. LIMITATION OF LIABILITY.
106
107 UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
108
109 8. U.S. GOVERNMENT END USERS.
110
111 The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
112
113 9. MISCELLANEOUS.
114
115 This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
116
117 10. RESPONSIBILITY FOR CLAIMS.
118
119 As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
120
121 NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
122
123 The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
0 javax.servlet.jsp-api License (for groovy-servlet module)
1
2 This product bundles the javax.servlet-api jar in binary form
3 which is available under the CDDL 1.0 license:
4 licenses/servlet-api-license.txt
0 COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
1
2 1. Definitions.
3
4 1.1. Contributor. means each individual or entity that creates or contributes to the creation of Modifications.
5
6 1.2. Contributor Version. means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
7
8 1.3. Covered Software. means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
9
10 1.4. Executable. means the Covered Software in any form other than Source Code.
11
12 1.5. Initial Developer. means the individual or entity that first makes Original Software available under this License.
13
14 1.6. Larger Work. means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
15
16 1.7. License. means this document.
17
18 1.8. Licensable. means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
19
20 1.9. Modifications. means the Source Code and Executable form of any of the following:
21
22 A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
23
24 B. Any new file that contains any part of the Original Software or previous Modification; or
25
26 C. Any new file that is contributed or otherwise made available under the terms of this License.
27
28 1.10. Original Software. means the Source Code and Executable form of computer software code that is originally released under this License.
29
30 1.11. Patent Claims. means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
31
32 1.12. Source Code. means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
33
34 1.13. You. (or .Your.) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, .You. includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, .control. means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
35
36 2. License Grants.
37
38 2.1. The Initial Developer Grant.
39
40 Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
41
42 (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
43
44 (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
45
46 (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
47
48 (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
49
50 2.2. Contributor Grant.
51
52 Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
53
54 (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
55
56 (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
57
58 (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
59
60 (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
61
62 3. Distribution Obligations.
63
64 3.1. Availability of Source Code.
65 Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
66
67 3.2. Modifications.
68 The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
69
70 3.3. Required Notices.
71 You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
72
73 3.4. Application of Additional Terms.
74 You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients. rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
75
76 3.5. Distribution of Executable Versions.
77 You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient.s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
78
79 3.6. Larger Works.
80 You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
81
82 4. Versions of the License.
83
84 4.1. New Versions.
85 Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
86
87 4.2. Effect of New Versions.
88 You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
89
90 4.3. Modified Versions.
91 When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
92
93 5. DISCLAIMER OF WARRANTY.
94
95 COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN .AS IS. BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
96
97 6. TERMINATION.
98
99 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
100
101 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as .Participant.) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
102
103 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
104
105 7. LIMITATION OF LIABILITY.
106
107 UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY.S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
108
109 8. U.S. GOVERNMENT END USERS.
110
111 The Covered Software is a .commercial item,. as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of .commercial computer software. (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and .commercial computer software documentation. as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
112
113 9. MISCELLANEOUS.
114
115 This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction.s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys. fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
116
117 10. RESPONSIBILITY FOR CLAIMS.
118
119 As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
120
121 NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
122
123 The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California.
55
66 This product includes/uses ANTLR (http://www.antlr2.org/)
77 developed by Terence Parr 1989-2006
8
9 This product bundles the javax.servlet.jsp-api jar in binary
10 form which is available under the CDDL 1.0 license
811
912 This product bundles the JUnit jar (junit.org)
1013 which is available under the terms of the Eclipse Public License v1.0
1922 (C) Copyright 2005-2006 Intel Corporation
2023 (C) Copyright 2006 Intel Corporation
2124
25 This product bundles the javax.servlet-api jar in binary
26 form which is available under the CDDL 1.0 license
27
2228 This product bundles icons from the famfamfam.com silk icons set
2329 http://www.famfamfam.com/lab/icons/silk/
2430 Licensed under the Creative Commons Attribution Licence v2.5
55
66 This product includes/uses ANTLR (http://www.antlr2.org/)
77 developed by Terence Parr 1989-2006
8
9 This product bundles the javax.servlet.jsp-api jar in binary
10 form which is available under the CDDL 1.0 license
811
912 This product bundles the JUnit jar (junit.org)
1013 which is available under the terms of the Eclipse Public License v1.0
1922 (C) Copyright 2005-2006 Intel Corporation
2023 (C) Copyright 2006 Intel Corporation
2124
25 This product bundles the javax.servlet-api jar in binary
26 form which is available under the CDDL 1.0 license
27
2228 This product bundles icons from the famfamfam.com silk icons set
2329 http://www.famfamfam.com/lab/icons/silk/
2430 Licensed under the Creative Commons Attribution Licence v2.5
0 This product bundles the javax.servlet.jsp-api jar in binary
1 form which is available under the CDDL 1.0 license
0 This product bundles the javax.servlet-api jar in binary
1 form which is available under the CDDL 1.0 license
4545 /**
4646 * An unary expression helper which generates optimized bytecode depending on
4747 * the current type on top of the operand stack.
48 *
49 * @author Cedric Champeau
5048 */
5149 public class StaticTypesUnaryExpressionHelper extends UnaryExpressionHelper implements Opcodes {
5250 private static final UnaryMinusExpression EMPTY_UNARY_MINUS = new UnaryMinusExpression(EmptyExpression.INSTANCE);
7068 @Override
7169 public void visit(final MethodVisitor mv) {
7270 if (long_TYPE==top) {
73 mv.visitLdcInsn(-1);
71 mv.visitLdcInsn(-1L);
7472 mv.visitInsn(LXOR);
7573 } else {
7674 mv.visitInsn(ICONST_M1);
215215 * Note that a new SimpleDateFormat instance is created for every
216216 * invocation of this method (for thread safety).
217217 *
218 * @param self placeholder variable used by Groovy categories; ignored for default static methods
219 * @param dateToString String to be parsed to create the date instance. Must match the pattern EEE MMM dd HH:mm:ss zzz yyyy with US-locale symbols
218 * @param self placeholder variable used by Groovy categories; ignored for default static methods
219 * @param dateToString String to be parsed to create the date instance. Must match the pattern EEE MMM dd HH:mm:ss zzz yyyy with US-locale symbols
220220 * @return a new Date instance representing the parsed input string
221221 * @throws ParseException if there is a parse error
222222 */
263263 }
264264
265265 public static File createTempDir(File self, final String prefix, final String suffix) throws IOException {
266 try {
267 return createTempDirNio(prefix + suffix);
268 } catch (IOException ignore) {
269 } catch (ClassNotFoundException ignore) {
270 }
271 return createTempDirFallback(prefix, suffix);
272 }
273
274 private static File createTempDirFallback(final String prefix, final String suffix) throws IOException {
266275 final int MAXTRIES = 3;
267276 int accessDeniedCounter = 0;
268 File tempFile=null;
269 for (int i=0; i<MAXTRIES; i++) {
277 File tempFile = null;
278 for (int i = 0; i < MAXTRIES; i++) {
270279 try {
271280 tempFile = File.createTempFile(prefix, suffix);
272281 tempFile.delete();
273 tempFile.mkdirs();
282 if (!tempFile.mkdirs()) continue;
274283 break;
275284 } catch (IOException ioe) {
276285 if (ioe.getMessage().startsWith("Access is denied")) {
277286 accessDeniedCounter++;
278 try { Thread.sleep(100); } catch (InterruptedException e) {}
287 try {
288 Thread.sleep(100);
289 } catch (InterruptedException ie) {
290 throw new RuntimeException(ie);
291 }
279292 }
280 if (i==MAXTRIES-1) {
281 if (accessDeniedCounter==MAXTRIES) {
282 String msg =
283 "Access is denied.\nWe tried " +
284 + accessDeniedCounter+
285 " times to create a temporary directory"+
286 " and failed each time. If you are on Windows"+
287 " you are possibly victim to"+
288 " http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325169. "+
289 " this is no bug in Groovy.";
293 if (i == MAXTRIES - 1) {
294 if (accessDeniedCounter == MAXTRIES) {
295 String msg = "Access is denied.\nWe tried " + accessDeniedCounter +
296 " times to create a temporary directory and failed each time." +
297 " If you are on Windows you are possibly victim to" +
298 " http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325169. " +
299 " This is not a bug in Groovy.";
290300 throw new IOException(msg);
291301 } else {
292302 throw ioe;
298308 return tempFile;
299309 }
300310
301 /**
302 * Get the current time in seconds
303 *
304 * @param self placeholder variable used by Groovy categories; ignored for default static methods
305 * @return the difference, measured in seconds, between
306 * the current time and midnight, January 1, 1970 UTC.
307 * @see System#currentTimeMillis()
308 */
309 public static long currentTimeSeconds(System self){
310 return System.currentTimeMillis() / 1000;
311 }
311 private static final Object[] NO_ARGS = new Object[0];
312
313 private static File createTempDirNio(String prefix) throws IOException, ClassNotFoundException {
314 Class<?> filesClass = Class.forName("java.nio.file.Files");
315 Object path = InvokerHelper.invokeStaticMethod(filesClass, "createTempDirectory", new Object[]{prefix});
316 return (File) InvokerHelper.invokeMethod(path, "toFile", NO_ARGS);
317 }
318
319 /**
320 * Get the current time in seconds
321 *
322 * @param self placeholder variable used by Groovy categories; ignored for default static methods
323 * @return the difference, measured in seconds, between the current time and midnight, January 1, 1970 UTC.
324 * @see System#currentTimeMillis()
325 */
326 public static long currentTimeSeconds(System self) {
327 return System.currentTimeMillis() / 1000;
328 }
312329
313330 }
240240 public static void waitForProcessOutput(Process self, Appendable output, Appendable error) {
241241 Thread tout = consumeProcessOutputStream(self, output);
242242 Thread terr = consumeProcessErrorStream(self, error);
243 try { tout.join(); } catch (InterruptedException ignore) {}
244 try { terr.join(); } catch (InterruptedException ignore) {}
245 try { self.waitFor(); } catch (InterruptedException ignore) {}
246 closeStreams(self);
243 boolean interrupted = false;
244 try {
245 try { tout.join(); } catch (InterruptedException ignore) { interrupted = true; }
246 try { terr.join(); } catch (InterruptedException ignore) { interrupted = true; }
247 try { self.waitFor(); } catch (InterruptedException ignore) { interrupted = true; }
248 closeStreams(self);
249 } finally {
250 if (interrupted) Thread.currentThread().interrupt();
251 }
247252 }
248253
249254 /**
262267 public static void waitForProcessOutput(Process self, OutputStream output, OutputStream error) {
263268 Thread tout = consumeProcessOutputStream(self, output);
264269 Thread terr = consumeProcessErrorStream(self, error);
265 try { tout.join(); } catch (InterruptedException ignore) {}
266 try { terr.join(); } catch (InterruptedException ignore) {}
267 try { self.waitFor(); } catch (InterruptedException ignore) {}
268 closeStreams(self);
270 boolean interrupted = false;
271 try {
272 try { tout.join(); } catch (InterruptedException ignore) { interrupted = true; }
273 try { terr.join(); } catch (InterruptedException ignore) { interrupted = true; }
274 try { self.waitFor(); } catch (InterruptedException ignore) { interrupted = true; }
275 closeStreams(self);
276 } finally {
277 if (interrupted) Thread.currentThread().interrupt();
278 }
269279 }
270280
271281 /**
414414 }
415415
416416 /**
417 * Gets an array of of all registered ConstantMetaClassListener instances.
417 * Gets an array of all registered ConstantMetaClassListener instances.
418418 */
419419 public MetaClassRegistryChangeEventListener[] getMetaClassRegistryChangeEventListeners() {
420420 synchronized (changeListenerList) {
3535 try {
3636 r = queue.remove(1000);
3737 } catch (InterruptedException e) {
38 Thread.currentThread().interrupt();
3839 break;
3940 }
4041 if (r==null) continue;
438438 ----
439439 include::{projectdir}/src/spec/test/OperatorsTest.groovy[tags=spreaddot_nullsafe,indent=0]
440440 ----
441 <1> build a list for which of of the elements is `null`
441 <1> build a list for which one of the elements is `null`
442442 <2> using the spread operator will *not* throw a `NullPointerException`
443443 <3> the receiver might also be null, in which case the return value is `null`
444444
2424 */
2525 class UnaryOperatorSTCTest extends StaticTypeCheckingTestCase {
2626
27 void testUnaryPlusOnInt() {
28 assertScript '''
27 // GROOVY-9704
28 void testBitwiseNegate_long() {
29 assertScript '''
30 long x = 1L
31 assert ~x == -2L
32 '''
33 }
34
35 void testUnaryPlusOnInt() {
36 assertScript '''
2937 int x = 1
3038 assert +x == 1
31 '''
32 }
33
34 void testUnaryPlusOnInteger() {
35 assertScript '''
39 '''
40 }
41
42 void testUnaryPlusOnInteger() {
43 assertScript '''
3644 Integer x = new Integer(1)
3745 assert +x == 1
38 '''
39 }
40
41 void testUnaryMinusOnInt() {
42 assertScript '''
46 '''
47 }
48
49 void testUnaryMinusOnInt() {
50 assertScript '''
4351 int x = 1
4452 assert -x == -1
45 '''
46 }
47
48 void testUnaryMinusOnInteger() {
49 assertScript '''
53 '''
54 }
55
56 void testUnaryMinusOnInteger() {
57 assertScript '''
5058 Integer x = new Integer(1)
5159 assert -x == -1
52 '''
53 }
54
55 void testUnaryPlusOnShort() {
56 assertScript '''
60 '''
61 }
62
63 void testUnaryPlusOnShort() {
64 assertScript '''
5765 short x = 1
5866 assert +x == 1
59 '''
60 }
61
62 void testUnaryPlusOnBoxedShort() {
63 assertScript '''
67 '''
68 }
69
70 void testUnaryPlusOnBoxedShort() {
71 assertScript '''
6472 Short x = new Short((short)1)
6573 assert +x == 1
66 '''
67 }
68
69 void testUnaryMinusOnShort() {
70 assertScript '''
74 '''
75 }
76
77 void testUnaryMinusOnShort() {
78 assertScript '''
7179 short x = 1
7280 assert -x == -1
73 '''
74 }
75
76 void testUnaryMinusOnBoxedShort() {
77 assertScript '''
81 '''
82 }
83
84 void testUnaryMinusOnBoxedShort() {
85 assertScript '''
7886 Short x = new Short((short)1)
7987 assert -x == -1
80 '''
81 }
82
83 void testUnaryPlusOnFloat() {
84 assertScript '''
88 '''
89 }
90
91 void testUnaryPlusOnFloat() {
92 assertScript '''
8593 float x = 1f
8694 assert +x == 1f
87 '''
88 }
89
90 void testUnaryPlusOnBoxedFloat() {
91 assertScript '''
95 '''
96 }
97
98 void testUnaryPlusOnBoxedFloat() {
99 assertScript '''
92100 Float x = new Float(1f)
93101 assert +x == 1f
94 '''
95 }
96
97 void testUnaryMinusOnFloat() {
98 assertScript '''
102 '''
103 }
104
105 void testUnaryMinusOnFloat() {
106 assertScript '''
99107 float x = 1f
100108 assert -x == -1f
101 '''
102 }
103
104 void testUnaryMinusOnBoxedFloat() {
105 assertScript '''
109 '''
110 }
111
112 void testUnaryMinusOnBoxedFloat() {
113 assertScript '''
106114 Float x = new Float(1f)
107115 assert -x == -1f
108 '''
109 }
110
111 void testUnaryPlusOnDouble() {
112 assertScript '''
116 '''
117 }
118
119 void testUnaryPlusOnDouble() {
120 assertScript '''
113121 double x = 1d
114122 assert +x == 1d
115 '''
116 }
117
118 void testUnaryPlusOnBoxedDouble() {
119 assertScript '''
123 '''
124 }
125
126 void testUnaryPlusOnBoxedDouble() {
127 assertScript '''
120128 Double x = new Double(1d)
121129 assert +x == 1d
122 '''
123 }
124
125 void testUnaryMinusOnDouble() {
126 assertScript '''
130 '''
131 }
132
133 void testUnaryMinusOnDouble() {
134 assertScript '''
127135 double x = 1d
128136 assert -x == -1d
129 '''
130 }
131
132 void testUnaryMinusOnBoxedDouble() {
133 assertScript '''
137 '''
138 }
139
140 void testUnaryMinusOnBoxedDouble() {
141 assertScript '''
134142 Double x = new Double(1d)
135143 assert -x == -1d
136 '''
137 }
144 '''
145 }
138146
139147 void testIntXIntInferredType() {
140148 assertScript '''
0 /*
1 * Licensed to the Apache Software Foundation (ASF) under one
2 * or more contributor license agreements. See the NOTICE file
3 * distributed with this work for additional information
4 * regarding copyright ownership. The ASF licenses this file
5 * to you under the Apache License, Version 2.0 (the
6 * "License"); you may not use this file except in compliance
7 * with the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
16 * under the License.
17 */
18 package groovy.jmx.builder;
19
20 import java.rmi.NoSuchObjectException;
21 import java.rmi.RemoteException;
22 import java.rmi.registry.LocateRegistry;
23 import java.rmi.registry.Registry;
24 import java.util.HashMap;
25 import java.util.Map;
26
27 /**
28 * Helper class to help with RMI
29 */
30 public class JmxConnectorHelper {
31 public static Map createRmiRegistry(int initPort) {
32 Map<String, Object> result = new HashMap<String, Object>(2);
33 int counter = 0;
34 int port = initPort;
35 Registry reg = null;
36 while (reg == null && counter <= 4) {
37 try {
38 reg = LocateRegistry.createRegistry(port);
39 result.put("registry", reg);
40 result.put("port", port);
41 break;
42 } catch (RemoteException ex) {
43 counter++;
44 port = port + 1;
45 System.out.println("JmxBuilder - *** FAILED *** to create RMI Registry - Will Retry on port [" + port + "].");
46 try {
47 Thread.currentThread().sleep(500);
48 } catch (InterruptedException e) {
49 throw new RuntimeException(e);
50 }
51 }
52 }
53 return result;
54 }
55
56 public static void destroyRmiRegistry(Registry reg) {
57 try {
58 if (reg != null) {
59 java.rmi.server.UnicastRemoteObject.unexportObject(reg, true);
60 }
61 } catch (NoSuchObjectException e) {
62 throw new RuntimeException(e);
63 }
64 }
65 }
0 /*
1 * Licensed to the Apache Software Foundation (ASF) under one
2 * or more contributor license agreements. See the NOTICE file
3 * distributed with this work for additional information
4 * regarding copyright ownership. The ASF licenses this file
5 * to you under the Apache License, Version 2.0 (the
6 * "License"); you may not use this file except in compliance
7 * with the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
16 * under the License.
17 */
18 package groovy.jmx.builder;
19
20 import java.rmi.NoSuchObjectException;
21 import java.rmi.RemoteException;
22 import java.rmi.registry.LocateRegistry;
23 import java.rmi.registry.Registry;
24 import java.util.HashMap;
25 import java.util.Map;
26
27 /**
28 * Helper class to help with RMI
29 */
30 public class JmxConnectorHelper {
31 public static Map createRmiRegistry(int initPort) {
32 Map<String, Object> result = new HashMap<String, Object>(2);
33 int counter = 0;
34 int port = initPort;
35 Registry reg = null;
36 while (reg == null && counter <= 4) {
37 try {
38 reg = LocateRegistry.createRegistry(port);
39 result.put("registry", reg);
40 result.put("port", port);
41 break;
42 } catch (RemoteException ex) {
43 counter++;
44 port = port + 1;
45 System.out.println("JmxBuilder - *** FAILED *** to create RMI Registry - Will Retry on port [" + port + "].");
46 try {
47 Thread.sleep(500);
48 } catch (InterruptedException e) {
49 throw new RuntimeException(e);
50 }
51 }
52 }
53 return result;
54 }
55
56 public static void destroyRmiRegistry(Registry reg) {
57 try {
58 if (reg != null) {
59 java.rmi.server.UnicastRemoteObject.unexportObject(reg, true);
60 }
61 } catch (NoSuchObjectException e) {
62 throw new RuntimeException(e);
63 }
64 }
65 }
221221 * Allow DefaultListModel to work with subscript operators.<p>
222222 * <b>WARNING:</b> this operation does not replace the element at the
223223 * specified index, rather it inserts the element at that index, thus
224 * increasing the size of of the model by 1.
224 * increasing the size of the model by 1.
225225 *
226226 * @param self a DefaultListModel
227227 * @param index an index
1717 */
1818 dependencies {
1919 compile rootProject
20 compile 'junit:junit:4.12'
20 compile 'junit:junit:4.13.1'
2121 testRuntime project(':groovy-ant')
2222 }
2323
225225 QName qname = (QName) key;
226226 element.setAttributeNS(qname.getNamespaceURI(), qname.getQualifiedName(), value.toString());
227227 } else {
228 throw new IllegalArgumentException("The key: " + key + " should be an instanceof of " + QName.class);
228 throw new IllegalArgumentException("The key: " + key + " should be an instance of " + QName.class);
229229 }
230230 }
231231 }