diff options
author | Andrew Clement <aclement@vmware.com> | 2025-04-09 14:56:06 -0700 |
---|---|---|
committer | Andrew Clement <aclement@vmware.com> | 2025-04-09 14:56:06 -0700 |
commit | 796f794c85150db35c32197248b97bda4a3949af (patch) | |
tree | 61655a06c03746521ad237da004eaad5507d6e3f | |
parent | fc46e12f52fabad64e91041d37bfb0dc43333eb0 (diff) | |
download | aspectj-796f794c85150db35c32197248b97bda4a3949af.tar.gz aspectj-796f794c85150db35c32197248b97bda4a3949af.zip |
Adapt to 1.9.24 release of AspectJ Eclipse JDT Compiler variant
48 files changed, 1206 insertions, 273 deletions
diff --git a/aspectjmatcher/aspectjmatcher-assembly.xml b/aspectjmatcher/aspectjmatcher-assembly.xml index 9b20bc1cf..d6c4615d3 100644 --- a/aspectjmatcher/aspectjmatcher-assembly.xml +++ b/aspectjmatcher/aspectjmatcher-assembly.xml @@ -16,6 +16,9 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-Apache-1.1.txt</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> + <include>licenses/LICENSE-BSD-3-CLAUSE.txt</include> </includes> </fileSet> <fileSet> diff --git a/aspectjmatcher/aspectjmatcher-sources-assembly.xml b/aspectjmatcher/aspectjmatcher-sources-assembly.xml index 378304cc1..cf38cd62e 100644 --- a/aspectjmatcher/aspectjmatcher-sources-assembly.xml +++ b/aspectjmatcher/aspectjmatcher-sources-assembly.xml @@ -17,6 +17,9 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-Apache-1.1.txt</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> + <include>licenses/LICENSE-BSD-3-CLAUSE.txt</include> </includes> </fileSet> <fileSet> diff --git a/aspectjrt/aspectjrt-assembly.xml b/aspectjrt/aspectjrt-assembly.xml index 09d7ac84b..3a995f964 100644 --- a/aspectjrt/aspectjrt-assembly.xml +++ b/aspectjrt/aspectjrt-assembly.xml @@ -16,6 +16,7 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> </includes> </fileSet> <fileSet> diff --git a/aspectjrt/aspectjrt-sources-assembly.xml b/aspectjrt/aspectjrt-sources-assembly.xml index a25ef741d..daf720389 100644 --- a/aspectjrt/aspectjrt-sources-assembly.xml +++ b/aspectjrt/aspectjrt-sources-assembly.xml @@ -17,6 +17,7 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> </includes> </fileSet> <fileSet> diff --git a/aspectjtools/aspectjtools-assembly.xml b/aspectjtools/aspectjtools-assembly.xml index b777ed5e4..9d9fb634f 100644 --- a/aspectjtools/aspectjtools-assembly.xml +++ b/aspectjtools/aspectjtools-assembly.xml @@ -29,6 +29,9 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-Apache-1.1.txt</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> + <include>licenses/LICENSE-BSD-3-CLAUSE.txt</include> </includes> </fileSet> diff --git a/aspectjtools/aspectjtools-sources-assembly.xml b/aspectjtools/aspectjtools-sources-assembly.xml index d33238215..762e19b4c 100644 --- a/aspectjtools/aspectjtools-sources-assembly.xml +++ b/aspectjtools/aspectjtools-sources-assembly.xml @@ -18,6 +18,9 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-Apache-1.1.txt</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> + <include>licenses/LICENSE-BSD-3-CLAUSE.txt</include> </includes> </fileSet> diff --git a/aspectjweaver/aspectjweaver-assembly.xml b/aspectjweaver/aspectjweaver-assembly.xml index 877ddf6b1..112c57bc2 100644 --- a/aspectjweaver/aspectjweaver-assembly.xml +++ b/aspectjweaver/aspectjweaver-assembly.xml @@ -28,6 +28,9 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-Apache-1.1.txt</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> + <include>licenses/LICENSE-BSD-3-CLAUSE.txt</include> </includes> </fileSet> <fileSet> diff --git a/aspectjweaver/aspectjweaver-sources-assembly.xml b/aspectjweaver/aspectjweaver-sources-assembly.xml index e27f5aff0..0b91cba78 100644 --- a/aspectjweaver/aspectjweaver-sources-assembly.xml +++ b/aspectjweaver/aspectjweaver-sources-assembly.xml @@ -17,6 +17,9 @@ <outputDirectory>.</outputDirectory> <includes> <include>LICENSE-AspectJ.adoc</include> + <include>licenses/LICENSE-Apache-1.1.txt</include> + <include>licenses/LICENSE-EPL-2.0.txt</include> + <include>licenses/LICENSE-BSD-3-CLAUSE.txt</include> </includes> </fileSet> <fileSet> diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java index 26c8ffe9c..883c8b836 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java @@ -1,5 +1,3 @@ -package org.aspectj.apache.bcel.classfile; - /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -53,6 +51,7 @@ package org.aspectj.apache.bcel.classfile; * information on the Apache Software Foundation, please see * <https://www.apache.org/>. */ +package org.aspectj.apache.bcel.classfile; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -67,7 +66,7 @@ import org.aspectj.apache.bcel.Constants; * Wrapper class that parses a given Java .class file. The method <A * href ="#parse">parse</A> returns a <A href ="JavaClass.html"> * JavaClass</A> object on success. When an I/O error or an - * inconsistency occurs an appropiate exception is propagated back to + * inconsistency occurs an appropriate exception is propagated back to * the caller. * * The structure and the names comply, except for a few conveniences, diff --git a/docs/LICENSE-AspectJ.adoc b/docs/LICENSE-AspectJ.adoc index c53ebe6e0..6453cd32b 100644 --- a/docs/LICENSE-AspectJ.adoc +++ b/docs/LICENSE-AspectJ.adoc @@ -1,7 +1,10 @@ +SPDX-License-Identifier: EPL-2.0 AND BSD-3-Clause AND Apache-1.1 + = AspectJ^TM^ Compiler and Core Tools License -This is a binary-only release. Source code is available from -https://eclipse.org/aspectj +Source code for these binaries is available from https://eclipse.org/aspectj + +== EPL-2.0 The Eclipse Foundation makes available all content in this distribution ("Content"). Unless otherwise indicated below, the Content is provided @@ -27,7 +30,7 @@ Eclipse Foundation, the following is provided for informational purposes only, and you should look to the Redistributor's license for terms and conditions of use. -=== BCEL v5.1 +=== BCEL v5.1 (Apache-1.1) This product contains software developed by the Apache Software Foundation (https://www.apache.org/[https://www.apache.org]). @@ -36,37 +39,93 @@ AspectJ includes a modified version of the Apache Jakarta Byte Code Engineering Library (BCEL) v5.1. BCEL is available at https://commons.apache.org/bcel/. Source code for the modified version of BCEL is available at Eclipse.org in the AspectJ source tree. This -code is made available under the Apache Software License v1.1 +code is made available under the Apache Software License v1.1. +The license is also reproduced here: + +[source, text] +.... +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (https://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache BCEL" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * "Apache BCEL", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <https://www.apache.org/>. + */ +.... -=== ASM v2.2.1 +=== ASM v9.8 (BSD-3-Clause) -AspectJ includes a binary version of ASM v2.2.1 -(https://asm.objectweb.org/index.html[https://asm.objectweb.org/]) The +AspectJ includes a binary version of ASM v9.8 +(https://asm.ow2.io[https://asm.ow2.io]) The source code for ASM is available from the ObjectWeb download site at -https://asm.objectweb.org/download/. +https://gitlab.ow2.org/asm/asm. -The ASM license is available at https://asm.objectweb.org/license.html. +The ASM license is available at https://asm.ow2.io/license.html. The license is also reproduced here: [source, text] .... -Copyright (c) 2000-2005 INRIA, France Telecom +ASM: a very small and fast Java bytecode manipulation framework +Copyright (c) 2000-2011 INRIA, France Telecom All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - + notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holders nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE diff --git a/docs/index.adoc b/docs/index.adoc index 61744fcda..b5784c246 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -98,6 +98,7 @@ JDK to run // AspectJ_JDK_Update: add new release to table |Release notes |Release notes, describing new features, improvements, bugfixes per AspectJ version: + + +xref:release/README-1.9.24.adoc[1.9.24], xref:release/README-1.9.23.adoc[1.9.23], xref:release/README-1.9.22.adoc[1.9.22 / 1.9.22.1], xref:release/README-1.9.21.adoc[1.9.21 / 1.9.21.1 / 1.9.21.2], xref:release/README-1.9.20.adoc[1.9.20 / 1.9.20.1], diff --git a/docs/licenses/LICENSE-Apache-1.1.txt b/docs/licenses/LICENSE-Apache-1.1.txt new file mode 100644 index 000000000..f86391bc5 --- /dev/null +++ b/docs/licenses/LICENSE-Apache-1.1.txt @@ -0,0 +1,53 @@ +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (https://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache BCEL" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * "Apache BCEL", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * <https://www.apache.org/>. + */
\ No newline at end of file diff --git a/docs/licenses/LICENSE-BSD-3-CLAUSE.txt b/docs/licenses/LICENSE-BSD-3-CLAUSE.txt new file mode 100644 index 000000000..631ee53c5 --- /dev/null +++ b/docs/licenses/LICENSE-BSD-3-CLAUSE.txt @@ -0,0 +1,27 @@ +ASM: a very small and fast Java bytecode manipulation framework +Copyright (c) 2000-2011 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file diff --git a/docs/licenses/LICENSE-EPL-2.0.txt b/docs/licenses/LICENSE-EPL-2.0.txt new file mode 100644 index 000000000..e23ece2c8 --- /dev/null +++ b/docs/licenses/LICENSE-EPL-2.0.txt @@ -0,0 +1,277 @@ +Eclipse Public License - v 2.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial content + Distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + where such changes and/or additions to the Program originate from + and are Distributed by that particular Contributor. A Contribution + "originates" from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's behalf. + Contributions do not include changes or additions to the Program that + are not Modified Works. + +"Contributor" means any person or entity that Distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which +are necessarily infringed by the use or sale of its Contribution alone +or when combined with the Program. + +"Program" means the Contributions Distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement +or any Secondary License (as applicable), including Contributors. + +"Derivative Works" shall mean any work, whether in Source Code or other +form, that is based on (or derived from) the Program and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. + +"Modified Works" shall mean any work in Source Code or other form that +results from an addition to, deletion from, or modification of the +contents of the Program, including, for purposes of clarity any new file +in Source Code form that contains any contents of the Program. Modified +Works shall not include works that contain only declarations, +interfaces, types, classes, structures, or files of the Program solely +in each case in order to link to, bind by name, or subclass the Program +or Modified Works thereof. + +"Distribute" means the acts of a) distributing or b) making available +in any manner that enables the transfer of a copy. + +"Source Code" means the form of a Program preferred for making +modifications, including but not limited to software source code, +documentation source, and configuration files. + +"Secondary License" means either the GNU General Public License, +Version 2.0, or any later versions of that license, including any +exceptions or additional permissions as identified by the initial +Contributor. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare Derivative Works of, publicly display, + publicly perform, Distribute and sublicense the Contribution of such + Contributor, if any, and such Derivative Works. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in Source Code or other form. This patent license shall + apply to the combination of the Contribution and the Program if, at + the time the Contribution is added by the Contributor, such addition + of the Contribution causes such combination to be covered by the + Licensed Patents. The patent license shall not apply to any other + combinations which include the Contribution. No hardware per se is + licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to Distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + + e) Notwithstanding the terms of any Secondary License, no + Contributor makes additional grants to any Recipient (other than + those set forth in this Agreement) as a result of such Recipient's + receipt of the Program under the terms of a Secondary License + (if permitted under the terms of Section 3). + +3. REQUIREMENTS + +3.1 If a Contributor Distributes the Program in any form, then: + + a) the Program must also be made available as Source Code, in + accordance with section 3.2, and the Contributor must accompany + the Program with a statement that the Source Code for the Program + is available under this Agreement, and informs Recipients how to + obtain it in a reasonable manner on or through a medium customarily + used for software exchange; and + + b) the Contributor may Distribute the Program under a license + different than this Agreement, provided that such license: + i) effectively disclaims on behalf of all other Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and + implied warranties or conditions of merchantability and fitness + for a particular purpose; + + ii) effectively excludes on behalf of all other Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) does not attempt to limit or alter the recipients' rights + in the Source Code under section 3.2; and + + iv) requires any subsequent distribution of the Program by any + party to be under a license that satisfies the requirements + of this section 3. + +3.2 When the Program is Distributed as Source Code: + + a) it must be made available under this Agreement, or if the + Program (i) is combined with other material in a separate file or + files made available under a Secondary License, and (ii) the initial + Contributor attached to the Source Code the notice described in + Exhibit A of this Agreement, then the Program may be made available + under the terms of such Secondary Licenses, and + + b) a copy of this Agreement must be included with each copy of + the Program. + +3.3 Contributors may not remove or alter any copyright, patent, +trademark, attribution notices, disclaimers of warranty, or limitations +of liability ("notices") contained within the Program from any copy of +the Program which they Distribute, provided that Contributors may add +their own appropriate notices. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities +with respect to end users, business partners and the like. While this +license is intended to facilitate the commercial use of the Program, +the Contributor who includes the Program in a commercial product +offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes +the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every +other Contributor ("Indemnified Contributor") against any losses, +damages and costs (collectively "Losses") arising from claims, lawsuits +and other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program +in a commercial product offering. The obligations in this section do not +apply to any claims or Losses relating to any actual or alleged +intellectual property infringement. In order to qualify, an Indemnified +Contributor must: a) promptly notify the Commercial Contributor in +writing of such claim, and b) allow the Commercial Contributor to control, +and cooperate with the Commercial Contributor in, the defense and any +related settlement negotiations. The Indemnified Contributor may +participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those performance +claims and warranties, and if a court requires any other Contributor to +pay any damages as a result, the Commercial Contributor must pay +those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF +TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE. Each Recipient is solely responsible for determining the +appropriateness of using and distributing the Program and assumes all +risks associated with its exercise of rights under this Agreement, +including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs +or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT +PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS +SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further +action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other software +or hardware) infringes such Recipient's patent(s), then such Recipient's +rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of +time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use +and distribution of the Program as soon as reasonably practicable. +However, Recipient's obligations under this Agreement and any licenses +granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and +may only be modified in the following manner. The Agreement Steward +reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement +Steward has the right to modify this Agreement. The Eclipse Foundation +is the initial Agreement Steward. The Eclipse Foundation may assign the +responsibility to serve as the Agreement Steward to a suitable separate +entity. Each new version of the Agreement will be given a distinguishing +version number. The Program (including Contributions) may always be +Distributed subject to the version of the Agreement under which it was +received. In addition, after a new version of the Agreement is published, +Contributor may elect to Distribute the Program (including its +Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient +receives no rights or licenses to the intellectual property of any +Contributor under this Agreement, whether expressly, by implication, +estoppel or otherwise. All rights in the Program not expressly granted +under this Agreement are reserved. Nothing in this Agreement is intended +to be enforceable by any entity that is not a Contributor or Recipient. +No third-party beneficiary rights are created under this Agreement. + +Exhibit A - Form of Secondary Licenses Notice + +"This Source Code may also be made available under the following +Secondary Licenses when the conditions for such availability set forth +in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), +version(s), and exceptions or additional permissions here}." + + Simply including a copy of this Agreement, including this Exhibit A + is not sufficient to license the Source Code under Secondary Licenses. + + If it is not possible or desirable to put the notice in a particular + file, then You may include the notice in a location (such as a LICENSE + file in a relevant directory) where a recipient would be likely to + look for such a notice. + + You may add additional accurate notices of copyright ownership.
\ No newline at end of file diff --git a/docs/licenses/readme.txt b/docs/licenses/readme.txt new file mode 100644 index 000000000..c402723b2 --- /dev/null +++ b/docs/licenses/readme.txt @@ -0,0 +1,14 @@ +The following licenses are utilized in AspectJ and are available in this folder: + +Updated: 4-Apr-2025 + +EPL-2.0 +from https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + +Apache-1.1 +from the ClassParser.java header in bcel-builder module ( https://github.com/eclipse-aspectj/aspectj/blob/master/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ClassParser.java ) +for Bcel v5.1 + +BSD-3-Clause +from https://asm.ow2.io/license.html +for ASM v9.8
\ No newline at end of file diff --git a/docs/release/JavaVersionCompatibility.adoc b/docs/release/JavaVersionCompatibility.adoc index 334853c40..a6397669f 100644 --- a/docs/release/JavaVersionCompatibility.adoc +++ b/docs/release/JavaVersionCompatibility.adoc @@ -9,6 +9,8 @@ be easily concluded from the AspectJ version number anymore, and we are sorry fo [%autowidth, stripes=even, options="header"] |=== |AspectJ version |Java version |Comments +|1.9.24 |24 | +|1.9.23 |23 | |1.9.22 - 1.9.22.1 |22 | |1.9.21 - 1.9.21.2 |21 |AspectJ compiler requires JDK 17+ during build time. During runtime, AspectJ still only requires Java 8+ for both compile-time and load-time weaving. Pure Java code can be compiled down to as old as 1.3 byte code level. |1.9.20 - 1.9.20.1 |20 | diff --git a/docs/release/README-1.9.23.adoc b/docs/release/README-1.9.23.adoc index 4ffc7c5c6..59c9a85a4 100644 --- a/docs/release/README-1.9.23.adoc +++ b/docs/release/README-1.9.23.adoc @@ -4,9 +4,6 @@ = AspectJ 1.9.23 -// AspectJ_JDK_Update: Each a.b.c release needs a new release notes document. For a.b.c.d minors, the existing a.b.c -// document can be updated. After copying this document, remove the comment from the previous one. - _© Copyright 2025 Contributors. All rights reserved._ _Release info: 1.9.23 available 7-Mar-2025_ diff --git a/docs/release/README-1.9.24.adoc b/docs/release/README-1.9.24.adoc new file mode 100644 index 000000000..ccdfd68da --- /dev/null +++ b/docs/release/README-1.9.24.adoc @@ -0,0 +1,93 @@ += AspectJ 1.9.24 +:doctype: book +:leveloffset: +1 + += AspectJ 1.9.24 + +// AspectJ_JDK_Update: Each a.b.c release needs a new release notes document. For a.b.c.d minors, the existing a.b.c +// document can be updated. After copying this document, remove the comment from the previous one. + +_© Copyright 2025 Contributors. All rights reserved._ + +_Release info: 1.9.24 available 28-Mar-2025_ + +Please note that Bugzilla for issue management is deprecated and new issues should be filed as +https://github.com/eclipse-aspectj/aspectj/issues/new[GitHub issues]. The list of issues addressed for 1.9.24 can be +found here: + +* https://github.com/eclipse-aspectj/aspectj/issues?q=is%3Aissue+is%3Aclosed++milestone%3A1.9.24[GitHub 1.9.24] +* https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.24[Bugzilla 1.9.24] + +== New features + +AspectJ 1.9.24 supports https://openjdk.java.net/projects/jdk/24/[Java 24], its final and preview features: + +* 404: Generational Shenandoah (Experimental) +* 450: Compact Object Headers (Experimental) +* 472: Prepare to Restrict the Use of JNI +* 475: Late Barrier Expansion for G1 +* 478: Key Derivation Function API (Preview) +* 479: Remove the Windows 32-bit x86 Port +* 483: Ahead-of-Time Class Loading & Linking +* 484: Class-File API +* 485: Stream Gatherers +* 486: Permanently Disable the Security Manager +* 487: Scoped Values (Fourth Preview) +* 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) +* 489: Vector API (Ninth Incubator) +* 490: ZGC: Remove the Non-Generational Mode +* 491: Synchronize Virtual Threads without Pinning +* 492: Flexible Constructor Bodies (Third Preview) +* 493: Linking Run-Time Images without JMODs +* 494: Module Import Declarations (Second Preview) +* 495: Simple Source Files and Instance Main Methods (Fourth Preview) +* 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism +* 497: Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm +* 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe +* 499: Structured Concurrency (Fourth Preview) +* 501: Deprecate the 32-bit x86 Port for Removal + +Some of these are API/JVM only so don't affect the compiler and should just work on Java 24 runtimes. + +== Improvements + +* No major improvements + +== Other changes and bug fixes + +Importantly with the adoption of JDT Compiler later than 22, the versions of Java 1.1 > 1.7 are considered no longer +supported so any attempt to specify a build for any of those Java versions will now fail immediately. + +== AspectJ usage hints + +[[ajc_build_system_requirements]] +=== AspectJ compiler build system requirements + +Since 1.9.21, the AspectJ compiler `ajc` (contained in the `aspectjtools` library) no longer works on JDKs 11 to 16. The +minimum compile-time requirement is now JDK 17 due to upstream changes in the Eclipse Java Compiler (subset of JDT +Core), which AspectJ is a fork of. You can still compile to legacy target versions as low as Java 1.3 when compiling +plain Java code or using plain Java ITD constructs which do not require the AspectJ runtime `aspectjrt`, but the +compiler itself needs JDK 17+. Just like in previous AspectJ versions, both the runtime `aspectjrt` and the load-time +weaver `aspectjweaver` still only require JRE 8+. + +History: Since 1.9.8, the AspectJ compiler ajc needed JDK 11+, before then JDK 8+. + +[[ltw_java_16]] +=== Use LTW on Java 16+ + +**Since AspectJ 1.9.21.1, using `--add-opens` is no longer necessary!** The additional JVM command-line option was +necessary for LTW on JRE 16+ in all AspectJ versions up to 1.9.21. Since AspectJ 1.9.21.1, the LTW agent uses an +alternative approach for defining new classes during weaving, which works without `--add-opens` - at least for now, i.e. +JDKs 8 to 22. There still is no canonical solution, because link:https://bugs.openjdk.org/browse/JDK-8200559[JDK-8200559] +is still unresolved since 2018. + +[[compile_with_preview]] +=== Compile with Java preview features + +For features marked as preview on a given JDK, you need to compile with `ajc --enable-preview` and run with +`java --enable-preview` on that JDK. + +Please note, that you cannot run code compiled with preview features on any other JDK than the one used for compilation. +For example, records compiled with preview on JDK 15 cannot be used on JDK 16 without recompilation. This is a JVM +limitation unrelated to AspectJ. Also, e.g. sealed classes are preview-1 on JDK 15 and preview-2 on JDK 16. You still +need to recompile, no matter what. diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java deleted file mode 100644 index 74acbd1db..000000000 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/compiler/IAjTerminalSymbols.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ******************************************************************* - * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v 2.0 - * which accompanies this distribution and is available at - * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt - * - * Contributors: - * PARC initial implementation - * ******************************************************************/ - - -package org.aspectj.ajdt.compiler; - -import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens; - -/** - * This should contain a list of symbols unique to AspectJ grammar, but - * getting jikespg to do that is too much work right now. - */ -public interface IAjTerminalSymbols extends TerminalTokens { - -} diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java index a9cf41801..a2e916f34 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/PseudoTokens.java @@ -28,8 +28,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.parser.Parser; -import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens; - +import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalToken; public class PseudoTokens extends ASTNode { BasicTokenSource tokenSource; @@ -62,7 +61,7 @@ public class PseudoTokens extends ASTNode { IToken last = tokenSource.next(); if (tokenSource.next() != IToken.EOF) { parser.problemReporter().parseError(last.getStart(), last.getEnd(), - TerminalTokens.TokenNameIdentifier, + TerminalToken.TokenNameIdentifier, last.getString().toCharArray(), last.getString(), new String[] {endToken}); @@ -86,7 +85,7 @@ public class PseudoTokens extends ASTNode { } parser.problemReporter().parseError(start, end, - TerminalTokens.TokenNameIdentifier, + TerminalToken.TokenNameIdentifier, found.toCharArray(), found, new String[] {pe.getMessage()}); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java index 9ecf56d2d..f433d188e 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java @@ -46,6 +46,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodScope; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; +import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalToken; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.AjAttribute; import org.aspectj.weaver.ISourceContext; @@ -292,7 +293,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { } } catch (ParserException pEx) { typeDecl.scope.problemReporter().parseError(pcLoc[0] + pEx.getLocation().getStart(), - pcLoc[0] + pEx.getLocation().getEnd(), -1, perClause.toCharArray(), perClause, + pcLoc[0] + pEx.getLocation().getEnd(), TerminalToken.TokenNameInvalid, perClause.toCharArray(), perClause, new String[] { pEx.getMessage() }); } } @@ -413,7 +414,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { ((AjMethodDeclaration) methodDeclaration).addAttribute(new EclipseAttributeAdapter(attr)); } catch (ParserException pEx) { methodDeclaration.scope.problemReporter().parseError(pcLocation[0] + pEx.getLocation().getStart(), - pcLocation[0] + pEx.getLocation().getEnd(), -1, pointcutExpression.toCharArray(), pointcutExpression, + pcLocation[0] + pEx.getLocation().getEnd(), TerminalToken.TokenNameInvalid, pointcutExpression.toCharArray(), pointcutExpression, new String[] { pEx.getMessage() }); } } @@ -586,7 +587,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { } } catch (ParserException pEx) { methodDeclaration.scope.problemReporter().parseError(pcLocation[0] + pEx.getLocation().getStart(), - pcLocation[0] + pEx.getLocation().getEnd(), -1, pointcutExpression.toCharArray(), pointcutExpression, + pcLocation[0] + pEx.getLocation().getEnd(), TerminalToken.TokenNameInvalid, pointcutExpression.toCharArray(), pointcutExpression, new String[] { pEx.getMessage() }); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java index 5a1d77774..95a98440f 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/parser/DeclarationFactory.java @@ -60,6 +60,15 @@ public class DeclarationFactory implements IDeclarationFactory { return new AjConstructorDeclaration(result); } + public ConstructorDeclaration createConstructorDeclaration(CompilationResult result, boolean isCompact) { + return new AjConstructorDeclaration(result) { + @Override + public boolean isCompactConstructor() { + return isCompact; + } + }; + } + public MessageSend createProceed(MessageSend m) { return new Proceed(m); } diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java index 59bea43e5..0c90a12bf 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java @@ -57,6 +57,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding; +import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalToken; import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemReporter; import org.aspectj.org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; import org.aspectj.util.FuzzyBoolean; @@ -770,7 +771,7 @@ public class AjProblemReporter extends ProblemReporter { // pr246393 - if we are going to complain about privileged, we clearly don't know what is going on, so don't // confuse the user - public void parseErrorInsertAfterToken(int start, int end, int currentKind, char[] errorTokenSource, String errorTokenName, + public void parseErrorInsertAfterToken(int start, int end, TerminalToken currentKind, char[] errorTokenSource, String errorTokenName, String expectedToken) { if (expectedToken.equals("privileged") || expectedToken.equals("around")) { super.parseErrorNoSuggestion(start, end, currentKind, errorTokenSource, errorTokenName); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index a937d328e..cc3af5534 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -74,6 +74,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile; import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult; import org.aspectj.org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; import org.aspectj.org.eclipse.jdt.internal.compiler.ICompilerRequestor; +import org.aspectj.org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy; import org.aspectj.org.eclipse.jdt.internal.compiler.IProblemFactory; import org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation; import org.aspectj.org.eclipse.jdt.internal.compiler.batch.CompilationUnit; @@ -1063,7 +1064,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour final BuildArgParser bMain = buildConfig.getBuildArgParser(); final org.aspectj.org.eclipse.jdt.internal.compiler.Compiler compiler = new org.aspectj.org.eclipse.jdt.internal.compiler.Compiler( - environment, DefaultErrorHandlingPolicies.proceedWithAllProblems(), settings, + environment, DefaultErrorHandlingPolicies.proceedWithAllProblems(), new CompilerOptions(settings), getBatchRequestor(), getProblemFactory()); bMain.compilerOptions = compiler.options; bMain.batchCompiler = compiler; diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java index 72edb9fa0..4bfbb0bf9 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AjASTConverter.java @@ -47,7 +47,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeConstants; -import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalTokens; +import org.aspectj.org.eclipse.jdt.internal.compiler.parser.TerminalToken; import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.patterns.Declare; import org.aspectj.weaver.patterns.DeclareAnnotation; @@ -3588,19 +3588,19 @@ public class AjASTConverter extends ASTConverter { // while (true) { // token = removeBlankScanner.getNextToken(); // switch (token) { - // case TerminalTokens.TokenNameCOMMENT_JAVADOC : - // case TerminalTokens.TokenNameCOMMENT_LINE : - // case TerminalTokens.TokenNameCOMMENT_BLOCK : + // case TokenNameCOMMENT_JAVADOC : + // case TokenNameCOMMENT_LINE : + // case TokenNameCOMMENT_BLOCK : // if (first) { // trimLeftPosition = removeBlankScanner.currentPosition; // } // break; - // case TerminalTokens.TokenNameWHITESPACE : + // case TokenNameWHITESPACE : // if (first) { // trimLeftPosition = removeBlankScanner.currentPosition; // } // break; - // case TerminalTokens.TokenNameEOF : + // case TokenNameEOF : // expression.sourceStart = trimLeftPosition; // expression.sourceEnd = trimRightPosition; // return; @@ -3623,30 +3623,30 @@ public class AjASTConverter extends ASTConverter { int count = 0; this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameSEMICOLON: + case TokenNameSEMICOLON: if (count == 0) { return this.scanner.currentPosition - 1; } break; - case TerminalTokens.TokenNameLBRACE: + case TokenNameLBRACE: count++; break; - case TerminalTokens.TokenNameRBRACE: + case TokenNameRBRACE: count--; break; - case TerminalTokens.TokenNameLPAREN: + case TokenNameLPAREN: count++; break; - case TerminalTokens.TokenNameRPAREN: + case TokenNameRPAREN: count--; break; - case TerminalTokens.TokenNameLBRACKET: + case TokenNameLBRACKET: count++; break; - case TerminalTokens.TokenNameRBRACKET: + case TokenNameRBRACKET: count--; } } @@ -3666,15 +3666,15 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(start, end); int foundPosition = -1; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameLBRACKET: - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: - case TerminalTokens.TokenNameCOMMENT_LINE: + case TokenNameLBRACKET: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_LINE: break; - case TerminalTokens.TokenNameRBRACKET:// 166 + case TokenNameRBRACKET:// 166 foundPosition = this.scanner.currentPosition - 1; break; default: @@ -3696,26 +3696,26 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(start, end); boolean isAnnotation = false; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch(token) { - case TerminalTokens.TokenNameAT: + case TokenNameAT: isAnnotation = true; break; - case TerminalTokens.TokenNameIdentifier: + case TokenNameIdentifier: if (isAnnotation) { isAnnotation = false; break; } //$FALL-THROUGH$ - case TerminalTokens.TokenNamebyte: - case TerminalTokens.TokenNamechar: - case TerminalTokens.TokenNamedouble: - case TerminalTokens.TokenNamefloat: - case TerminalTokens.TokenNameint: - case TerminalTokens.TokenNamelong: - case TerminalTokens.TokenNameshort: - case TerminalTokens.TokenNameboolean: + case TokenNamebyte: + case TokenNamechar: + case TokenNamedouble: + case TokenNamefloat: + case TokenNameint: + case TokenNamelong: + case TokenNameshort: + case TokenNameboolean: return new int[]{this.scanner.startPosition, this.scanner.currentPosition - 1}; } } @@ -3733,10 +3733,10 @@ public class AjASTConverter extends ASTConverter { protected int retrieveEndOfRightParenthesisPosition(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameRPAREN: + case TokenNameRPAREN: return this.scanner.currentPosition; } } @@ -3756,15 +3756,15 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(start, end); int dimensions = 0; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameLBRACKET: - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: - case TerminalTokens.TokenNameCOMMENT_LINE: + case TokenNameLBRACKET: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_LINE: break; - case TerminalTokens.TokenNameRBRACKET:// 166 + case TokenNameRBRACKET:// 166 dimensions++; break; default: @@ -3779,10 +3779,10 @@ public class AjASTConverter extends ASTConverter { protected void retrieveIdentifierAndSetPositions(int start, int end, Name name) { this.scanner.resetTo(start, end); - int token; + TerminalToken token; try { - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { - if (token == TerminalTokens.TokenNameIdentifier) { + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { + if (token == TerminalToken.TokenNameIdentifier) { int startName = this.scanner.startPosition; int endName = this.scanner.currentPosition - 1; name.setSourceRange(startName, endName - startName + 1); @@ -3802,10 +3802,10 @@ public class AjASTConverter extends ASTConverter { protected int retrieveIdentifierEndPosition(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameIdentifier:// 110 + case TokenNameIdentifier:// 110 return this.scanner.getCurrentTokenEndPosition(); } } @@ -3824,29 +3824,29 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(start, end); int braceCounter = 0; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameLBRACE: + case TokenNameLBRACE: braceCounter++; break; - case TerminalTokens.TokenNameRBRACE: + case TokenNameRBRACE: braceCounter--; break; - case TerminalTokens.TokenNameLPAREN: + case TokenNameLPAREN: braceCounter++; break; - case TerminalTokens.TokenNameRPAREN: + case TokenNameRPAREN: braceCounter--; break; - case TerminalTokens.TokenNameLBRACKET: + case TokenNameLBRACKET: braceCounter++; break; - case TerminalTokens.TokenNameRBRACKET: + case TokenNameRBRACKET: braceCounter--; break; - case TerminalTokens.TokenNameCOMMA: - case TerminalTokens.TokenNameSEMICOLON: + case TokenNameCOMMA: + case TokenNameSEMICOLON: if (braceCounter == 0) { return this.scanner.startPosition - 1; } @@ -3861,10 +3861,11 @@ public class AjASTConverter extends ASTConverter { protected int retrieveProperRightBracketPosition(int bracketNumber, int start) { this.scanner.resetTo(start, this.compilationUnitSourceLength); try { - int token, count = 0; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + int count = 0; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameRBRACKET: + case TokenNameRBRACKET: count++; if (count == bracketNumber) { return this.scanner.currentPosition - 1; @@ -3885,12 +3886,12 @@ public class AjASTConverter extends ASTConverter { protected int retrieveRightBraceOrSemiColonPosition(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameRBRACE: + case TokenNameRBRACE: return this.scanner.currentPosition - 1; - case TerminalTokens.TokenNameSEMICOLON: + case TokenNameSEMICOLON: return this.scanner.currentPosition - 1; } } @@ -3908,10 +3909,10 @@ public class AjASTConverter extends ASTConverter { protected int retrieveRightBrace(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameRBRACE: + case TokenNameRBRACE: return this.scanner.currentPosition - 1; } } @@ -3929,10 +3930,10 @@ public class AjASTConverter extends ASTConverter { protected int retrieveRightBracketPosition(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameRBRACKET: + case TokenNameRBRACKET: return this.scanner.currentPosition - 1; } } @@ -3953,31 +3954,31 @@ public class AjASTConverter extends ASTConverter { int count = 0; this.scanner.resetTo(end, this.compilationUnitSourceLength); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameSEMICOLON: + case TokenNameSEMICOLON: if (count == 0) { node.setSourceRange(start, this.scanner.currentPosition - start); return; } break; - case TerminalTokens.TokenNameLBRACE: + case TokenNameLBRACE: count++; break; - case TerminalTokens.TokenNameRBRACE: + case TokenNameRBRACE: count--; break; - case TerminalTokens.TokenNameLPAREN: + case TokenNameLPAREN: count++; break; - case TerminalTokens.TokenNameRPAREN: + case TokenNameRPAREN: count--; break; - case TerminalTokens.TokenNameLBRACKET: + case TokenNameLBRACKET: count++; break; - case TerminalTokens.TokenNameRBRACKET: + case TokenNameRBRACKET: count--; } } @@ -3994,10 +3995,10 @@ public class AjASTConverter extends ASTConverter { protected int retrieveStartBlockPosition(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNameLBRACE:// 110 + case TokenNameLBRACE:// 110 return this.scanner.startPosition; } } @@ -4015,10 +4016,10 @@ public class AjASTConverter extends ASTConverter { protected int retrieveStartingCatchPosition(int start, int end) { this.scanner.resetTo(start, end); try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { switch (token) { - case TerminalTokens.TokenNamecatch:// 225 + case TokenNamecatch:// 225 return this.scanner.startPosition; } } @@ -4051,45 +4052,45 @@ public class AjASTConverter extends ASTConverter { protected void setModifiers(BodyDeclaration bodyDeclaration, org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations) { try { - int token; + TerminalToken token; int indexInAnnotations = 0; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { IExtendedModifier modifier = null; switch (token) { - case TerminalTokens.TokenNameabstract: + case TokenNameabstract: modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); break; - case TerminalTokens.TokenNamepublic: + case TokenNamepublic: modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); break; - case TerminalTokens.TokenNamestatic: + case TokenNamestatic: modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); break; - case TerminalTokens.TokenNameprotected: + case TokenNameprotected: modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); break; - case TerminalTokens.TokenNameprivate: + case TokenNameprivate: modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); break; - case TerminalTokens.TokenNamefinal: + case TokenNamefinal: modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); break; - case TerminalTokens.TokenNamenative: + case TokenNamenative: modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); break; - case TerminalTokens.TokenNamesynchronized: + case TokenNamesynchronized: modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); break; - case TerminalTokens.TokenNametransient: + case TokenNametransient: modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); break; - case TerminalTokens.TokenNamevolatile: + case TokenNamevolatile: modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); break; - case TerminalTokens.TokenNamestrictfp: + case TokenNamestrictfp: modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD); break; - case TerminalTokens.TokenNameAT: + case TokenNameAT: // we have an annotation if (annotations != null && indexInAnnotations < annotations.length) { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++]; @@ -4097,9 +4098,9 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength); } break; - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_LINE: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_LINE: + case TokenNameCOMMENT_JAVADOC: break; default: return; @@ -4244,44 +4245,44 @@ public class AjASTConverter extends ASTConverter { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = argument.annotations; int indexInAnnotations = 0; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { IExtendedModifier modifier = null; switch (token) { - case TerminalTokens.TokenNameabstract: + case TokenNameabstract: modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); break; - case TerminalTokens.TokenNamepublic: + case TokenNamepublic: modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); break; - case TerminalTokens.TokenNamestatic: + case TokenNamestatic: modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); break; - case TerminalTokens.TokenNameprotected: + case TokenNameprotected: modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); break; - case TerminalTokens.TokenNameprivate: + case TokenNameprivate: modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); break; - case TerminalTokens.TokenNamefinal: + case TokenNamefinal: modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); break; - case TerminalTokens.TokenNamenative: + case TokenNamenative: modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); break; - case TerminalTokens.TokenNamesynchronized: + case TokenNamesynchronized: modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); break; - case TerminalTokens.TokenNametransient: + case TokenNametransient: modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); break; - case TerminalTokens.TokenNamevolatile: + case TokenNamevolatile: modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); break; - case TerminalTokens.TokenNamestrictfp: + case TokenNamestrictfp: modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD); break; - case TerminalTokens.TokenNameAT: + case TokenNameAT: // we have an annotation if (annotations != null && indexInAnnotations < annotations.length) { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++]; @@ -4289,9 +4290,9 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength); } break; - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_LINE: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_LINE: + case TokenNameCOMMENT_JAVADOC: break; default: return; @@ -4319,44 +4320,44 @@ public class AjASTConverter extends ASTConverter { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = localDeclaration.annotations; int indexInAnnotations = 0; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { IExtendedModifier modifier = null; switch (token) { - case TerminalTokens.TokenNameabstract: + case TokenNameabstract: modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); break; - case TerminalTokens.TokenNamepublic: + case TokenNamepublic: modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); break; - case TerminalTokens.TokenNamestatic: + case TokenNamestatic: modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); break; - case TerminalTokens.TokenNameprotected: + case TokenNameprotected: modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); break; - case TerminalTokens.TokenNameprivate: + case TokenNameprivate: modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); break; - case TerminalTokens.TokenNamefinal: + case TokenNamefinal: modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); break; - case TerminalTokens.TokenNamenative: + case TokenNamenative: modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); break; - case TerminalTokens.TokenNamesynchronized: + case TokenNamesynchronized: modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); break; - case TerminalTokens.TokenNametransient: + case TokenNametransient: modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); break; - case TerminalTokens.TokenNamevolatile: + case TokenNamevolatile: modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); break; - case TerminalTokens.TokenNamestrictfp: + case TokenNamestrictfp: modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD); break; - case TerminalTokens.TokenNameAT: + case TokenNameAT: // we have an annotation if (annotations != null && indexInAnnotations < annotations.length) { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++]; @@ -4364,9 +4365,9 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength); } break; - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_LINE: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_LINE: + case TokenNameCOMMENT_JAVADOC: break; default: return; @@ -4422,44 +4423,44 @@ public class AjASTConverter extends ASTConverter { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = localDeclaration.annotations; int indexInAnnotations = 0; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { IExtendedModifier modifier = null; switch (token) { - case TerminalTokens.TokenNameabstract: + case TokenNameabstract: modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); break; - case TerminalTokens.TokenNamepublic: + case TokenNamepublic: modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); break; - case TerminalTokens.TokenNamestatic: + case TokenNamestatic: modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); break; - case TerminalTokens.TokenNameprotected: + case TokenNameprotected: modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); break; - case TerminalTokens.TokenNameprivate: + case TokenNameprivate: modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); break; - case TerminalTokens.TokenNamefinal: + case TokenNamefinal: modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); break; - case TerminalTokens.TokenNamenative: + case TokenNamenative: modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); break; - case TerminalTokens.TokenNamesynchronized: + case TokenNamesynchronized: modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); break; - case TerminalTokens.TokenNametransient: + case TokenNametransient: modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); break; - case TerminalTokens.TokenNamevolatile: + case TokenNamevolatile: modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); break; - case TerminalTokens.TokenNamestrictfp: + case TokenNamestrictfp: modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD); break; - case TerminalTokens.TokenNameAT: + case TokenNameAT: // we have an annotation if (annotations != null && indexInAnnotations < annotations.length) { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++]; @@ -4467,9 +4468,9 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength); } break; - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_LINE: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_LINE: + case TokenNameCOMMENT_JAVADOC: break; default: return; @@ -4503,44 +4504,44 @@ public class AjASTConverter extends ASTConverter { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = localDeclaration.annotations; int indexInAnnotations = 0; try { - int token; - while ((token = this.scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { + TerminalToken token; + while ((token = this.scanner.getNextToken()) != TerminalToken.TokenNameEOF) { IExtendedModifier modifier = null; switch (token) { - case TerminalTokens.TokenNameabstract: + case TokenNameabstract: modifier = createModifier(Modifier.ModifierKeyword.ABSTRACT_KEYWORD); break; - case TerminalTokens.TokenNamepublic: + case TokenNamepublic: modifier = createModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD); break; - case TerminalTokens.TokenNamestatic: + case TokenNamestatic: modifier = createModifier(Modifier.ModifierKeyword.STATIC_KEYWORD); break; - case TerminalTokens.TokenNameprotected: + case TokenNameprotected: modifier = createModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD); break; - case TerminalTokens.TokenNameprivate: + case TokenNameprivate: modifier = createModifier(Modifier.ModifierKeyword.PRIVATE_KEYWORD); break; - case TerminalTokens.TokenNamefinal: + case TokenNamefinal: modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); break; - case TerminalTokens.TokenNamenative: + case TokenNamenative: modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); break; - case TerminalTokens.TokenNamesynchronized: + case TokenNamesynchronized: modifier = createModifier(Modifier.ModifierKeyword.SYNCHRONIZED_KEYWORD); break; - case TerminalTokens.TokenNametransient: + case TokenNametransient: modifier = createModifier(Modifier.ModifierKeyword.TRANSIENT_KEYWORD); break; - case TerminalTokens.TokenNamevolatile: + case TokenNamevolatile: modifier = createModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD); break; - case TerminalTokens.TokenNamestrictfp: + case TokenNamestrictfp: modifier = createModifier(Modifier.ModifierKeyword.STRICTFP_KEYWORD); break; - case TerminalTokens.TokenNameAT: + case TokenNameAT: // we have an annotation if (annotations != null && indexInAnnotations < annotations.length) { org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation annotation = annotations[indexInAnnotations++]; @@ -4548,9 +4549,9 @@ public class AjASTConverter extends ASTConverter { this.scanner.resetTo(annotation.declarationSourceEnd + 1, this.compilationUnitSourceLength); } break; - case TerminalTokens.TokenNameCOMMENT_BLOCK: - case TerminalTokens.TokenNameCOMMENT_LINE: - case TerminalTokens.TokenNameCOMMENT_JAVADOC: + case TokenNameCOMMENT_BLOCK: + case TokenNameCOMMENT_LINE: + case TokenNameCOMMENT_JAVADOC: break; default: return; diff --git a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties index 37b3e7b1d..2a3328ab3 100644 --- a/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties +++ b/org.aspectj.ajdt.core/src/main/resources/org/aspectj/org/eclipse/jdt/internal/compiler/batch/messages_aspectj.properties @@ -1,7 +1,7 @@ compiler.name = AspectJ Compiler # AspectJ_JDK_Update: Update not only for new Java versions, but each time JDT Core is updated with an upstream merge. # Always make sure to update to the latest merge commit ID and date of the latest upstream commit. -compiler.version = Eclipse Compiler 261e7fa1c2f057 (4Feb2025) - Java23 +compiler.version = Eclipse Compiler 557e0013ed92 (27Mar2025) - Java24 compiler.copyright = misc.version = {0} {1} - {2} {3} @@ -27,8 +27,8 @@ <maven.javadoc.skip>true</maven.javadoc.skip> <!-- Dependency versions --> - <jdt.core.version>1.9.23</jdt.core.version> <!-- AspectJ_JDK_Update --> - <asm.version>9.7.1</asm.version> <!-- AspectJ_JDK_Update --> + <jdt.core.version>1.9.24</jdt.core.version> <!-- AspectJ_JDK_Update --> + <asm.version>9.8</asm.version> <!-- AspectJ_JDK_Update --> <commons.digester.version>3.2</commons.digester.version> <commons.logging.version>1.3.0</commons.logging.version> <lib.ant.version>1.6.3</lib.ant.version> @@ -188,7 +188,7 @@ <profile> <id>jdk-18-to-xx</id> <activation> - <jdk>[18,)</jdk> + <jdk>[18,23)</jdk> </activation> <properties> <!-- diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java index 3da7556e5..c51b441df 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -251,26 +251,26 @@ public class AjcTask extends MatchingTask { public static final String COMMAND_EDITOR_NAME = AjcTask.class.getName() + ".COMMAND_EDITOR"; // AspectJ_JDK_Update: Check minimum supported ECJ version, currently 1.3 - public static final int JAVA_VERSION_MIN = 3; + public static final int JAVA_VERSION_MIN = 8; // AspectJ_JDK_Update: Check maximum supported ECJ version - public static final int JAVA_VERSION_MAX = 23; + public static final int JAVA_VERSION_MAX = 24; static final String[] SOURCE_INPUTS; static final String[] TARGET_INPUTS; static final String[] COMPLIANCE_INPUTS; static { - // 1.3 to 1.9 + // JAVA_VERSION_MIN to 1.9 final int major1Versions = 10 - JAVA_VERSION_MIN; // 5 to JAVA_VERSION_MAX - final int major5AndUpVersions = JAVA_VERSION_MAX - 4; + final int major5AndUpVersions = JAVA_VERSION_MAX - 7; // was -4 meaning don't count 1.1/1.2/1.3/1.4 - changed to -7 meaning don't include 1.1>1.7 SOURCE_INPUTS = new String[major1Versions + major5AndUpVersions]; TARGET_INPUTS = new String[major1Versions + major5AndUpVersions]; COMPLIANCE_INPUTS = new String[major1Versions + major5AndUpVersions]; int arrayIndex = 0; - for (int i = 3; i <= JAVA_VERSION_MAX ; i++) { + for (int i = JAVA_VERSION_MIN; i <= JAVA_VERSION_MAX ; i++) { // Before Java 10, 1.x majors were supported by ECJ/AJC if (i < 10) { SOURCE_INPUTS[arrayIndex] = "1." + i; diff --git a/taskdefs/src/test/java/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java b/taskdefs/src/test/java/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java index 5758bcfc7..15fe287d9 100644 --- a/taskdefs/src/test/java/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java +++ b/taskdefs/src/test/java/org/aspectj/tools/ant/taskdefs/AjcTaskTest.java @@ -620,6 +620,7 @@ public class AjcTaskTest extends TestCase { public void testVersions() { String[] inputs = AjcTask.TARGET_INPUTS; for (String value : inputs) { + System.out.println("Value is "+value); AjcTask task = getTask(NOFILE); task.setTarget(value); String[] cmd = task.makeCommand(); diff --git a/tests/bugs1923/gh322/SomeAnnotation.java b/tests/bugs1923/gh322/SomeAnnotation.java new file mode 100644 index 000000000..3d472d3f9 --- /dev/null +++ b/tests/bugs1923/gh322/SomeAnnotation.java @@ -0,0 +1,5 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface SomeAnnotation {} + diff --git a/tests/bugs1923/gh322/TheAspect.java b/tests/bugs1923/gh322/TheAspect.java new file mode 100644 index 000000000..41b33119a --- /dev/null +++ b/tests/bugs1923/gh322/TheAspect.java @@ -0,0 +1,11 @@ +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; + +@Aspect +public class TheAspect { + @Around("execution(* *(@SomeAnnotation (*), ..))") + public Object aroundContext(ProceedingJoinPoint pjp) throws Throwable { + return pjp.proceed(); + } +} diff --git a/tests/bugs1923/gh322/TheClass.java b/tests/bugs1923/gh322/TheClass.java new file mode 100644 index 000000000..590c4f7bf --- /dev/null +++ b/tests/bugs1923/gh322/TheClass.java @@ -0,0 +1,5 @@ +public class TheClass implements TheInterface { + @Override + public void method(int param) { + } +} diff --git a/tests/bugs1923/gh322/TheInterface.java b/tests/bugs1923/gh322/TheInterface.java new file mode 100644 index 000000000..358f9037b --- /dev/null +++ b/tests/bugs1923/gh322/TheInterface.java @@ -0,0 +1,3 @@ +public interface TheInterface { + void method(@Deprecated int param); +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1923/Ajc1923TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc1923/Ajc1923TestsJava.java index 08e32db82..083f8a3b4 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1923/Ajc1923TestsJava.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1923/Ajc1923TestsJava.java @@ -32,9 +32,9 @@ public class Ajc1923TestsJava extends JavaVersionSpecificXMLBasedAjcTestCase { protected java.net.URL getSpecFile() { return getClassResource("ajc1923.xml"); } - - public void testJep455PrimitivePatternsSwitch2() { - runTest("primitive types patterns - switch - with advice"); + + public void testNothing() { } + } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1923/AllTestsAspectJ1923.java b/tests/src/test/java/org/aspectj/systemtest/ajc1923/AllTestsAspectJ1923.java index 7ed05849e..7498d6995 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1923/AllTestsAspectJ1923.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1923/AllTestsAspectJ1923.java @@ -12,18 +12,6 @@ import junit.framework.TestSuite; import org.aspectj.tools.ant.taskdefs.AjcTask; import org.aspectj.util.LangUtil; -//AspectJ_JDK_Update -//- Copy 'ajc*' package with all classes to a new package, incrementing the version number in the package -//- Rename all classes, incrementing version numbers -//- Add this class to the suite in class AllTests19 -//- Increment version numbers in strings, method calls and constants to the appropriate values, creating necessary -// methods and constants classes providing them, if they do not exist yet -//- Also increment references to 'ajc*.xml' and 'sanity-tests-*.xml' test definition, copying the previous -// tests/src/test/resources/org/aspectj/systemtest/ajc* directory, incrementing all names and adjusting the XML -// file contents appropriately -//- Search for other 'AspectJ_JDK_Update' hints in the repository, also performing the necessary to-dos there -//- Remove this comment from the previous class version after copying this one - /** * @author Alexander Kriegisch * @author Andy Clement diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1923/Bugs1923Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1923/Bugs1923Tests.java index 8a3547472..2b26d8d6e 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1923/Bugs1923Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1923/Bugs1923Tests.java @@ -42,6 +42,10 @@ public class Bugs1923Tests extends XMLBasedAjcTestCase { public void testGh326_ClassCastExceptionHandling() { runTest("classcast on exception handling aspect"); } + + public void testGh322_DeprecatedAnnotation() { + runTest("ajc error for particular Pointcut and @Deprecated"); + } @Override protected java.net.URL getSpecFile() { diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Ajc1924TestsJava.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Ajc1924TestsJava.java new file mode 100644 index 000000000..dfdb1ccdf --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Ajc1924TestsJava.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2025 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc1924; + +import org.aspectj.apache.bcel.Constants; +import org.aspectj.testing.JavaVersionSpecificXMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCase; + +import junit.framework.Test; + +/** + * @author Andy Clement + */ +public class Ajc1924TestsJava extends JavaVersionSpecificXMLBasedAjcTestCase { + + private static final Constants.ClassFileVersion classFileVersion = Constants.ClassFileVersion.of(24); + + public Ajc1924TestsJava() { + super(24); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Ajc1924TestsJava.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc1924.xml"); + } + + public void testJep455PrimitivePatternsSwitch2() { + runTest("primitive types patterns - switch - with advice"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/AllTestsAspectJ1924.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/AllTestsAspectJ1924.java new file mode 100644 index 000000000..d644c842d --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/AllTestsAspectJ1924.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2025 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc1924; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.aspectj.systemtest.ajc1923.Ajc1923TestsJava; +import org.aspectj.systemtest.ajc1923.Bugs1923Tests; +import org.aspectj.systemtest.ajc1923.Java23PreviewFeaturesTests; +import org.aspectj.systemtest.ajc1923.SanityTestsJava23; +import org.aspectj.tools.ant.taskdefs.AjcTask; +import org.aspectj.util.LangUtil; + +//AspectJ_JDK_Update +//- Copy 'ajc*' package with all classes to a new package, incrementing the version number in the package +//- Rename all classes, incrementing version numbers +//- Add this class to the suite in class AllTests19 +//- Increment version numbers in strings, method calls and constants to the appropriate values, creating necessary +// methods and constants classes providing them, if they do not exist yet +//- Also increment references to 'ajc*.xml' and 'sanity-tests-*.xml' test definition, copying the previous +// tests/src/test/resources/org/aspectj/systemtest/ajc* directory, incrementing all names and adjusting the XML +// file contents appropriately +//- Search for other 'AspectJ_JDK_Update' hints in the repository, also performing the necessary to-dos there +//- Remove this comment from the previous class version after copying this one + +/** + * @author Andy Clement + */ +public class AllTestsAspectJ1924 { + + private static final int JAVA_VERSION = 24; + + public static Test suite() { + TestSuite suite = new TestSuite("AspectJ 1.9.24 tests"); + suite.addTest(Bugs1924Tests.suite()); + if (LangUtil.isVMGreaterOrEqual(JAVA_VERSION)) { + suite.addTest(SanityTestsJava24.suite()); + suite.addTest(Ajc1924TestsJava.suite()); + } + // Do not run tests using a previous compiler's preview features anymore. They + // would all fail. + if (AjcTask.JAVA_VERSION_MAX == JAVA_VERSION) { + if (LangUtil.isVMGreaterOrEqual(JAVA_VERSION) && LangUtil.isVMLessOrEqual(JAVA_VERSION)) { + suite.addTest(Java24PreviewFeaturesTests.suite()); + } + } + return suite; + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java new file mode 100644 index 000000000..e186993b2 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Bugs1924Tests.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2025 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc1924; + +import junit.framework.Test; +import org.aspectj.testing.XMLBasedAjcTestCase; + +/** + * @author Andy Clement + */ +public class Bugs1924Tests extends XMLBasedAjcTestCase { + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Bugs1924Tests.class); + } + + public void testNothing() { + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc1924.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java new file mode 100644 index 000000000..3e95d587e --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/Java24PreviewFeaturesTests.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2025 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc1924; + +import org.aspectj.testing.JavaVersionSpecificXMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCase; + +import junit.framework.Test; + +/** + * @author Andy Clement + */ +public class Java24PreviewFeaturesTests extends JavaVersionSpecificXMLBasedAjcTestCase { + + public Java24PreviewFeaturesTests() { + super(24, 24); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Java24PreviewFeaturesTests.class); + } + + public void testJep455PrimitivePatternsSwitch1() { + fail(); +// runTest("primitive types patterns - switch"); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc1924.xml"); + } + +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1924/SanityTestsJava24.java b/tests/src/test/java/org/aspectj/systemtest/ajc1924/SanityTestsJava24.java new file mode 100644 index 000000000..c423c8cea --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1924/SanityTestsJava24.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * Copyright (c) 2025 Contributors + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + *******************************************************************************/ +package org.aspectj.systemtest.ajc1924; + +import junit.framework.Test; +import org.aspectj.apache.bcel.Constants; +import org.aspectj.testing.JavaVersionSpecificXMLBasedAjcTestCase; +import org.aspectj.testing.XMLBasedAjcTestCase; + +/* + * Some very trivial tests that help verify things are OK. + * These are a copy of the earlier Sanity Tests created for 1.6 but these supply the -23 option + * to check code generation and modification with that version specified. + * + * @author Andy Clement + */ +public class SanityTestsJava24 extends JavaVersionSpecificXMLBasedAjcTestCase { + + public static final int bytecode_version_for_JDK_level = Constants.ClassFileVersion.of(24).MAJOR; + + public SanityTestsJava24() { + super(24); + } + + // Incredibly trivial test programs that check the compiler works at all (these are easy-ish to debug) + public void testSimpleJava_A() { + runTest("simple - a"); + } + + public void testSimpleJava_B() { + runTest("simple - b"); + } + + public void testSimpleCode_C() { + runTest("simple - c"); + } + + public void testSimpleCode_D() { + runTest("simple - d"); + } + + public void testSimpleCode_E() { + runTest("simple - e"); + } + + public void testSimpleCode_F() { + runTest("simple - f"); + } + + public void testSimpleCode_G() { + runTest("simple - g"); + } + + public void testSimpleCode_H() { + runTest("simple - h", true); + } + + public void testSimpleCode_I() { + runTest("simple - i"); + } + + public void testVersionCorrect1() { + runTest("simple - j"); + checkVersion("A", bytecode_version_for_JDK_level, 0); + } + + public void testVersionCorrect2() { + runTest("simple - k"); + checkVersion("A", bytecode_version_for_JDK_level, 0); + } + + public void testVersionCorrect4() { + runTest("simple - m"); + checkVersion("A", Constants.ClassFileVersion.of(8).MAJOR, 0); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(SanityTestsJava24.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("sanity-tests-24.xml"); + } + +} diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml index 238b0329f..41f4b8808 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml @@ -257,10 +257,18 @@ <!--<run class="ataspectj.DeclareParentsInterfaceTest" ltw="ataspectj/aop-decptest.xml"/>--> <ant file="ajc-ant.xml" target="ltw.Decp" verbose="true"> <stderr> + <line text="WARNING: A terminally deprecated method in sun.misc.Unsafe has been called" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: Please consider reporting this to the maintainers of class org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release" vm="24"/> <line text="Extending interface set for type 'ataspectj.DeclareParentsInterfaceTest$Target' (DeclareParentsInterfaceTest.java) to include 'ataspectj.DeclareParentsInterfaceTest$Marker' (DeclareParentsInterfaceTest.java)"/> <line text="see also:"/> <line text="Join point 'method-execution(void ataspectj.DeclareParentsInterfaceTest$Target.target())' in Type 'ataspectj.DeclareParentsInterfaceTest$Target' (DeclareParentsInterfaceTest.java:27) advised by before advice from 'ataspectj.DeclareParentsInterfaceTest$TestAspect' (DeclareParentsInterfaceTest.java)"/> <line text="see also:"/> + <line text="WARNING: A terminally deprecated method in sun.misc.Unsafe has been called" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: Please consider reporting this to the maintainers of class org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release" vm="24"/> <line text="Extending interface set for type 'ataspectj.DeclareParentsImplementsTest$Target' (DeclareParentsImplementsTest.java) to include 'ataspectj.DeclareParentsImplementsTest$Introduced' (DeclareParentsImplementsTest.java)"/> <line text="see also:"/> <line text="Type 'ataspectj.DeclareParentsImplementsTest$Target' (DeclareParentsImplementsTest.java) has intertyped method from 'ataspectj.DeclareParentsImplementsTest$TestAspect' (DeclareParentsImplementsTest.java:'void ataspectj.DeclareParentsImplementsTest$Introduced.intro()')"/> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml index fccc5c606..edfd2449e 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc150/ltw/ltw.xml @@ -513,6 +513,10 @@ </stdout> <stderr> <line text="TraceFactory.instance=" /> + <line text="WARNING: A terminally deprecated method in sun.misc.Unsafe has been called" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: Please consider reporting this to the maintainers of class org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release" vm="24"/> </stderr> </ant> </ajc-test> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc161/ajc161.xml index 83d812a28..3dfac1c5f 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc161/ajc161.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc161/ajc161.xml @@ -70,7 +70,7 @@ <!-- this message no longer coming out with Java23 upgrade to ECJ --> <!-- message file="C.java" kind="error" line="1" text="Unnamed Classes and Instance Main Methods"/--> <!-- this message now comes out with Java23 upgrade to ECJ --> - <message file="C.java" kind="error" line="1" text="The preview feature Implicitly Declared Classes and Instance Main Methods is only available with source level 23 and above"/> + <message file="C.java" kind="error" line="1" text="The preview feature Implicitly Declared Classes and Instance Main Methods is only available with source level 24 and above"/> <message file="C.java" kind="error" line="2" text="blahblahpackage cannot be resolved to a type"/> <message file="C.java" kind="error" line="2" text="Implicitly declared class must have a candidate main method"/> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1923/ajc1923.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1923/ajc1923.xml index 6908c1e12..19a27feb8 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1923/ajc1923.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1923/ajc1923.xml @@ -30,22 +30,6 @@ </run> </ajc-test> - <!-- https://openjdk.org/jeps/455 --> - <ajc-test dir="features1923/java23" vm="23" title="primitive types patterns - switch - with advice"> - <compile files="PrimitivePatternsSwitch2.java" options="--enable-preview -23 -showWeaveInfo"> - <message kind="weave" line="12" text="Join point 'method-call(boolean PrimitivePatternsSwitch2.isOdd(int))' in Type 'PrimitivePatternsSwitch2' (PrimitivePatternsSwitch2.java:12) advised by around advice from 'X'"/>> - </compile> - <run class="PrimitivePatternsSwitch2" vmargs="--enable-preview"> - <stdout> - <!-- advice forces all the isOdd() calls to return false --> - <line text="no"/> - <line text="no"/> - <line text="no"/> - <line text="no"/> - </stdout> - </run> - </ajc-test> - <ajc-test dir="bugs1923/gh328" vm="17" title="problem with inline accessor generator for around advice"> <compile files="One.java" options="-17"> </compile> @@ -71,16 +55,30 @@ <compile files="F.aj" options="-17"> </compile> </ajc-test> - + <ajc-test dir="bugs1923/gh326" vm="17" title="classcast on exception handling aspect"> <compile files="pkg/BusinessDao.java pkg/BusinessService.java pkg/SourceException.java pkg/TargetException.java pkg/BusinessDto.java pkg/HandleSourceException.java pkg/SourceExceptionHandlerAspect.aj" options="-17"> </compile> <run class="pkg.BusinessService"> - <stdout> + <stdout> <line text="42"/> </stdout> </run> </ajc-test> + <ajc-test dir="bugs1923/gh322" vm="17" title="ajc error for particular Pointcut and @Deprecated"> + <!-- + <compile files="TheClass.java TheInterface.java TheAspect.java SomeAnnotation.java" options="-17,-Xlint:ignore"> + </compile> + <compile files="TheInterface.java TheAspect.java SomeAnnotation.java TheClass.java" options="-17,-Xlint:ignore"> + </compile> + --> + <compile files="TheAspect.java SomeAnnotation.java TheClass.java TheInterface.java " options="-17,-Xlint:ignore"> + </compile> + <compile files="TheAspect.java SomeAnnotation.java TheClass.java TheInterface.java" options="-17,-Xlint:ignore"> + </compile> + </ajc-test> + + </suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1924/ajc1924.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1924/ajc1924.xml new file mode 100644 index 000000000..137932609 --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1924/ajc1924.xml @@ -0,0 +1,49 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> + +<!-- + JDK 23 (https://openjdk.org/projects/jdk/24/): + 404: Generational Shenandoah (Experimental) + 450: Compact Object Headers (Experimental) + 472: Prepare to Restrict the Use of JNI + 475: Late Barrier Expansion for G1 + 478: Key Derivation Function API (Preview) + 479: Remove the Windows 32-bit x86 Port + 483: Ahead-of-Time Class Loading & Linking + 484: Class-File API + 485: Stream Gatherers + 486: Permanently Disable the Security Manager + 487: Scoped Values (Fourth Preview) + 488: Primitive Types in Patterns, instanceof, and switch (Second Preview) + 489: Vector API (Ninth Incubator) + 490: ZGC: Remove the Non-Generational Mode + 491: Synchronize Virtual Threads without Pinning + 492: Flexible Constructor Bodies (Third Preview) + 493: Linking Run-Time Images without JMODs + 494: Module Import Declarations (Second Preview) + 495: Simple Source Files and Instance Main Methods (Fourth Preview) + 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism + 497: Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm + 498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe + 499: Structured Concurrency (Fourth Preview) + 501: Deprecate the 32-bit x86 Port for Removal +--> +<suite> + + <!-- https://openjdk.org/jeps/455 --> + <ajc-test dir="features1923/java23" vm="24" title="primitive types patterns - switch - with advice"> + <compile files="PrimitivePatternsSwitch2.java" options="--enable-preview -24 -showWeaveInfo"> + <message kind="weave" line="12" text="Join point 'method-call(boolean PrimitivePatternsSwitch2.isOdd(int))' in Type 'PrimitivePatternsSwitch2' (PrimitivePatternsSwitch2.java:12) advised by around advice from 'X'"/>> + </compile> + <run class="PrimitivePatternsSwitch2" vmargs="--enable-preview"> + <stdout> + <!-- advice forces all the isOdd() calls to return false --> + <line text="no"/> + <line text="no"/> + <line text="no"/> + <line text="no"/> + </stdout> + </run> + </ajc-test> + + +</suite> diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1924/sanity-tests-24.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1924/sanity-tests-24.xml new file mode 100644 index 000000000..58af3b40b --- /dev/null +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1924/sanity-tests-24.xml @@ -0,0 +1,68 @@ +<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> +<suite> + + <!-- empty class --> + <ajc-test dir="bugs160/simplejava" title="simple - a"> + <compile files="SimpleA.java" options="-24"/> + </ajc-test> + + <!-- class with one method --> + <ajc-test dir="bugs160/simplejava" title="simple - b"> + <compile files="SimpleB.java" options="-24"/> + <run class="SimpleB"/> + </ajc-test> + + <!-- empty aspect --> + <ajc-test dir="bugs160/simplejava" title="simple - c"> + <compile files="SimpleC.java" options="-24"/> + </ajc-test> + + <!-- simple before --> + <ajc-test dir="bugs160/simplejava" title="simple - d"> + <compile files="SimpleD.java" options="-24"/> + </ajc-test> + + <!-- simple itd field --> + <ajc-test dir="bugs160/simplejava" title="simple - e"> + <compile files="SimpleE.java" options="-24"/> + </ajc-test> + + <!-- aspect with main calling a static method --> + <ajc-test dir="bugs160/simplejava" title="simple - f"> + <compile files="SimpleF.java" options="-24"/> + </ajc-test> + + <!-- pertarget --> + <ajc-test dir="bugs160/simplejava" title="simple - g"> + <compile files="SimpleG.java" options="-24"/> + </ajc-test> + + <!-- generic ctor itds --> + <ajc-test dir="bugs160/simplejava" title="simple - h"> + <compile files="SimpleH.java" options="-24"/> + </ajc-test> + + <!-- overriding generic itd methods --> + <ajc-test dir="bugs160/simplejava" title="simple - i"> + <compile files="SimpleI.java" options="-24"/> + </ajc-test> + + <!-- check class file version --> + <ajc-test dir="bugs160/simplejava" title="simple - j"> + <compile files="SimpleJ.java" options="-24"/> + </ajc-test> + + <!-- check class file version --> + <ajc-test dir="bugs160/simplejava" title="simple - k"> + <compile files="SimpleJ.java" options="-source 24"/> + </ajc-test> + + <ajc-test dir="bugs160/simplejava" title="simple - m"> + <compile files="SimpleJ.java" options="-1.8"/> + </ajc-test> + + <ajc-test dir="bugs160/simplejava" title="simple - n"> + <compile files="SimpleN.java" options="-24"/> + </ajc-test> + +</suite>
\ No newline at end of file diff --git a/tests/src/test/resources/org/aspectj/systemtest/tracing/tracing.xml b/tests/src/test/resources/org/aspectj/systemtest/tracing/tracing.xml index b31370543..c89b8a372 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/tracing/tracing.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/tracing/tracing.xml @@ -44,6 +44,10 @@ writer --> <stderr> + <line text="WARNING: A terminally deprecated method in sun.misc.Unsafe has been called" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: Please consider reporting this to the maintainers of class org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor" vm="24"/> + <line text="WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release" vm="24"/> <line text="info AspectJ Weaver Version"/> <line text="info register classloader"/> <line text="info using configuration"/> |