diff --git a/LICENSE b/LICENSE index 94636f28aa..6e1506c168 100644 --- a/LICENSE +++ b/LICENSE @@ -1,199 +1,279 @@ -Per: https://www.eclipse.org/legal/epl-v10.html +Per: https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt -Eclipse Public License - v 1.0 +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. + 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 code and documentation - 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 -additions to the Program which: (i) are separate modules of software -distributed in conjunction with the Program under their own license agreement, -and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. + a) in the case of the initial Contributor, the initial content + Distributed under this Agreement, and -"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. + 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. -"Program" means the Contributions distributed in accordance with this Agreement. +"Contributor" means any person or entity that Distributes the Program. -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. +"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, in source code and object code form. -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 and - object code 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. + 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 -A Contributor may choose to distribute the Program in object code form under -its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all 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 Contributors all liability for - damages, including direct, indirect, special, incidental and consequential - damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by - that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, - and informs licensees how to obtain it in a reasonable manner on or through - a medium customarily used for software exchange. -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. -Contributors may not remove or alter any copyright notices contained within -the Program. - -Each Contributor must identify itself as the originator of its Contribution, -if any, in a manner that reasonably allows subsequent Recipients to identify -the originator of the Contribution. +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 +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. +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, 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. +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, 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 +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. - -This Agreement is governed by the laws of the State of New York and the -intellectual property laws of the United States of America. No party to this -Agreement will bring a legal action under this Agreement more than one year -after the cause of action arose. Each party waives its rights to a jury -trial in any resulting litigation. +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. diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/BrowserManager.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/BrowserManager.java index a5856afd98..e140d3bd93 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/BrowserManager.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/BrowserManager.java @@ -1,13 +1,13 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -49,7 +49,7 @@ /** * IDE manager for standalone AJDE application. - * + * * @author Mik Kersten */ public class BrowserManager { @@ -107,7 +107,7 @@ public void init(String[] configFilesArgs, boolean visible) { /** * Find and create the set of build configuration files - * + * * @param configFilesArgs */ private void setUpConfigFiles(String[] configFilesArgs) { diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/Main.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/Main.java index 6d56a6f2a9..51a33c73ea 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/Main.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/Main.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.tools.ajbrowser; @@ -23,7 +23,7 @@ public class Main { /** * Run ajbrowser if args contains only .lst files and ajc otherwise. - * + * * @param args the String[] of args to interpret */ public static void main(String[] args) { @@ -34,7 +34,7 @@ public static void main(String[] args) { /** * Invoke the compiler if there are arguments and some are not .lst files. - * + * * @return false if compiler was not invoked and the browser main should be */ static boolean compilerMain(String[] args) { diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserBuildProgressMonitor.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserBuildProgressMonitor.java index aab3e3b3ab..a19c2b717e 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserBuildProgressMonitor.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserBuildProgressMonitor.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.core; @@ -27,13 +27,13 @@ public class BrowserBuildProgressMonitor extends Thread implements IBuildProgressMonitor { public static final String PROGRESS_HEADING = "AspectJ Build"; - + private BuildProgressPanel progressDialog = null; private JDialog dialog = null; private TopFrame topFrame; - + private BrowserMessageHandler handler; - + public BrowserBuildProgressMonitor(BrowserMessageHandler handler) { this.handler = handler; topFrame = (TopFrame) BrowserManager.getDefault().getRootFrame(); @@ -42,16 +42,16 @@ public BrowserBuildProgressMonitor(BrowserMessageHandler handler) { dialog.setContentPane(progressDialog); dialog.setSize(550, 120); try { - dialog.setLocationRelativeTo(topFrame); + dialog.setLocationRelativeTo(topFrame); } catch (NoSuchMethodError nsme) { // running on 1.3 } } - + public void finish(boolean wasFullBuild) { Ajde.getDefault().getIdeUIAdapter().displayStatusInformation("build finished..."); progressDialog.finish(); - dialog.dispose(); + dialog.dispose(); if (handler.getMessages().isEmpty()) { topFrame.hideMessagesPanel(handler); } else { diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java index 2546965318..e1ec5c81d1 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.core; diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserErrorHandler.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserErrorHandler.java index 9d8e3857c7..d264e19008 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserErrorHandler.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserErrorHandler.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.core; @@ -47,7 +47,7 @@ private static String getStackTraceAsString(Throwable t) { if (t != null) { t.printStackTrace(new PrintWriter(stringWriter)); return stringWriter.getBuffer().toString(); - } + } return ""; } diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java index c721394e24..81192131d2 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.core; diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/PreferenceStoreConstants.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/PreferenceStoreConstants.java index 6ad9b448cb..f92fae4c1b 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/PreferenceStoreConstants.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/core/PreferenceStoreConstants.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.core; @@ -20,5 +20,5 @@ public class PreferenceStoreConstants { public static final String BUILD_OUTPUTPATH = "build.outputpath"; public static final String JAVA_CLASSPATH = "java.class.path"; public static final String NONSTANDARD_OPTIONS = "ajc.nonStandardOptions"; - + } diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BasicEditor.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BasicEditor.java index 7830f8b194..d81367a82f 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BasicEditor.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BasicEditor.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -80,7 +80,7 @@ public void showSourceLine(ISourceLocation sourceLocation, boolean highlight) { Ajde.getDefault().getIdeUIAdapter().displayStatusInformation(" no corresponding source line to seek to"); } } - + public void showSourceLine(int lineNumber, boolean highlight) { showSourceLine(filePath, lineNumber, highlight); } @@ -95,7 +95,7 @@ public void pasteToCaretPos(String text) { public void showSourceLine(String filePath, int lineNumber, boolean highlight) { //AjdeUIManager.getDefault().getIdeUIAdapter().resetEditor(); - + this.filePath = filePath; // if (oldPath != filePath && !Ajde.INSTANCE.BROWSER_MANAGER.isGlobalMode()) { // Ajde.INSTANCE.BROWSER_MANAGER.updateView(); @@ -121,7 +121,7 @@ public void showSourceLine(String filePath, int lineNumber, boolean highlight) { public void showSourcelineAnnotation(String filePath, int lineNumber, java.util.List items) { } public void addEditorViewForSourceLine(String filePath, int lineNumber) { - + } public void saveContents() throws IOException { diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserMessageHandler.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserMessageHandler.java index 5188f8daf9..2878e84a30 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserMessageHandler.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserMessageHandler.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.ui; diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserRuntimeProperties.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserRuntimeProperties.java index a00c51d0d6..a680da9847 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserRuntimeProperties.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserRuntimeProperties.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.tools.ajbrowser.ui; @@ -21,11 +21,11 @@ public class BrowserRuntimeProperties implements IRuntimeProperties { private UserPreferencesAdapter preferencesAdapter; - + public BrowserRuntimeProperties(UserPreferencesAdapter preferencesAdapter) { this.preferencesAdapter = preferencesAdapter; } - + public String getClassToExecute() { return preferencesAdapter.getProjectPreference(PreferenceStoreConstants.RUNTIME_MAINCLASS); } diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserUIAdapter.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserUIAdapter.java index 2388c33907..a6a993d911 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserUIAdapter.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/BrowserUIAdapter.java @@ -1,17 +1,17 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ - + package org.aspectj.tools.ajbrowser.ui; import org.aspectj.ajde.IdeUIAdapter; @@ -22,7 +22,7 @@ * information in the status bar at the bottom of the AjBrowser GUI. */ public class BrowserUIAdapter implements IdeUIAdapter { - + public void displayStatusInformation(String message) { BrowserManager.getDefault().setStatusInformation(message); } diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/EditorManager.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/EditorManager.java index f58a5c81d4..f004e6e2bd 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/EditorManager.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/EditorManager.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.tools.ajbrowser.ui; @@ -31,7 +31,7 @@ /** * Responsible for controlling the editor. - * + * *

TODO: remove coupling to BasicEditor

* @author Mik Kersten */ diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/BrowserOptionsPanel.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/BrowserOptionsPanel.java index e01c01f12a..fd93bb51ff 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/BrowserOptionsPanel.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/BrowserOptionsPanel.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -25,11 +25,11 @@ /** * Panel the displays both ajc and runtime options - * + * * @author Mik Kersten */ public class BrowserOptionsPanel extends OptionsPanel { - + private static final long serialVersionUID = 4491319302490183151L; private JPanel runOptions_panel = new JPanel(); private JPanel build_panel = new JPanel(); @@ -81,8 +81,8 @@ public void loadOptions() throws IOException { getProjectPreference(PreferenceStoreConstants.RUNTIME_MAINCLASS) ); } - - public void saveOptions() throws IOException { + + public void saveOptions() throws IOException { BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( PreferenceStoreConstants.BUILD_OUTPUTPATH, outputPath_field.getText()); BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( @@ -91,7 +91,7 @@ public void saveOptions() throws IOException { PreferenceStoreConstants.BUILD_CLASSPATH, classpath_field.getText()); BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( PreferenceStoreConstants.RUNTIME_MAINCLASS, classToRun_field.getText()); - } + } private void jbInit() throws Exception { border1 = diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/MessageHandlerPanel.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/MessageHandlerPanel.java index 26ec8f00c6..7c02f6426c 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/MessageHandlerPanel.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/MessageHandlerPanel.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/TopFrame.java b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/TopFrame.java index 5949e2e070..5d9b7cc179 100644 --- a/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/TopFrame.java +++ b/ajbrowser/src/main/java/org/aspectj/tools/ajbrowser/ui/swing/TopFrame.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.tools.ajbrowser.ui.swing; @@ -51,7 +51,7 @@ /** * UI for standalone operation. - * + * * @author Mik Kersten */ public class TopFrame extends JFrame { diff --git a/ajbrowser/src/test/java/org/aspectj/tools/ajbrowser/JemmyDriver.java b/ajbrowser/src/test/java/org/aspectj/tools/ajbrowser/JemmyDriver.java index b993713ca8..48bc0aabe1 100644 --- a/ajbrowser/src/test/java/org/aspectj/tools/ajbrowser/JemmyDriver.java +++ b/ajbrowser/src/test/java/org/aspectj/tools/ajbrowser/JemmyDriver.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -26,17 +26,17 @@ // */ //public class JemmyDriver implements Scenario { // -// public static final String CUT +// public static final String CUT // = "org.aspectj.tools.ajbrowser.Main"; -// public static final String DRIVER +// public static final String DRIVER // = "org.aspectj.tools.ajbrowser.JemmyDriver"; -// +// // // XXX need to fix literal path locations -// public static final String USERDIR +// public static final String USERDIR // = "j:/home/wes/dev/tools/aj/examples"; -// public static final String FILENAME_RELATIVE +// public static final String FILENAME_RELATIVE // = USERDIR + "spacewar/debug.lst"; -// public static final String FILENAME +// public static final String FILENAME // = USERDIR + "/" + FILENAME_RELATIVE; // // public static void main(String[] argv) { @@ -53,7 +53,7 @@ // // grab parameter - pass in .lst file // if (null != param) { // Class c = param.getClass(); -// if (c.isArray() && +// if (c.isArray() && // (String.class == c.getComponentType())) { // args = (String[]) param; // if (0 < args.length) { diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/AjCompiler.java b/ajde.core/src/main/java/org/aspectj/ajde/core/AjCompiler.java index d6231a05f3..d6acebf8f6 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/AjCompiler.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/AjCompiler.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.core; @@ -24,7 +24,7 @@ * The class to be used by tools to drive a build. An AjCompiler is created with a unique id (for example the absolute pathname of a * project or .lst file) along with implementations of ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. Tools * then call build() or buildFresh() on this AjCompiler. - * + * *

* An AjCompiler is associated with one id, therefore a new one needs to be created for a new id (project, .lst file etc.). It is * the responsibility of the tools to manage the lifecycle of the AjCompiler's. @@ -40,7 +40,7 @@ public class AjCompiler { /** * Creates a new AjCompiler for the given id, ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. None of * the arguments can be null. - * + * * @param compilerId - Unique String used to identify this AjCompiler * @param compilerConfig - ICompilerConfiguration implementation * @param buildProgressMonitor - IBuildProgressMonitor implementation @@ -138,10 +138,10 @@ private boolean hasValidId() { /** * Set a CustomMungerFactory to the compiler's weaver - * + * * The type of factory should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, it * is Object for now. - * + * * @param factory */ public void setCustomMungerFactory(Object factory) { @@ -150,7 +150,7 @@ public void setCustomMungerFactory(Object factory) { /** * @return the CustomMungerFactory from the compiler's weaver - * + * * The return type should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, * it is Object for now. */ diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildMessageHandler.java b/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildMessageHandler.java index 064e37c926..da2c7b2759 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildMessageHandler.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildMessageHandler.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.core; @@ -16,13 +16,13 @@ /** * Interface that handles messages sent from the compiler. * Implementations define which messages are logged and whether - * the handler aborts the process. + * the handler aborts the process. */ public interface IBuildMessageHandler { - /** + /** * Handle message by reporting and/or throwing an AbortException. - * + * * @param message the IMessage to handle - never null * @return true if this message was handled by this handler * @throws IllegalArgumentException if message is null @@ -32,25 +32,25 @@ public interface IBuildMessageHandler { /** * Signal whether this will ignore messages of a given type. - * Clients may use this to avoid constructing or sending + * Clients may use this to avoid constructing or sending * certain messages. - * + * * @return true if this handler is ignoring all messages of this type */ boolean isIgnoring(IMessage.Kind kind); /** - * Allow fine grained configuration after initialization. - * + * Allow fine grained configuration after initialization. + * * @param kind */ void dontIgnore(IMessage.Kind kind); - + /** - * Allow fine grained configuration after initialization. - * + * Allow fine grained configuration after initialization. + * * @param kind */ void ignore(IMessage.Kind kind); - + } diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildProgressMonitor.java b/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildProgressMonitor.java index da45fdf208..a4f64acb69 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildProgressMonitor.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/IBuildProgressMonitor.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/ICompilerConfiguration.java b/ajde.core/src/main/java/org/aspectj/ajde/core/ICompilerConfiguration.java index 7cd1148a7a..5c098d5581 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/ICompilerConfiguration.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/ICompilerConfiguration.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/IOutputLocationManager.java b/ajde.core/src/main/java/org/aspectj/ajde/core/IOutputLocationManager.java index 270d470385..913de3d722 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/IOutputLocationManager.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/IOutputLocationManager.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 Contributors.All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: + * Copyright (c) 2006 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 + * + * Contributors: * Adrian Colyer Initial implementation * Helen Hawkins bug 166580 and 148190 * ******************************************************************/ @@ -25,7 +25,7 @@ public interface IOutputLocationManager { * Return the directory root under which the results of compiling the given source file. For example, if the source file * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to * "target/classes/a/b/C.class" - * + * * @param compilationUnit the compilation unit that has been compiled * @return a File object representing the root directory under which compilation results for this unit should be written */ @@ -34,7 +34,7 @@ public interface IOutputLocationManager { /** * For environments where multiple source folders are supported, they need to be included in the model. This method allows * AspectJ to determine which source folder a source file came from. Example return values would be "src" or "main/java" - * + * * @param sourceFile the File object for the source file * @return the source folder where this file came from, or null if in project root or source folders not supported. */ @@ -43,7 +43,7 @@ public interface IOutputLocationManager { /** * When copying resources from source folders to output location, return the root directory under which the resource should be * copied. - * + * * @param resource the resource to be copied * @return a File object representing the root directory under which this resource should be copied */ @@ -63,7 +63,7 @@ public interface IOutputLocationManager { /** * Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also * supplied. - * + * * @param outputfile the file that has been written * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type */ @@ -77,7 +77,7 @@ public interface IOutputLocationManager { /** * Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also * supplied. - * + * * @param file the file that has been written * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type */ diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/JavaOptions.java b/ajde.core/src/main/java/org/aspectj/ajde/core/JavaOptions.java index cab96198bd..8ebaa664da 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/JavaOptions.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/JavaOptions.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.core; @@ -19,7 +19,7 @@ * Class containing the current custom java options */ public final class JavaOptions { - + public static final String COMPLIANCE_LEVEL = CompilerOptions.OPTION_Compliance; public static final String SOURCE_COMPATIBILITY_LEVEL = CompilerOptions.OPTION_Source; public static final String TARGET_COMPATIBILITY_LEVEL = CompilerOptions.OPTION_TargetPlatform; @@ -28,46 +28,46 @@ public final class JavaOptions { public static final String VERSION_14 = CompilerOptions.VERSION_1_4; public static final String VERSION_15 = CompilerOptions.VERSION_1_5; public static final String VERSION_16 = CompilerOptions.VERSION_1_6; - - // by default will use the platform default encoding + + // by default will use the platform default encoding public static final String CHARACTER_ENCODING = CompilerOptions.OPTION_Encoding; - + // indicates if unused/optimizable local variables need to be preserved (debugging purpose) public static final String PRESERVE_ALL_LOCALS = CompilerOptions.OPTION_PreserveUnusedLocal; public static final String PRESERVE = CompilerOptions.PRESERVE; public static final String OPTIMIZE = CompilerOptions.OPTIMIZE_OUT; - + // Warning constants public static final String WARN_METHOD_WITH_CONSTRUCTOR_NAME = CompilerOptions.OPTION_ReportMethodWithConstructorName; - public static final String WARN_OVERRIDING_PACKAGE_DEFAULT_METHOD = CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod; - public static final String WARN_DEPRECATION = CompilerOptions.OPTION_ReportDeprecation; - public static final String WARN_HIDDEN_CATCH_BLOCKS = CompilerOptions.OPTION_ReportHiddenCatchBlock; - public static final String WARN_UNUSED_LOCALS = CompilerOptions.OPTION_ReportUnusedLocal; - public static final String WARN_UNUSED_PARAMETER = CompilerOptions.OPTION_ReportUnusedParameter; - public static final String WARN_UNUSED_IMPORTS = CompilerOptions.OPTION_ReportUnusedImport; - public static final String WARN_SYNTHETIC_ACCESS = CompilerOptions.OPTION_ReportSyntheticAccessEmulation; - public static final String WARN_ASSERT_IDENITIFIER = CompilerOptions.OPTION_ReportAssertIdentifier; + public static final String WARN_OVERRIDING_PACKAGE_DEFAULT_METHOD = CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod; + public static final String WARN_DEPRECATION = CompilerOptions.OPTION_ReportDeprecation; + public static final String WARN_HIDDEN_CATCH_BLOCKS = CompilerOptions.OPTION_ReportHiddenCatchBlock; + public static final String WARN_UNUSED_LOCALS = CompilerOptions.OPTION_ReportUnusedLocal; + public static final String WARN_UNUSED_PARAMETER = CompilerOptions.OPTION_ReportUnusedParameter; + public static final String WARN_UNUSED_IMPORTS = CompilerOptions.OPTION_ReportUnusedImport; + public static final String WARN_SYNTHETIC_ACCESS = CompilerOptions.OPTION_ReportSyntheticAccessEmulation; + public static final String WARN_ASSERT_IDENITIFIER = CompilerOptions.OPTION_ReportAssertIdentifier; public static final String WARN_NON_NLS = CompilerOptions.OPTION_ReportNonExternalizedStringLiteral; // warning option constants public static final String IGNORE = CompilerOptions.IGNORE; public static final String WARNING = CompilerOptions.WARNING; - - // Debug constants + + // Debug constants public static final String DEBUG_SOURCE = CompilerOptions.OPTION_SourceFileAttribute; public static final String DEBUG_LINES = CompilerOptions.OPTION_LocalVariableAttribute; public static final String DEBUG_VARS = CompilerOptions.OPTION_LineNumberAttribute; // Debug option constants public static final String GENERATE = CompilerOptions.GENERATE; public static final String DO_NOT_GENERATE = CompilerOptions.DO_NOT_GENERATE; - + private static Map defaultOptionsMap; - + /** * @return the java options map with the default settings */ public static Map getDefaultJavaOptions() { if (defaultOptionsMap != null) return defaultOptionsMap; - + defaultOptionsMap = new HashMap<>(); defaultOptionsMap.put(COMPLIANCE_LEVEL, VERSION_14); defaultOptionsMap.put(SOURCE_COMPATIBILITY_LEVEL, VERSION_13); @@ -85,10 +85,10 @@ public static Map getDefaultJavaOptions() { defaultOptionsMap.put(DEBUG_SOURCE, GENERATE); defaultOptionsMap.put(DEBUG_LINES, GENERATE); defaultOptionsMap.put(DEBUG_VARS, DO_NOT_GENERATE); - + return defaultOptionsMap; } - + /** * @return true if the given value is a valid JVM version * (JavaOptions.VERSION_13, JavaOptions.VERSION_134, JavaOptions.VERSION_15, @@ -100,23 +100,23 @@ public static boolean isValidJvmVersion(String value) { } /** - * @return true if the given option is JavaOptions.PRESERVE or + * @return true if the given option is JavaOptions.PRESERVE or * JavaOptions.OPTIMIZE and false otherwise */ public static boolean isValidPreserveAllLocalsOption(String option) { return PRESERVE.equals(option) || OPTIMIZE.equals(option); } - + /** - * @return true if the given option is JavaOptions.IGNORE or + * @return true if the given option is JavaOptions.IGNORE or * JavaOptions.WARNING and false otherwise */ public static boolean isIgnoreOrWarning(String option) { return IGNORE.equals(option) || WARNING.equals(option); } - + /** - * @return true if the given option is JavaOptions.GENERATE or + * @return true if the given option is JavaOptions.GENERATE or * JavaOptions.DO_NOT_GENERATE and false otherwise */ public static boolean isGenerateOrNot(String option) { diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java index e9f3a1b863..d98f264628 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildManager.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildNotifierAdapter.java b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildNotifierAdapter.java index 9cc5ecfc90..eac68bc326 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildNotifierAdapter.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreBuildNotifierAdapter.java @@ -1,14 +1,14 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins converted to new interface (pr148190) + * Helen Hawkins converted to new interface (pr148190) * ******************************************************************/ @@ -18,8 +18,8 @@ import org.aspectj.bridge.IProgressListener; /** - * Enables the compiler/weaver progres to be related to the user via the - * IBuildProgressMonitor as well as relating whether or not the user has + * Enables the compiler/weaver progres to be related to the user via the + * IBuildProgressMonitor as well as relating whether or not the user has * cancelled the build progress back to the compiler/weaver. */ public class AjdeCoreBuildNotifierAdapter implements IProgressListener { diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreMessageHandlerAdapter.java b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreMessageHandlerAdapter.java index 8cb53e0472..0d2b0ff6b8 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreMessageHandlerAdapter.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/AjdeCoreMessageHandlerAdapter.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.core.internal; @@ -23,11 +23,11 @@ public class AjdeCoreMessageHandlerAdapter implements IMessageHandler { private IBuildMessageHandler handler; - + public AjdeCoreMessageHandlerAdapter(IBuildMessageHandler messageHandler) { this.handler = messageHandler; } - + public void dontIgnore(Kind kind) { handler.dontIgnore(kind); } diff --git a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/OutputLocationAdapter.java b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/OutputLocationAdapter.java index 7fe6a9cb17..51ec3f667a 100644 --- a/ajde.core/src/main/java/org/aspectj/ajde/core/internal/OutputLocationAdapter.java +++ b/ajde.core/src/main/java/org/aspectj/ajde/core/internal/OutputLocationAdapter.java @@ -1,14 +1,14 @@ /******************************************************************** - * Copyright (c) 2006 Contributors.All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: + * Copyright (c) 2006 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 + * + * Contributors: * Adrian Colyer Initial implementation * Helen Hawkins converted to new interface (bug 148190) - * + * *******************************************************************/ package org.aspectj.ajde.core.internal; @@ -64,7 +64,7 @@ public int discoverChangesSince(File dir, long buildtime) { /** * Return a map from fully qualified jar/dir entries to handle components. - * + * * @return a map from inpath entries (jars/dirs) to handle components. */ public Map getInpathMap() { diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreModuleTests.java b/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreModuleTests.java index 45d70a8459..178a8fe0a4 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreModuleTests.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreModuleTests.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreTestCase.java b/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreTestCase.java index 2d17fc41e5..cbf2246d31 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreTestCase.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/AjdeCoreTestCase.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.ajde.core; diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/TestBuildProgressMonitor.java b/ajde.core/src/test/java/org/aspectj/ajde/core/TestBuildProgressMonitor.java index e25632cf90..b1488fd015 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/TestBuildProgressMonitor.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/TestBuildProgressMonitor.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java b/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java index 0376836c14..2cee23cc61 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/TestCompilerConfiguration.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/TestMessageHandler.java b/ajde.core/src/test/java/org/aspectj/ajde/core/TestMessageHandler.java index 8b707d1b7b..d74fac8e9a 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/TestMessageHandler.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/TestMessageHandler.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/TestOutputLocationManager.java b/ajde.core/src/test/java/org/aspectj/ajde/core/TestOutputLocationManager.java index 6313dd4a23..8aff91042b 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/TestOutputLocationManager.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/TestOutputLocationManager.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.ajde.core; diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/AjConfigTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/AjConfigTest.java index b32ea26233..e9acb3ae86 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/AjConfigTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/AjConfigTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.ajde.core.tests; diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/BuildCancellingTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/BuildCancellingTest.java index 75c37df848..7469cd2268 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/BuildCancellingTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/BuildCancellingTest.java @@ -1,12 +1,12 @@ /******************************************************************** * Copyright (c) 2004 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement Initial version * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -21,21 +21,21 @@ * weaving phases - this testcase verifies a few cases, making sure the process * stops when expected. It can check the disk contents, but it doesn't right * now. - * + * * Two different .lst files are used during these tests: LoadsaCode.lst and * EvenMoreCode.lst which contain mixes of aspects and classes - * + * * Here are some things to think about that will help you understand what is on * the disk when we cancel the compiler. - * + * * There are 3 important phases worth remembering : - Compile all the types - * Weave all the aspects - Weave all the classes - * + * * Each of those steps goes through all the types. This means during the 'weave * all the aspects' step we are jumping over classes and during the 'weave all * the classes ' step we are jumping over aspects. Why is this important? - * - * + * + * * We only write bytes out during the 'weave all the classes ' phase and it is * even during that phase that we write out the bytes for aspects. This means if * you cancel during compilation or during the weaving of aspects - there will @@ -204,10 +204,10 @@ public void testCancelThirdAspectWeave() { * After first weave class message, get it to cancel, there should be one * more warning message about cancelling the weave and their should be * nothing on the disk. - * + * * EvenMoreCode.lst contains: A1.aj Cl1.java A2.aj Cl2.java HW.java A3.aj * Cl3.java A4.aj - * + * */ public void testCancelFirstClassWeave() { if (debugTests) @@ -238,10 +238,10 @@ public void testCancelFirstClassWeave() { * After first weave aspect message, get it to cancel, there should be one * more warning message about cancelling the weave and their should be * nothing on the disk. - * + * * EvenMoreCode.lst contains: A1.aj Cl1.java A2.aj Cl2.java HW.java A3.aj * Cl3.java A4.aj - * + * */ public void testCancelSecondClassWeave() { if (debugTests) diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/CompilerMessagesTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/CompilerMessagesTest.java index 0284b3d101..e7846430ef 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/CompilerMessagesTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/CompilerMessagesTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * AMC 2003 initial version * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -28,7 +28,7 @@ public class CompilerMessagesTest extends AjdeCoreTestCase { private TestCompilerConfiguration compilerConfig; private String[] files = { "apackage" + File.separator + "InitCatcher.java", "apackage" + File.separator + "SomeClass.java" }; - + protected void setUp() throws Exception { super.setUp(); initialiseProject("declare-warning"); @@ -43,7 +43,7 @@ protected void tearDown() throws Exception { handler = null; compilerConfig = null; } - + public void testMessages() { // bug 33474 // The build has happened, what messages did the compiler give, and do they @@ -53,7 +53,7 @@ public void testMessages() { assertTrue("not two messages: " + msgs, false); } assertEquals("Two warning messages should be produced",2,msgs.size()); - TestMessageHandler.TestMessage msg = + TestMessageHandler.TestMessage msg = (TestMessageHandler.TestMessage) msgs.get(0); assertEquals( 8, msg.getContainedMessage().getSourceLocation().getLine()); assertEquals( "Please don't call init methods", msg.getContainedMessage().getMessage()); @@ -62,13 +62,13 @@ public void testMessages() { // this name has a tester specific prefix, followed by the location of the file. // we can validate the ending. fullyQualifiedFile = fullyQualifiedFile.replace('\\','/'); // ignore platform differences in slashes - assertTrue( "Fully-qualified source file location returned", + assertTrue( "Fully-qualified source file location returned", fullyQualifiedFile.endsWith("/declare-warning/apackage/SomeClass.java")); } catch (IOException ex) { assertTrue( "Unable to convert source file location: " + msg.getContainedMessage().getSourceLocation().getSourceFile(), false); } } - + public void testDeclareMessageContents() { List msgs = handler.getMessages(); IMessage msg = ((TestMessageHandler.TestMessage)msgs.get(1)).getContainedMessage(); diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/DuplicateManifestTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/DuplicateManifestTest.java index c438715b7b..019f9ae82f 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/DuplicateManifestTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/DuplicateManifestTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * 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 - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Matthew Webster - initial implementation * Helen Hawkins - Converted to new interface (bug 148190) diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/InpathTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/InpathTest.java index ee54cef969..8e32116a0a 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/InpathTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/InpathTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Mik Kersten initial implementation - * Andy Clement Copied/changed for -inpath testing + * Andy Clement Copied/changed for -inpath testing * Helen Hawkins Changed to use new ajde interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.core.tests; @@ -67,7 +67,7 @@ protected void tearDown() throws Exception { /** * Inputs to the compiler: inpath = 'indir1/' source = 'src' output = a jar file - * + * * Expected result = output jar file contains contents of indir1 and class file for source that was in src */ public void testInpathToOutjar() { @@ -97,7 +97,7 @@ public void testInpathToOutjar() { /** * Similar to the first test but outputs to a directory rather than a jar. - * + * */ public void testInpathToBin() { Set inpath = new HashSet<>(); @@ -126,10 +126,10 @@ public void testInpathToBin() { /** * Inputs to the compiler: inpath is 'indir2' that contains a helloworld source file and class file. source is 'src2' which * contains Aspect.java which weaves before advice into the HelloWorld code from 'indir2' - * + * * Expected result: HelloWorld copied through to output jar and 'weaved'. Compiled version of Aspect.java put into the output * jar. The HelloWorld.java source file is also copied through to the output jar. - * + * * An extra check is done at the end of this test to verify that HelloWorld has changed size (due to the weaving). */ public void testInpathToOutjar2() { @@ -174,11 +174,11 @@ public void testInpathToOutjar2() { /** * More complex inpath - a jar and a directory - * + * * Inputs: -inpath injar.jar;indir2 source is 'src2' which contains Aspect.java - * + * * Expected result: Result should be a directory containing the contents of injar.jar and indir2 and the Aspect.class file. - * + * */ public void testInpathAndInjarToBin() { Set inpath = new HashSet<>(); diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/JarManifestTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/JarManifestTest.java index 242c3e3f35..757d33a7cd 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/JarManifestTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/JarManifestTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * 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 - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * IBM Corporation - initial API and implementation * Helen Hawkins - Converted to new interface (bug 148190) @@ -27,7 +27,7 @@ public class JarManifestTest extends AjdeCoreTestCase { private String[] weave = { "src" + File.separator + "Main.java", "src" + File.separator + "Logging.aj" }; - + private TestMessageHandler handler; private TestCompilerConfiguration compilerConfig; @@ -44,7 +44,7 @@ protected void tearDown() throws Exception { handler = null; compilerConfig = null; } - + public void testWeave () { File outjar = openFile(outjarName); compilerConfig.setOutjar(outjar.getAbsolutePath()); @@ -54,7 +54,7 @@ public void testWeave () { + handler.getMessages(), handler.getMessages().isEmpty()); checkManifest(outjar); } - + public void testNoWeave () { File outjar = openFile(outjarName); compilerConfig.setOutjar(outjar.getAbsolutePath()); @@ -65,7 +65,7 @@ public void testNoWeave () { + handler.getMessages(), handler.getMessages().isEmpty()); checkManifest(outjar); } - + private void checkManifest (File outjarFile) { Manifest manifest = null; diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/OutxmlTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/OutxmlTest.java index 64417e84cf..f807e79e12 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/OutxmlTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/OutxmlTest.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2003 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Matthew Webster initial implementation diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ResourceCopyTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ResourceCopyTest.java index 3176f1e31e..9d97fd81e5 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ResourceCopyTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ResourceCopyTest.java @@ -1,12 +1,12 @@ /******************************************************************** - * Copyright (c) 2003 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * Copyright (c) 2003 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 + * + * Contributors: + * Mik Kersten initial implementation * Helen Hawkins Converted to new interface (bug 148190) *******************************************************************/ package org.aspectj.ajde.core.tests; @@ -283,7 +283,7 @@ public void compareInjarsToBin(File injarFile, String indirName, String outdirNa /** * Look in the specified jar file for resources (anything not .class) and add it the resources Set. - * + * * @param injarFile jar file to open up * @param resources the set where resources should be accumulated * @param wantDirectories should any directories found in the jar be included diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ReweavableTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ReweavableTest.java index c29f4ba212..fc5afe5b03 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ReweavableTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ReweavableTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement Initial version * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -55,9 +55,9 @@ protected void tearDown() throws Exception { /** * Aim: Check we haven't damaged 'normal compilation' when not supplying -Xreweavable. Also determines baseline sizes for the * compiled class files for later comparison. - * + * * Inputs to the compiler: NonReweavable1.lst -> CalculatePI.java -> Logger.aj -> -verbose -> -noExit - * + * * Expected result = Compile successful, the types will not be reweavable and the weaver should not report it is running in * reweavable mode. */ @@ -90,9 +90,9 @@ public void testNonReweavableCompile() { /** * Aim: Basic call to -Xreweavable. Weaver should report it is in reweavable mode and the classes produced should be much larger * than normal classes (those produced in the first test). - * + * * Inputs to the compiler: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit - * + * * Expected result = Compile successful, the types will be reweavable and the weaver should report it is running in reweavable * mode. The files produced should be larger than those created during the last test. */ @@ -137,10 +137,10 @@ public void testReweavableCompile() { * Aim: Use the optional ':compress' modifier on -Xreweavable. This causes some of the meta-data for use in reweaving to be * compressed. It should succeed and produce class files smaller than straight -Xreweavable but larger than without specifying * -Xreweavable. - * + * * Inputs to the compiler: ReweavableCompress1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable:compress -> -verbose -> * -noExit - * + * * Expected result = Compile successful, the types will be reweavable and the weaver should report it is running in reweavable * mode. The files created should have a size between the non-reweavable versions and the reweavable (without compression) * versions. @@ -200,11 +200,11 @@ public void testReweavableCompressCompile() { * Aim: The tests above have determined that reweaving appears to be behaving in terms of the .class files it is creating. Now * lets actually attempt a reweave. For this, we build two files as reweavable and then build a single file whilst specifying an * inpath that contains the .class files from the first compile. This should succeed. - * + * * Inputs to the first compile: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit - * + * * Input to the second compile: Reweavable2.lst -> SecondAspect.aj -> -Xreweavable -> -verbose -> -noExit -inpath bin\. - * + * * Expected result = Both compiles will succeed. */ public void testReweavableSimpleCompile() { @@ -247,11 +247,11 @@ public void testReweavableSimpleCompile() { /** * Aim: Based on the test above, if we delete Logger.class between the first and second compiles the second compile should fail * because there is not enough information to reweave CalculatePI - * + * * Inputs to the first compile: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit - * + * * Input to the second compile: Reweavable2.lst -> SecondAspect.aj -> -Xreweavable -> -verbose -> -noExit -inpath bin\. - * + * * Expected result = Second compile will fail - reporting that Logger is missing (it 'touched' in the first compile CalculatePI) */ public void testForReweavableSimpleErrorCompile() { @@ -296,11 +296,11 @@ public void testForReweavableSimpleErrorCompile() { /** * Aim: Based on the test above, if we delete Logger.class between the first and second compiles the second compile should fail * because there is not enough information to reweave CalculatePI - * + * * Inputs to the first compile: TJP1.lst -> tjp/Demo.java -> tjp/GetInfo.java -> -Xreweavable -> -verbose -> -noExit - * + * * Now, delete bin\tjp\GetInfo.class and do a compile with: TJP2.lst -> -Xreweavable -> -verbose -> -noExit -inpath bin\. - * + * * Expected result = Second compile will fail - reporting that tjp.GetInfo is missing (it 'touched' in the first compile * tjp.Demo) */ diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ShowWeaveMessagesTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ShowWeaveMessagesTest.java index 1c8aa71085..543f70e2d8 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ShowWeaveMessagesTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/ShowWeaveMessagesTest.java @@ -2,9 +2,9 @@ * Copyright (c) 2004 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Andy Clement Initial version diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmDeclarationsTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmDeclarationsTest.java index 6112e67a3a..319abf0c39 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmDeclarationsTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmDeclarationsTest.java @@ -2,9 +2,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * ******************************************************************/ package org.aspectj.ajde.core.tests.model; diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmRelationshipsTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmRelationshipsTest.java index 093de8cb77..2862f19c64 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmRelationshipsTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/AsmRelationshipsTest.java @@ -2,9 +2,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * ******************************************************************/ diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTest.java index 6430cead1d..27f9058ae6 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/SavedModelConsistencyTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.core.tests.model; diff --git a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/StructureModelTest.java b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/StructureModelTest.java index 6f06a1aa0b..1af2b46b44 100644 --- a/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/StructureModelTest.java +++ b/ajde.core/src/test/java/org/aspectj/ajde/core/tests/model/StructureModelTest.java @@ -2,9 +2,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/ajsrc/org/aspectj/ajde/AjdeApiRules.aj b/ajde/ajsrc/org/aspectj/ajde/AjdeApiRules.aj index cc03e1f331..1dab27e794 100644 --- a/ajde/ajsrc/org/aspectj/ajde/AjdeApiRules.aj +++ b/ajde/ajsrc/org/aspectj/ajde/AjdeApiRules.aj @@ -1,24 +1,23 @@ -/* ******************************************************************* - * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), - * 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * AMC 01.20.2003 extended to support new AspectJ 1.1 options, - * bugzilla #29769 - * ******************************************************************/ - -public aspect AjdeApiRules { - - - declare warning: - call(* javax.swing..*(..)) && !within(org.aspectj.ajde.ui.swing..*): - "do not use Swing outside of org.aspectj.ajde.swing"; - -} - \ No newline at end of file +/* ******************************************************************* + * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), + * 2003 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 + * + * Contributors: + * Xerox/PARC initial implementation + * AMC 01.20.2003 extended to support new AspectJ 1.1 options, + * bugzilla #29769 + * ******************************************************************/ + +public aspect AjdeApiRules { + + + declare warning: + call(* javax.swing..*(..)) && !within(org.aspectj.ajde.ui.swing..*): + "do not use Swing outside of org.aspectj.ajde.swing"; + +} diff --git a/ajde/src/main/java/org/aspectj/ajde/Ajde.java b/ajde/src/main/java/org/aspectj/ajde/Ajde.java index 1446e8278a..3eef4fd066 100644 --- a/ajde/src/main/java/org/aspectj/ajde/Ajde.java +++ b/ajde/src/main/java/org/aspectj/ajde/Ajde.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) *******************************************************************/ package org.aspectj.ajde; @@ -46,9 +46,9 @@ * Singleton class used to initialize the Ajde ui as well as the properties required to run the compiler. Users must call * "Ajde.init(...)" before doing anything else. There are getter methods for the various properties that are set in the * initialization. - * + * * This also defines the factory for getting new AjCompiler instances. - * + * * @author Mik Kersten * @author Andy Clement */ @@ -159,7 +159,7 @@ public void configsListUpdated(List configsList) { /** * Utility to run the project main class from the project properties in the same VM using a class loader populated with the * classpath and output path or jar. Errors are logged to the ErrorHandler. - * + * * @return Thread running with process, or null if unable to start */ public Thread runInSameVM() { @@ -184,7 +184,7 @@ public void run() { /** * Utility to run the project main class from the project properties in a new VM. Errors are logged to the ErrorHandler. - * + * * @return LangUtil.ProcessController running with process, or null if unable to start */ public LangUtil.ProcessController runInNewVM() { @@ -286,7 +286,7 @@ private void showWarningMessage(String message) { /** * Set the build off in the same thread - * + * * @param configFile * @param buildFresh - true if want to do a full build, false otherwise */ @@ -304,7 +304,7 @@ public void runBuildInSameThread(String configFile, boolean buildFresh) { /** * Set the build off in a different thread. Would need to set the build off in a different thread if using a swing application * to display the build progress. - * + * * @param configFile * @param buildFresh - true if want to do a full build, false otherwise */ @@ -447,7 +447,7 @@ public IBuildProgressMonitor getBuildProgressMonitor() { /** * If the provided configFile is the same as the id for the last compiler then returns that, otherwise clears the state for the * saved compiler and creates a new one for the provided configFile - * + * * @param configFile * @return the AjCompiler with the id of the given configFile */ diff --git a/ajde/src/main/java/org/aspectj/ajde/EditorAdapter.java b/ajde/src/main/java/org/aspectj/ajde/EditorAdapter.java index 9e51cf8aff..8200ccb5fc 100644 --- a/ajde/src/main/java/org/aspectj/ajde/EditorAdapter.java +++ b/ajde/src/main/java/org/aspectj/ajde/EditorAdapter.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/EditorListener.java b/ajde/src/main/java/org/aspectj/ajde/EditorListener.java index 6c7c087b70..8f3522c412 100644 --- a/ajde/src/main/java/org/aspectj/ajde/EditorListener.java +++ b/ajde/src/main/java/org/aspectj/ajde/EditorListener.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/IRuntimeProperties.java b/ajde/src/main/java/org/aspectj/ajde/IRuntimeProperties.java index 2a4f20ba2e..a51fce0aaf 100644 --- a/ajde/src/main/java/org/aspectj/ajde/IRuntimeProperties.java +++ b/ajde/src/main/java/org/aspectj/ajde/IRuntimeProperties.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde/src/main/java/org/aspectj/ajde/IUIBuildMessageHandler.java b/ajde/src/main/java/org/aspectj/ajde/IUIBuildMessageHandler.java index 243a6947e0..2ec881c922 100644 --- a/ajde/src/main/java/org/aspectj/ajde/IUIBuildMessageHandler.java +++ b/ajde/src/main/java/org/aspectj/ajde/IUIBuildMessageHandler.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java b/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java index 8169f2735f..b36378b22f 100644 --- a/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java +++ b/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -33,7 +33,7 @@ public class IconRegistry extends AbstractIconRegistry { //public static IconRegistry INSTANCE = null; protected String RESOURCE_PATH = "org/aspectj/ajde/resources/"; - + private final Icon START_AJDE = makeIcon("actions/startAjde.gif"); private final Icon STOP_AJDE = makeIcon("actions/stopAjde.gif"); private final Icon BUILD = makeIcon("actions/build.gif"); @@ -41,28 +41,28 @@ public class IconRegistry extends AbstractIconRegistry { private final Icon EXECUTE = makeIcon("actions/execute.gif"); private final Icon AJBROWSER = makeIcon("structure/advice.gif"); private final Icon AJBROWSER_ENABLED = makeIcon("actions/browserEnabled.gif"); - private final Icon AJBROWSER_DISABLED = makeIcon("actions/browserDisabled.gif"); - private final Icon STRUCTURE_VIEW = makeIcon("actions/structureView.gif"); + private final Icon AJBROWSER_DISABLED = makeIcon("actions/browserDisabled.gif"); + private final Icon STRUCTURE_VIEW = makeIcon("actions/structureView.gif"); - private final Icon HIDE_ASSOCIATIONS = makeIcon("actions/hideAssociations.gif"); - private final Icon HIDE_NON_AJ = makeIcon("actions/hideNonAJ.gif"); - private final Icon GRANULARITY = makeIcon("actions/granularity.gif"); - private final Icon AJDE_SMALL = makeIcon("actions/ajdeSmall.gif"); + private final Icon HIDE_ASSOCIATIONS = makeIcon("actions/hideAssociations.gif"); + private final Icon HIDE_NON_AJ = makeIcon("actions/hideNonAJ.gif"); + private final Icon GRANULARITY = makeIcon("actions/granularity.gif"); + private final Icon AJDE_SMALL = makeIcon("actions/ajdeSmall.gif"); private final Icon ERROR = makeIcon("structure/error.gif"); private final Icon WARNING = makeIcon("structure/warning.gif"); - private final Icon INFO = makeIcon("structure/info.gif"); + private final Icon INFO = makeIcon("structure/info.gif"); private final Icon POPUP = makeIcon("actions/popup.gif"); private final Icon FILTER = makeIcon("actions/filter.gif"); private final Icon RELATIONS = makeIcon("actions/relations.gif"); private final Icon ORDER = makeIcon("actions/order.gif"); - + private final Icon ZOOM_STRUCTURE_TO_FILE_MODE = makeIcon("actions/zoomStructureToFileMode.gif"); private final Icon ZOOM_STRUCTURE_TO_GLOBAL_MODE = makeIcon("actions/zoomStructureToGlobalMode.gif"); private final Icon SPLIT_STRUCTURE_VIEW = makeIcon("actions/splitStructureView.gif"); private final Icon MERGE_STRUCTURE_VIEW = makeIcon("actions/mergeStructureView.gif"); - + private final Icon BACK = makeIcon("actions/back.gif"); private final Icon FORWARD = makeIcon("actions/forward.gif"); private final Icon SEARCH = makeIcon("actions/search.gif"); @@ -71,7 +71,7 @@ public class IconRegistry extends AbstractIconRegistry { private final Icon SAVE = makeIcon("actions/save.gif"); private final Icon SAVE_ALL = makeIcon("actions/saveAll.gif"); private final Icon BROWSER_OPTIONS = makeIcon("actions/browseroptions.gif"); - + private final Icon ACCESSIBILITY_PUBLIC = makeIcon("structure/accessibility-public.gif"); private final Icon ACCESSIBILITY_PACKAGE = makeIcon("structure/accessibility-package.gif"); private final Icon ACCESSIBILITY_PROTECTED = makeIcon("structure/accessibility-protected.gif"); @@ -113,17 +113,17 @@ public class IconRegistry extends AbstractIconRegistry { public Icon getStructureViewIcon() { return STRUCTURE_VIEW; } public Icon getAssociationSwingIcon(IRelationship.Kind relation) { - return convertToSwingIcon(getIcon(relation)); + return convertToSwingIcon(getIcon(relation)); } - + public AbstractIcon getStructureIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { - return getIcon(kind); + return getIcon(kind); } - - public Icon getStructureSwingIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { - return convertToSwingIcon(getStructureIcon(kind, accessibility)); + + public Icon getStructureSwingIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { + return convertToSwingIcon(getStructureIcon(kind, accessibility)); } - + public Icon getStructureSwingIcon(IProgramElement.Kind kind) { return convertToSwingIcon(getIcon(kind)); } @@ -149,7 +149,7 @@ public Icon convertToSwingIcon(AbstractIcon iconAdapter) { return (Icon)iconAdapter.getIconResource(); } else { return null; - } + } } protected AbstractIcon createIcon(String path) { @@ -157,8 +157,8 @@ protected AbstractIcon createIcon(String path) { if (resource == null) { throw new IllegalStateException("Unable to find icon resource: "+path); } - return new AbstractIcon(new ImageIcon(resource)); -// return new AbstractIcon(new ImageIcon(ClassLoader.getSystemResource(path))); + return new AbstractIcon(new ImageIcon(resource)); +// return new AbstractIcon(new ImageIcon(ClassLoader.getSystemResource(path))); } protected Icon makeIcon(String iconPath) { diff --git a/ajde/src/main/java/org/aspectj/ajde/IdeUIAdapter.java b/ajde/src/main/java/org/aspectj/ajde/IdeUIAdapter.java index 09f9865402..bb74daa967 100644 --- a/ajde/src/main/java/org/aspectj/ajde/IdeUIAdapter.java +++ b/ajde/src/main/java/org/aspectj/ajde/IdeUIAdapter.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigListener.java b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigListener.java index 9fd974e327..a0fa478335 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigListener.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigListener.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java index 310662335f..293bedb43f 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java index 9f0d1c818a..88b7bec47a 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileParser.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajde.internal; diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java index ece904adf8..8e409b4d95 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java index 2837de76b2..5a90fe77b4 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/StructureUtilities.java b/ajde/src/main/java/org/aspectj/ajde/internal/StructureUtilities.java index 6e84a99c54..6d75e4b31e 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/StructureUtilities.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/StructureUtilities.java @@ -1,17 +1,17 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ - + package org.aspectj.ajde.internal; //import org.aspectj.ajde.compiler.AjdeCompiler; @@ -56,7 +56,7 @@ public class StructureUtilities { */ // public static void dumpStructure(StructureNode node, String indent) { // if (node == null) return; -// Syste.println(indent + node); +// Syste.println(indent + node); // if (node.getChildren() != null) { // for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) { // dumpStructure((StructureNode)it.next(), indent + " "); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIcon.java b/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIcon.java index c9485c8855..4338f188c1 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIcon.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIcon.java @@ -1,31 +1,31 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ - + package org.aspectj.ajde.ui; /** * @author Mik Kersten */ public class AbstractIcon { - + private Object iconResource; - + public AbstractIcon(Object iconResource) { - this.iconResource = iconResource; - } + this.iconResource = iconResource; + } public Object getIconResource() { - return iconResource; + return iconResource; } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java b/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java index a81485ca79..ba757a88f9 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -19,11 +19,11 @@ /** * Uses the factory pattern. - * + * * @author Mik Kersten */ public abstract class AbstractIconRegistry { - + protected final String RESOURCE_PATH = "org/aspectj/ajde/resources/"; protected final String STRUCTURE_PATH = RESOURCE_PATH + "structure/"; @@ -41,12 +41,12 @@ public abstract class AbstractIconRegistry { protected final AbstractIcon DECLARE_SOFT = createIcon(STRUCTURE_PATH + "declareSoft.gif"); protected final AbstractIcon CODE = createIcon(STRUCTURE_PATH + "code.gif"); protected final AbstractIcon ERROR = createIcon(STRUCTURE_PATH + "error.gif"); - + protected final AbstractIcon FILE = createIcon(STRUCTURE_PATH + "file.gif"); protected final AbstractIcon FILE_JAVA = createIcon(STRUCTURE_PATH + "file-java.gif"); protected final AbstractIcon FILE_ASPECTJ = createIcon(STRUCTURE_PATH + "file-aspectj.gif"); protected final AbstractIcon FILE_LST = createIcon(STRUCTURE_PATH + "file-lst.gif"); - + protected final AbstractIcon METHOD = createIcon(STRUCTURE_PATH + "method.gif"); protected final AbstractIcon FIELD = createIcon(STRUCTURE_PATH + "field.gif"); protected final AbstractIcon ENUM_VALUE = createIcon(STRUCTURE_PATH + "field.gif"); // ??? should be enum value icon @@ -78,13 +78,13 @@ public AbstractIcon getIcon(IRelationship.Kind relationship) { * @return null if the kind could not be resolved */ protected abstract AbstractIcon getStructureIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility); - + /** * Assumes "public" visibility for the icon. - * + * * @return null if the kind could not be resolved */ - public AbstractIcon getIcon(IProgramElement.Kind kind) { + public AbstractIcon getIcon(IProgramElement.Kind kind) { if (kind == IProgramElement.Kind.PROJECT) { return PROJECT; } else if (kind == IProgramElement.Kind.PACKAGE) { @@ -148,10 +148,10 @@ public AbstractIcon getIcon(IProgramElement.Kind kind) { return null; } } - + /** * Implement to create platform-specific icons. - */ + */ protected abstract AbstractIcon createIcon(String path); } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigEditor.java b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigEditor.java index 8e7d26e58d..8f485b9b64 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigEditor.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigEditor.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java index 659ada21d0..31b64fb2ad 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java index 06749bf234..ce3434cb92 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigNode.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajde.ui; @@ -24,7 +24,7 @@ /** * @author Mik Kersten - * + * * TODO: clean-up after merging of org.aspectj.asm.StructureNode */ public class BuildConfigNode { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/FileStructureView.java b/ajde/src/main/java/org/aspectj/ajde/ui/FileStructureView.java index 6e51075499..291118784a 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/FileStructureView.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/FileStructureView.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -18,16 +18,16 @@ /** * Should only be created by the {@link StructureViewManager} or an * equivalent factory. - * + * * @author Mik Kersten */ public class FileStructureView extends StructureView { - + private String sourceFilePath = null; - + public FileStructureView(StructureViewProperties viewProperties) { - super.viewProperties = viewProperties; - } + super.viewProperties = viewProperties; + } public String getSourceFile() { return sourceFilePath; } @@ -40,9 +40,9 @@ public void setRootNode(IStructureViewNode rootNode) { super.setRootNode(rootNode); notifyViewUpdated(); } - + public String getName() { - return "File view for: " + sourceFilePath; + return "File view for: " + sourceFilePath; } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/GlobalStructureView.java b/ajde/src/main/java/org/aspectj/ajde/ui/GlobalStructureView.java index 3abf9c31f9..3b1614df9e 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/GlobalStructureView.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/GlobalStructureView.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -18,7 +18,7 @@ /** * Should only be created by the {@link StructureViewManager} or an * equivalent factory. - * + * * @author Mik Kersten */ public class GlobalStructureView extends FileStructureView { @@ -27,26 +27,26 @@ public class GlobalStructureView extends FileStructureView { public GlobalStructureView(GlobalViewProperties viewProperties) { super(viewProperties); - this.viewProperties = viewProperties; - } - + this.viewProperties = viewProperties; + } + public GlobalViewProperties getGlobalViewProperties() { - return viewProperties; + return viewProperties; } - + // public void setActiveNode(StructureViewNode activeNode) { // StructureNode node = activeNode.getStructureNode(); -// +// // activeNode = activeNode; // if (renderer != null) renderer.setActiveNode(activeNode); // } -// +// // public void setActiveNode(StructureViewNode activeNode, int sourceLine) { // activeNode = activeNode; // if (renderer != null) renderer.setActiveNode(activeNode, sourceLine); // } - + public String toString() { - return viewProperties.getHierarchy().toString(); + return viewProperties.getHierarchy().toString(); } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/GlobalViewProperties.java b/ajde/src/main/java/org/aspectj/ajde/ui/GlobalViewProperties.java index fb58021cc7..1df7de9ba3 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/GlobalViewProperties.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/GlobalViewProperties.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -20,12 +20,12 @@ public class GlobalViewProperties extends StructureViewProperties { private StructureViewProperties.Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS; - private StructureViewProperties.Hierarchy hierarchy = StructureViewProperties.Hierarchy.DECLARATION; + private StructureViewProperties.Hierarchy hierarchy = StructureViewProperties.Hierarchy.DECLARATION; public GlobalViewProperties(StructureViewProperties.Hierarchy hierarchy) { this.hierarchy = hierarchy; } - + public void setGranularity(StructureViewProperties.Granularity granularity) { this.granularity = granularity; } @@ -33,15 +33,15 @@ public void setGranularity(StructureViewProperties.Granularity granularity) { public StructureViewProperties.Granularity getGranularity() { return granularity; } - + public void setHierarchy(StructureViewProperties.Hierarchy hierarchy) { - this.hierarchy = hierarchy; + this.hierarchy = hierarchy; } - + public StructureViewProperties.Hierarchy getHierarchy() { return hierarchy; } - + public String getName() { return hierarchy.toString(); } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java b/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java index a66e1faf69..e56da38696 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/InvalidResourceException.java b/ajde/src/main/java/org/aspectj/ajde/ui/InvalidResourceException.java index f8b24afd63..3d458c5ed0 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/InvalidResourceException.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/InvalidResourceException.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java index ce0560287c..b30e3e395f 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureView.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureView.java index 4a10462a2f..acba6b3325 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureView.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureView.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -21,17 +21,17 @@ */ public abstract class StructureView { - private IStructureViewNode rootNode = null; - private IStructureViewNode activeNode = null; + private IStructureViewNode rootNode = null; + private IStructureViewNode activeNode = null; protected StructureViewProperties viewProperties = null; protected StructureViewRenderer renderer = null; - + public StructureViewProperties getViewProperties() { - return viewProperties; - } - + return viewProperties; + } + public IStructureViewNode getRootNode() { - return rootNode; + return rootNode; } public void setRootNode(IStructureViewNode rootNode) { @@ -54,7 +54,7 @@ protected void notifyViewUpdated() { * @return the view node corresponding to the active ProgramElementNode or null */ public IStructureViewNode getActiveNode() { - if (activeNode != null + if (activeNode != null && activeNode.getStructureNode()!=null) { return activeNode; } else { @@ -64,40 +64,40 @@ public IStructureViewNode getActiveNode() { /** * Searches from the root node of the view down in order to find matches. - * + * * @return the first match */ public IStructureViewNode findCorrespondingViewNode(IProgramElement node) { return findCorrespondingViewNodeHelper(rootNode, node); } - private IStructureViewNode findCorrespondingViewNodeHelper(IStructureViewNode node, IProgramElement pNode) { + private IStructureViewNode findCorrespondingViewNodeHelper(IStructureViewNode node, IProgramElement pNode) { if (node != null - && node.getStructureNode() != null + && node.getStructureNode() != null && node.getStructureNode().equals(pNode) - && node.getKind() == IStructureViewNode.Kind.DECLARATION) { - - return node; - } - + && node.getKind() == IStructureViewNode.Kind.DECLARATION) { + + return node; + } + if (node != null && node.getChildren() != null) { for (Object o : node.getChildren()) { IStructureViewNode foundNode = findCorrespondingViewNodeHelper((IStructureViewNode) o, pNode); if (foundNode != null) return foundNode; } } - + return null; - } + } public void setActiveNode(IStructureViewNode activeNode) { this.activeNode = activeNode; if (renderer != null) renderer.setActiveNode(activeNode); } - + public void setActiveNode(IStructureViewNode activeNode, int sourceLine) { this.activeNode = activeNode; if (renderer != null) renderer.setActiveNode(activeNode, sourceLine); } } - + diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewManager.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewManager.java index 2ca5386d1a..3c8953a9f8 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewManager.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui; @@ -82,7 +82,7 @@ public void fireNavigateForwardAction(StructureView view) { /** * Only navigations of the default view are registered with the history. - * + * * @param newFilePath the canonicalized path to the new file */ public void fireNavigationAction(String newFilePath, int lineNumber) { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewNodeFactory.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewNodeFactory.java index afefbbe189..60991439a0 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewNodeFactory.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewNodeFactory.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajde.ui; @@ -77,7 +77,7 @@ public IStructureViewNode createNode(IProgramElement node, List children) { /** * Implementors must override this method in order to create new relationship nodes. - * + * * If returned node is null it will not be added to the tree. */ protected abstract IStructureViewNode createRelationship(IRelationship relationship, AbstractIcon icon); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java index a6604abd62..0b7f325535 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewRenderer.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewRenderer.java index 49cf272790..d4067f3305 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewRenderer.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewRenderer.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/UserPreferencesAdapter.java b/ajde/src/main/java/org/aspectj/ajde/ui/UserPreferencesAdapter.java index 6d00fb96ac..d2a2b0a5b4 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/UserPreferencesAdapter.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/UserPreferencesAdapter.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/internal/NavigationHistoryModel.java b/ajde/src/main/java/org/aspectj/ajde/ui/internal/NavigationHistoryModel.java index 0aad967fb0..dcca917cd0 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/internal/NavigationHistoryModel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/internal/NavigationHistoryModel.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -22,17 +22,17 @@ * @author Mik Kersten */ public class NavigationHistoryModel { - + private IProgramElement currNode = null; private Stack backHistory = new Stack(); private Stack forwardHistory = new Stack(); - + /** * @return null if the history is empty */ public IProgramElement navigateBack() { if (backHistory.isEmpty() || currNode == null) return null; - + forwardHistory.push(currNode); currNode = (IProgramElement)backHistory.pop(); return currNode; @@ -40,18 +40,18 @@ public IProgramElement navigateBack() { /** * @return null if the history is empty - */ + */ public IProgramElement navigateForward() { if (forwardHistory.isEmpty() || currNode == null) return null; - + backHistory.push(currNode); currNode = (IProgramElement)forwardHistory.pop(); return currNode; } - + public void navigateToNode(IProgramElement toNode) { if (currNode != null) backHistory.push(currNode); - currNode = toNode; + currNode = toNode; } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java b/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java index 9d885396d4..6def17bd62 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/internal/UserPreferencesStore.java b/ajde/src/main/java/org/aspectj/ajde/ui/internal/UserPreferencesStore.java index b827e92311..b8dc93332b 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/internal/UserPreferencesStore.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/internal/UserPreferencesStore.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaBuildOptions.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaBuildOptions.java index 0fd719f85a..668d4e5606 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaBuildOptions.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaBuildOptions.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.javaoptions; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java index d00146ff90..1163c21be7 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.javaoptions; @@ -35,21 +35,21 @@ */ public class JavaCompilerWarningsOptionsPanel extends OptionsPanel { - private final String[] ignoreOrWarning = new String[] {JavaOptions.IGNORE,JavaOptions.WARNING}; + private final String[] ignoreOrWarning = new String[] {JavaOptions.IGNORE,JavaOptions.WARNING}; private static final long serialVersionUID = 4491319302490183151L; - + private JPanel parentPanel; - + private Border warningsEtchedBorder; private TitledBorder warningsTitleBorder; private Border warningsCompoundBorder; private JPanel warningsPanel; private Box warningsBox = Box.createVerticalBox(); - + private JavaBuildOptions javaBuildOptions; private Map/*String --> JComboBox*/ warningComboBoxes = new HashMap(); - + public JavaCompilerWarningsOptionsPanel(JavaBuildOptions javaBuildOptions) { this.javaBuildOptions = javaBuildOptions; try { @@ -63,8 +63,8 @@ public JavaCompilerWarningsOptionsPanel(JavaBuildOptions javaBuildOptions) { public void loadOptions() throws IOException { createWarningContents(); } - - public void saveOptions() throws IOException { + + public void saveOptions() throws IOException { Set s = warningComboBoxes.entrySet(); for (Object o : s) { Entry entry = (Entry) o; @@ -73,7 +73,7 @@ public void saveOptions() throws IOException { String value = (String) combo.getSelectedItem(); javaBuildOptions.setOption(javaOption, value); } - } + } private void jbInit() throws Exception { this.setLayout(new BorderLayout()); @@ -96,40 +96,40 @@ private void createWarningContents() { createWarningsEntry("Non-externalized strings",JavaOptions.WARN_NON_NLS); warningsPanel.add(warningsBox,null); } - + private void createWarningsEntry(String labelText, String javaOptionToSet) { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); - + JLabel label = new JLabel(); label.setFont(new java.awt.Font("Dialog", 0, 11)); label.setText(labelText); panel.add(label,BorderLayout.WEST); - + JComboBox warnings = new JComboBox(ignoreOrWarning); String value = (String) javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet); if (value.equals(JavaOptions.IGNORE)) { warnings.setSelectedIndex(0); } else { - warnings.setSelectedIndex(1); + warnings.setSelectedIndex(1); } panel.add(warnings,BorderLayout.EAST); warningsBox.add(panel,null); warningComboBoxes.put(javaOptionToSet,warnings); } - - private void createBorders() { + + private void createBorders() { warningsEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158)); warningsTitleBorder = new TitledBorder(warningsEtchedBorder, "Warning Options"); warningsCompoundBorder = BorderFactory.createCompoundBorder(warningsTitleBorder, BorderFactory.createEmptyBorder(5, 5, 5, 5)); warningsTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11)); } - + private void addBordersToPanel() { parentPanel = new JPanel(); parentPanel.setLayout(new BorderLayout()); - + warningsPanel = new JPanel(); warningsPanel.setBorder(warningsCompoundBorder); parentPanel.add(warningsPanel,BorderLayout.CENTER); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java index 667e673ae4..89ebb60f3b 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java index 0e7e09abc6..128b995c92 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaOtherOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaOtherOptionsPanel.java index 5ffaf13c3e..25f84334b5 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaOtherOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaOtherOptionsPanel.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.javaoptions; @@ -33,7 +33,7 @@ public class JavaOtherOptionsPanel extends OptionsPanel { private static final long serialVersionUID = 4491319302490183151L; - + private JPanel parentPanel; private Border otherEtchedBorder; @@ -41,11 +41,11 @@ public class JavaOtherOptionsPanel extends OptionsPanel { private Border otherCompoundBorder; private JPanel otherPanel; private Box otherBox = Box.createVerticalBox(); - + private JavaBuildOptions javaBuildOptions; private JTextField characterEncoding; - + public JavaOtherOptionsPanel(JavaBuildOptions javaBuildOptions) { this.javaBuildOptions = javaBuildOptions; try { @@ -59,14 +59,14 @@ public JavaOtherOptionsPanel(JavaBuildOptions javaBuildOptions) { public void loadOptions() throws IOException { createOtherContents(); } - - public void saveOptions() throws IOException { + + public void saveOptions() throws IOException { String text = characterEncoding.getText(); if (text != null ) { javaBuildOptions.setCharacterEncoding(text); - } - } - + } + } + private void jbInit() throws Exception { this.setLayout(new BorderLayout()); createBorders(); @@ -82,35 +82,35 @@ private void createOtherContents() { label.setFont(new java.awt.Font("Dialog", 0, 11)); label.setText("Character encoding (will default to platform encoding)"); panel.add(label,BorderLayout.WEST); - - characterEncoding = new JTextField(); + + characterEncoding = new JTextField(); characterEncoding.setFont(new java.awt.Font("SansSerif", 0, 11)); characterEncoding.setMinimumSize(new Dimension(100, 21)); characterEncoding.setPreferredSize(new Dimension(150, 21)); panel.add(characterEncoding,BorderLayout.EAST); - + String option = (String) javaBuildOptions.getJavaBuildOptionsMap().get( JavaOptions.CHARACTER_ENCODING); if (option != null) { characterEncoding.setText(option); } - + otherBox.add(panel,null); otherPanel.add(otherBox); } - + private void createBorders() { otherEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158)); otherTitleBorder = new TitledBorder(otherEtchedBorder, "Other Options"); otherCompoundBorder = BorderFactory.createCompoundBorder(otherTitleBorder, - BorderFactory.createEmptyBorder(5, 5, 5, 5)); + BorderFactory.createEmptyBorder(5, 5, 5, 5)); otherTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11)); } - + private void addBordersToPanel() { parentPanel = new JPanel(); parentPanel.setLayout(new BorderLayout()); - + otherPanel = new JPanel(); otherPanel.setBorder(otherCompoundBorder); parentPanel.add(otherPanel,BorderLayout.CENTER); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/AJButtonMenuCombo.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/AJButtonMenuCombo.java index 72b7abeba4..8af92063bb 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/AJButtonMenuCombo.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/AJButtonMenuCombo.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -31,7 +31,7 @@ import org.aspectj.ajde.Ajde; public class AJButtonMenuCombo extends JPanel { - + private static final long serialVersionUID = -4866207530403336160L; private JButton mainButton; @@ -39,13 +39,13 @@ public class AJButtonMenuCombo extends JPanel { private JPopupMenu menu; // private boolean depressable = false; private boolean isPressed = false; - - public AJButtonMenuCombo(String name, - String toolTipText, - Icon icon, + + public AJButtonMenuCombo(String name, + String toolTipText, + Icon icon, JPopupMenu menu, boolean depressable) { - + this.menu = menu; // this.depressable = depressable; mainButton = new JButton(); @@ -54,24 +54,24 @@ public AJButtonMenuCombo(String name, mainButton.setToolTipText(toolTipText); mainButton.setPreferredSize(new Dimension(22, 20)); mainButton.setMinimumSize(new Dimension(22, 20)); - mainButton.setMaximumSize(new Dimension(22, 20)); - + mainButton.setMaximumSize(new Dimension(22, 20)); + popupButton = new JButton(); popupButton.setIcon(Ajde.getDefault().getIconRegistry().getPopupIcon()); popupButton.setBorder(BorderFactory.createEmptyBorder()); popupButton.setToolTipText(toolTipText); popupButton.setPreferredSize(new Dimension(13, 20)); popupButton.setMinimumSize(new Dimension(13, 20)); - popupButton.setMaximumSize(new Dimension(13, 20)); - + popupButton.setMaximumSize(new Dimension(13, 20)); + PopupListener popupListener = new PopupListener(mainButton); - + if (depressable) { mainButton.addActionListener(new ButtonActionListener()); } else { - mainButton.addMouseListener(popupListener); + mainButton.addMouseListener(popupListener); } - + popupButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { popupButton.setBorder(null); @@ -81,15 +81,15 @@ public void actionPerformed(ActionEvent e) { BorderUpdateListener borderUpdateListner = new BorderUpdateListener(); mainButton.addMouseListener(borderUpdateListner); popupButton.addMouseListener(borderUpdateListner); - + popupButton.addMouseListener(popupListener); - + this.setLayout(new BorderLayout()); this.add(mainButton, BorderLayout.CENTER); this.add(popupButton, BorderLayout.EAST); - + this.setMinimumSize(new Dimension(35, 20)); - this.setMaximumSize(new Dimension(35, 20)); + this.setMaximumSize(new Dimension(35, 20)); } class ButtonActionListener implements ActionListener { @@ -103,14 +103,14 @@ public void actionPerformed(ActionEvent e) { } } } - + class BorderUpdateListener extends MouseAdapter { public void mouseEntered(MouseEvent e) { popupButton.setBorder(AjdeWidgetStyles.RAISED_BEVEL_BORDER); mainButton.setBorder(AjdeWidgetStyles.RAISED_BEVEL_BORDER); } - + public void mouseExited(MouseEvent e) { popupButton.setBorder(AjdeWidgetStyles.DEFAULT_BORDER); if (isPressed) { @@ -140,7 +140,7 @@ private void maybeShowPopup(MouseEvent e) { menu.show(e.getComponent(), button.getX(), button.getY() + popupButton.getHeight()); } } - + public void setEnabled(boolean enabled) { mainButton.setEnabled(enabled); popupButton.setEnabled(enabled); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/AjdeWidgetStyles.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/AjdeWidgetStyles.java index 714971f034..30f9f24df8 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/AjdeWidgetStyles.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/AjdeWidgetStyles.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java index 10601a27b5..f66635f579 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * 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: + * Xerox/PARC initial implementation + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserView.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserView.java index de7a16d548..350f461ed6 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserView.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserView.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -80,14 +80,14 @@ public BrowserView(BrowserViewPanel masterView, BrowserViewPanel slaveView, Icon configs_comboBox.setRenderer(new ConfigsCellRenderer()); // configs_comboBox.addItemListener(new ItemListener() { // public void itemStateChanged(ItemEvent e) { -// Ajde.getDefault().getConfigurationManager().setCurrConfigFile(lastSelectedConfig); +// Ajde.getDefault().getConfigurationManager().setCurrConfigFile(lastSelectedConfig); // } // }); - + if (Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().size() > 0) { - Ajde.getDefault().getBuildConfigManager().setActiveConfigFile((String)Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().get(0)); + Ajde.getDefault().getBuildConfigManager().setActiveConfigFile((String)Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().get(0)); } - + jbInit(); fixButtonBorders(); views_splitPane.add(masterView, JSplitPane.TOP); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewManager.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewManager.java index cd01dec70f..300a56cd25 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewManager.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -34,7 +34,7 @@ public class BrowserViewManager { // private boolean globalMode = true; // private boolean splitViewMode = false; // private IconRegistry icons; -// +// // private Stack backHistory = new Stack(); // private Stack forwardHistory = new Stack(); // private IProgramElement currNode = null; @@ -64,12 +64,12 @@ public void extractAndInsertSignatures(java.util.List signatures, boolean calls) pointcutWizard.setVisible(true); pointcutWizard.setLocation(Ajde.getDefault().getRootFrame().getX()+100, Ajde.getDefault().getRootFrame().getY()+100); } - - { + + { DECLARATION_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.DECLARATION); CROSSCUTTING_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.CROSSCUTTING); - INHERITANCE_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE); - + INHERITANCE_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE); + // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); @@ -83,7 +83,7 @@ public void extractAndInsertSignatures(java.util.List signatures, boolean calls) // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.IMPLEMENTS_RELATION); // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_MEMBERS_RELATION); // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_RELATION); - + DECLARATION_VIEW_PROPERTIES.setRelations(Ajde.getDefault().getStructureViewManager().getAvailableRelations()); CROSSCUTTING_VIEW = Ajde.getDefault().getStructureViewManager().createGlobalView(CROSSCUTTING_VIEW_PROPERTIES); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewPanel.java index 5459e916fc..bb2c3c8c35 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewPanel.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * 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: + * Xerox/PARC initial implementation + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java index 8e88a38a49..64971dc225 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java @@ -1,18 +1,18 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ - + package org.aspectj.ajde.ui.swing; import java.awt.event.ActionEvent; @@ -67,7 +67,7 @@ public void singleClickNavigation(MouseEvent e) { //if (AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) { // AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView((ProgramElementNode)currNode); //} - } + } // else if (currNode instanceof LinkNode) { //if (!AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) { // AjdeUIManager.getDefault().getViewManager().showNodeInMasterView((LinkNode)currNode); @@ -87,7 +87,7 @@ public void doubleClickNavigation(MouseEvent e) { && e.getModifiers() != 4) { //AjdeUIManager.getDefault().getViewManager().showNodeInMasterView(((LinkNode)currNode).getProgramElementNode()); //AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView(((LinkNode)currNode).getProgramElementNode()); - } + } // else if (currNode instanceof LinkNode) { // if (clickCount == 1) { // //AjdeUIManager.getDefault().getViewManager().showLink((LinkNode)currNode); @@ -118,7 +118,7 @@ private void maybeShowPopup(MouseEvent e) { JMenuItem showSourcesItem = new JMenuItem("Display sources", Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.CODE)); showSourcesItem.setFont(new java.awt.Font("Dialog", 0, 11)); showSourcesItem.addActionListener(new AbstractAction() { - + private static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent e) { @@ -150,7 +150,7 @@ public void actionPerformed(ActionEvent e) { JMenuItem generatePCD = new JMenuItem("Pointcut Wizard (alpha)...", Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.POINTCUT)); generatePCD.setFont(new java.awt.Font("Dialog", 0, 11)); generatePCD.addActionListener(new AbstractAction() { - + private static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent e) { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java index f1aca6bcda..c52e5dd726 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -30,7 +30,7 @@ /** * Creates a popup menu that displays all the available .lst files. When one * is selected it runs a full build of files within the selected .lst file - * in a separate thread. + * in a separate thread. */ public class BuildConfigPopupMenu extends JPopupMenu { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildProgressPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildProgressPanel.java index ac8dcf2a00..3b9decc549 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildProgressPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/BuildProgressPanel.java @@ -1,20 +1,20 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui.swing; - + import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -44,7 +44,7 @@ public class BuildProgressPanel extends JPanel { JProgressBar compile_progressBar = new JProgressBar(); private boolean buildIsCancelled = false; - + public BuildProgressPanel() { try { jbInit(); @@ -134,7 +134,7 @@ public void actionPerformed(ActionEvent e) { void cancel_button_actionPerformed(ActionEvent e) { buildIsCancelled = true; } - + public boolean isCancelRequested() { return buildIsCancelled; } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java index ea681475f3..103d6c1d96 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/CompilerMessagesCellRenderer.java @@ -1,20 +1,20 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui.swing; - + import java.awt.Component; import javax.swing.JLabel; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/DefaultBuildProgressMonitor.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/DefaultBuildProgressMonitor.java index 7fab45d918..01e41b4310 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/DefaultBuildProgressMonitor.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/DefaultBuildProgressMonitor.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -21,7 +21,7 @@ import org.aspectj.ajde.Ajde; import org.aspectj.ajde.core.IBuildProgressMonitor; - + /** * This dialog box is open while ajc is compiling the system and displays * a corresponding progress bar. @@ -31,7 +31,7 @@ public class DefaultBuildProgressMonitor extends Thread implements IBuildProgressMonitor { public static final String PROGRESS_HEADING = "AspectJ Build"; - + private BuildProgressPanel progressDialog = null; private JDialog dialog = null; @@ -41,7 +41,7 @@ public DefaultBuildProgressMonitor(Frame parent) { dialog.setContentPane(progressDialog); dialog.setSize(550, 120); try { - dialog.setLocationRelativeTo(parent); + dialog.setLocationRelativeTo(parent); } catch (NoSuchMethodError nsme) { // running on 1.3 } @@ -69,7 +69,7 @@ public void setProgressText(String text) { */ public void finish(boolean wasFullBuild) { progressDialog.finish(); - dialog.dispose(); + dialog.dispose(); } public boolean isCancelRequested() { @@ -77,6 +77,6 @@ public boolean isCancelRequested() { } public void setProgress(double percentDone) { - progressDialog.setProgressBarVal((int) (percentDone*progressDialog.getProgressBarMax())); + progressDialog.setProgressBarVal((int) (percentDone*progressDialog.getProgressBarMax())); } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/ErrorDialog.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/ErrorDialog.java index 582926a927..68bf340cf9 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/ErrorDialog.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/ErrorDialog.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/GoToLineThread.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/GoToLineThread.java index 7b7ae7b682..adbddfa1f0 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/GoToLineThread.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/GoToLineThread.java @@ -1,18 +1,18 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ - + package org.aspectj.ajde.ui.swing; @@ -26,12 +26,12 @@ /** * Used to ensure that a source line has been seeked to. Will repeatedly attempt * to seek to the line until this has succeeded. - * + * * @author Mik Kersten */ public class GoToLineThread extends Thread { private EditorAdapter editorAdapter = null; - + private int lineNumber = 0; private String fileToSeekTo = ""; private boolean finished = false; @@ -62,7 +62,7 @@ public void run() { editorAdapter.showSourceLine(lineNumber, true); } }); - } catch (Exception e) { + } catch (Exception e) { Message msg = new Message("Could not seek to line.",IMessage.ERROR,e,null); Ajde.getDefault().getMessageHandler().handleMessage(msg); } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/MultiStructureViewPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/MultiStructureViewPanel.java index 5c44d09bae..038a2e0017 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/MultiStructureViewPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/MultiStructureViewPanel.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -28,7 +28,7 @@ * @author Mik Kersten */ public class MultiStructureViewPanel extends JPanel { - + private static final long serialVersionUID = -4409192026967597082L; JSplitPane views_splitPane; BorderLayout borderLayout1 = new BorderLayout(); @@ -37,7 +37,7 @@ public MultiStructureViewPanel(StructureViewPanel topPanel, StructureViewPanel b super(); try { views_splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, bottomPanel); - jbInit(); + jbInit(); } catch(Exception e) { Message msg = new Message("Could not initialize GUI.",IMessage.ERROR,e,null); Ajde.getDefault().getMessageHandler().handleMessage(msg); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsFrame.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsFrame.java index 1729ac87a7..6a21852aa5 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsFrame.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsFrame.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -58,14 +58,14 @@ public class OptionsFrame extends JFrame { "version 1.0, approved by the Open Source Initiative as\n" + "conforming to the Open Source Definition.\n\n" + "For support or for more information about the AspectJ\n" + - "project or the license, visit the project home page at\n" + + "project or the license, visit the project home page at\n" + " http://eclipse.org/aspectj\n\n" + "If you find a bug (not solved by the documentation in the\n" + "Development Environment Guide available with this release,\n" + "any release notes, or the bug database), please submit steps\n" + - "to reproduce the bug (using the IDE component) at:\n" + + "to reproduce the bug (using the IDE component) at:\n" + " http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ"; - + private JTabbedPane main_tabbedPane = new JTabbedPane(); private JPanel button_panel = new JPanel(); private JButton apply_button = new JButton(); @@ -267,7 +267,7 @@ public void actionPerformed(ActionEvent e) { jTextArea1.setFont(new java.awt.Font("SansSerif", 0, 12)); jTextArea1.setEditable(false); jTextArea1.setText(ABOUT_TEXT); - + about_panel.setBorder(border9); built_label.setText("Built: "); built_label.setFont(new java.awt.Font("Dialog", 1, 12)); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsPanel.java index e49fc247ab..cbb35436c0 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/OptionsPanel.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -22,7 +22,7 @@ * @author Mik Kersten */ public abstract class OptionsPanel extends JPanel { - + public abstract void loadOptions() throws IOException; public abstract void saveOptions() throws IOException; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java index f80ff76e67..efe13e6365 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -59,7 +59,7 @@ public PointcutWizard(java.util.List signatures) { List views = new ArrayList(); views.add(StructureViewProperties.Hierarchy.INHERITANCE); // typeTreeView = new BrowserViewPanel(AjdeUIManager.getDefault().getIconRegistry(), views, StructureViewProperties.Hierarchy.INHERITANCE); - + throw new RuntimeException("unimplemented, can't get the current file"); //typeTreeView.updateTree(Ajde.getDefault().getEditorManager().getCurrFile()); // try { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java index b12698d5e1..f3ac1ee09f 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SimpleStructureViewToolPanel.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui.swing; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTree.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTree.java index af4cd16e24..69134c6b01 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTree.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTree.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -58,5 +58,5 @@ private void jbInit() throws Exception { public int getToggleClickCount() { return 1; - } + } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTreeManager.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTreeManager.java index 474ba1f60f..c6d937d8df 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTreeManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureTreeManager.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui.swing; @@ -213,7 +213,7 @@ public void valueForPathChanged(TreePath path, Object newValue) { // try { // SwingUtilities.invokeAndWait(update); // } catch (Exception ee) { -// +// // } // } // } @@ -228,7 +228,7 @@ public void valueForPathChanged(TreePath path, Object newValue) { // setIcon(getProgramElementNodeIcon(lexicalNode)); // } else if (node instanceof RelationNode) { // RelationNode relationNode = (RelationNode)node; -// +// // setIcon(icons.getAssociationSwingIcon(relationNode.getRelation())); // this.setFont(new Font(this.getFont().getName(), Font.ITALIC, this.getFont().getSize())); // @@ -349,7 +349,7 @@ public void valueForPathChanged(TreePath path, Object newValue) { // return null; // } -// +// // if (relationNode.getKind().equals(org.aspectj.asm.associations.Advice.NAME) || // relationNode.getKind().equals(org.aspectj.asm.associations.Introduction.NAME)) { // if (relationNode.getRelation().getBackNavigationName().equals(relationNode.getName()) ){ @@ -421,7 +421,7 @@ public void valueForPathChanged(TreePath path, Object newValue) { // } // private class StructureViewNodeAdapter extends DefaultMutableTreeNode { -// +// // private StructureViewNode nodeInfo = null; // // public StructureViewNodeAdapter(StructureViewNode nodeInfo) { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewPanel.java index c3e87bcf87..8a8cb7e61c 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewPanel.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -69,7 +69,7 @@ public StructureViewPanel(java.util.List structureViews) { structureToolBar_panel = new BrowserStructureViewToolPanel(structureViews, currentView, this); init(); } - + private void init() { try { jbInit(); @@ -87,8 +87,8 @@ public void setCurrentView(StructureView view) { public void updateView(StructureView structureView) { if (structureView == currentView) { - treeManager.updateTree(structureView); - } + treeManager.updateTree(structureView); + } } private void initView(StructureView view) { diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewTreeListener.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewTreeListener.java index 589762fef5..a0846205cf 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewTreeListener.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/StructureViewTreeListener.java @@ -1,17 +1,17 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ - + package org.aspectj.ajde.ui.swing; import java.awt.event.MouseEvent; @@ -52,14 +52,14 @@ public void navigate(MouseEvent e) { SwingTreeViewNode treeNode = (SwingTreeViewNode)tree.getLastSelectedPathComponent(); if (treeNode == null || lastSelectedNode == treeNode) return; lastSelectedNode = treeNode; - + //if (e.getClickCount() == 2) { Ajde.getDefault().getStructureViewManager().fireNavigationAction( treeNode.getStructureNode(), treeNode.getKind() == IStructureViewNode.Kind.LINK ); //} - } + } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java index 987c2d130d..fd418872a7 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -39,13 +39,13 @@ public class SwingTreeViewNode extends DefaultMutableTreeNode implements IStruct /** * Create a declaration node. - */ + */ public SwingTreeViewNode(IProgramElement programElement, AbstractIcon icon, List children) { super(programElement, true); this.programElement = programElement; this.icon = icon; this.kind = Kind.DECLARATION; - + if (children != null) { for (Object o : children) { SwingTreeViewNode child = (SwingTreeViewNode) o; @@ -58,52 +58,52 @@ public SwingTreeViewNode(IProgramElement programElement, AbstractIcon icon, List /** * Create a relationship node. - */ + */ public SwingTreeViewNode(IRelationship relationship, AbstractIcon icon) { super(null, true); this.icon = icon; this.kind = Kind.RELATIONSHIP; this.relationshipName = relationship.getName(); } - + /** * Create a link. - */ + */ public SwingTreeViewNode(IProgramElement programElement, AbstractIcon icon) { super(programElement, false); this.programElement = programElement; this.kind = Kind.LINK; this.icon = icon; } - + public IProgramElement getStructureNode() { - return programElement; + return programElement; } - + public AbstractIcon getIcon() { return icon; - } + } - public void add(IStructureViewNode child) { + public void add(IStructureViewNode child) { super.add((DefaultMutableTreeNode)child); } - public void add(IStructureViewNode child, int position) { + public void add(IStructureViewNode child, int position) { super.insert((DefaultMutableTreeNode)child, position); } - - public void remove(IStructureViewNode child) { + + public void remove(IStructureViewNode child) { super.remove((DefaultMutableTreeNode)child); } - + public List getChildren() { if (children == null) { return new ArrayList(); } else { return children; - } + } } - + public Kind getKind() { return kind; } @@ -111,12 +111,12 @@ public Kind getKind() { public String getRelationshipName() { return relationshipName; } - + public String toString() { if (kind == IStructureViewNode.Kind.RELATIONSHIP) { return relationshipName; } else if (kind == IStructureViewNode.Kind.LINK) { - return programElement.toLinkLabelString(); + return programElement.toLinkLabelString(); } else { return programElement.toLabelString(); } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java index 32aa3708aa..18d88e7aea 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * 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: + * Xerox/PARC initial implementation + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -28,9 +28,9 @@ * @author Mik Kersten */ public class SwingTreeViewNodeFactory extends StructureViewNodeFactory { - + public SwingTreeViewNodeFactory(IconRegistry iconRegistry) { - super(iconRegistry); + super(iconRegistry); } protected IStructureViewNode createDeclaration( diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeRenderer.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeRenderer.java index 80396be73c..bed2fb7830 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeRenderer.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeRenderer.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -43,39 +43,39 @@ public Component getTreeCellRendererComponent(JTree tree, boolean leaf, int row, boolean hasFocus) { - if (treeNode == null) return null; - this.setFont(StructureTree.DEFAULT_FONT); + if (treeNode == null) return null; + this.setFont(StructureTree.DEFAULT_FONT); SwingTreeViewNode viewNode = (SwingTreeViewNode)treeNode; IProgramElement node = viewNode.getStructureNode(); if (viewNode.getKind() == IStructureViewNode.Kind.LINK) { ISourceLocation sourceLoc = node.getSourceLocation(); - if ((null != sourceLoc) + if ((null != sourceLoc) && (null != sourceLoc.getSourceFile().getAbsolutePath())) { setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_COLOR); } else { setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_NO_SOURCE_COLOR); } - + } else if (viewNode.getKind() == IStructureViewNode.Kind.RELATIONSHIP) { this.setFont(new Font(this.getFont().getName(), Font.ITALIC, this.getFont().getSize())); setTextNonSelectionColor(new Color(0, 0, 0)); - + } else if (viewNode.getKind() == IStructureViewNode.Kind.DECLARATION) { setTextNonSelectionColor(new Color(0, 0, 0)); } - - super.getTreeCellRendererComponent(tree, treeNode, sel, expanded, leaf, row, hasFocus); + + super.getTreeCellRendererComponent(tree, treeNode, sel, expanded, leaf, row, hasFocus); if (viewNode.getIcon() != null && viewNode.getIcon().getIconResource() != null) { setIcon((Icon)viewNode.getIcon().getIconResource()); } else { setIcon(null); } - + if (node != null) { if (node.isRunnable()) { setIcon(Ajde.getDefault().getIconRegistry().getExecuteIcon()); - } + } if (node.getMessage() != null) { if (node.getMessage().getKind().equals(IMessage.WARNING)) { setIcon(Ajde.getDefault().getIconRegistry().getWarningIcon()); @@ -86,7 +86,7 @@ public Component getTreeCellRendererComponent(JTree tree, } } - } + } return this; } } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java index 9e8b21fb58..4a2fb09e2f 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -60,12 +60,12 @@ public class TreeViewBuildConfigEditor extends JPanel implements BuildConfigEdit private ConfigTreeNode root; // private ConfigTreeNode currNode; private BuildConfigModel model = null; - + private static java.util.List selectedEntries = new ArrayList(); // private String configFile = null; // private File sourcePath = null; //private BuildConfigModelBuilder configTreeBuilder = new BuildConfigModelBuilder(); - + BorderLayout borderLayout1 = new BorderLayout(); JPanel jPanel1 = new JPanel(); JLabel jLabel1 = new JLabel(); @@ -88,7 +88,7 @@ public void openFile(String configFile) throws IOException, InvalidResourceExcep jbInit(); jLabel1.setText(" Build configuration: " + configFile); - model = Ajde.getDefault().getBuildConfigManager().buildModel(configFile); + model = Ajde.getDefault().getBuildConfigManager().buildModel(configFile); root = buildTree(model.getRoot()); buildConfig_tree.setModel(new DefaultTreeModel(root)); @@ -103,15 +103,15 @@ public void openFile(String configFile) throws IOException, InvalidResourceExcep Ajde.getDefault().getMessageHandler().handleMessage(msg); } } - + private ConfigTreeNode buildTree(BuildConfigNode node) { ConfigTreeNode treeNode = new ConfigTreeNode(node); for (BuildConfigNode childNode : node.getChildren()) { treeNode.add(buildTree(childNode)); } return treeNode; - } - + } + private void saveModel() { Ajde.getDefault().getBuildConfigManager().writeModel(model); } @@ -154,7 +154,7 @@ public void actionPerformed(ActionEvent e) { } private static class ConfigTreeNode extends DefaultMutableTreeNode { - + private static final long serialVersionUID = 1L; public JCheckBox checkBox = null; public BuildConfigNode modelNode; @@ -193,12 +193,12 @@ public void mousePressed(MouseEvent e) { // if (isCheckBox(x, tree.getPathBounds(path).x)) { if (node.checkBox.isSelected()) { node.getModelNode().setActive(false); - node.checkBox.setSelected(false); + node.checkBox.setSelected(false); } else { node.getModelNode().setActive(true); - node.checkBox.setSelected(true); + node.checkBox.setSelected(true); } - + ((DefaultTreeModel)tree.getModel()).nodeChanged(node); if (node.getModelNode().getName() != null) { if (node.checkBox.isSelected()) { @@ -237,41 +237,41 @@ public Component getTreeCellRendererComponent(JTree tree, final JCheckBox cbox = ((ConfigTreeNode)value).checkBox; cbox.setBackground(Color.white); if (row != 0) { - p.add(cbox); + p.add(cbox); } ConfigTreeNode ctn = (ConfigTreeNode)value; //if (TreeViewBuildConfigEditor.selectedEntries.contains(ctn.getSourceFile())) { if (ctn.getModelNode().isActive()) { cbox.setSelected(true); - } - + } + if (!ctn.getModelNode().isValidResource()) { - ctn.checkBox.setEnabled(false); + ctn.checkBox.setEnabled(false); } - + //} BuildConfigNode.Kind kind = ctn.getModelNode().getBuildConfigNodeKind(); if (kind.equals(BuildConfigNode.Kind.FILE_ASPECTJ)) { - setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.FILE_ASPECTJ)); + setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.FILE_ASPECTJ)); } else if (kind.equals(BuildConfigNode.Kind.FILE_JAVA)) { - setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.FILE_JAVA)); + setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.FILE_JAVA)); } else if (kind.equals(BuildConfigNode.Kind.FILE_LST)) { - setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.FILE_LST)); + setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.FILE_LST)); } else if (kind.equals(BuildConfigNode.Kind.DIRECTORY)) { - setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.PACKAGE)); + setIcon(Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.PACKAGE)); } else { - setIcon((Icon)Ajde.getDefault().getIconRegistry().getIcon(IProgramElement.Kind.ERROR).getIconResource()); + setIcon((Icon)Ajde.getDefault().getIconRegistry().getIcon(IProgramElement.Kind.ERROR).getIconResource()); p.remove(cbox); } - + // if (ctn.getModelNode().getResourcePath() != null) { // if (ctn.getModelNode().getResourcePath().endsWith(".java")) { -// this.setIcon(AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.CLASS)); +// this.setIcon(AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.CLASS)); // } else if (ctn.getModelNode().getResourcePath().endsWith(".aj")) { -// this.setIcon(AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.ASPECT)); +// this.setIcon(AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.ASPECT)); // } else { -// this.setIcon(AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.PACKAGE)); +// this.setIcon(AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.PACKAGE)); // } // } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java index 2fc7bf201b..1a429419b0 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ diff --git a/ajde/src/test/java/org/aspectj/ajde/AjdeCompilerTest.java b/ajde/src/test/java/org/aspectj/ajde/AjdeCompilerTest.java index 1e3605db2a..1f91e680df 100644 --- a/ajde/src/test/java/org/aspectj/ajde/AjdeCompilerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/AjdeCompilerTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde; @@ -18,12 +18,12 @@ * to only remember the compiler for the last .lst file. */ public class AjdeCompilerTest extends AjdeTestCase { - + protected void setUp() throws Exception { super.setUp(); initialiseProject("LstBuildConfigManagerTest"); } - + // Expect to get a different compiler instance for each // different config file public void testGetSameAjCompilerForSameConfigFiles() { @@ -32,7 +32,7 @@ public void testGetSameAjCompilerForSameConfigFiles() { assertEquals("expected the same AjCompiler instance to be returned" + " for the same configFile but found different ones", c1, c2); } - + // Expect to get a different compiler instance for each // different config file public void testGetDifferentAjCompilerForDifferentConfigFiles() { @@ -41,36 +41,36 @@ public void testGetDifferentAjCompilerForDifferentConfigFiles() { assertNotSame("expected different AjCompiler instances to be returned" + " for different configFiles but found the smae", c1, c2); } - + // want to keep the same setting regardless of the configFile // being built - therefore the same instance should be passed // from one AjCompiler instance to the next - public void testSameCompilerConfigForDifferentConfigFiles() { + public void testSameCompilerConfigForDifferentConfigFiles() { AjCompiler c1 = getCompilerForConfigFileWithName("bad-injar.lst"); AjCompiler c2 = getCompilerForConfigFileWithName("dir-entry.lst"); assertEquals("expected the same compilerConfig instance to be associated" + - " with the different AjCompiler's however found different ones", + " with the different AjCompiler's however found different ones", c1.getCompilerConfiguration(), c2.getCompilerConfiguration()); } - + // want to have a different messageHandler instance for the different // config files - or we can just reset?!?! Resetting would be easier public void testSameMessageHandlerForDifferentConfigFiles() { AjCompiler c1 = getCompilerForConfigFileWithName("bad-injar.lst"); AjCompiler c2 = getCompilerForConfigFileWithName("dir-entry.lst"); assertEquals("expected the same messageHandler instance to be associated" + - " with the different AjCompiler's however found different ones", + " with the different AjCompiler's however found different ones", c1.getMessageHandler(), c2.getMessageHandler()); } - + // can have the same buildProgressMonitor for the different configFiles // because it holds no state public void testSameBuildProgressMonitorForDifferentConfigFiles() { AjCompiler c1 = getCompilerForConfigFileWithName("bad-injar.lst"); AjCompiler c2 = getCompilerForConfigFileWithName("dir-entry.lst"); assertEquals("expected the same buildProgressMonitor instance to be associated" + - " with the different AjCompiler's however found different ones", + " with the different AjCompiler's however found different ones", c1.getBuildProgressMonitor(), c2.getBuildProgressMonitor()); } - + } diff --git a/ajde/src/test/java/org/aspectj/ajde/AjdeModuleTests.java b/ajde/src/test/java/org/aspectj/ajde/AjdeModuleTests.java index 354c00d321..09753ad849 100644 --- a/ajde/src/test/java/org/aspectj/ajde/AjdeModuleTests.java +++ b/ajde/src/test/java/org/aspectj/ajde/AjdeModuleTests.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajde; @@ -22,18 +22,18 @@ public class AjdeModuleTests extends TestCase { - public static TestSuite suite() { + public static TestSuite suite() { TestSuite suite = new TestSuite(AjdeModuleTests.class.getName()); suite.addTestSuite(SymbolFileGenerationTest.class); suite.addTestSuite(ExtensionTest.class); - suite.addTestSuite(AspectJBuildManagerTest.class); + suite.addTestSuite(AspectJBuildManagerTest.class); suite.addTestSuite(LstBuildConfigManagerTest.class); - suite.addTestSuite(StructureSearchManagerTest.class); - suite.addTestSuite(StructureViewManagerTest.class); + suite.addTestSuite(StructureSearchManagerTest.class); + suite.addTestSuite(StructureViewManagerTest.class); suite.addTestSuite(AjdeCompilerTest.class); return suite; } public AjdeModuleTests(String name) { super(name); } -} +} diff --git a/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java b/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java index f1d979181f..66ba851e5d 100644 --- a/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java +++ b/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java @@ -1,12 +1,12 @@ /******************************************************************** * 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 v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation * Helen Hawkins Converted to new interface (bug 148190) and * to use a sandbox directory diff --git a/ajde/src/test/java/org/aspectj/ajde/ExtensionTest.java b/ajde/src/test/java/org/aspectj/ajde/ExtensionTest.java index 384d417f7d..450bf0036f 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ExtensionTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/ExtensionTest.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * 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 - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Andy Clement - initial implementation *******************************************************************************/ @@ -38,9 +38,9 @@ protected void setUp() throws Exception { /** * Aim: Check that the ID of certain message kinds are correct - * + * * ajc -warn:unusedImport UnusedImport.java - * + * * Expected result is that id matches IProblem.UnusedImport */ public void testMessageID() { @@ -121,9 +121,9 @@ public void walkit(IProgramElement ipe, int indent) { /** * Aim: Check that the start/end of certain warnings are correct - * + * * ajc -warn:unusedImport UnusedImport.java - * + * * Expected result is first warning message has start=7 end=20 */ public void testMessageSourceStartEnd() { diff --git a/ajde/src/test/java/org/aspectj/ajde/SymbolFileGenerationTest.java b/ajde/src/test/java/org/aspectj/ajde/SymbolFileGenerationTest.java index 2d16696950..19201a36d4 100644 --- a/ajde/src/test/java/org/aspectj/ajde/SymbolFileGenerationTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/SymbolFileGenerationTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajde; diff --git a/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java index 4382dfe7db..5678069248 100644 --- a/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -28,7 +28,7 @@ public class AspectJBuildManagerTest extends AjdeTestCase { public static TestSuite suite() { TestSuite result = new TestSuite(); - result.addTestSuite(AspectJBuildManagerTest.class); + result.addTestSuite(AspectJBuildManagerTest.class); return result; } @@ -50,15 +50,15 @@ public void testSequence() { file.delete(); } else { assertTrue("expected class " + file, false); - } - + } + // TODO-path file = openFile("all.ajsym"); if (file.exists()) { file.delete(); } else { assertTrue("expected .ajsym: " + file, false); - } + } } finally { AsmManager.dumpModelPostBuild=false; } diff --git a/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java index 74a8cc1eb5..280c11e771 100644 --- a/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java @@ -1,18 +1,18 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ -package org.aspectj.ajde.internal; +package org.aspectj.ajde.internal; import java.io.File; import java.io.IOException; @@ -25,15 +25,15 @@ import junit.framework.TestSuite; public class LstBuildConfigManagerTest extends AjdeTestCase { - + private BuildConfigManager buildConfigManager = new LstBuildConfigManager(); public static TestSuite suite() { TestSuite result = new TestSuite(); - result.addTestSuite(LstBuildConfigManagerTest.class); + result.addTestSuite(LstBuildConfigManagerTest.class); return result; } - + protected void setUp() throws Exception { super.setUp(); initialiseProject("LstBuildConfigManagerTest"); @@ -43,7 +43,7 @@ public void testConfigParserErrorMessages() { doBuild("dir-entry.lst"); List messages = getMessages("dir-entry.lst"); TestMessage message = (TestMessage)messages.get(0); - + assertEquals(message.getContainedMessage().getSourceLocation().getSourceFile().getAbsolutePath(), openFile("dir-entry.lst").getAbsolutePath()); doBuild("bad-injar.lst"); @@ -56,25 +56,25 @@ public void testErrorMessages() throws IOException { doBuild("invalid-entry.lst"); assertFalse("expected there to be error messages because the build failed but didn't" + " find any", getErrorMessages("invalid-entry.lst").isEmpty()); - + List messages = getMessages("invalid-entry.lst"); - TestMessage message = (TestMessage)messages.get(0); + TestMessage message = (TestMessage)messages.get(0); assertTrue(message.getContainedMessage().getMessage(), message.getContainedMessage().getMessage().contains("aaa.bbb")); - + } public void testNonExistentConfigFile() throws IOException { File file = openFile("mumbleDoesNotExist.lst"); assertTrue("valid non-existing file", !file.exists()); BuildConfigModel model = buildConfigManager.buildModel(file.getCanonicalPath()); - assertTrue("root: " + model.getRoot(), model.getRoot() != null); + assertTrue("root: " + model.getRoot(), model.getRoot() != null); } public void testFileRelativePathSameDir() throws IOException { File file = openFile("file-relPath-sameDir.lst"); buildConfigManager.buildModel(file.getCanonicalPath()); assertTrue("single file", true); - } - + } + } diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeFileStructureView.java b/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeFileStructureView.java index 40c0b2b92c..228119c93e 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeFileStructureView.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeFileStructureView.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -18,12 +18,12 @@ * @author Mik Kersten */ public class NullIdeFileStructureView extends FileStructureView { - + private String sourceFilePath = null; - + public NullIdeFileStructureView(StructureViewProperties viewProperties) { - super(viewProperties); - } + super(viewProperties); + } public String getSourceFile() { return sourceFilePath; } diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeStructureViewRenderer.java b/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeStructureViewRenderer.java index 81b65dea02..ef47a972f9 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeStructureViewRenderer.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/NullIdeStructureViewRenderer.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -20,19 +20,19 @@ public class NullIdeStructureViewRenderer implements StructureViewRenderer { private boolean hasBeenNotified = false; - + public void updateView(StructureView structureView) { - hasBeenNotified = true; + hasBeenNotified = true; } - + public void setActiveNode(IStructureViewNode node) { - // ignored + // ignored } - + public void setActiveNode(IStructureViewNode node, int lineOffset) { // ignored } - + public boolean getHasBeenNotified() { return hasBeenNotified; } @@ -41,4 +41,4 @@ public void setHasBeenNotified(boolean hasBeenNotified) { this.hasBeenNotified = hasBeenNotified; } } - + diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java index ecbfed0d77..b95a5370b7 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -29,7 +29,7 @@ public class StructureSearchManagerTest extends AjdeTestCase { public static TestSuite suite() { TestSuite result = new TestSuite(); - result.addTestSuite(StructureSearchManagerTest.class); + result.addTestSuite(StructureSearchManagerTest.class); return result; } @@ -56,11 +56,11 @@ public void testFindNonExistent() { ); assertTrue("non existent", matches.isEmpty()); } - + protected void setUp() throws Exception { super.setUp(); initialiseProject("StructureSearchManagerTest"); - doBuild("all.lst"); + doBuild("all.lst"); } protected void tearDown() throws Exception { diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java index 5948d2c5ab..ab77431836 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui; diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestBuildProgressMonitor.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestBuildProgressMonitor.java index ef70388ad9..aaf1b08339 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestBuildProgressMonitor.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestBuildProgressMonitor.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java index 4dd195aed9..68ecee15d2 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestCompilerConfiguration.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2007 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestEditorAdapter.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestEditorAdapter.java index 6c94e7f333..c09510877d 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestEditorAdapter.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestEditorAdapter.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.utils; diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestIdeUIAdapter.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestIdeUIAdapter.java index 2bc23ec602..77a0963d73 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestIdeUIAdapter.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestIdeUIAdapter.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.utils; diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestMessageHandler.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestMessageHandler.java index 8901b02f40..d0fd36bd0e 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestMessageHandler.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestMessageHandler.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.utils; @@ -30,7 +30,7 @@ public class TestMessageHandler implements IUIBuildMessageHandler { private List ignoring; private List messages; private List errors; - + public TestMessageHandler() { ignoring = new ArrayList(); messages = new ArrayList(); @@ -40,7 +40,7 @@ public TestMessageHandler() { } public boolean handleMessage(IMessage message) throws AbortException { - IMessage.Kind kind = message.getKind(); + IMessage.Kind kind = message.getKind(); if (isIgnoring(kind)) { return true; } @@ -66,32 +66,32 @@ public void dontIgnore(Kind kind) { public boolean isIgnoring(Kind kind) { return ((null != kind) && (ignoring.contains(kind))); } - + public void ignore(Kind kind) { if ((null != kind) && (!ignoring.contains(kind))) { ignoring.add(kind); - } + } } public List getMessages() { return messages; } - + public List getErrors() { return errors; } - + public static class TestMessage { IMessage message; - + public TestMessage(IMessage m) { message = m; } - + public IMessage getContainedMessage() { return message; } - + public String toString() { String loc = ""; if (null != message.getSourceLocation()) { diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestOutputLocationManager.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestOutputLocationManager.java index 157f3ecd42..3872b45bd7 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestOutputLocationManager.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestOutputLocationManager.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.utils; @@ -40,7 +40,7 @@ public void reportFileWrite(String outputfile, int filetype) { public String getUniqueIdentifier() { return testProjectOutputPath; } - + public Map getInpathMap() { return Collections.EMPTY_MAP; } diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestRuntimeProperties.java b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestRuntimeProperties.java index a9e923e2af..588bcbb419 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestRuntimeProperties.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/utils/TestRuntimeProperties.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2007 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2007 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version (bug 148190) *******************************************************************/ package org.aspectj.ajde.ui.utils; diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java index 5af5610a92..f32f45d24a 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java index 500e8603a3..13bb6f8e95 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Config.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java index 0c8bc3575b..b7144965a5 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/DocException.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andrew Huff initial implementation + * 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: + * Andrew Huff initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java index 56565e05a9..8d36a24338 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java index 21c56d1604..8b32dfa668 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/JavadocRunner.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java index 9f728a946a..a32c1bd8a5 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * Mik Kersten port to AspectJ 1.1+ code base * ******************************************************************/ @@ -40,7 +40,7 @@ /** * This is an old implementation of ajdoc that does not use an OO style. However, it does the job, and should serve to evolve a * lightweight ajdoc implementation until we can make a properly extended javadoc implementation. - * + * * @author Mik Kersten */ public class Main implements Config { diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java index 4db92d66a7..b615078ba7 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StructureUtil.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -27,7 +27,7 @@ public class StructureUtil { /** * Calculate the targets for a given IProgramElement (and it's immediate children if its not a type or if the child is CODE) and * relationship kind - * + * * @return null if a relationship of that kind is not found */ public static List getTargets(IProgramElement node, IRelationship.Kind kind) { @@ -37,7 +37,7 @@ public static List getTargets(IProgramElement node, IRelationship.Kind k /** * Calculate the targets for a given IProgramElement (and it's immediate children if its not a type or if the child is CODE) and * relationship kind with the specified relationship name. - * + * * @return null if a relationship of that kind is not found */ public static List getTargets(IProgramElement node, IRelationship.Kind kind, String relName) { @@ -166,7 +166,7 @@ public static boolean isAnonymous(IProgramElement node) { return isIntName || node.getName().startsWith("new "); // return isIntName; // if (!isIntName) { - // + // // return node.getName().startsWith("new "); // } else { // return false; diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java index 64d7aebf22..3dd6a25b56 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/StubFileGenerator.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * Mik Kersten port to AspectJ 1.1+ code base * ******************************************************************/ @@ -48,7 +48,7 @@ static void processFile(AsmManager model, File inputFile, File signatureFile) th FileUtil.copyFile(inputFile, signatureFile); return; } - + String path = StructureUtil.translateAjPathName(signatureFile.getCanonicalPath()); PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(path))); @@ -190,7 +190,7 @@ static String addDeclID(IProgramElement decl, String formalComment) { /** * We want to go: just before the first period just before the first @ just before the end of the comment - * + * * Adds a place holder for the period ('#') if one will need to be replaced. */ static String addToFormal(String formalComment, String string) { diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java index c5eb5f9211..3636d98d66 100644 --- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java +++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Util.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -20,5 +20,5 @@ public static boolean isExecutingOnJava5() { String version = System.getProperty("java.class.version","44.0"); return version.equals("49.0"); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java index 50bddfb5d8..8bf87bb732 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AJDocConstants.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2019 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * 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.tools.ajdoc; @@ -14,5 +14,5 @@ public class AJDocConstants { public final static String VERSION = "1.7"; - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java index 6210647e03..89c4e7f2e3 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocModuleTests.java @@ -1,14 +1,14 @@ package org.aspectj.tools.ajdoc; /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ import junit.framework.Test; @@ -24,12 +24,12 @@ public static Test suite() { suite.addTestSuite(DeclareFormsTest.class); suite.addTestSuite(SpacewarTestCase.class); suite.addTestSuite(PatternsTestCase.class); - suite.addTestSuite(CoverageTestCase.class); + suite.addTestSuite(CoverageTestCase.class); suite.addTestSuite(ITDTest.class); suite.addTestSuite(FullyQualifiedArgumentTest.class); suite.addTestSuite(EnumTest.class); suite.addTestSuite(PointcutVisibilityTest.class); - suite.addTestSuite(ExecutionTestCase.class); + suite.addTestSuite(ExecutionTestCase.class); suite.addTestSuite(BugTest.class); return suite; } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java index 3e69f4887e..dd90652cb1 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocOutputChecker.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2005 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java index 0baeb7dcde..35916f030e 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTestCase.java @@ -1,9 +1,9 @@ /******************************************************************** * Copyright (c) 2005 Contributors. All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java index 2fbe19b44f..a3594819fc 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/AjdocTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wes Isberg initial implementation + * 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: + * Wes Isberg initial implementation * ******************************************************************/ @@ -18,9 +18,9 @@ import org.aspectj.util.FileUtil; public class AjdocTests {//extends TestCase { - + public static File ASPECTJRT_PATH; - + static { String[] paths = { "sp:aspectjrt.path", "sp:aspectjrt.jar", "../lib/test/aspectjrt.jar", "../aj-build/jars/aspectj5rt-all.jar", diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java index 6cbec3ebeb..42d2c6f43b 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/BugTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2006 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -28,7 +28,7 @@ public void testPr160302() throws Exception { assertFalse("expected all decorating tags to be removed but found that they" + " weren't",AjdocOutputChecker.containsString(html, Config.DECL_ID_STRING)); } - + /** * Passing the "-Xlint:error" option through to the compiler should * cause the ajc build to fail because the advice did not match @@ -60,7 +60,7 @@ public void testPr148906_2() { "advice defined in AdviceDidNotMatch has not been applied [Xlint:adviceDidNotMatch]", Main.getErrors()[0].getMessage()); } - + /** * Passing the -aspectpath option though to the compiler should * result in relationships being displayed @@ -76,12 +76,12 @@ public void testPr148906_3() throws Exception { fail("couldn't find " + getAbsolutePathOutdir() + File.separator + "C.html - were there javadoc/compilation errors?"); } assertTrue("expected to find 'Advised by' in the html output but did " + - " not",AjdocOutputChecker.containsString(html, + " not",AjdocOutputChecker.containsString(html, HtmlDecorator.HtmlRelationshipKind.ADVISED_BY.getName())); } - + /** - * Passing an option starting with "-" that doesn't require a second entry + * Passing an option starting with "-" that doesn't require a second entry * should mean everything is correctly given to the compiler. For example: * '-outxml -aspectpath " should mean both '-outxml' and the aspectpath * options are given correctly. @@ -97,15 +97,15 @@ public void testPr148906_4() throws Exception { fail("couldn't find " + getAbsolutePathOutdir() + File.separator + "C.html - were there javadoc/compilation errors?"); } assertTrue("expected to find 'Advised by' in the html output but did " + - " not",AjdocOutputChecker.containsString(html, + " not",AjdocOutputChecker.containsString(html, HtmlDecorator.HtmlRelationshipKind.ADVISED_BY.getName())); - File aopFile = new File(getAbsolutePathOutdir() + File.separator + File aopFile = new File(getAbsolutePathOutdir() + File.separator + "META-INF" + File.separator + "aop-ajc.xml"); - assertTrue("couldn't find " + getAbsolutePathOutdir() + File.separator - + "META-INF" + File.separator + "aop-ajc.xml" , + assertTrue("couldn't find " + getAbsolutePathOutdir() + File.separator + + "META-INF" + File.separator + "aop-ajc.xml" , aopFile.exists()); - } - + } + /** * Passing bogus option to ajc */ @@ -116,7 +116,7 @@ public void testPr148906_5() throws Exception { runAjdoc(files,"1.5",ajOptions); assertTrue("expected build of project to abort",Main.hasAborted()); } - + /** * Not passing any files to ajdoc should result in both the ajdoc * and ajc usage messages @@ -127,11 +127,11 @@ public void testPr148906_6() throws Exception { options.add("-verbose"); runAjdoc(options); assertTrue("expected the ajdoc usage message to be reported",Main.hasShownAjdocUsageMessage()); - assertTrue("expected build of project to abort",Main.hasAborted()); + assertTrue("expected build of project to abort",Main.hasAborted()); } - + /** - * javadoc comments should still appear even if preceded by + * javadoc comments should still appear even if preceded by * 'normal' comments */ public void testPr164356() throws Exception { @@ -140,7 +140,7 @@ public void testPr164356() throws Exception { runAjdoc(files); File htmlFile = new File(getAbsolutePathOutdir() + "/C.html"); if (!htmlFile.exists()) { - fail("couldn't find " + htmlFile.getAbsolutePath() + + fail("couldn't find " + htmlFile.getAbsolutePath() + " (ajc aborted: " + Main.hasAborted() + ")"); } String foo = "description of foo"; @@ -148,19 +148,19 @@ public void testPr164356() throws Exception { String goo = "description of goo"; String bas = "description of bas"; assertTrue("expected method description 'description of foo' to appear" + - " in ajdoc output but it did not", + " in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, foo)); assertTrue("expected method description 'description of bar' to " + - "appear in ajdoc output but it did not", + "appear in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, bar)); assertFalse("didn't expect method description 'description of goo' to " + - "appear in ajdoc output but it did not", + "appear in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, goo)); assertTrue("expected method description 'description of bas' to appear" + - " in ajdoc output but it did not", + " in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, bas)); } - + /** * Comments for a constructor should be included in the ajdoc output */ @@ -170,16 +170,16 @@ public void testPr164340() throws Exception { runAjdoc(files); File htmlFile = new File(getAbsolutePathOutdir() + "/C.html"); if (!htmlFile.exists()) { - fail("couldn't find " + htmlFile.getAbsolutePath() + + fail("couldn't find " + htmlFile.getAbsolutePath() + " (ajc aborted: " + Main.hasAborted() + ")"); } String methodDesc = "This is method foo"; String constDesc = "This is a constructor"; assertTrue("expected method description 'This is method foo' to appear" + - " in ajdoc output but it did not", + " in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, methodDesc)); assertTrue("expected constructor description 'This is a constructor' to " + - "appear in ajdoc output but it did not", + "appear in ajdoc output but it did not", AjdocOutputChecker.containsString(htmlFile, constDesc)); } } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java index ab2fc8ec22..412d2d4eb5 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java index 6f2e369590..ab132ed46d 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/DeclareFormsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -28,20 +28,20 @@ public class DeclareFormsTest extends AjdocTestCase { private String declareParentsImpl = "declare parents: implements Serializable"; private String declareSoft = "declare soft: foo.SizeException2"; private String declarePrecedence = "declare precedence: foo.DeclareCoverage2, foo.InterTypeDecCoverage2"; - + private String doItHref = "HREF=\"../foo/Main2.html#doIt()\""; private String pointHref = "HREF=\"../foo/Point2.html\""; private String cHref = "HREF=\"../foo/C.html\""; - + private String doIt = "doIt()"; - + public void testCoverage() { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage.java")}; runAjdoc("private","1.6",files); } - + /** * Test that the declare statements appear in the Declare Detail * and Declare Summary sections of the ajdoc @@ -50,14 +50,14 @@ public void testDeclareStatments() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } // check the contents of the declare detail summary - String[] strings = { + String[] strings = { declareError, declareWarning, declareParentsImpl, @@ -68,7 +68,7 @@ public void testDeclareStatments() throws Exception { htmlFile,strings,"DECLARE DETAIL SUMMARY"); assertTrue(htmlFile.getName() + " should contain all declare statements in " + "the Declare Detail section",missing.isEmpty()); - + // check the contents of the declare summary - should contain // the same strings missing = AjdocOutputChecker.getMissingStringsInSection( @@ -76,7 +76,7 @@ public void testDeclareStatments() throws Exception { assertTrue(htmlFile.getName() + " should contain all declare statements in " + "the Declare Summary section",missing.isEmpty()); } - + /** * Declare warning's should have the 'matched by' relationship * in the ajdoc for the declaring aspect @@ -85,31 +85,31 @@ public void testDeclareWarning() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY", declareWarningQuotes, HtmlDecorator.HtmlRelationshipKind.MATCHED_BY, doItHref); - assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + + assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", declareWarningQuotes, HtmlDecorator.HtmlRelationshipKind.MATCHED_BY, doItHref); - assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + + assertTrue("Should have '" + declareWarningQuotes + " matched by " + doItHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare warning should have the 'matches + * The target of a declare warning should have the 'matches * declare' relationship in the ajdoc - test the case when * the declare warning matches a call join point */ @@ -117,31 +117,31 @@ public void testMatchesDeclareCall() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Main2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName(doIt), HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, declareWarningQuotes); - assertTrue("Should have '" + doIt + " matches declare " + + assertTrue("Should have '" + doIt + " matches declare " + declareWarningQuotes + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", toName(doIt), HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, declareWarningQuotes); - assertTrue("Should have '" + doIt + " matches declare " + + assertTrue("Should have '" + doIt + " matches declare " + declareWarningQuotes + "' in the Declare Summary section", b); } - + /** - * The target of a declare warning should have the 'matches + * The target of a declare warning should have the 'matches * declare' relationship in the ajdoc - test the case when * the declare warning matches an execution join point */ @@ -149,20 +149,20 @@ public void testMatchesDeclareExecution() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Point2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("setX(int)"), // LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)", HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;blahquot;"); - assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + + assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", @@ -170,10 +170,10 @@ public void testMatchesDeclareExecution() throws Exception { // LangUtil.is18VMOrGreater()?"setX-int-":"setX(int)", HtmlDecorator.HtmlRelationshipKind.MATCHES_DECLARE, "declare warning: quot;blahquot;"); - assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + + assertTrue("Should have 'setX(int) matches declare declare warning: quot;blahquot;" + "' in the Method Summary section", b); } - + /** * Declare parents's should have the 'declared on' relationship * in the ajdoc for the declaring aspect @@ -182,38 +182,38 @@ public void testDeclareParents() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY", declareParentsImpl, HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, pointHref); - assertTrue("Should have ' " + declareParentsImpl + " declared on " + + assertTrue("Should have ' " + declareParentsImpl + " declared on " + pointHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", declareParentsImpl, HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, pointHref); - assertTrue("Should have ' " + declareParentsImpl + " declared on " + + assertTrue("Should have ' " + declareParentsImpl + " declared on " + pointHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare parent should have the 'aspect + * The target of a declare parent should have the 'aspect * declarations' relationship in the ajdoc */ public void testAspectDeclarations() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Point2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() @@ -227,7 +227,7 @@ public void testAspectDeclarations() throws Exception { " declare parents: implements Serializable'",b); } - + /** * Declare soft's should have the 'softens' relationship * in the ajdoc for the declaring aspect @@ -236,60 +236,60 @@ public void testDeclareSoft() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareCoverage2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY", declareSoft, HtmlDecorator.HtmlRelationshipKind.SOFTENS, doItHref); - assertTrue("Should have '" + declareSoft + " softens " + doItHref + + assertTrue("Should have '" + declareSoft + " softens " + doItHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", declareSoft, HtmlDecorator.HtmlRelationshipKind.SOFTENS, doItHref); - assertTrue("Should have '" + declareSoft + " softens " + doItHref + + assertTrue("Should have '" + declareSoft + " softens " + doItHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare soft should have the 'softened + * The target of a declare soft should have the 'softened * by' relationship in the ajdoc */ public void testSoftenedBy() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareCoverage2.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Main2.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName(doIt), HtmlDecorator.HtmlRelationshipKind.SOFTENED_BY, declareSoft); - assertTrue("Should have '" + doIt + " softened by " + declareSoft + + assertTrue("Should have '" + doIt + " softened by " + declareSoft + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", toName(doIt), HtmlDecorator.HtmlRelationshipKind.SOFTENED_BY, declareSoft); - assertTrue("Should have '" + doIt + " softened by " + declareSoft + + assertTrue("Should have '" + doIt + " softened by " + declareSoft + "' in the Method Summary section", b); } - + private String toName(String name) { if (!LangUtil.is11VMOrGreater()) { name = name.replace('(','-'); @@ -297,7 +297,7 @@ private String toName(String name) { } return name; } - + /** * Declare annotation should have the 'annotates' relationship * in the ajdoc for the declaring aspect @@ -306,7 +306,7 @@ public void testDeclareAnnotation() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtType.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + // Aspect AnnotationTest should contain within it's declare // detail and summary the declare annotation statement. // Check for this.... @@ -332,19 +332,19 @@ public void testDeclareAnnotation() throws Exception { "declare @type: foo.C : @MyAnnotation", HtmlDecorator.HtmlRelationshipKind.ANNOTATES, cHref); - assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + cHref + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", "declare @type: foo.C : @MyAnnotation", HtmlDecorator.HtmlRelationshipKind.ANNOTATES, cHref); - assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + assertTrue("Should have 'declare @type: foo.C : @MyAnnotation annotates " + cHref + "' in the Declare Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -352,19 +352,19 @@ public void testMethodAnnotatedBy() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtMethod.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @method: public * foo.C.*(..) : @MyAnnotation"); assertTrue("Should have 'amethod() annotated by " + - "declare @method: public * foo.C.*(..) : @MyAnnotation" + + "declare @method: public * foo.C.*(..) : @MyAnnotation" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", @@ -372,12 +372,12 @@ public void testMethodAnnotatedBy() throws Exception { HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @method: public * foo.C.*(..) : @MyAnnotation"); assertTrue("Should have 'amethod() annotated by " + - "declare @method: public * foo.C.*(..) : @MyAnnotation" + + "declare @method: public * foo.C.*(..) : @MyAnnotation" + "' in the Method Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -385,33 +385,33 @@ public void testConstructorAnnotatedBy() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtConstructor.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== CONSTRUCTOR DETAIL", LangUtil.is11VMOrGreater()?"<init>(java.lang.String)":toName("C(java.lang.String)"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @constructor: foo.C.new(..) : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @constructor: foo.C.new(..) : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @constructor: foo.C.new(..) : @MyAnnotation" + "' in the Method Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== CONSTRUCTOR SUMMARY", LangUtil.is11VMOrGreater()?"#%3Cinit%3E(java.lang.String)":toName("C(java.lang.String)"), HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @constructor: foo.C.new(..) : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @constructor: foo.C.new(..) : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @constructor: foo.C.new(..) : @MyAnnotation" + "' in the Method Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -419,33 +419,33 @@ public void testFieldAnnotatedBy() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareAtField.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== FIELD DETAIL", "x", HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @field: int foo.C.* : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @field: int foo.C.* : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @field: int foo.C.* : @MyAnnotation" + "' in the Field Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== FIELD SUMMARY", "x", HtmlDecorator.HtmlRelationshipKind.ANNOTATED_BY, "declare @field: int foo.C.* : @MyAnnotation"); - assertTrue("Should have '" + doIt + " annotated by " + - "declare @field: int foo.C.* : @MyAnnotation" + + assertTrue("Should have '" + doIt + " annotated by " + + "declare @field: int foo.C.* : @MyAnnotation" + "' in the Field Summary section", b); } - + /** - * The target of a declare method annotation should have the + * The target of a declare method annotation should have the * 'annotated by' relationship in the ajdoc within the method * information */ @@ -466,7 +466,7 @@ public void testTypeAnnotatedBy() throws Exception { assertTrue("The class data section should have 'annotated by" + " declare @type: foo.C : @MyAnnotation'",b); } - + /** * Test that info for both "matches declare" and "advised by" * appear in the ajdoc for a method when the method is affected @@ -476,13 +476,13 @@ public void testMatchesDeclareAndAdvisedBy() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "A.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/C.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("amethod()"), @@ -497,24 +497,24 @@ public void testMatchesDeclareAndAdvisedBy() throws Exception { "declare warning: quot;warningquot;"); assertTrue("Should have 'amethod() matches declare declare warning: " + "quot;warningquot;' in the Method Summary section", b); - + b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"=== METHOD DETAIL", toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "before(): p.."); assertTrue("the Method Detail should have amethod() advised by before(): p..",b); - + b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"=== METHOD SUMMARY", toName("amethod()"), HtmlDecorator.HtmlRelationshipKind.ADVISED_BY, "before(): p.."); - assertTrue("the Method Summary should have amethod() advised by before(): p..",b); + assertTrue("the Method Summary should have amethod() advised by before(): p..",b); } - + /** - * Test that if there are two declare parents statements within + * Test that if there are two declare parents statements within * an aspect, one which extends and one which implements, that the * ajdoc shows the correct information */ @@ -522,48 +522,48 @@ public void testTwoDeclareParents() throws Exception { initialiseProject("declareForms"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "DeclareParents.aj")}; runAjdoc("private",AJDocConstants.VERSION,files); - + File htmlFile = new File(getAbsolutePathOutdir() + "/foo/DeclareParents.html"); if (!htmlFile.exists()) { fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?"); } - + String[] strings = { "declare parents: implements Serializable", "HREF=\"../foo/Class1.html\"", "declare parents: extends Observable", "HREF=\"../foo/Class2.html\""}; - + // check that the correct declare statements are there for (int i = 0; i < strings.length - 1; i = i+2) { boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY",strings[i], HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, strings[i+1]); - assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + + assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + "' in the Declare Detail section", b); } - + for (int i = 0; i < strings.length - 1; i = i+2) { boolean b = AjdocOutputChecker.summarySectionContainsRel( htmlFile,"DECLARE SUMMARY", strings[i], HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, strings[i+1]); - assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + + assertTrue("Should have ' " + strings[i] + " declared on " + strings[i+1] + "' in the Declare Summary section", b); } - - // check that we don't have declare statements for those that don't + + // check that we don't have declare statements for those that don't // exist in the code boolean b = AjdocOutputChecker.detailSectionContainsRel( htmlFile,"DECLARE DETAIL SUMMARY",strings[0], HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, strings[3]); - assertFalse("Should not have ' " + strings[0] + " declared on " + strings[3] + + assertFalse("Should not have ' " + strings[0] + " declared on " + strings[3] + "' in the Declare Detail section", b); - + } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java index 65ef3b3c92..0ff0c581f9 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/EnumTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2005 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2005 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,7 +14,7 @@ public class EnumTest extends AjdocTestCase { - + /** * Test for pr122728 - no StringOutOfBoundsException * when processing an Enum @@ -27,14 +27,14 @@ public void testEnum() throws Exception { /** * Test for pr122728 - no StringOutOfBoundsException - * when processing an Enum + * when processing an Enum */ public void testInlinedEnum() throws Exception { initialiseProject("pr122728"); File[] files = {new File(getAbsoluteProjectDir() + "/src/pack/ClassWithInnerEnum.java")}; runAjdoc("private","1.5",files); } - + /** * Test for pr122728 - no StringOutOfBoundsException * when processing an Enum diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java index 721977f2c1..cbbe8e49fb 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ExecutionTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -20,17 +20,17 @@ * @author Mik Kersten */ public class ExecutionTestCase extends AjdocTestCase { - + public void testVersionMatch() { String ajdocVersion = Main.getVersion(); String compilerVersion = Version.getText(); assertTrue("version check", ajdocVersion.endsWith(compilerVersion)); } - + public void testFailingBuild() { initialiseProject("failing-build"); File file1 = new File(getAbsoluteProjectDir() + File.separatorChar + "Fail.java"); - String[] args = { file1.getAbsolutePath() }; + String[] args = { file1.getAbsolutePath() }; org.aspectj.tools.ajdoc.Main.main(args); assertTrue(Main.hasAborted()); } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java index 2d97a82bfa..700cd18ab3 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/FullyQualifiedArgumentTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2005 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2005 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,7 +14,7 @@ import java.util.List; public class FullyQualifiedArgumentTest extends AjdocTestCase { - + /** * Test for pr58520 */ @@ -24,7 +24,7 @@ public void testPr58520() throws Exception { new File(getAbsoluteProjectDir() + File.separatorChar +"src/pack/C.java"), new File(getAbsoluteProjectDir() + File.separatorChar + "src/pack/A.aj")}; runAjdoc("private",files); - + // check the contents of A.html File htmlA = new File(getAbsolutePathOutdir() + "/pack/A.html"); if (!htmlA.exists()) { @@ -41,5 +41,5 @@ public void testPr58520() throws Exception { assertEquals("The fully qualified name should appear in the argument", "C.html#method3(String)",missing.get(0)); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java index 899782d888..2444469f9d 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/ITDTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2005 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2005 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - iniital version *******************************************************************/ package org.aspectj.tools.ajdoc; @@ -14,7 +14,7 @@ import java.util.List; public class ITDTest extends AjdocTestCase { - + /** * Test for pr119453 */ @@ -36,19 +36,19 @@ public void testITDDeclaredOn() throws Exception { "C.y", HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, "HREF=\"../pack/C.html\""); - assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + + assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + "' in the Declare Detail section", b); b = AjdocOutputChecker.summarySectionContainsRel( htmlA,"DECLARE SUMMARY", "C.y", HtmlDecorator.HtmlRelationshipKind.DECLARED_ON, "HREF=\"../pack/C.html\""); - assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + + assertTrue("Should have 'C.y declared on HREF=\"../pack/C.html\"" + "' in the Declare Summary section", b); - + // check the modifiers are correct in the declare detail summary String[] stringsA = { "private int", - "public java.lang.String", + "public java.lang.String", "

C.y

", "public C.C", "package void"}; @@ -56,14 +56,14 @@ public void testITDDeclaredOn() throws Exception { assertEquals("There should be one missing string ",1,missing.size()); assertEquals("the 'package' and 'void' modifiers shouldn't appear in the 'Declare Detail' section of the ajdoc", "package void", missing.get(0)); - + // check the modifiers are correct in the declare summary String[] stringsA2 = {"private", "int", "public", "String", "package void"}; missing = AjdocOutputChecker.getMissingStringsInSection(htmlA,stringsA2,"DECLARE SUMMARY"); assertEquals("There should be two missing strings ",2,missing.size()); assertTrue("the public modifier shouldn't appear in the 'Declare Summary' section of the ajdoc", missing.contains("public")); assertTrue("the 'package' and 'void' modifiers shouldn't appear in the 'Declare Summary' section of the ajdoc", missing.contains("package void")); - + } /** @@ -86,10 +86,10 @@ public void testITDMatchesDeclare() throws Exception { // check that the required sections exist assertTrue(htmlC.getAbsolutePath() + " should contain an " - + "'INTER-TYPE METHOD SUMMARY' section", + + "'INTER-TYPE METHOD SUMMARY' section", AjdocOutputChecker.containsString(htmlC, "INTER-TYPE METHOD SUMMARY")); assertTrue(htmlC.getAbsolutePath() + " should contain an " - + "'INTER-TYPE FIELD SUMMARY' section", + + "'INTER-TYPE FIELD SUMMARY' section", AjdocOutputChecker.containsString(htmlC, "INTER-TYPE FIELD SUMMARY")); assertTrue(htmlC.getAbsolutePath() + " should contain an " + "'INTER-TYPE CONSTRUCTOR SUMMARY' section", @@ -105,12 +105,12 @@ public void testITDMatchesDeclare() throws Exception { String[] stringsC2 = { "private" }; missing = AjdocOutputChecker.getMissingStringsInSection(htmlC,stringsC2,"INTER-TYPE FIELD SUMMARY"); assertTrue("the private modifier for itd methods should appear in the ajdoc ",missing.size() == 0); - + } - + /** * Test that the ITD's do not appear in as 'aspect declarations' in the - * class data information. + * class data information. */ public void testNoAspectDeclarations() throws Exception { initialiseProject("pr119453"); diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java index 61c0d67cd5..de8ab55715 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PatternsTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -16,25 +16,25 @@ /** * A long way to go until full coverage, but this is the place to add more. - * + * * @author Mik Kersten */ public class PatternsTestCase extends AjdocTestCase { - + public void testSimpleExample() { - + // System.err.println(new File("testdata.figures-demo").exists()); // File file1 = new File("testdata/patterns/allPatterns.lst"); File outdir = new File("testdata/patterns/doc"); File srcdir = new File("../../docs/sandbox/ubc-design-patterns/src"); - - String[] args = { -// "-XajdocDebug", + + String[] args = { +// "-XajdocDebug", "-classpath", AjdocTests.ASPECTJRT_PATH.getPath(), - "-d", + "-d", outdir.getAbsolutePath(), - "-sourcepath", + "-sourcepath", srcdir.getAbsolutePath(), "ca.ubc.cs.spl.aspectPatterns.patternLibrary", "ca.ubc.cs.spl.aspectPatterns.examples.abstractFactory.java", @@ -84,8 +84,8 @@ public void testSimpleExample() { "ca.ubc.cs.spl.aspectPatterns.examples.visitor.java", "ca.ubc.cs.spl.aspectPatterns.examples.visitor.aspectj" }; - + org.aspectj.tools.ajdoc.Main.main(args); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java index b3544d5633..1ea3bbd40d 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/PointcutVisibilityTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -18,7 +18,7 @@ * @author Mik Kersten */ public class PointcutVisibilityTest extends AjdocTestCase { - + /** * Test that passing the "public" argument only shows * public pointcuts in the ajdoc @@ -27,7 +27,7 @@ public void testCoveragePublicMode() throws Exception { initialiseProject("bug82340"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "Pointcuts.java")}; runAjdoc("public",files); - + // ajdoc for Pointcut.java should contain info about // the public pointcuts but not the protected and // private one (since "public" was an argument) @@ -43,18 +43,18 @@ public void testCoveragePublicMode() throws Exception { assertTrue("passing the 'public' argument means the private pointcut shouldn't appear in the ajdoc", missing.contains("privatePointcut")); assertTrue("passing the 'public' argument means the protected pointcut shouldn't appear in the ajdoc", missing.contains("protectedPointcut")); } - + /** * Test that passing the "protected" argument only shows - * public and protected pointcuts in the ajdoc + * public and protected pointcuts in the ajdoc */ public void testCoverageProtectedMode() throws Exception { initialiseProject("bug82340"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "Pointcuts.java")}; runAjdoc("protected",files); - + // ajdoc for Pointcut.java should contain info about - // the public and protected pointcuts but not the + // the public and protected pointcuts but not the // private one (since "protected" was an argument) // Check that this is the case...... File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Pointcuts.html"); @@ -65,21 +65,21 @@ public void testCoverageProtectedMode() throws Exception { String[] strings = { "privatePointcut","protectedPointcut","publicPointcut"}; List missing = AjdocOutputChecker.getMissingStringsInSection(htmlFile,strings,"POINTCUT SUMMARY"); assertEquals("There should be one missing strings",1,missing.size()); - assertEquals("passing the 'protected' argument means the private pointcut shouldn't appear in the ajdoc", + assertEquals("passing the 'protected' argument means the private pointcut shouldn't appear in the ajdoc", "privatePointcut", missing.get(0)); } - + /** * Test that passing the "private" argument shows all - * pointcuts (public, protected and private) in the ajdoc + * pointcuts (public, protected and private) in the ajdoc */ public void testCoveragePrivateMode() throws Exception { initialiseProject("bug82340"); File[] files = {new File(getAbsoluteProjectDir() + File.separatorChar + "Pointcuts.java")}; runAjdoc("private",files); - + // ajdoc for Pointcut.java should contain info about - // the public, protected and private pointcuts + // the public, protected and private pointcuts // (since "private" was an argument) // Check that this is the case...... File htmlFile = new File(getAbsolutePathOutdir() + "/foo/Pointcuts.html"); @@ -92,5 +92,5 @@ public void testCoveragePrivateMode() throws Exception { assertTrue("passing the 'private' modifier means that private, protected and public " + "pointcuts should appear in the ajdoc",missing.isEmpty()); } - + } diff --git a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java index 53f7a5ef9a..4dab37aab5 100644 --- a/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java +++ b/ajdoc/src/test/java/org/aspectj/tools/ajdoc/SpacewarTestCase.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * ******************************************************************/ package org.aspectj.tools.ajdoc; @@ -18,18 +18,18 @@ * @author Mik Kersten */ public class SpacewarTestCase extends AjdocTestCase { - + private String[] dirs = {"spacewar","coordination"}; - + protected void setUp() throws Exception { super.setUp(); initialiseProject("spacewar"); } - + public void testSimpleExample() { runAjdoc(dirs); } - + public void testPublicModeExample() { runAjdoc("public",dirs); } diff --git a/asm/src/main/java/org/aspectj/asm/AsmManager.java b/asm/src/main/java/org/aspectj/asm/AsmManager.java index cbebe28427..e81b91b4d6 100644 --- a/asm/src/main/java/org/aspectj/asm/AsmManager.java +++ b/asm/src/main/java/org/aspectj/asm/AsmManager.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Andy Clement incremental support and switch on/off state * ******************************************************************/ @@ -46,7 +46,7 @@ * The Abstract Structure Model (ASM) represents the containment hierarchy and crosscutting structure map for AspectJ programs. It * is used by IDE views such as the document outline, and by other tools such as ajdoc to show both AspectJ declarations and * crosscutting links, such as which advice affects which join point shadows. - * + * * @author Mik Kersten * @author Andy Clement */ @@ -287,7 +287,7 @@ private String genExternFilePath(String configFilePath) { public String getCanonicalFilePath(File f) { return canonicalFilePathMap.get(f); } - + public CanonicalFilePathMap getCanonicalFilePathMap() { return canonicalFilePathMap; } @@ -657,15 +657,15 @@ private String getTypeNameFromHandle(String handle, Map cache) { /** * two kinds of relationships - * + * * A affects B B affectedBy A - * + * * Both of these relationships are added when 'B' is modified. Concrete examples are 'advises/advisedby' or * 'annotates/annotatedby'. - * + * * What we need to do is when 'B' is going to be woven, remove all relationships that may reoccur when it is woven. So - remove * 'affects' relationships where the target is 'B', remove all 'affectedBy' relationships where the source is 'B'. - * + * */ public void removeRelationshipsTargettingThisType(String typename) { boolean debug = false; diff --git a/asm/src/main/java/org/aspectj/asm/HierarchyWalker.java b/asm/src/main/java/org/aspectj/asm/HierarchyWalker.java index 7629f7c684..4cc2fdfc52 100644 --- a/asm/src/main/java/org/aspectj/asm/HierarchyWalker.java +++ b/asm/src/main/java/org/aspectj/asm/HierarchyWalker.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003,2010 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Andy Clement * ******************************************************************/ @@ -26,7 +26,7 @@ protected void preProcess(IProgramElement node) { } protected void postProcess(IProgramElement node) { - } + } public IProgramElement process(IProgramElement node) { preProcess(node); diff --git a/asm/src/main/java/org/aspectj/asm/IElementHandleProvider.java b/asm/src/main/java/org/aspectj/asm/IElementHandleProvider.java index 02a2a3474b..d6a3b69473 100644 --- a/asm/src/main/java/org/aspectj/asm/IElementHandleProvider.java +++ b/asm/src/main/java/org/aspectj/asm/IElementHandleProvider.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/asm/src/main/java/org/aspectj/asm/IHierarchy.java b/asm/src/main/java/org/aspectj/asm/IHierarchy.java index cadbb65498..6816179423 100644 --- a/asm/src/main/java/org/aspectj/asm/IHierarchy.java +++ b/asm/src/main/java/org/aspectj/asm/IHierarchy.java @@ -2,9 +2,9 @@ * Copyright (c) 2003,2010 Contributors * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/asm/src/main/java/org/aspectj/asm/IHierarchyListener.java b/asm/src/main/java/org/aspectj/asm/IHierarchyListener.java index 3a93231139..e80eb1d73e 100644 --- a/asm/src/main/java/org/aspectj/asm/IHierarchyListener.java +++ b/asm/src/main/java/org/aspectj/asm/IHierarchyListener.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/asm/src/main/java/org/aspectj/asm/IModelFilter.java b/asm/src/main/java/org/aspectj/asm/IModelFilter.java index f5181b7cb2..863d890b50 100644 --- a/asm/src/main/java/org/aspectj/asm/IModelFilter.java +++ b/asm/src/main/java/org/aspectj/asm/IModelFilter.java @@ -1,20 +1,20 @@ /* ******************************************************************* * Copyright (c) 2006 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement IBM initial implementation + * 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: + * Andy Clement IBM initial implementation * ******************************************************************/ package org.aspectj.asm; /** * When dumping the model out (for debugging/testing), various parts of it can be passed through this filter. Currently it is used * to ensure the source locations we dump out are independent of sandbox directory. - * + * * @author Andy Clement */ public interface IModelFilter { diff --git a/asm/src/main/java/org/aspectj/asm/IProgramElement.java b/asm/src/main/java/org/aspectj/asm/IProgramElement.java index 95c796b65c..276bb1c5ba 100644 --- a/asm/src/main/java/org/aspectj/asm/IProgramElement.java +++ b/asm/src/main/java/org/aspectj/asm/IProgramElement.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/asm/src/main/java/org/aspectj/asm/IRelationship.java b/asm/src/main/java/org/aspectj/asm/IRelationship.java index 61c67eb8c8..c0b35c105f 100644 --- a/asm/src/main/java/org/aspectj/asm/IRelationship.java +++ b/asm/src/main/java/org/aspectj/asm/IRelationship.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/asm/src/main/java/org/aspectj/asm/IRelationshipMap.java b/asm/src/main/java/org/aspectj/asm/IRelationshipMap.java index 9d03aef75d..bf9d8f968b 100644 --- a/asm/src/main/java/org/aspectj/asm/IRelationshipMap.java +++ b/asm/src/main/java/org/aspectj/asm/IRelationshipMap.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Mik Kersten initial implementation diff --git a/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java index 4efe0401ec..74c48a1b64 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java +++ b/asm/src/main/java/org/aspectj/asm/internal/AspectJElementHierarchy.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Andy Clement Extensions for better IDE representation * ******************************************************************/ @@ -114,7 +114,7 @@ public boolean isValid() { /** * Returns the first match - * + * * @param parent * @param kind not null * @return null if not found @@ -149,7 +149,7 @@ public IProgramElement findElementForLabel(IProgramElement parent, IProgramEleme /** * Find the entry in the model that represents a particular type. - * + * * @param packageName the package in which the type is declared or null for the default package * @param typeName the name of the type * @return the IProgramElement representing the type, or null if not found @@ -217,7 +217,7 @@ public IProgramElement findElementForType(String packageName, String typeName) { /** * Look for any package nodes matching the specified package name. There may be multiple in the case where the types within a * package are split across source folders. - * + * * @param packagename the packagename being searched for * @return a list of package nodes that match that name */ @@ -356,7 +356,7 @@ public IProgramElement findElementForSourceLine(ISourceLocation location) { /** * Never returns null - * + * * @param sourceFilePath canonicalized path for consistency * @param lineNumber if 0 or 1 the corresponding file node will be returned * @return a new structure node for the file if it was not found in the model @@ -383,7 +383,7 @@ public IProgramElement findElementForSourceLine(String sourceFilePath, int lineN /** * Discover the node representing a particular source file. - * + * * @param node where in the model to start looking (usually the root on the initial call) * @param sourcefilePath the source file being searched for * @return the node representing that source file or null if it cannot be found @@ -442,7 +442,7 @@ private IProgramElement createFileStructureNode(String sourceFilePath) { /** * For a specified node, check if any of the children more accurately represent the specified line. - * + * * @param node where to start looking * @param lineno the line number * @return any closer match below 'node' or null if nothing is a more accurate match diff --git a/asm/src/main/java/org/aspectj/asm/internal/CharOperation.java b/asm/src/main/java/org/aspectj/asm/internal/CharOperation.java index bf5330a11c..6d44ecf6ce 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/CharOperation.java +++ b/asm/src/main/java/org/aspectj/asm/internal/CharOperation.java @@ -1,18 +1,18 @@ /******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2006 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.asm.internal; /** * Taken from org.aspectj.org.eclipse.jdt.core.compiler.CharOperation - * + * */ public class CharOperation { diff --git a/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java b/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java index 9bbfc307cf..2732d109f9 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java +++ b/asm/src/main/java/org/aspectj/asm/internal/HandleProviderDelimiter.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2006 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.asm.internal; diff --git a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java index 0ae669502b..0c82714415 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java +++ b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2006 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.asm.internal; @@ -20,11 +20,11 @@ /** * Creates JDT-like handles, for example - * + * * method with string argument: <tjp{Demo.java[Demo~main~\[QString; method with generic argument: * <pkg{MyClass.java[MyClass~myMethod~QList\<QString;>; an aspect: <pkg*A1.aj}A1 advice with Integer arg: * <pkg*A8.aj}A8&afterReturning&QInteger; method call: <pkg*A10.aj[C~m1?method-call(void pkg.C.m2()) - * + * */ public class JDTLikeHandleProvider implements IElementHandleProvider { @@ -151,7 +151,7 @@ private String getParameters(IProgramElement ipe) { /** * Determine a count to be suffixed to the handle, this is only necessary for identical looking entries at the same level in the * model (for example two anonymous class declarations). The format is ! where n will be greater than 2. - * + * * @param ipe the program element for which the handle is being constructed * @return a char suffix that will either be empty or of the form "!" */ diff --git a/asm/src/main/java/org/aspectj/asm/internal/NameConvertor.java b/asm/src/main/java/org/aspectj/asm/internal/NameConvertor.java index 395d0d42bd..9e691eef33 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/NameConvertor.java +++ b/asm/src/main/java/org/aspectj/asm/internal/NameConvertor.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2006 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.asm.internal; @@ -100,7 +100,7 @@ public static char[] convertFromSignature(char[] c) { /** * Given a char array, returns the type name for this. For example 'I' returns 'int', 'Ljava/lang/String' returns * 'java.lang.String' and '[Ljava/lang/String' returns 'java.lang.String[]' - * + * * NOTE: Doesn't go any deaper so given 'Ljava/lang/String;' it would return * 'java.lang.String;', however, only called with something like 'Ljava/lang/String' */ @@ -220,7 +220,7 @@ public static char[] createShortName(char[] c, boolean haveFullyQualifiedAtLeast * Convert a typename into its handle form. There are various cases to consider here - many are discussed in pr249216. The flag * allreadyFQd indicates if we've already included a fq'd name in what we are creating - if we have then further references * should not be fq'd and can be the short name (so java.util.Set becomes just Set). - * + * */ /** diff --git a/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java b/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java index a35709bc18..06dd1c6c63 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003,2010 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Andy Clement, IBM, SpringSource Extensions for better IDE representation * ******************************************************************/ @@ -611,7 +611,7 @@ public void setModifiers(int i) { /** * Convenience mechanism for setting new modifiers which do not require knowledge of the private internal representation - * + * * @param newModifier */ public void addModifiers(IProgramElement.Modifiers newModifier) { diff --git a/asm/src/main/java/org/aspectj/asm/internal/Relationship.java b/asm/src/main/java/org/aspectj/asm/internal/Relationship.java index 8bd4a7e663..af4eba6a13 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/Relationship.java +++ b/asm/src/main/java/org/aspectj/asm/internal/Relationship.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003,2010 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Andy Clement Extensions for better IDE representation * ******************************************************************/ package org.aspectj.asm.internal; @@ -76,7 +76,7 @@ public boolean hasRuntimeTest() { /** * Return the direction of the relationship. It might be affects or affected-by. The direction enables the incremental model * repair code to do the right thing. - * + * * @return true if is an affects relationship: advises/declareson/softens/matchedby/declaredon/annotates */ public boolean isAffects() { diff --git a/asm/src/main/java/org/aspectj/asm/internal/RelationshipMap.java b/asm/src/main/java/org/aspectj/asm/internal/RelationshipMap.java index a9bca8a1dc..d3f18f1448 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/RelationshipMap.java +++ b/asm/src/main/java/org/aspectj/asm/internal/RelationshipMap.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2003,2010 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Mik Kersten initial implementation + * 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: + * Mik Kersten initial implementation * Andy Clement * ******************************************************************/ diff --git a/asm/src/test/java/org/aspectj/asm/AsmModuleTests.java b/asm/src/test/java/org/aspectj/asm/AsmModuleTests.java index 96a3843665..d948de9c72 100644 --- a/asm/src/test/java/org/aspectj/asm/AsmModuleTests.java +++ b/asm/src/test/java/org/aspectj/asm/AsmModuleTests.java @@ -1,15 +1,15 @@ package org.aspectj.asm; /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -18,7 +18,7 @@ public class AsmModuleTests extends TestCase { - public static TestSuite suite() { + public static TestSuite suite() { TestSuite suite = new TestSuite(AsmModuleTests.class.getName()); suite.addTestSuite(NameConvertorTest.class); return suite; @@ -27,4 +27,4 @@ public static TestSuite suite() { public AsmModuleTests(String name) { super(name); } public void testNothing() {} -} +} diff --git a/asm/src/test/java/org/aspectj/asm/NameConvertorTest.java b/asm/src/test/java/org/aspectj/asm/NameConvertorTest.java index f52d4f045d..4c168a8718 100644 --- a/asm/src/test/java/org/aspectj/asm/NameConvertorTest.java +++ b/asm/src/test/java/org/aspectj/asm/NameConvertorTest.java @@ -1,11 +1,11 @@ /******************************************************************** - * Copyright (c) 2006 Contributors. All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * Contributors: IBM Corporation - initial API and implementation + * Copyright (c) 2006 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 + * + * Contributors: IBM Corporation - initial API and implementation * Helen Hawkins - initial version *******************************************************************/ package org.aspectj.asm; diff --git a/aspectjmatcher/pom.xml b/aspectjmatcher/pom.xml index ac52698ab2..94a43ac1af 100644 --- a/aspectjmatcher/pom.xml +++ b/aspectjmatcher/pom.xml @@ -21,8 +21,8 @@ - Eclipse Public License - v 1.0 - http://www.eclipse.org/legal/epl-v10.html + Eclipse Public License - v 2.0 + https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt repo diff --git a/aspectjrt/pom.xml b/aspectjrt/pom.xml index a63eb51718..b4e73c1fa3 100644 --- a/aspectjrt/pom.xml +++ b/aspectjrt/pom.xml @@ -20,8 +20,8 @@ - Eclipse Public License - v 1.0 - http://www.eclipse.org/legal/epl-v10.html + Eclipse Public License - v 2.0 + https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt repo diff --git a/aspectjtools/pom.xml b/aspectjtools/pom.xml index dd16458aec..869e1882bd 100644 --- a/aspectjtools/pom.xml +++ b/aspectjtools/pom.xml @@ -22,8 +22,8 @@ - Eclipse Public License - v 1.0 - http://www.eclipse.org/legal/epl-v10.html + Eclipse Public License - v 2.0 + https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt repo diff --git a/aspectjweaver/pom.xml b/aspectjweaver/pom.xml index d394a76d89..73abc26f1e 100644 --- a/aspectjweaver/pom.xml +++ b/aspectjweaver/pom.xml @@ -20,8 +20,8 @@ - Eclipse Public License - v 1.0 - http://www.eclipse.org/legal/epl-v10.html + Eclipse Public License - v 2.0 + https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt repo diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/AnnotationDefault.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/AnnotationDefault.java index bd5a7251f1..23564007ef 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/AnnotationDefault.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/AnnotationDefault.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement initial implementation + * + * 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile; @@ -20,11 +20,11 @@ import org.aspectj.apache.bcel.classfile.annotation.ElementValue; /** - * This attribute is attached to a method and indicates the default + * This attribute is attached to a method and indicates the default * value for an annotation element. */ public class AnnotationDefault extends Attribute { - + private ElementValue value; public AnnotationDefault(int nameIndex, int len, DataInputStream dis, ConstantPool cpool) throws IOException { @@ -41,13 +41,13 @@ public Attribute copy(ConstantPool constant_pool) { // is this next line sufficient? // return (EnclosingMethod)clone(); } - - public final ElementValue getElementValue() { return value; } - + + public final ElementValue getElementValue() { return value; } + public final void dump(DataOutputStream dos) throws IOException { super.dump(dos); value.dump(dos); - } + } public void accept(ClassVisitor v) { v.visitAnnotationDefault(this); diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/EnclosingMethod.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/EnclosingMethod.java index 9e1554ec58..eda8b3b09e 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/EnclosingMethod.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/EnclosingMethod.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement initial implementation + * + * 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile; @@ -19,22 +19,22 @@ import org.aspectj.apache.bcel.Constants; /** - * This attribute exists for local or + * This attribute exists for local or * anonymous classes and ... there can be only one. */ public class EnclosingMethod extends Attribute { - - // Pointer to the CONSTANT_Class_info structure representing the + + // Pointer to the CONSTANT_Class_info structure representing the // innermost class that encloses the declaration of the current class. private int classIndex; - - // If the current class is not immediately enclosed by a method or - // constructor, then the value of the method_index item must be zero. - // Otherwise, the value of the method_index item must point to a - // CONSTANT_NameAndType_info structure representing the name and the - // type of a method in the class referenced by the class we point - // to in the class_index. *It is the compiler responsibility* to - // ensure that the method identified by this index is the closest + + // If the current class is not immediately enclosed by a method or + // constructor, then the value of the method_index item must be zero. + // Otherwise, the value of the method_index item must point to a + // CONSTANT_NameAndType_info structure representing the name and the + // type of a method in the class referenced by the class we point + // to in the class_index. *It is the compiler responsibility* to + // ensure that the method identified by this index is the closest // lexically enclosing method that includes the local/anonymous class. private int methodIndex; @@ -58,23 +58,23 @@ public Attribute copy(ConstantPool constant_pool) { // is this next line sufficient? // return (EnclosingMethod)clone(); } - + // Accessors - public final int getEnclosingClassIndex() { return classIndex; } + public final int getEnclosingClassIndex() { return classIndex; } public final int getEnclosingMethodIndex(){ return methodIndex;} - + public final void setEnclosingClassIndex(int idx) {classIndex = idx;} public final void setEnclosingMethodIndex(int idx){methodIndex= idx;} public final ConstantClass getEnclosingClass() { - ConstantClass c = + ConstantClass c = (ConstantClass)cpool.getConstant(classIndex,Constants.CONSTANT_Class); return c; } - + public final ConstantNameAndType getEnclosingMethod() { if (methodIndex == 0) return null; - ConstantNameAndType nat = + ConstantNameAndType nat = (ConstantNameAndType)cpool.getConstant(methodIndex,Constants.CONSTANT_NameAndType); return nat; } @@ -83,5 +83,5 @@ public final void dump(DataOutputStream file) throws IOException { super.dump(file); file.writeShort(classIndex); file.writeShort(methodIndex); - } + } } diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTypeTable.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTypeTable.java index ecd7e43834..93951faf89 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTypeTable.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/LocalVariableTypeTable.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement initial implementation + * + * 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: + * Andy Clement initial implementation * Heavily based on LocalVariableTable * ******************************************************************/ package org.aspectj.apache.bcel.classfile; @@ -37,7 +37,7 @@ // u2 attribute_name_index; // u4 attribute_length; // u2 local_variable_type_table_length; -// { +// { // u2 start_pc; // u2 length; // u2 name_index; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java index 5470415840..df331ac4e6 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/MethodParameters.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement initial implementation + * + * 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile; @@ -24,24 +24,24 @@ public class MethodParameters extends Attribute { public final static int[] NO_PARAMETER_NAME_INDEXES = new int[0]; public final static int[] NO_PARAMETER_ACCESS_FLAGS = new int[0]; - + public final static int ACCESS_FLAGS_FINAL = 0x0010; public final static int ACCESS_FLAGS_SYNTHETIC = 0x1000; public final static int ACCESS_FLAGS_MANDATED = 0x8000; - + // if 'isInPackedState' then this data needs unpacking private boolean isInPackedState = false; private byte[] data; private int[] names; private int[] accessFlags; - + public MethodParameters(int index, int length, DataInputStream dis, ConstantPool cpool) throws IOException { super(Constants.ATTR_METHOD_PARAMETERS,index,length,cpool); data = new byte[length]; dis.readFully(data,0,length); isInPackedState = true; } - + private void ensureInflated() { if (names!=null) return; try { @@ -63,7 +63,7 @@ private void ensureInflated() { throw new RuntimeException("Unabled to inflate type annotation data, badly formed?"); } } - + public void dump(DataOutputStream dos) throws IOException { super.dump(dos); if (isInPackedState) { @@ -76,18 +76,18 @@ public void dump(DataOutputStream dos) throws IOException { } } } - + public int getParametersCount() { ensureInflated(); return names.length; } - + public String getParameterName(int parameter) { ensureInflated(); ConstantUtf8 c = (ConstantUtf8) cpool.getConstant(names[parameter], Constants.CONSTANT_Utf8); return c.getValue(); } - + public int getAccessFlags(int parameter) { ensureInflated(); return accessFlags[parameter]; @@ -96,11 +96,11 @@ public int getAccessFlags(int parameter) { public boolean isFinal(int parameter) { return (getAccessFlags(parameter) & ACCESS_FLAGS_FINAL)!=0; } - + public boolean isSynthetic(int parameter) { return (getAccessFlags(parameter) & ACCESS_FLAGS_SYNTHETIC)!=0; } - + public boolean isMandated(int parameter) { return (getAccessFlags(parameter) & ACCESS_FLAGS_MANDATED)!=0; } diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationElementValue.java index 2e60245808..d5995b274e 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationElementValue.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java index 8418abdb8a..93c875d4c0 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2004, 2013 IBM Corporation - * - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement initial implementation + * + * 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ArrayElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ArrayElementValue.java index 4cb5f5fe81..3481f64a87 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ArrayElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ArrayElementValue.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ClassElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ClassElementValue.java index a4e18b6d4f..c946b213f1 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ClassElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ClassElementValue.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java index 06f7c72730..63ab8caa75 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004, 2013 IBM, VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/EnumElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/EnumElementValue.java index a8b219774e..6d16ff7324 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/EnumElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/EnumElementValue.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java index 99b4211ec8..0140b34cb9 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java index b4734ee92b..2cfda2452c 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004, 2013 IBM, VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -69,7 +69,7 @@ protected void writeAnnotations(DataOutputStream dos) throws IOException { } } - + private void inflate() { try { DataInputStream dis = new DataInputStream(new ByteArrayInputStream(annotation_data)); diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java index 9ec53978d2..e433ffac05 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004, 2013 IBM, VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -21,17 +21,17 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeInvisAnnos extends RuntimeAnnos { - - public RuntimeInvisAnnos(int nameIdx, int len, ConstantPool cpool) { + + public RuntimeInvisAnnos(int nameIdx, int len, ConstantPool cpool) { super(Constants.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS, false, nameIdx, len, cpool); - } + } - public RuntimeInvisAnnos(int nameIdx, int len, + public RuntimeInvisAnnos(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException { this(nameIdx, len, cpool); readAnnotations(dis,cpool); } - + public RuntimeInvisAnnos(int nameIndex, int len, byte[] rvaData,ConstantPool cpool) { super(Constants.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS,false,nameIndex,len,rvaData,cpool); } @@ -48,4 +48,4 @@ public final void dump(DataOutputStream dos) throws IOException { public Attribute copy(ConstantPool constant_pool) { throw new RuntimeException("Not implemented yet!"); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java index dd5d2a6554..d8b2a1e33b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004, 2013 IBM, VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -20,17 +20,17 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeInvisParamAnnos extends RuntimeParamAnnos { - - public RuntimeInvisParamAnnos(int nameIdx, int len, ConstantPool cpool) { + + public RuntimeInvisParamAnnos(int nameIdx, int len, ConstantPool cpool) { super(Constants.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS, false, nameIdx, len, cpool); } - public RuntimeInvisParamAnnos(int nameIdx, int len, + public RuntimeInvisParamAnnos(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException { this(nameIdx, len, cpool); readParameterAnnotations(dis,cpool); } - + public RuntimeInvisParamAnnos(int nameIndex, int len, byte[] rvaData,ConstantPool cpool) { super(Constants.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS,false,nameIndex,len,rvaData,cpool); } @@ -42,4 +42,4 @@ public void accept(ClassVisitor v) { public Attribute copy(ConstantPool constant_pool) { throw new RuntimeException("Not implemented yet!"); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java index 3351948409..b54848faaa 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -33,4 +33,4 @@ public RuntimeInvisTypeAnnos(int nameIdx, int len, ConstantPool cpool) { public void accept(ClassVisitor v) { v.visitRuntimeInvisibleTypeAnnotations(this); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java index 5b1dcafff7..1a38d2bc65 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeParamAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -22,45 +22,45 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public abstract class RuntimeParamAnnos extends Attribute { - + private List parameterAnnotations; private boolean visible; - + // Keep just a byte stream of the data until someone actually asks for it private boolean inflated = false; private byte[] annotation_data; - + public RuntimeParamAnnos(byte attrid, boolean visible, int nameIdx, int len, ConstantPool cpool) { super(attrid,nameIdx,len,cpool); - this.visible = visible; + this.visible = visible; parameterAnnotations = new ArrayList<>(); } - + public RuntimeParamAnnos(byte attrid,boolean visible,int nameIdx,int len,byte[] data,ConstantPool cpool) { super(attrid,nameIdx,len,cpool); this.visible = visible; parameterAnnotations = new ArrayList<>(); annotation_data = data; } - + public final void dump(DataOutputStream dos) throws IOException { super.dump(dos); writeAnnotations(dos); - } + } public Attribute copy(ConstantPool constant_pool) { throw new RuntimeException("Not implemented yet!"); } - + /** Return a list of Annotation[] - each list entry contains the annotations for one parameter */ public List /*Annotation[]*/ getParameterAnnotations() { if (!inflated) inflate(); return parameterAnnotations; } - + public AnnotationGen[] getAnnotationsOnParameter(int parameterIndex) { if (!inflated) inflate(); // This may happen. In a ctor for a non static inner type the compiler @@ -73,7 +73,7 @@ public AnnotationGen[] getAnnotationsOnParameter(int parameterIndex) { } return parameterAnnotations.get(parameterIndex); } - + public boolean areVisible() { return visible; } @@ -109,7 +109,7 @@ private void inflate() { } } - + protected void writeAnnotations(DataOutputStream dos) throws IOException { if (!inflated) { dos.write(annotation_data,0,length); @@ -123,7 +123,7 @@ protected void writeAnnotations(DataOutputStream dos) throws IOException { } } } - + /** FOR TESTING ONLY: Tells you if the annotations have been inflated to an object graph */ public boolean isInflated() { return inflated; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java index 4e4fae650a..ba87f52f49 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeTypeAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -20,10 +20,10 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public abstract class RuntimeTypeAnnos extends Attribute { - + private boolean visible; private TypeAnnotationGen[] typeAnnotations; // null until inflated - + // Keep just a byte stream of the data until someone actually asks for the information within private byte[] annotation_data; @@ -40,10 +40,10 @@ protected void readTypeAnnotations(DataInputStream dis,ConstantPool cpool) throw public final void dump(DataOutputStream dos) throws IOException { super.dump(dos); writeTypeAnnotations(dos); - } + } protected void writeTypeAnnotations(DataOutputStream dos) throws IOException { - if (typeAnnotations == null) { + if (typeAnnotations == null) { dos.write(annotation_data,0,length); } else { dos.writeShort(typeAnnotations.length); @@ -68,8 +68,8 @@ public TypeAnnotationGen[] getTypeAnnotations() { ensureInflated(); return typeAnnotations; } - - + + public boolean areVisible() { return visible; } diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java index 97512bd6a0..998af41873 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -21,12 +21,12 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeVisAnnos extends RuntimeAnnos { - - public RuntimeVisAnnos(int nameIdx, int len, ConstantPool cpool) { + + public RuntimeVisAnnos(int nameIdx, int len, ConstantPool cpool) { super(Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS, true, nameIdx, len, cpool); - } + } - public RuntimeVisAnnos(int nameIdx, int len, + public RuntimeVisAnnos(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException { this(nameIdx, len, cpool); readAnnotations(dis,cpool); @@ -48,4 +48,4 @@ public final void dump(DataOutputStream dos) throws IOException { public Attribute copy(ConstantPool constant_pool) { throw new RuntimeException("Not implemented yet!"); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java index d8432732bc..cbe4a374dc 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -20,16 +20,16 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeVisParamAnnos extends RuntimeParamAnnos { - - public RuntimeVisParamAnnos(int nameIdx, int len, ConstantPool cpool) { + + public RuntimeVisParamAnnos(int nameIdx, int len, ConstantPool cpool) { super(Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS, true, nameIdx, len, cpool); } - + public RuntimeVisParamAnnos(int nameIndex, int len, byte[] rvaData,ConstantPool cpool) { super(Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS,true,nameIndex,len,rvaData,cpool); } - public RuntimeVisParamAnnos(int nameIdx, int len, + public RuntimeVisParamAnnos(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException { this(nameIdx, len, cpool); readParameterAnnotations(dis,cpool); @@ -42,4 +42,4 @@ public void accept(ClassVisitor v) { public Attribute copy(ConstantPool constant_pool) { throw new RuntimeException("Not implemented yet!"); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java index 2bccc130ee..d775f19828 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -19,18 +19,18 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeVisTypeAnnos extends RuntimeTypeAnnos { - + public RuntimeVisTypeAnnos(int nameIdx, int len, DataInputStream dis,ConstantPool cpool) throws IOException { this(nameIdx, len, cpool); readTypeAnnotations(dis,cpool); } - - public RuntimeVisTypeAnnos(int nameIdx, int len, ConstantPool cpool) { + + public RuntimeVisTypeAnnos(int nameIdx, int len, ConstantPool cpool) { super(Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS, true, nameIdx, len, cpool); } - + public void accept(ClassVisitor v) { v.visitRuntimeVisibleTypeAnnotations(this); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java index fabfa8ca47..cba515b628 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/TypeAnnotationGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/TypeAnnotationGen.java index ad7544eba3..b1f4882299 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/TypeAnnotationGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/TypeAnnotationGen.java @@ -1,14 +1,14 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement initial implementation + * + * 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: + * Andy Clement initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.annotation; @@ -21,7 +21,7 @@ public class TypeAnnotationGen { public static final TypeAnnotationGen[] NO_TYPE_ANNOTATIONS = new TypeAnnotationGen[0]; public static final int[] NO_TYPE_PATH = new int[0]; - + private ConstantPool cpool; private TypeAnnotationGen(ConstantPool cpool) { @@ -34,20 +34,20 @@ private TypeAnnotationGen(ConstantPool cpool) { private int info; // meaning varies depending on target type private int info2; // meaning varies depending on target type private int[] localVarTarget; - + // target type constants public final static int CLASS_TYPE_PARAMETER = 0x00; public final static int METHOD_TYPE_PARAMETER = 0x01; - + public final static int CLASS_EXTENDS = 0x10; public final static int CLASS_TYPE_PARAMETER_BOUND = 0x11; public final static int METHOD_TYPE_PARAMETER_BOUND = 0x12; public final static int FIELD = 0x13; - public final static int METHOD_RETURN = 0x14; + public final static int METHOD_RETURN = 0x14; public final static int METHOD_RECEIVER = 0x15; public final static int METHOD_FORMAL_PARAMETER = 0x16; public final static int THROWS = 0x17; - + public final static int LOCAL_VARIABLE = 0x40; public final static int RESOURCE_VARIABLE = 0x41; public final static int EXCEPTION_PARAMETER = 0x42; @@ -60,14 +60,14 @@ private TypeAnnotationGen(ConstantPool cpool) { public final static int METHOD_INVOCATION_TYPE_ARGUMENT = 0x49; public final static int CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A; public final static int METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B; - + // type path entry kinds public final static int TYPE_PATH_ENTRY_KIND_ARRAY = 0; public final static int TYPE_PATH_ENTRY_KIND_INNER_TYPE = 1; public final static int TYPE_PATH_ENTRY_KIND_WILDCARD = 2; public final static int TYPE_PATH_ENTRY_KIND_TYPE_ARGUMENT = 3; - + public static TypeAnnotationGen read(DataInputStream dis, ConstantPool cpool, boolean isVisible) throws IOException { TypeAnnotationGen typeAnno = new TypeAnnotationGen(cpool); typeAnno.targetType = dis.readUnsignedByte(); @@ -139,7 +139,7 @@ public static TypeAnnotationGen read(DataInputStream dis, ConstantPool cpool, bo typeAnno.annotation = AnnotationGen.read(dis, cpool, isVisible); return typeAnno; } - + public static int[] readLocalVarTarget(DataInputStream dis) throws IOException { int tableLength = dis.readUnsignedShort(); int[] table = new int[tableLength*3]; @@ -213,32 +213,32 @@ public void dump(DataOutputStream dos) throws IOException { } annotation.dump(dos); } - + public int getSupertypeIndex() { assert (targetType==CLASS_EXTENDS); return info; } - + public int getOffset() { assert (targetType==INSTANCEOF || targetType==NEW || targetType==CONSTRUCTOR_REFERENCE || targetType==METHOD_REFERENCE || - targetType==CAST || targetType==CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT || - targetType==METHOD_INVOCATION_TYPE_ARGUMENT || targetType==CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT || + targetType==CAST || targetType==CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT || + targetType==METHOD_INVOCATION_TYPE_ARGUMENT || targetType==CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT || targetType==METHOD_REFERENCE_TYPE_ARGUMENT); return info; } - + public int getTypeParameterIndex() { - assert (targetType==CLASS_TYPE_PARAMETER || targetType==METHOD_TYPE_PARAMETER || + assert (targetType==CLASS_TYPE_PARAMETER || targetType==METHOD_TYPE_PARAMETER || targetType==CLASS_TYPE_PARAMETER_BOUND || targetType==METHOD_TYPE_PARAMETER_BOUND); return info; } - + public int getTypeArgumentIndex() { - assert (targetType==CAST || targetType==CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT || + assert (targetType==CAST || targetType==CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT || targetType==METHOD_INVOCATION_TYPE_ARGUMENT || targetType==CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT || targetType==METHOD_REFERENCE_TYPE_ARGUMENT); return info2; } - + public int getBoundIndex() { assert (targetType==CLASS_TYPE_PARAMETER_BOUND || targetType==METHOD_TYPE_PARAMETER_BOUND); return info2; @@ -265,11 +265,11 @@ public int getExceptionTableIndex() { } - + public int getTargetType() { return targetType; } - + public AnnotationGen getAnnotation() { return annotation; } @@ -332,7 +332,7 @@ public AnnotationGen getAnnotation() { // } // return false; // } - + // public TypeAnnotationGen(TypeAnnotationGen a, ConstantPool cpool, boolean copyPoolEntries) { // this.cpool = cpool; // if (copyPoolEntries) { @@ -369,11 +369,11 @@ public AnnotationGen getAnnotation() { public int[] getTypePath() { return typePath; } - + public String getTypePathString() { return toTypePathString(typePath); } - + public static String toTypePathString(int[] typepath) { StringBuilder sb = new StringBuilder(); int count = 0; @@ -395,7 +395,7 @@ public static String toTypePathString(int[] typepath) { break; case TYPE_PATH_ENTRY_KIND_TYPE_ARGUMENT: sb.append("TYPE_ARGUMENT(").append(typepath[count++]).append(")"); - break; + break; } } sb.append("]"); diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberTag.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberTag.java index fe1d56c277..6bafd89774 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberTag.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LineNumberTag.java @@ -1,21 +1,21 @@ /* ******************************************************************* * Copyright (c) 2002 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * 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 * Andy Clement pushed down into bcel module * ******************************************************************/ package org.aspectj.apache.bcel.generic; -/** - * we don't actually target instructions, but instructions target us. +/** + * we don't actually target instructions, but instructions target us. */ public class LineNumberTag extends Tag { @@ -24,15 +24,15 @@ public class LineNumberTag extends Tag { public LineNumberTag(int lineNumber) { this.lineNumber = lineNumber; } - - public int getLineNumber() { - return lineNumber; + + public int getLineNumber() { + return lineNumber; } - + public String toString() { return "line " + lineNumber; } - + public boolean equals(Object other) { if (!(other instanceof LineNumberTag)) return false; return lineNumber == ((LineNumberTag)other).lineNumber; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableTag.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableTag.java index 7a4fab4e9f..bb09988aab 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableTag.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/LocalVariableTag.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * 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 * Andy Clement pushed down into bcel module * ******************************************************************/ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Tag.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Tag.java index 1d6935e6da..cd293fd219 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Tag.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Tag.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2002 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * PARC initial implementation + * 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 * Andy Clement pushed down into bcel module * ******************************************************************/ diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java index abc6e85134..fed0f7bb47 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -22,19 +22,19 @@ import junit.framework.TestCase; public class AnnotationAccessFlagTest extends TestCase { - + private boolean verbose = false; protected void setUp() throws Exception { super.setUp(); } - + /** * If you write an annotation and compile it, the class file generated should be * marked as an annotation type - which is detectable through BCEL. */ public void testAnnotationClassSaysItIs() throws ClassNotFoundException { - ClassPath cp = + ClassPath cp = new ClassPath("testdata"+File.separator+"testcode.jar"+File.pathSeparator+System.getProperty("java.class.path")); SyntheticRepository repos = SyntheticRepository.getInstance(cp); JavaClass clazz = repos.loadClass("SimpleAnnotation"); @@ -45,11 +45,11 @@ public void testAnnotationClassSaysItIs() throws ClassNotFoundException { assertTrue("Expected SimpleClass class to say it was not an annotation - but it didn't !", !clazz.isAnnotation()); } - + protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationDefaultAttributeTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationDefaultAttributeTest.java index ced29d4896..dc4945fcd7 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationDefaultAttributeTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationDefaultAttributeTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -24,7 +24,7 @@ protected void setUp() throws Exception { super.setUp(); } - + /** * For values in an annotation that have default values, we should be able to * query the AnnotationDefault attribute against the method to discover the @@ -32,7 +32,7 @@ protected void setUp() throws Exception { */ public void testMethodAnnotations() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("SimpleAnnotation"); - + Method m = getMethod(clazz,"fruit"); AnnotationDefault a = (AnnotationDefault) findAttribute("AnnotationDefault",m.getAttributes()); SimpleElementValue val = (SimpleElementValue) a.getElementValue(); @@ -45,5 +45,5 @@ public void testMethodAnnotations() throws ClassNotFoundException { protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java index 84f9d95321..90d51ca40f 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2004 IBM All rights reserved. This program and the accompanying - * materials are made available under the terms of the Eclipse Public License - * v1.0 which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * 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: Andy Clement - initial implementation ******************************************************************************/ @@ -176,4 +176,4 @@ protected void tearDown() throws Exception { super.tearDown(); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnonymousClassTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnonymousClassTest.java index 4a9bc0a3fd..b5ce1c8aaa 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnonymousClassTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnonymousClassTest.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2005 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Adrian Colyer - initial implementation + * 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: + * Adrian Colyer - initial implementation */ package org.aspectj.apache.bcel.classfile.tests; @@ -26,35 +26,35 @@ public class AnonymousClassTest extends TestCase { private SyntheticRepository repos; - + public void testRegularClassIsNotAnonymous() throws ClassNotFoundException { JavaClass clazz = repos.loadClass("AnonymousClassTest"); assertFalse("regular outer classes are not anonymous",clazz.isAnonymous()); assertFalse("regular outer classes are not nested",clazz.isNested()); } - + public void testNamedInnerClassIsNotAnonymous() throws ClassNotFoundException { JavaClass clazz = repos.loadClass("AnonymousClassTest$X"); - assertFalse("regular inner classes are not anonymous",clazz.isAnonymous()); - assertTrue("regular inner classes are nested",clazz.isNested()); + assertFalse("regular inner classes are not anonymous",clazz.isAnonymous()); + assertTrue("regular inner classes are nested",clazz.isNested()); } - + public void testStaticInnerClassIsNotAnonymous() throws ClassNotFoundException { JavaClass clazz = repos.loadClass("AnonymousClassTest$Y"); - assertFalse("regular static inner classes are not anonymous",clazz.isAnonymous()); - assertTrue("regular static inner classes are nested",clazz.isNested()); + assertFalse("regular static inner classes are not anonymous",clazz.isAnonymous()); + assertTrue("regular static inner classes are nested",clazz.isNested()); } - + public void testAnonymousInnerClassIsAnonymous() throws ClassNotFoundException { JavaClass clazz = repos.loadClass("AnonymousClassTest$1"); - assertTrue("anonymous inner classes are anonymous",clazz.isAnonymous()); - assertTrue("anonymous inner classes are anonymous",clazz.isNested()); + assertTrue("anonymous inner classes are anonymous",clazz.isAnonymous()); + assertTrue("anonymous inner classes are anonymous",clazz.isNested()); } - + protected void setUp() throws Exception { - ClassPath cp = + ClassPath cp = new ClassPath("testdata"+File.separator+"testcode.jar"+File.pathSeparator+System.getProperty("java.class.path")); repos = SyntheticRepository.getInstance(cp); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java index b18d51308a..a67eaca0ac 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 - 2016 IBM, VMware, Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement - initial implementation {date} * ******************************************************************/ @@ -162,7 +162,7 @@ public AnnotationGen createFruitAnnotation(ConstantPool cp, String aFruit, boole elements.add(nvGen); return new AnnotationGen(t, elements, visibility, cp); } - + public Attribute getAttribute(Attribute[] attrs, byte tag) { for (Attribute attr: attrs) { if (attr.getTag() == tag) { diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ConstantPoolToStringTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ConstantPoolToStringTest.java index 3a41c6c704..73b863067a 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ConstantPoolToStringTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ConstantPoolToStringTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2018 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -30,17 +30,17 @@ public void testToStringLambdaElements() throws ClassNotFoundException { ConstantPool pool = clazz.getConstantPool(); Method[] methods = clazz.getMethods(); String codeString = methods[1].getCode().getCodeString(); - assertEquals("Code(max_stack = 1, max_locals = 2, code_length = 13)\n" + - "0: invokedynamic #0.run ()Ljava/lang/Runnable; (2)\n" + - "5: astore_1\n" + - "6: aload_1\n" + - "7: invokeinterface java.lang.Runnable.run ()V (3) 1 0\n" + + assertEquals("Code(max_stack = 1, max_locals = 2, code_length = 13)\n" + + "0: invokedynamic #0.run ()Ljava/lang/Runnable; (2)\n" + + "5: astore_1\n" + + "6: aload_1\n" + + "7: invokeinterface java.lang.Runnable.run ()V (3) 1 0\n" + "12: return\n",codeString); - + // #20 = MethodHandle 6:#32 // REF_invokeStatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; String cts = pool.constantToString(pool.getConstant(20)); assertEquals("6:java.lang.invoke.LambdaMetafactory.metafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;",cts); - + // #21 = MethodType #10 // ()V cts = pool.constantToString(pool.getConstant(21)); assertEquals("()V",cts); diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ElementValueGenTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ElementValueGenTest.java index ec7645aebf..02604fdfd8 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ElementValueGenTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ElementValueGenTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2004 IBM All rights reserved. This program and the accompanying - * materials are made available under the terms of the Eclipse Public License - * v1.0 which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * 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: Andy Clement - initial implementation ******************************************************************************/ @@ -226,4 +226,4 @@ protected void tearDown() throws Exception { super.tearDown(); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnclosingMethodAttributeTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnclosingMethodAttributeTest.java index a03c9b386c..86d4c3ddf0 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnclosingMethodAttributeTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnclosingMethodAttributeTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java index 2909a391c9..1896cec9a6 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -22,20 +22,20 @@ import junit.framework.TestCase; public class EnumAccessFlagTest extends TestCase { - + private boolean verbose = false; protected void setUp() throws Exception { super.setUp(); } - + /** * An enumerated type, once compiled, should result in a class file that * is marked such that we can determine from the access flags (through BCEL) that * it was originally an enum type declaration. */ public void testEnumClassSaysItIs() throws ClassNotFoundException { - ClassPath cp = + ClassPath cp = new ClassPath("testdata"+File.separator+"testcode.jar"+File.pathSeparator+System.getProperty("java.class.path")); SyntheticRepository repos = SyntheticRepository.getInstance(cp); JavaClass clazz = repos.loadClass("SimpleEnum"); @@ -46,11 +46,11 @@ public void testEnumClassSaysItIs() throws ClassNotFoundException { assertTrue("Expected SimpleClass class to say it was not an enum - but it didn't !", !clazz.isEnum()); } - + protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/FieldAnnotationsTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/FieldAnnotationsTest.java index 54969f4906..cdf7050779 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/FieldAnnotationsTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/FieldAnnotationsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -25,19 +25,19 @@ public class FieldAnnotationsTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - - + + /** * Check field annotations are retrievable. */ public void testFieldAnnotations() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("AnnotatedFields"); - + checkAnnotatedField(clazz,"i","SimpleAnnotation","id","1"); checkAnnotatedField(clazz,"s","SimpleAnnotation","id","2"); @@ -48,17 +48,17 @@ public void testFieldAnnotations() throws ClassNotFoundException { */ public void testFieldAnnotationsReadWrite() throws ClassNotFoundException,IOException { JavaClass clazz = getClassFromJar("AnnotatedFields"); - + checkAnnotatedField(clazz,"i","SimpleAnnotation","id","1"); checkAnnotatedField(clazz,"s","SimpleAnnotation","id","2"); - + // Write it out File tfile = createTestdataFile("AnnotatedFields.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedFields"); - + checkAnnotatedField(clazz,"i","SimpleAnnotation","id","1"); checkAnnotatedField(clazz,"s","SimpleAnnotation","id","2"); @@ -72,7 +72,7 @@ public void testFieldAnnotationsReadWrite() throws ClassNotFoundException,IOExce public void testFieldAnnotationsModification() throws ClassNotFoundException, IOException { boolean dbg = false; JavaClass clazz = getClassFromJar("AnnotatedFields"); - + ClassGen clg = new ClassGen(clazz); Field f = clg.getFields()[0]; if (dbg) System.err.println("Field in freshly constructed class is: "+f); @@ -87,16 +87,16 @@ public void testFieldAnnotationsModification() throws ClassNotFoundException, IO if (dbg) System.err.println("Replacing original field with new field that has extra annotation"); clg.removeField(f); clg.addField(fg.getField()); - + f = clg.getFields()[1]; // there are two fields in the class, removing and readding has changed the order // so this time index [1] is the 'int i' field if (dbg) System.err.println("Field now looks like this: "+f); if (dbg) System.err.println("With annotations: "+dumpAnnotations(f.getAnnotations())); assertTrue("Should be 2 annotations on this field, but there are "+f.getAnnotations().length,f.getAnnotations().length==2); } - + // helper methods - + public void checkAnnotatedField(JavaClass clazz,String fieldname, String annotationName,String annotationElementName,String annotationElementValue) { Field[] fields = clazz.getFields(); @@ -109,7 +109,7 @@ public void checkAnnotatedField(JavaClass clazz,String fieldname, } } } - + private void checkAnnotation(AnnotationGen a,String name,String elementname,String elementvalue) { assertTrue("Expected annotation to have name "+name+" but it had name "+a.getTypeName(), a.getTypeName().equals(name)); @@ -120,10 +120,10 @@ private void checkAnnotation(AnnotationGen a,String name,String elementname,Stri assertTrue("Expected element value "+elementvalue+" but was "+envp.getValue().stringifyValue(), elementvalue.equals(envp.getValue().stringifyValue())); } - + // helper methods - + public void checkValue(AnnotationGen a,String name,String tostring) { for (NameValuePair element : a.getValues()) { if (element.getNameString().equals(name)) { @@ -139,5 +139,5 @@ public void checkValue(AnnotationGen a,String name,String tostring) { protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java index 00a300b612..f493ca409e 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2004 IBM All rights reserved. This program and the accompanying - * materials are made available under the terms of the Eclipse Public License - * v1.0 which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * 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: Andy Clement - initial implementation ******************************************************************************/ @@ -40,7 +40,7 @@ * The program that some of the tests generate looks like this: public class HelloWorld { public static void main(String[] argv) { * BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String name = null; try { name = "Andy"; } * catch(IOException e) { return; } System.out.println("Hello, " + name); } } - * + * */ public class GeneratingAnnotatedClassesTest extends BcelTestCase { @@ -567,4 +567,4 @@ protected void tearDown() throws Exception { super.tearDown(); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java index c97e12678b..d5f53c98df 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericSignatureParsingTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement (IBM) initial implementation + * 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: + * Andy Clement (IBM) initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -34,11 +34,11 @@ * that is not part of the JVM type system, such as generic type and method * declarations and parameterized types. This kind of information is * needed to support reflection and debugging, and by the Java compiler. - * - * ============================================= - * + * + * ============================================= + * * ClassTypeSignature = LPackageSpecifier* SimpleClassTypeSignature ClassTypeSignatureSuffix*; - * + * * PackageSpecifier = Identifier/PackageSpecifier* * SimpleClassTypeSignature= Identifier TypeArguments(opt) * ClassTypeSignatureSuffix= .SimpleClassTypeSignature @@ -51,7 +51,7 @@ * ArrayTypeSignature = [TypeSignature * TypeSignature = [FieldTypeSignature * [BaseType - * + * * * Examples: * Ljava/util/List; == java.util.List @@ -61,54 +61,54 @@ * Ljava/util/List<-Ljava/lang/Number;>; == java.util.List * Ljava/util/List<*>; == java.util.List * Ljava/util/Map<*-Ljava/lang/Number;>; == java.util.Map - * - * ============================================= - * + * + * ============================================= + * * ClassSignature = FormalTypeParameters(opt) SuperclassSignature SuperinterfaceSignatures* - * + * * optional formal type parameters then a superclass signature then a superinterface signature - * + * * FormalTypeParameters = - * FormalTypeParameter = Identifier ClassBound InterfaceBound* + * FormalTypeParameter = Identifier ClassBound InterfaceBound* * ClassBound = :FieldTypeSignature(opt) * InterfaceBound = :FieldTypeSignature - * + * * If it exists, a set of formal type parameters are contained in anglies and consist of an identifier a classbound (assumed to be * object if not specified) and then an optional list of InterfaceBounds - * + * * SuperclassSignature = ClassTypeSignature * SuperinterfaceSignature = ClassTypeSignature * FieldTypeSignature = ClassTypeSignature * ArrayTypeSignature * TypeVariableSignature - * - * + * + * * MethodTypeSignature = FormalTypeParameters(opt) ( TypeSignature* ) ReturnType ThrowsSignature* * ReturnType = TypeSignature * VoidDescriptor * ThrowsSignature = ^ClassTypeSignature * ^TypeVariableSignature - * - * Examples: - * + * + * Examples: + * * ;> - * + * * ClassBound not supplied, Object assumed. Interface bound is Comparable - * + * * "T:Ljava/lang/Object;:Ljava/lang/Comparable<-TT;>;","T extends java.lang.Object & java.lang.Comparable" * */ public class GenericSignatureParsingTest extends BcelTestCase { - - - /** - * Throw some generic format signatures at the BCEL signature + + + /** + * Throw some generic format signatures at the BCEL signature * parsing code and see what it does. */ public void testParsingGenericSignatures_ClassTypeSignature() { // trivial checkClassTypeSignature("Ljava/util/List;","java.util.List"); - + // basics checkClassTypeSignature("Ljava/util/List;","java.util.List"); checkClassTypeSignature("Ljava/util/List;","java.util.List"); @@ -118,37 +118,37 @@ public void testParsingGenericSignatures_ClassTypeSignature() { checkClassTypeSignature("Ljava/util/List<-Ljava/lang/Number;>;","java.util.List"); checkClassTypeSignature("Ljava/util/List<*>;", "java.util.List"); checkClassTypeSignature("Ljava/util/Map<*-Ljava/lang/Number;>;","java.util.Map"); - + // with type params checkClassTypeSignature("Ljava/util/Collection;","java.util.Collection"); - + // arrays checkClassTypeSignature("Ljava/util/List<[Ljava/lang/String;>;","java.util.List"); checkClassTypeSignature("[Ljava/util/List;","java.util.List[]"); } - - + + public void testMethodTypeToSignature() { checkMethodTypeToSignature("void",new String[]{"java.lang.String[]","boolean"},"([Ljava/lang/String;Z)V"); checkMethodTypeToSignature("void",new String[]{"java.util.List"},"(Ljava/util/List;)V"); } - + public void testMethodSignatureToArgumentTypes() { checkMethodSignatureArgumentTypes("([Ljava/lang/String;Z)V",new String[]{"java.lang.String[]","boolean"}); // checkMethodSignatureArgumentTypes("(Ljava/util/List;)V",new String[]{"java.util.List"}); } - + public void testMethodSignatureReturnType() { checkMethodSignatureReturnType("([Ljava/lang/String;)Z","boolean"); } - + public void testLoadingGenerics() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("PossibleGenericsSigs"); // J5TODO asc fill this bit in... } - - + + // helper methods below // These routines call BCEL to determine if it can correctly translate from one form to the other. @@ -158,21 +158,21 @@ private void checkClassTypeSignature(String sig, String expected) { assertTrue("Only swallowed "+p+" chars of this sig "+sig+" (len="+sig.length()+")",p==sig.length()); assertTrue("Expected '"+expected+"' but got '"+result.toString()+"'",result.toString().equals(expected)); } - + private void checkMethodTypeToSignature(String ret,String[] args,String expected) { String res = GenericSignatureParsingTest.methodTypeToSignature(ret,args); if (!res.equals(expected)) { fail("Should match. Got: "+res+" Expected:"+expected); } } - + private void checkMethodSignatureReturnType(String sig,String expected) { String result = GenericSignatureParsingTest.methodSignatureReturnType(sig,false); if (!result.equals(expected)) { fail("Should match. Got: "+result+" Expected:"+expected); } } - + private void checkMethodSignatureArgumentTypes(String in,String[] expected) { String[] result = GenericSignatureParsingTest.methodSignatureArgumentTypes(in,false); if (result.length!=expected.length) { @@ -184,7 +184,7 @@ private void checkMethodSignatureArgumentTypes(String in,String[] expected) { fail("Argument: "+i+" should have been "+expected[i]+" but was "+string); } } - + public Signature getSignatureAttribute(JavaClass clazz,String name) { Method m = getMethod(clazz,name); Attribute[] as = m.getAttributes(); @@ -201,7 +201,7 @@ public Signature getSignatureAttribute(JavaClass clazz,String name) { * Takes a string and consumes a single complete signature from it, returning * how many chars it consumed. The chopit flag indicates whether to shorten * type references ( java/lang/String => String ) - * + * * FIXME asc this should also create some kind of object you can query for information about whether its parameterized, what the bounds are, etc... */ public static final int readClassTypeSignatureFrom(String signature, int posn, StringBuffer result, boolean chopit) { @@ -217,37 +217,37 @@ public static final int readClassTypeSignatureFrom(String signature, int posn, S case 'S' : result.append("short"); return 1; case 'Z' : result.append("boolean");return 1; case 'V' : result.append("void"); return 1; - - + + //FIXME ASC Need a state machine to check we are parsing the right stuff here ! - case 'T' : + case 'T' : idx++; int nextSemiIdx = signature.indexOf(';',idx); result.append(signature.substring(idx,nextSemiIdx)); return nextSemiIdx+1-posn; - - case '+' : + + case '+' : result.append("? extends "); return readClassTypeSignatureFrom(signature,idx+1,result,chopit)+1; - - case '-' : + + case '-' : result.append("? super "); return readClassTypeSignatureFrom(signature,idx+1,result,chopit)+1; - - case '*' : + + case '*' : result.append("?"); return 1; - + case 'L' : // Full class name boolean parameterized = false; int idxSemicolon = signature.indexOf(';',idx); // Look for closing ';' or '<' int idxAngly = signature.indexOf('<',idx); int endOfSig = idxSemicolon; if ((idxAngly!=-1) && idxAngly0) {result.append("[]");dim--;} return idx-posn; - + default : throw new ClassFormatException("Invalid signature: `" + signature + "'"); } @@ -309,14 +309,14 @@ public static int countBrackets(String brackets) { default: } } - + if (open) throw new RuntimeException("Illegally nested brackets:" + brackets); - + return count; } - /** + /** * Parse Java type such as "char", or "java.lang.String[]" and return the * signature in byte code format, e.g. "C" or "[Ljava/lang/String;" respectively. * @@ -328,46 +328,46 @@ public static String getSignature(String type) { char[] chars = type.toCharArray(); boolean char_found = false, delim = false; int index = -1; - + loop: for (int i=0; i < chars.length; i++) { switch (chars[i]) { case ' ': case '\t': case '\n': case '\r': case '\f': if (char_found) delim = true; break; - + case '[': if (!char_found) throw new RuntimeException("Illegal type: " + type); index = i; break loop; - + default: char_found = true; if (!delim) buf.append(chars[i]); } } - + int brackets = 0; - + if(index > 0) brackets = GenericSignatureParsingTest.countBrackets(type.substring(index)); - + type = buf.toString(); buf.setLength(0); - + for (int i=0; i < brackets; i++) buf.append('['); - + boolean found = false; - + for(int i=Constants.T_BOOLEAN; (i <= Constants.T_VOID) && !found; i++) { if (Constants.TYPE_NAMES[i].equals(type)) { found = true; buf.append(Constants.SHORT_TYPE_NAMES[i]); } } - + // Class name if (!found) buf.append('L' + type.replace('.', '/') + ';'); - + return buf.toString(); } @@ -385,7 +385,7 @@ public static final String methodSignatureReturnType(String signature,boolean ch String type; try { // Read return type after `)' - index = signature.lastIndexOf(')') + 1; + index = signature.lastIndexOf(')') + 1; type = Utility.signatureToString(signature.substring(index), chopit); } catch (StringIndexOutOfBoundsException e) { throw new ClassFormatException("Invalid method signature: " + signature); @@ -397,10 +397,10 @@ public static final String methodSignatureReturnType(String signature,boolean ch /** * For some method signature (class file format) like '([Ljava/lang/String;)Z' this returns * the string representing the return type its 'normal' form, e.g. 'boolean' - * + * * @param signature Method signature * @return return type of method - * @throws ClassFormatException + * @throws ClassFormatException */ public static final String methodSignatureReturnType(String signature) throws ClassFormatException { return GenericSignatureParsingTest.methodSignatureReturnType(signature, true); @@ -410,7 +410,7 @@ public static final String methodSignatureReturnType(String signature) throws Cl /** * For some method signature (class file format) like '([Ljava/lang/String;Z)V' this returns an array * of strings representing the arguments in their 'normal' form, e.g. '{java.lang.String[],boolean}' - * + * * @param signature Method signature * @param chopit Shorten class names * @return Array of argument types @@ -419,13 +419,13 @@ public static final String[] methodSignatureArgumentTypes(String signature,boole List vec = new ArrayList<>(); int index; String[] types; - + try { // Read all declarations between for `(' and `)' if (signature.charAt(0) != '(') throw new ClassFormatException("Invalid method signature: " + signature); - + index = 1; // current string position - + while(signature.charAt(index) != ')') { Utility.ResultHolder rh = Utility.signatureToStringInternal(signature.substring(index),chopit); vec.add(rh.getResult()); @@ -434,7 +434,7 @@ public static final String[] methodSignatureArgumentTypes(String signature,boole } catch(StringIndexOutOfBoundsException e) { throw new ClassFormatException("Invalid method signature: " + signature); } - + types = new String[vec.size()]; vec.toArray(types); return types; @@ -442,7 +442,7 @@ public static final String[] methodSignatureArgumentTypes(String signature,boole /** - * Converts string containing the method return and argument types + * Converts string containing the method return and argument types * to a byte code method signature. * * @param returnType Return type of method (e.g. "char" or "java.lang.String[]") @@ -450,9 +450,9 @@ public static final String[] methodSignatureArgumentTypes(String signature,boole * @return Byte code representation of method signature */ public final static String methodTypeToSignature(String returnType, String[] methodArgs) throws ClassFormatException { - + StringBuffer buf = new StringBuffer("("); - + if (methodArgs != null) { for (String methodArg : methodArgs) { String str = GenericSignatureParsingTest.getSignature(methodArg); @@ -463,10 +463,10 @@ public final static String methodTypeToSignature(String returnType, String[] met buf.append(str); } } - + buf.append(")" + GenericSignatureParsingTest.getSignature(returnType)); - + return buf.toString(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericsErasureTesting.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericsErasureTesting.java index 73f2e6d1b3..6f66ff579e 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericsErasureTesting.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GenericsErasureTesting.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement (IBM) initial implementation + * 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: + * Andy Clement (IBM) initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -21,8 +21,8 @@ * the signature attribute. */ public class GenericsErasureTesting extends BcelTestCase { - - + + public void testLoadingGenerics() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("ErasureTestData"); Method m = getMethod(clazz,"getData"); @@ -31,10 +31,10 @@ public void testLoadingGenerics() throws ClassNotFoundException { System.err.println(sig); assertTrue("Incorrect: "+sig,sig.equals("()Ljava/util/Vector;")); } - - + + // helper methods below - + public Signature getSignatureAttribute(JavaClass clazz,String name) { Method m = getMethod(clazz,name); Attribute[] as = m.getAttributes(); @@ -45,5 +45,5 @@ public Signature getSignatureAttribute(JavaClass clazz,String name) { } return null; } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java index 06bd9ccc8b..c5a3bff5fd 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GetReflectMembersTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -25,37 +25,37 @@ public class GetReflectMembersTest extends TestCase { private Repository bcelRepository; private JavaClass jc; - + public void testGetMethod() throws Exception { assertNotNull(jc.getMethod(GetMe.class.getMethod("foo",new Class[] {String.class}))); } - + public void testGetConstructor() throws Exception { - assertNotNull(jc.getMethod(GetMe.class.getConstructor(new Class[] {int.class}))); + assertNotNull(jc.getMethod(GetMe.class.getConstructor(new Class[] {int.class}))); } - + public void testGetField() throws Exception { assertNotNull(jc.getField(GetMe.class.getDeclaredField("x"))); } - + protected void setUp() throws Exception { super.setUp(); this.bcelRepository = new ClassLoaderRepository(getClass().getClassLoader()); this.jc = bcelRepository.loadClass(GetMe.class); } - + protected void tearDown() throws Exception { super.tearDown(); this.bcelRepository.clear(); } - + private static class GetMe { - + private int x; - + public GetMe(int x) { this.x = x;} - + public void foo(String s) {}; - + } } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTypeTableTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTypeTableTest.java index 202cd54624..017367fc99 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTypeTableTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/LocalVariableTypeTableTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -21,23 +21,23 @@ public class LocalVariableTypeTableTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - + /** * Check the local variable type table includes information about generic signatures. */ public void testLocalVariableTypeTableAttribute() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("SimpleGenericsProgram"); - + Method mainMethod = getMethod(clazz,"main"); Code codeAttr = (Code) findAttribute("Code",mainMethod.getAttributes()); - LocalVariableTypeTable localVariableTypeTable = + LocalVariableTypeTable localVariableTypeTable = (LocalVariableTypeTable) findAttribute("LocalVariableTypeTable",codeAttr.getAttributes()); - + assertTrue("Should be two entries in the LocalVariableTypeTable but found "+localVariableTypeTable.getTableLength(), localVariableTypeTable.getTableLength()==2); @@ -64,9 +64,9 @@ public void testLocalVariableTypeTableAttribute() throws ClassNotFoundException } if (!tc1OK || !tc2OK) fail(errormessage); } - + protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java index 26f877cce2..5b7fb8a5bf 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodAnnotationsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -23,41 +23,41 @@ public class MethodAnnotationsTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - + public void testMethodAnnotations() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("AnnotatedMethods"); - + checkAnnotatedMethod(clazz,"method1","SimpleAnnotation","id","1"); checkAnnotatedMethod(clazz,"method2","SimpleAnnotation","id","2"); } - + public void testMethodAnnotationsReadWrite() throws ClassNotFoundException,IOException { JavaClass clazz = getClassFromJar("AnnotatedMethods"); - + checkAnnotatedMethod(clazz,"method1","SimpleAnnotation","id","1"); checkAnnotatedMethod(clazz,"method2","SimpleAnnotation","id","2"); - + // Write it out File tfile = createTestdataFile("AnnotatedMethods.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedMethods"); - + checkAnnotatedMethod(clazz,"method1","SimpleAnnotation","id","1"); checkAnnotatedMethod(clazz,"method2","SimpleAnnotation","id","2"); assertTrue(tfile.delete()); } - + // helper methods - + public void checkAnnotatedMethod(JavaClass clazz,String methodname, String annotationName,String annotationElementName,String annotationElementValue) { Method[] methods = clazz.getMethods(); @@ -70,7 +70,7 @@ public void checkAnnotatedMethod(JavaClass clazz,String methodname, } } } - + private void checkAnnotation(AnnotationGen a,String name,String elementname,String elementvalue) { assertTrue("Expected annotation to have name "+name+" but it had name "+a.getTypeName(), a.getTypeName().equals(name)); @@ -81,10 +81,10 @@ private void checkAnnotation(AnnotationGen a,String name,String elementname,Stri assertTrue("Expected element value "+elementvalue+" but was "+envp.getValue().stringifyValue(), elementvalue.equals(envp.getValue().stringifyValue())); } - + // helper methods - + public void checkValue(AnnotationGen a,String name,String tostring) { for (NameValuePair element : a.getValues()) { if (element.getNameString().equals(name)) { @@ -100,5 +100,5 @@ public void checkValue(AnnotationGen a,String name,String tostring) { protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodParametersTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodParametersTest.java index 76a9b84d8e..295666b615 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodParametersTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/MethodParametersTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -17,11 +17,11 @@ import org.aspectj.apache.bcel.classfile.MethodParameters; public class MethodParametersTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - + public void testMethodParameters1() throws Exception { JavaClass jc = getClassFromJava8Jar("Parameters"); Method m = getMethod(jc, "foo"); @@ -34,7 +34,7 @@ public void testMethodParameters1() throws Exception { assertFalse(mp.isSynthetic(0)); assertFalse(mp.isMandated(0)); } - + // this method specifies the receiver public void testMethodParameters2() throws Exception { JavaClass jc = getClassFromJava8Jar("Parameters"); @@ -53,34 +53,34 @@ public void testMethodParameters3() throws Exception { Method m = getMethod(jc, ""); MethodParameters mp = (MethodParameters)getAttribute(m.getAttributes(),Constants.ATTR_METHOD_PARAMETERS); assertEquals(2,mp.getParametersCount()); - + assertEquals("this$0",mp.getParameterName(0)); assertTrue(mp.isFinal(0)); assertFalse(mp.isSynthetic(0)); assertTrue(mp.isMandated(0)); - + assertEquals("x",mp.getParameterName(1)); assertFalse(mp.isFinal(1)); assertFalse(mp.isSynthetic(1)); assertFalse(mp.isMandated(1)); } - + // access flags public void testMethodParameters4() throws Exception { JavaClass jc = getClassFromJava8Jar("Parameters$Color"); Method m = getMethod(jc, ""); MethodParameters mp = (MethodParameters)getAttribute(m.getAttributes(),Constants.ATTR_METHOD_PARAMETERS); assertEquals(2,mp.getParametersCount()); - + assertEquals("$enum$name",mp.getParameterName(0)); assertFalse(mp.isFinal(0)); assertTrue(mp.isSynthetic(0)); assertFalse(mp.isMandated(0)); - + assertEquals("$enum$ordinal",mp.getParameterName(1)); assertFalse(mp.isFinal(1)); assertTrue(mp.isSynthetic(1)); assertFalse(mp.isMandated(1)); } - -} \ No newline at end of file + +} diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java index 454817df8f..2eab96c54e 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ModuleTest.java @@ -1,10 +1,10 @@ /* ******************************************************************* * Copyright (c) 2016-2017 Contributors - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * 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.apache.bcel.classfile.tests; @@ -26,7 +26,7 @@ /** * http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html - * + * * @author Andy Clement */ public class ModuleTest extends BcelTestCase { @@ -38,7 +38,7 @@ public void testLoadSimpleModuleClass() throws Exception { assertNotNull(javaClass); assertEquals(Constants.MAJOR_1_9,javaClass.getMajor()); assertEquals(Constants.MINOR_1_9,javaClass.getMinor()); - assertEquals(Constants.ACC_MODULE,javaClass.getModifiers()); + assertEquals(Constants.ACC_MODULE,javaClass.getModifiers()); assertEquals(0,javaClass.getSuperclassNameIndex()); assertEquals(0,javaClass.getInterfaceIndices().length); assertEquals(0,javaClass.getFields().length); @@ -65,7 +65,7 @@ public void testLoadSimpleModuleClass() throws Exception { } } } - + public void testRequires() throws Exception { Module moduleAttr = getModuleAttribute("testdata/modules/two/d/module-info.class"); @@ -80,7 +80,7 @@ public void testRequires() throws Exception { assertEquals("b.c.d",requires[2].getModuleName()); assertEquals("c.d.e",requires[3].getModuleName()); } - + public void testExports() throws Exception { Module moduleAttr = getModuleAttribute("testdata/modules/two/e/module-info.class"); Export[] exports = moduleAttr.getExports(); @@ -95,7 +95,7 @@ public void testExports() throws Exception { assertEquals("a.b.c",exports[2].getToModuleNames()[0]); assertEquals("b.c.d",exports[2].getToModuleNames()[1]); } - + public void testOpens() throws Exception { Module moduleAttr = getModuleAttribute("testdata/modules/two/h/module-info.class"); Open[] opens = moduleAttr.getOpens(); @@ -104,7 +104,7 @@ public void testOpens() throws Exception { assertEquals("opens com.foo2 to a.b.c", opens[1].toString()); assertEquals("opens com.foo3 to a.b.c, b.c.d", opens[2].toString()); } - + public void testUses() throws Exception { Module moduleAttr = getModuleAttribute("testdata/modules/two/f/module-info.class"); Uses[] uses = moduleAttr.getUses(); @@ -112,7 +112,7 @@ public void testUses() throws Exception { assertEquals("com/foo1/I1",uses[0].getTypeName()); assertEquals("uses com.foo1.I1",uses[0].toString()); } - + public void testProvides() throws Exception { Module moduleAttr = getModuleAttribute("testdata/modules/two/g/module-info.class"); Provide[] provides = moduleAttr.getProvides(); @@ -126,11 +126,11 @@ public void testProvides() throws Exception { } // --- - + private Module getModuleAttribute(String moduleInfoClass) throws Exception { ClassParser classParser = new ClassParser(moduleInfoClass); JavaClass javaClass = classParser.parse(); return (Module)getAttribute(javaClass.getAttributes(), Constants.ATTR_MODULE); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java index 8a979b73fd..334ba840f4 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2004 IBM All rights reserved. This program and the accompanying - * materials are made available under the terms of the Eclipse Public License - * v1.0 which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * + * 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: Andy Clement - initial implementation ******************************************************************************/ @@ -65,12 +65,12 @@ public void testParameterAnnotations_builtOK() { ClassGen clg = createClassGen("HelloWorld"); ConstantPool cpg = clg.getConstantPool(); InstructionList il = new InstructionList(); - + buildClassContentsWithAnnotatedMethods(clg,cpg,il,true); - + int i = clg.getMethods().length; assertTrue("Class should have 2 methods but has "+i,i==2); - + Method mainMethod = clg.getMethods()[0]; AnnotationGen[] annos = mainMethod.getAnnotationsOnParameter(0); assertTrue("Should be two annotation on the 'argv' parameter to main() but there are "+annos.length,annos.length==2); @@ -79,9 +79,9 @@ public void testParameterAnnotations_builtOK() { assertTrue("This annotation should contain the string 'fruit=Oranges' but it is "+annos[1].toString(), annos[1].toString().contains("fruit=Oranges")); } - - - + + + /** * Check we can save and load a constructed class that contains parameter annotations */ @@ -89,18 +89,18 @@ public void testParameterAnnotations_savedAndLoadedOK() throws ClassNotFoundExce ClassGen clg = createClassGen("HelloWorld"); ConstantPool cpg = clg.getConstantPool(); InstructionList il = new InstructionList(); - + buildClassContentsWithAnnotatedMethods(clg,cpg,il,true); - + dumpClass(clg,"temp5","HelloWorld.class"); - + JavaClass jc = getClassFrom("temp5","HelloWorld"); - + clg = new ClassGen(jc); - + int i = clg.getMethods().length; assertTrue("Class should have 2 methods but has "+i,i==2); - + Method mainMethod = clg.getMethods()[0]; AnnotationGen[] annos = mainMethod.getAnnotationsOnParameter(0); assertTrue("Should be two annotation on the 'argv' parameter to main() but there are "+annos.length,annos.length==2); @@ -109,45 +109,45 @@ public void testParameterAnnotations_savedAndLoadedOK() throws ClassNotFoundExce assertTrue("This annotation should contain the string 'fruit=Oranges' but it is "+annos[1].toString(), annos[1].toString().contains("fruit=Oranges")); assertTrue(wipe("temp5","HelloWorld.class")); - + } - - + + /* * Load an existing class, add new parameter annotations, save and then reload it */ public void testParameterAnnotations_loadedThenModifiedThenSavedAndLoadedOK() throws ClassNotFoundException { JavaClass jc = getClassFrom("testcode.jar","AnnotatedParameters"); - + ClassGen clg = new ClassGen(jc); ConstantPool cpg = clg.getConstantPool(); - + // // Foo method looks like this: // public void foo(@SimpleAnnotation(id=2) int arg1, // @SimpleAnnotation(id=3) @AnnotationEnumElement(enumval=SimpleEnum.Red) String arg2) Method m = findMethod(clg,"foo"); assertTrue("Should be able to find method foo but couldn't",m!=null); - - + + /////////////////////// 1. Check the right number of annotations are there int i = m.getAnnotationsOnParameter(1).length; assertTrue("Should be two annotations on the second parameter but found: "+i,i==2); - - + + /////////////////////// 2. Let's add a new parameter annotation, a visible one, to the first parameter. // Build a modifiable version of the foo method MethodGen mg = new MethodGen(m,clg.getClassName(),cpg); - + // Check the annotations survived that transform i = mg.getAnnotationsOnParameter(1).size(); assertTrue("Should be two annotations on the second parameter but found: "+i,i==2); - + // That worked, so let's add a new parameter annotation mg.addParameterAnnotation(0,createFruitAnnotation(cpg,"Banana",true)); - + // Foo method should now look like this: // public void foo(@SimpleAnnotation(id=2) @SimpleStringAnnotation(fruit=Banana) int arg1, // @SimpleAnnotation(id=3) @AnnotationEnumElement(enumval=SimpleEnum.Red) String arg2) @@ -160,17 +160,17 @@ public void testParameterAnnotations_loadedThenModifiedThenSavedAndLoadedOK() th // delete the old method and add the new one clg.removeMethod(m); clg.addMethod(mg.getMethod()); - + /////////////////////// 3. Dump it to disk dumpClass(clg,"temp2","AnnotatedParameters.class"); - + /////////////////////// 4. Load it back in and verify the annotations persisted JavaClass jc2 = getClassFrom("temp2","AnnotatedParameters"); m = jc2.getMethods()[2]; AnnotationGen[] p1annotations = m.getAnnotationsOnParameter(0); AnnotationGen[] p2annotations = m.getAnnotationsOnParameter(1); - + assertTrue("Expected two annotations on the first parameter but found "+p1annotations.length,p1annotations.length==2); assertTrue("Expected two annotations on the second parameter but found "+p2annotations.length,p2annotations.length==2); String expectedString = "[@SimpleAnnotation(id=2),@SimpleStringAnnotation(fruit=Banana)]"; @@ -179,44 +179,44 @@ public void testParameterAnnotations_loadedThenModifiedThenSavedAndLoadedOK() th expectedString = "[@SimpleAnnotation(id=3),@AnnotationEnumElement(enumval=LSimpleEnum;Red)]"; assertTrue("Expected formatted short string of '"+expectedString+"' but it was '"+dumpAnnotations(p2annotations)+"'", dumpAnnotations(p2annotations).equals(expectedString)); - + assertTrue(wipe("temp2","AnnotatedParameters.class")); } - - + + /** * same as above test but attaching invisible runtime parameter annotations - */ + */ public void testParameterAnnotations_loadedThenModifiedWithInvisibleAnnotationThenSavedAndLoadedOK() throws ClassNotFoundException { JavaClass jc = getClassFrom("testcode.jar","AnnotatedParameters"); ClassGen clg = new ClassGen(jc); ConstantPool cpg = clg.getConstantPool(); - + // // Foo method looks like this: // public void foo(@SimpleAnnotation(id=2) int arg1, // @SimpleAnnotation(id=3) @AnnotationEnumElement(enumval=SimpleEnum.Red) String arg2) Method m = findMethod(clg,"foo"); assertTrue("Should be able to find method foo but couldn't",m!=null); - - + + /////////////////////// 1. Check the right number of annotations are there int i = m.getAnnotationsOnParameter(1).length; assertTrue("Should be two annotations on the second parameter but found: "+i,i==2); - - + + /////////////////////// 2. Let's add a new parameter annotation, a visible one, to the first parameter. // Build a modifiable version of the foo method MethodGen mg = new MethodGen(m,clg.getClassName(),cpg); - + // Check the annotations survived that transform i = mg.getAnnotationsOnParameter(1).size(); assertTrue("Should be two annotations on the second parameter but found: "+i,i==2); - + // That worked, so let's add a new parameter annotation mg.addParameterAnnotation(0,createFruitAnnotation(cpg,"Banana",false)); - + // Foo method should now look like this: // public void foo(@SimpleAnnotation(id=2) @SimpleStringAnnotation(fruit=Banana) int arg1, // @SimpleAnnotation(id=3) @AnnotationEnumElement(enumval=SimpleEnum.Red) String arg2) @@ -230,10 +230,10 @@ public void testParameterAnnotations_loadedThenModifiedWithInvisibleAnnotationTh // delete the old method and add the new one clg.removeMethod(m); clg.addMethod(mg.getMethod()); - + /////////////////////// 3. Dump it to disk dumpClass(clg,"temp3","AnnotatedParameters.class"); - + /////////////////////// 4. Load it back in and verify the annotations persisted JavaClass jc2 = getClassFrom("temp3","AnnotatedParameters"); @@ -241,7 +241,7 @@ public void testParameterAnnotations_loadedThenModifiedWithInvisibleAnnotationTh m = jc2.getMethods()[2]; AnnotationGen[] p1annotations = m.getAnnotationsOnParameter(0); AnnotationGen[] p2annotations = m.getAnnotationsOnParameter(1); - + assertTrue("Expected two annotations on the first parameter but found "+p1annotations.length,p1annotations.length==2); assertTrue("Expected two annotations on the second parameter but found "+p2annotations.length,p2annotations.length==2); String expectedString = "[@SimpleAnnotation(id=2),@SimpleStringAnnotation(fruit=Banana)]"; @@ -250,12 +250,12 @@ public void testParameterAnnotations_loadedThenModifiedWithInvisibleAnnotationTh expectedString = "[@SimpleAnnotation(id=3),@AnnotationEnumElement(enumval=LSimpleEnum;Red)]"; assertTrue("Expected formatted short string of '"+expectedString+"' but it was '"+dumpAnnotations(p2annotations)+"'", dumpAnnotations(p2annotations).equals(expectedString)); - + assertTrue("Second annotation on first parameter should be runtime invisible?", !p1annotations[1].isRuntimeVisible()); assertTrue(wipe("temp3","AnnotatedParameters.class")); - - + + // 5. Verify that when annotations for parameters are unpacked from attributes, the // attributes vanish ! clg = new ClassGen(jc2); @@ -265,18 +265,18 @@ public void testParameterAnnotations_loadedThenModifiedWithInvisibleAnnotationTh List l = mg.getAnnotationsOnParameter(0); assertTrue("Should be 2 annotations on first parameter but there is only "+l.size()+":"+l.toString(), l.size()==2); - assertTrue("Should be 0 but there are "+mg.getAttributes().size(),mg.getAttributes().size()==0); + assertTrue("Should be 0 but there are "+mg.getAttributes().size(),mg.getAttributes().size()==0); } - + private Method findMethod(ClassGen c,String mname) { Method[] ms = c.getMethods(); for (Method m : ms) { if (m.getName().equals(mname)) return m; } return null; - } - + } + private void dumpClass(ClassGen cg, String fname) { try { File f = createTestdataFile(fname); @@ -285,7 +285,7 @@ private void dumpClass(ClassGen cg, String fname) { System.err.println(e); } } - + private void dumpClass(ClassGen cg, String dir, String fname) { dumpClass(cg,dir+File.separator+fname); @@ -355,11 +355,11 @@ private void buildClassContentsWithAnnotatedMethods(ClassGen cg, ConstantPool cp LocalVariableGen var_ex = mg.addLocalVariable("ex",Type.getType("Ljava.io.IOException;"),null,null); int var_ex_slot = var_ex.getIndex(); - + InstructionHandle handler = il.append(InstructionFactory.createASTORE(var_ex_slot)); var_ex.setStart(handler); var_ex.setEnd(il.append(InstructionConstants.RETURN)); - + mg.addExceptionHandler(try_start, try_end, handler, new ObjectType("java.io.IOException")); @@ -396,7 +396,7 @@ private void buildClassContentsWithAnnotatedMethods(ClassGen cg, ConstantPool cp // would have to be computed on the fly and add a default constructor // method to the class, which is empty in this case. - mg.addParameterAnnotation(0,createFruitAnnotation(cp,"Apples",true)); + mg.addParameterAnnotation(0,createFruitAnnotation(cp,"Apples",true)); mg.addParameterAnnotation(0,createFruitAnnotation(cp,"Oranges",true)); mg.setMaxStack(); mg.setMaxLocals(); @@ -404,7 +404,7 @@ private void buildClassContentsWithAnnotatedMethods(ClassGen cg, ConstantPool cp il.dispose(); // Allow instruction handles to be reused cg.addEmptyConstructor(Constants.ACC_PUBLIC); } - + private void buildClassContents(ClassGen cg, ConstantPool cp, InstructionList il) { // Create method 'public static void main(String[]argv)' MethodGen mg = createMethodGen("main",il,cp); @@ -468,11 +468,11 @@ private void buildClassContents(ClassGen cg, ConstantPool cp, InstructionList il LocalVariableGen var_ex = mg.addLocalVariable("ex",Type.getType("Ljava.io.IOException;"),null,null); int var_ex_slot = var_ex.getIndex(); - + InstructionHandle handler = il.append(InstructionFactory.createASTORE(var_ex_slot)); var_ex.setStart(handler); var_ex.setEnd(il.append(InstructionConstants.RETURN)); - + mg.addExceptionHandler(try_start, try_end, handler, new ObjectType("java.io.IOException")); @@ -520,18 +520,18 @@ private JavaClass getClassFrom(String where,String clazzname) throws ClassNotFou SyntheticRepository repos = createRepos(where); return repos.loadClass(clazzname); } - - - + + + // helper methods - + private ClassGen createClassGen(String classname) { return new ClassGen(classname, "java.lang.Object", "", Constants.ACC_PUBLIC | Constants.ACC_SUPER, null); } - + private MethodGen createMethodGen(String methodname,InstructionList il,ConstantPool cp) { return new MethodGen( Constants.ACC_STATIC | Constants.ACC_PUBLIC, // access flags @@ -542,7 +542,7 @@ private MethodGen createMethodGen(String methodname,InstructionList il,ConstantP il, cp); } - + public AnnotationGen createSimpleVisibleAnnotation(ConstantPool cp) { SimpleElementValue evg = new SimpleElementValue( ElementValue.PRIMITIVE_INT, cp, 4); @@ -557,18 +557,18 @@ public AnnotationGen createSimpleVisibleAnnotation(ConstantPool cp) { AnnotationGen a = new AnnotationGen(t, elements,true, cp); return a; } - + public AnnotationGen createCombinedAnnotation(ConstantPool cp) { // Create an annotation instance AnnotationGen a = createSimpleVisibleAnnotation(cp); ArrayElementValue array = new ArrayElementValue(cp); - array.addElement(new AnnotationElementValue(a,cp)); + array.addElement(new AnnotationElementValue(a,cp)); NameValuePair nvp = new NameValuePair("value",array,cp); List elements = new ArrayList<>(); elements.add(nvp); return new AnnotationGen(new ObjectType("CombinedAnnotation"),elements,true,cp); } - + public AnnotationGen createSimpleInvisibleAnnotation(ConstantPool cp) { SimpleElementValue evg = new SimpleElementValue( ElementValue.PRIMITIVE_INT, cp, 4); @@ -587,4 +587,4 @@ protected void tearDown() throws Exception { super.tearDown(); } -} \ No newline at end of file +} diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java index 62c1b3bd77..6c04eac28a 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -35,12 +35,12 @@ public class RuntimeVisibleAnnotationAttributeTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - + public void testSeeAnnotationsAsAttribute() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("SimpleAnnotatedClass"); @@ -49,7 +49,7 @@ public void testSeeAnnotationsAsAttribute() throws ClassNotFoundException { assertTrue("Expected a RuntimeVisibleAnnotations attribute but found none", rvaAttr.length==1); } - + public void testAnnotationsAttributeContainsRightData() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("SimpleAnnotatedClass"); @@ -73,7 +73,7 @@ public void testAnnotationsAttributeContainsRightData() throws ClassNotFoundExce assertTrue("'id' should have value 4 but it is "+evalue.getValueInt(), evalue.getValueInt()==4); } - + public void testAccessingAnnotationsOnClazz() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("SimpleAnnotatedClass"); @@ -82,7 +82,7 @@ public void testAccessingAnnotationsOnClazz() throws ClassNotFoundException { assertTrue("Expected one annotation on SimpleAnnotatedClass class but got "+anns.length, anns.length==1); } - + public void testReadingWritingAnnotations() throws ClassNotFoundException, IOException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("SimpleAnnotatedClass"); @@ -90,45 +90,45 @@ public void testReadingWritingAnnotations() throws ClassNotFoundException, IOExc AnnotationGen[] anns = clazz.getAnnotations(); assertTrue("Expected one annotation on SimpleAnnotatedClass class but got "+anns.length, anns.length==1); - + // Write it out File tfile = createTestdataFile("SimpleAnnotatedClass.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos.loadClass("SimpleAnnotatedClass"); ConstantPool pool2 = clazz2.getConstantPool(); AnnotationGen[] anns2 = clazz2.getAnnotations(); assertTrue("Expected one annotation on SimpleAnnotatedClass class but got "+anns2.length, anns2.length==1); - + assertTrue(tfile.delete()); } - - - + + + //// // Test for annotations containing string elements - + public void testAnnotationStringElement() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedClass"); verifyAnnotationStringElement(clazz); } - + public void testAnnotationStringElementReadWrite() throws ClassNotFoundException, IOException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedClass"); verifyAnnotationStringElement(clazz); - + // Write it out File tfile = createTestdataFile("AnnotatedClass.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedClass"); - verifyAnnotationStringElement(clazz2); + verifyAnnotationStringElement(clazz2); assertTrue(tfile.delete()); } @@ -148,16 +148,16 @@ private void verifyAnnotationStringElement(JavaClass clazz) { assertTrue("String value should be 'hello' but was '"+ev.getValueString()+"'", ev.getValueString().equals("hello")); } - + //// // Test for complex annotation that includes all primitives - + public void testComplexAnnotation() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("ComplexAnnotatedClass"); verifyComplexAnnotation(clazz); } - + public void testComplexAnnotationsReadWrite() throws ClassNotFoundException, IOException { SyntheticRepository repos = createRepos("testcode.jar"); @@ -167,15 +167,15 @@ public void testComplexAnnotationsReadWrite() throws ClassNotFoundException, IOE // Write it out File tfile = createTestdataFile("ComplexAnnotatedClass.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos.loadClass("ComplexAnnotatedClass"); verifyComplexAnnotation(clazz2); - + assertTrue(tfile.delete()); - + } - + private void verifyComplexAnnotation(JavaClass clazz) { AnnotationGen[] anns = clazz.getAnnotations(); assertTrue("Should be one annotation but found "+anns.length,anns.length==1); @@ -194,7 +194,7 @@ private void verifyComplexAnnotation(JavaClass clazz) { assertTrue("Cant find expected element ",names.contains("sval")); assertTrue("Cant find expected element ",names.contains("bval")); assertTrue("Cant find expected element ",names.contains("cval")); - + checkValue(ann,"ival","4"); checkValue(ann,"jval","56"); checkValue(ann,"fval","3.0"); @@ -203,7 +203,7 @@ private void verifyComplexAnnotation(JavaClass clazz) { checkValue(ann,"bval","2"); checkValue(ann,"cval", Character.toString('5')); checkValue(ann,"zval","false"); - + } private void checkValue(AnnotationGen a,String name,String tostring) { @@ -220,13 +220,13 @@ private void checkValue(AnnotationGen a,String name,String tostring) { //// // Test an annotation containing a 'Class' element - + public void testAnnotationClassElement() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithClassClass"); verifyClassAnnotation(clazz); } - + public void testAnnotationClassElementCopying() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithClassClass"); @@ -236,7 +236,7 @@ public void testAnnotationClassElementCopying() throws ClassNotFoundException { new AnnotationGen(anns[0],cg.getConstantPool(),true); new AnnotationGen(anns[0],cg.getConstantPool(),false); } - + public void testAnnotationClassElementReadWrite() throws ClassNotFoundException,IOException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithClassClass"); @@ -245,14 +245,14 @@ public void testAnnotationClassElementReadWrite() throws ClassNotFoundException, // Write it out File tfile = createTestdataFile("AnnotatedWithClassClass.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedWithClassClass"); verifyClassAnnotation(clazz2); - + assertTrue(wipe("AnnotatedWithClassClass.class")); } - + private void verifyClassAnnotation(JavaClass clazz) { AnnotationGen[] anns = clazz.getAnnotations(); assertTrue("should be one annotation but found "+anns.length,anns.length==1); @@ -267,18 +267,18 @@ private void verifyClassAnnotation(JavaClass clazz) { ClassElementValue ev = (ClassElementValue)nvp.getValue(); assertTrue("String value should be 'Ljava/lang/Integer;' but was '"+ev.getClassString()+"'", ev.getClassString().equals("Ljava/lang/Integer;")); - + } - + //// // Test an annotation containing an enum element - + public void testAnnotationEnumElement() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithEnumClass"); verifyAnnotationEnumElement(clazz); } - + public void testAnnotationEnumElementReadWrite() throws ClassNotFoundException, IOException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithEnumClass"); @@ -287,14 +287,14 @@ public void testAnnotationEnumElementReadWrite() throws ClassNotFoundException, // Write it out File tfile = createTestdataFile("AnnotatedWithEnumClass.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedWithEnumClass"); verifyAnnotationEnumElement(clazz2); - + assertTrue(tfile.delete()); } - + public void verifyAnnotationEnumElement(JavaClass clazz) { AnnotationGen[] anns = clazz.getAnnotations(); assertTrue("should be one annotation but found "+anns.length,anns.length==1); @@ -314,10 +314,10 @@ public void verifyAnnotationEnumElement(JavaClass clazz) { assertTrue("String value should be 'Red' but was '"+eev.getEnumValueString()+"'", eev.getEnumValueString().equals("Red")); } - + //// // Test an annotation with an array element - + public void testAnnotationArraysOfAnnotations() throws ClassNotFoundException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithCombinedAnnotation"); @@ -325,18 +325,18 @@ public void testAnnotationArraysOfAnnotations() throws ClassNotFoundException { assertTrue("should be one annotation but found "+anns.length,anns.length==1); checkCombinedAnnotation(anns[0]); } - + public void testAnnotationArraysOfAnnotationsReadWrite() throws ClassNotFoundException, IOException { SyntheticRepository repos = createRepos("testcode.jar"); JavaClass clazz = repos.loadClass("AnnotatedWithCombinedAnnotation"); AnnotationGen[] anns = clazz.getAnnotations(); assertTrue("should be one annotation but found "+anns.length,anns.length==1); checkCombinedAnnotation(anns[0]); - + // Write it out File tfile = createTestdataFile("AnnotatedWithCombinedAnnotation.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedWithCombinedAnnotation"); AnnotationGen[] anns2 = clazz2.getAnnotations(); @@ -345,8 +345,8 @@ public void testAnnotationArraysOfAnnotationsReadWrite() throws ClassNotFoundExc assertTrue(tfile.delete()); } - - + + private void checkCombinedAnnotation(AnnotationGen ann) { assertTrue("should be called 'CombinedAnnotation' but was called "+ann.getTypeName(), ann.getTypeName().equals("CombinedAnnotation")); @@ -358,7 +358,7 @@ private void checkCombinedAnnotation(AnnotationGen ann) { ElementValue ev = nvp.getValue(); assertTrue("Should be of type ArrayElementValue but is "+ev,ev instanceof ArrayElementValue); ArrayElementValue aev = (ArrayElementValue)ev; - + assertTrue("Array element value should be of size 1 but is "+aev.getElementValuesArraySize(), aev.getElementValuesArraySize()==1); ElementValue[] evs = aev.getElementValuesArray(); @@ -374,7 +374,7 @@ private void checkCombinedAnnotation(AnnotationGen ann) { assertTrue("Value of 'id' should be 4 but it is "+envp.getValue().stringifyValue(), envp.getValue().stringifyValue().equals("4")); } - + protected void tearDown() throws Exception { super.tearDown(); @@ -388,5 +388,5 @@ public static List getListOfAnnotationNames(AnnotationGen a) { } return names; } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleParameterAnnotationAttributeTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleParameterAnnotationAttributeTest.java index be0b2fb301..3ccd41ba45 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleParameterAnnotationAttributeTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleParameterAnnotationAttributeTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -25,12 +25,12 @@ public class RuntimeVisibleParameterAnnotationAttributeTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - + public void testAccessingRuntimeVisibleParameterAnnotations() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("AnnotatedParameters"); @@ -63,32 +63,32 @@ public void testAccessingRuntimeVisibleParameterAnnotations() throws ClassNotFou } } } - + public void testAccessingParameterAnnotationsThroughGetAnnotations() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("AnnotatedParameters"); Attribute[] rvaAttr = findAttribute("RuntimeVisibleParameterAnnotations",clazz); - + checkFooMethod(clazz); } - + public void testParameterAnnotationsReadWrite() throws ClassNotFoundException,IOException { JavaClass clazz = getClassFromJar("AnnotatedParameters"); - + checkFooMethod(clazz); // Write it out File tfile = createTestdataFile("AnnotatedParameters.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("AnnotatedParameters"); - + checkFooMethod(clazz); assertTrue(tfile.delete()); } - - + + public void checkFooMethod(JavaClass clazz) { Method[] methods = clazz.getMethods(); @@ -105,7 +105,7 @@ public void checkFooMethod(JavaClass clazz) { } } } - + private void checkAnnotation(AnnotationGen a,String name,String elementname,String elementvalue) { assertTrue("Expected annotation to have name "+name+" but it had name "+a.getTypeName(), a.getTypeName().equals(name)); @@ -116,10 +116,10 @@ private void checkAnnotation(AnnotationGen a,String name,String elementname,Stri assertTrue("Expected element value "+elementvalue+" but was "+envp.getValue().stringifyValue(), elementvalue.equals(envp.getValue().stringifyValue())); } - + // helper methods - + public void checkValue(AnnotationGen a,String name,String tostring) { for (NameValuePair element : a.getValues()) { if (element.getNameString().equals(name)) { @@ -135,5 +135,5 @@ public void checkValue(AnnotationGen a,String name,String tostring) { protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java index be3e3d5ac0..c63b4fb9b3 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/TypeAnnotationsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2013 VMware - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -21,11 +21,11 @@ import org.aspectj.apache.bcel.classfile.annotation.TypeAnnotationGen; public class TypeAnnotationsTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - + public Attribute getAttribute(Attribute[] attrs, byte tag) { for (Attribute attr: attrs) { if (attr.getTag() == tag) { @@ -34,7 +34,7 @@ public Attribute getAttribute(Attribute[] attrs, byte tag) { } return null; } - + public void testClassTypeParameter() throws Exception { JavaClass jc = getClassFromJava8Jar("TypeAnnoOnClassTypeParameter"); RuntimeVisTypeAnnos rvta = (RuntimeVisTypeAnnos)getAttribute(jc.getAttributes(), Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS); @@ -44,7 +44,7 @@ public void testClassTypeParameter() throws Exception { checkTypeAnnotationClassTypeParameter(tas[0],0,"@Anno"); checkTypeAnnotationClassTypeParameter(tas[1],1,"@Anno(value=2)"); } - + public void testMethodTypeParameter() throws Exception { JavaClass jc = getClassFromJava8Jar("TypeAnnoOnMethodTypeParameter"); Method m = getMethod(jc, "m"); @@ -54,7 +54,7 @@ public void testMethodTypeParameter() throws Exception { assertEquals(1,tas.length); checkTypeAnnotationMethodTypeParameter(tas[0],0,"@Anno"); } - + public void testSuperinterface() throws Exception { JavaClass jc = getClassFromJava8Jar("TypeAnnoOnSuperinterface1"); RuntimeVisTypeAnnos rvta = (RuntimeVisTypeAnnos)getAttribute(jc.getAttributes(), Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS); @@ -64,7 +64,7 @@ public void testSuperinterface() throws Exception { TypeAnnotationGen ta = tas[0]; checkTypeAnnotationClassExtends(ta, 0, "@Anno"); } - + public void testSupertypes() throws Exception { JavaClass jc = getClassFromJava8Jar("TypeAnnoOnSupertypes"); RuntimeVisTypeAnnos rvta = (RuntimeVisTypeAnnos)getAttribute(jc.getAttributes(), Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS); @@ -114,15 +114,15 @@ public void testField() throws Exception { assertEquals(1,tas.length); checkTypeAnnotationField(tas[0],"@Anno"); checkTypePath(tas[0],TypeAnnotationGen.NO_TYPE_PATH); - + tas = getTypeAnnotations(getField(jc,"f2"),true); checkTypeAnnotationField(tas[0],"@Anno"); checkTypePath(tas[0],new int[]{TypeAnnotationGen.TYPE_PATH_ENTRY_KIND_TYPE_ARGUMENT,0}); - + tas = getTypeAnnotations(getField(jc,"f3"),true); checkTypeAnnotationField(tas[0],"@Anno"); checkTypePath(tas[0],new int[]{TypeAnnotationGen.TYPE_PATH_ENTRY_KIND_ARRAY,0}); - + tas = getTypeAnnotations(getField(jc,"f4"),true); checkTypeAnnotationField(tas[0],"@Anno"); checkTypePath(tas[0],new int[]{ @@ -160,7 +160,7 @@ public void testThrows() throws Exception { checkTypeAnnotationThrows(tas[1],1, "@Anno(value=2)"); checkTypePath(tas[1],TypeAnnotationGen.NO_TYPE_PATH); } - + public void testLocalVariable() throws Exception { JavaClass jc = getClassFromJava8Jar("TypeAnnoOnLocalVariable"); // TODO I think the attribute should be on the code for the method, not the method @@ -177,7 +177,7 @@ public void testResourceVariable() throws Exception { checkTypeAnnotationResourceVariable(tas[0],new int[]{17,204,1}, "@Anno"); checkTypeAnnotationResourceVariable(tas[1],new int[]{36,114,3}, "@Anno(value=99)"); } - + public void testExceptionParameter() throws Exception { JavaClass jc = getClassFromJava8Jar("TypeAnnoOnExceptionParameter"); // TODO I think the attribute should be on the code for the method, not the method @@ -203,7 +203,7 @@ public void testNew() throws Exception { assertEquals(4,tas.length); checkTypeAnnotationNew(tas[0],0, "@Anno"); checkTypePath(tas[0],TypeAnnotationGen.NO_TYPE_PATH); - + // TODO type path bugs in javac b90 according to the spec // checkTypeAnnotationNew(tas[1],8, "@Anno(value=2)"); // checkTypePath(tas[1],new int[]{ @@ -224,17 +224,17 @@ private TypeAnnotationGen[] getTypeAnnotations(Attribute[] attrs, boolean visibl RuntimeTypeAnnos rvta = (RuntimeTypeAnnos)getAttribute(attrs, visible?Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS:Constants.ATTR_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS); return rvta.getTypeAnnotations(); } - + private TypeAnnotationGen[] getTypeAnnotations(Method m, boolean visible) { RuntimeTypeAnnos rvta = (RuntimeTypeAnnos)getAttribute(m.getAttributes(), visible?Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS:Constants.ATTR_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS); return rvta.getTypeAnnotations(); } - + private TypeAnnotationGen[] getTypeAnnotations(Field f, boolean visible) { RuntimeTypeAnnos rvta = (RuntimeTypeAnnos)getAttribute(f.getAttributes(), visible?Constants.ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS:Constants.ATTR_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS); return rvta.getTypeAnnotations(); } - + private void checkTypePath(TypeAnnotationGen ta, int[] expectedTypePath) { int[] typepath = ta.getTypePath(); if (expectedTypePath==TypeAnnotationGen.NO_TYPE_PATH || expectedTypePath==null) { @@ -260,7 +260,7 @@ private void checkLocalVarTarget(TypeAnnotationGen ta, int[] expectedLocalVarTar } } } - + public static String toLocalVarTargetString(int[] localVarTarget) { StringBuilder sb = new StringBuilder(); int count = 0; @@ -327,18 +327,18 @@ private void checkTypeAnnotationMethodFormalParameter(TypeAnnotationGen ta, int assertEquals(expectedFormalParameterIndex,ta.getMethodFormalParameterIndex()); assertEquals(expectedAnnotationText,ta.getAnnotation().toShortString()); } - + private void checkTypeAnnotationThrows(TypeAnnotationGen ta, int expectedThrowsTypeIndex, String expectedAnnotationText) { assertEquals(TypeAnnotationGen.THROWS,ta.getTargetType()); assertEquals(expectedThrowsTypeIndex,ta.getThrowsTypeIndex()); assertEquals(expectedAnnotationText,ta.getAnnotation().toShortString()); } - + private void checkTypeAnnotationMethodReceiver(TypeAnnotationGen ta, String expectedAnnotationText) { assertEquals(TypeAnnotationGen.METHOD_RECEIVER,ta.getTargetType()); assertEquals(expectedAnnotationText,ta.getAnnotation().toShortString()); } - + private void checkTypeAnnotationClassExtends(TypeAnnotationGen ta, int expectedSupertypeIndex, String expectedAnnotationText) { assertEquals(TypeAnnotationGen.CLASS_EXTENDS,ta.getTargetType()); assertEquals(expectedSupertypeIndex,ta.getSupertypeIndex()); @@ -350,7 +350,7 @@ private void checkTypeAnnotationClassTypeParameter(TypeAnnotationGen ta, int exp assertEquals(expectedTypeParameterIndex,ta.getTypeParameterIndex()); assertEquals(expectedAnnotationText,ta.getAnnotation().toShortString()); } - + private void checkTypeAnnotationClassTypeParameterBound(TypeAnnotationGen ta, int expectedTypeParameterIndex, int expectedBoundIndex, String expectedAnnotationText) { assertEquals(TypeAnnotationGen.CLASS_TYPE_PARAMETER_BOUND,ta.getTargetType()); assertEquals(expectedTypeParameterIndex,ta.getTypeParameterIndex()); @@ -370,5 +370,5 @@ private void checkTypeAnnotationMethodTypeParameter(TypeAnnotationGen ta, int ex assertEquals(expectedTypeParameterIndex,ta.getTypeParameterIndex()); assertEquals(expectedAnnotationText,ta.getAnnotation().toShortString()); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/UtilTests.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/UtilTests.java index 750dbf4f10..f96efdaa3a 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/UtilTests.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/UtilTests.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -19,31 +19,31 @@ import junit.framework.TestCase; public class UtilTests extends TestCase { - + protected void setUp() throws Exception { super.setUp(); } - + public void testUtilityClassSignatureManipulation1() { String[] ss = UtilTests.methodSignatureArgumentTypes("(Ljava/lang/String;I[Ljava/lang/Integer;)"); assertTrue("should be 3 not "+ss.length,ss.length==3); - + assertTrue("first should be 'String', not "+ss[0],ss[0].equals("String")); assertTrue("second should be 'int', not "+ss[1],ss[1].equals("int")); assertTrue("third should be 'Integer[]', not "+ss[2],ss[2].equals("Integer[]")); } - + public void testUtilityClassSignatureManipulation2() { String s = Utility.methodSignatureToString("(Ljava/lang/String;[Z[[Ljava/lang/Integer;II)Z","hello","public"); String expected = "public boolean hello(String arg1, boolean[] arg2, Integer[][] arg3, int arg4, int arg5)"; assertTrue("Expected '"+expected+"' but got "+s,s.equals(expected)); } - + public void testTypeUtilMethods1() { String s = Utility.toMethodSignature(Type.DOUBLE,new Type[]{Type.INT,Type.STRING,Type.SHORT}); System.err.println(s); } - + public void testTypeUtilMethods2() { Type s = Type.getType("Ljava/lang/String;"); System.err.println(s); @@ -58,11 +58,11 @@ protected void tearDown() throws Exception { /** * @param signature Method signature * @return Array of argument types - * @throws ClassFormatException + * @throws ClassFormatException */ public static final String[] methodSignatureArgumentTypes(String signature) throws ClassFormatException { return GenericSignatureParsingTest.methodSignatureArgumentTypes(signature, true); } - + } diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/VarargsTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/VarargsTest.java index 23c46ac251..a497fd2e10 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/VarargsTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/VarargsTest.java @@ -1,13 +1,13 @@ /* ******************************************************************* * Copyright (c) 2004 IBM - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Andy Clement - initial implementation + * 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: + * Andy Clement - initial implementation * ******************************************************************/ package org.aspectj.apache.bcel.classfile.tests; @@ -23,44 +23,44 @@ public class VarargsTest extends BcelTestCase { - + protected void setUp() throws Exception { super.setUp(); } - - + + public void testVarargs() throws ClassNotFoundException { JavaClass clazz = getClassFromJar("VarargsClass"); - + checkMarkedVarargs(clazz,"foo",true); checkMarkedVarargs(clazz,"goo",true); checkMarkedVarargs(clazz,"hoo",false); } - + public void testVarargsReadWrite() throws ClassNotFoundException,IOException { JavaClass clazz = getClassFromJar("VarargsClass"); - + checkMarkedVarargs(clazz,"foo",true); checkMarkedVarargs(clazz,"goo",true); checkMarkedVarargs(clazz,"hoo",false); - + // Write it out File tfile = createTestdataFile("VarargsClass.class"); clazz.dump(tfile); - + SyntheticRepository repos2 = createRepos("."); JavaClass clazz2 = repos2.loadClass("VarargsClass"); - + checkMarkedVarargs(clazz,"foo",true); checkMarkedVarargs(clazz,"goo",true); checkMarkedVarargs(clazz,"hoo",false); assertTrue(tfile.delete()); } - + // helper methods - + public void checkMarkedVarargs(JavaClass clazz,String methodname,boolean shouldBeMarked) { Method[] methods = clazz.getMethods(); @@ -71,10 +71,10 @@ public void checkMarkedVarargs(JavaClass clazz,String methodname,boolean shouldB } } } - + // helper methods - + public void checkValue(AnnotationGen a,String name,String tostring) { for (NameValuePair element : a.getValues()) { if (element.getNameString().equals(name)) { @@ -90,5 +90,5 @@ public void checkValue(AnnotationGen a,String name,String tostring) { protected void tearDown() throws Exception { super.tearDown(); } - + } diff --git a/bridge/src/main/java/org/aspectj/bridge/AbortException.java b/bridge/src/main/java/org/aspectj/bridge/AbortException.java index 6dac2005ea..dadd16f9ee 100644 --- a/bridge/src/main/java/org/aspectj/bridge/AbortException.java +++ b/bridge/src/main/java/org/aspectj/bridge/AbortException.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -23,7 +23,7 @@ * normally (e.g., a test failure causes the test to abort but the reporting and testing continues normally), use the static methods * to borrow and return a "porter" to avoid the expense of constructing a stack trace each time. A porter stack trace is invalid, * and it should only be used to convey a message. E.g., to print the stack of the AbortException and any contained message: - * + * *
  * catch (AbortException ae) {
  *     IMessage m = ae.getMessage();
@@ -32,7 +32,7 @@
  *     if (null != thrown) thrown.printStackTrace(System.err);
  * }
  * 
- * + * * @author PARC * @author Andy Clement */ @@ -124,7 +124,7 @@ public IMessage getIMessage() { /** * The stack trace of a porter is invalid; it is only used to carry a message (which may itself have a wrapped exception). - * + * * @return true if this exception is only to carry exception */ public boolean isPorter() { @@ -152,7 +152,7 @@ private void setIMessage(IMessage message) { /** * Get message for this AbortException, either associated explicitly as message or implicitly as IMessage message or its thrown * message. - * + * * @see java.lang.Throwable#getMessage() */ public String getMessage() { @@ -184,7 +184,7 @@ public void printStackTrace() { /** * Print the stack trace of any enclosed thrown or this otherwise. - * + * * @see java.lang.Throwable#printStackTrace(PrintStream) */ public void printStackTrace(PrintStream s) { @@ -200,7 +200,7 @@ public void printStackTrace(PrintStream s) { /** * Print the stack trace of any enclosed thrown or this otherwise. - * + * * @see java.lang.Throwable#printStackTrace(PrintWriter) */ public void printStackTrace(PrintWriter s) { diff --git a/bridge/src/main/java/org/aspectj/bridge/Constants.java b/bridge/src/main/java/org/aspectj/bridge/Constants.java index 31f239678b..c4f5dc758a 100644 --- a/bridge/src/main/java/org/aspectj/bridge/Constants.java +++ b/bridge/src/main/java/org/aspectj/bridge/Constants.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * 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 - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Matthew Webster - initial implementation *******************************************************************************/ @@ -15,7 +15,7 @@ public class Constants { /* Default resource names for user and generate aop.xml file */ public final static String AOP_USER_XML = "META-INF/aop.xml"; public final static String AOP_AJC_XML = "META-INF/aop-ajc.xml"; - + /* Resource name for OSGi */ public final static String AOP_OSGI_XML = "org/aspectj/aop.xml"; diff --git a/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java b/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java index f1ea8f2fbe..e80ce5fc3f 100644 --- a/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java +++ b/bridge/src/main/java/org/aspectj/bridge/CountingMessageHandler.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -63,7 +63,7 @@ public boolean isIgnoring(IMessage.Kind kind) { /** * Delegate - * + * * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) * @param kind */ @@ -73,7 +73,7 @@ public void dontIgnore(IMessage.Kind kind) { /** * Delegate - * + * * @see org.aspectj.bridge.IMessageHandler#ignore(org.aspectj.bridge.IMessage.Kind) * @param kind */ @@ -88,7 +88,7 @@ public String toString() { /** * Return count of messages seen through this interface. - * + * * @param kind the IMessage.Kind of the messages to count (if null, count all) * @param orGreater if true, then count this kind and any considered greater by the ordering of IMessage.Kind#COMPARATOR * @return number of messages of this kind (optionally or greater) diff --git a/bridge/src/main/java/org/aspectj/bridge/ICommand.java b/bridge/src/main/java/org/aspectj/bridge/ICommand.java index b77d58e591..a9c394633d 100644 --- a/bridge/src/main/java/org/aspectj/bridge/ICommand.java +++ b/bridge/src/main/java/org/aspectj/bridge/ICommand.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -27,13 +27,13 @@ public interface ICommand { * @return true if the command completed successfully */ boolean runCommand(String[] args, IMessageHandler handler); - + /** * Rerun the command. - * + * * @param handler the IMessageHandler for all output from the command - * + * * @return true if the command completed successfully */ - boolean repeatCommand(IMessageHandler handler); + boolean repeatCommand(IMessageHandler handler); } diff --git a/bridge/src/main/java/org/aspectj/bridge/ILifecycleAware.java b/bridge/src/main/java/org/aspectj/bridge/ILifecycleAware.java index c5ac9b1493..55c6b9b13e 100644 --- a/bridge/src/main/java/org/aspectj/bridge/ILifecycleAware.java +++ b/bridge/src/main/java/org/aspectj/bridge/ILifecycleAware.java @@ -1,21 +1,21 @@ /* ******************************************************************* * Copyright (c) 2006 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.bridge; /** - * Interface that can be implemented by MessageHandlers that need to - * perform some additional processing when a build is starting and + * Interface that can be implemented by MessageHandlers that need to + * perform some additional processing when a build is starting and * when it has finished. - * + * * @author Adrian Colyer * @since 1.5.1 */ @@ -25,11 +25,11 @@ public interface ILifecycleAware { * called when a build starts */ void buildStarting(boolean isIncremental); - + /** * called when a batch build finishes * */ void buildFinished(boolean wasIncremental); - + } diff --git a/bridge/src/main/java/org/aspectj/bridge/IMessage.java b/bridge/src/main/java/org/aspectj/bridge/IMessage.java index 21ef8d7ab3..b9c7c05ea4 100644 --- a/bridge/src/main/java/org/aspectj/bridge/IMessage.java +++ b/bridge/src/main/java/org/aspectj/bridge/IMessage.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/IMessageContext.java b/bridge/src/main/java/org/aspectj/bridge/IMessageContext.java index e3e0d0962c..cde4ce4888 100644 --- a/bridge/src/main/java/org/aspectj/bridge/IMessageContext.java +++ b/bridge/src/main/java/org/aspectj/bridge/IMessageContext.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright (c) 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Matthew Webster - initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/IMessageHandler.java b/bridge/src/main/java/org/aspectj/bridge/IMessageHandler.java index 9baf234658..3268dd3fb1 100644 --- a/bridge/src/main/java/org/aspectj/bridge/IMessageHandler.java +++ b/bridge/src/main/java/org/aspectj/bridge/IMessageHandler.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/IMessageHolder.java b/bridge/src/main/java/org/aspectj/bridge/IMessageHolder.java index c438b83503..bb8b8074a6 100644 --- a/bridge/src/main/java/org/aspectj/bridge/IMessageHolder.java +++ b/bridge/src/main/java/org/aspectj/bridge/IMessageHolder.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/IProgressListener.java b/bridge/src/main/java/org/aspectj/bridge/IProgressListener.java index 21eb6eeb40..1fa39c2b1b 100644 --- a/bridge/src/main/java/org/aspectj/bridge/IProgressListener.java +++ b/bridge/src/main/java/org/aspectj/bridge/IProgressListener.java @@ -2,9 +2,9 @@ * Copyright (c) 2003 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/ISourceLocation.java b/bridge/src/main/java/org/aspectj/bridge/ISourceLocation.java index 5045d0f47a..45207fcb61 100644 --- a/bridge/src/main/java/org/aspectj/bridge/ISourceLocation.java +++ b/bridge/src/main/java/org/aspectj/bridge/ISourceLocation.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/Message.java b/bridge/src/main/java/org/aspectj/bridge/Message.java index 959491c1f1..fa6a90d9f8 100644 --- a/bridge/src/main/java/org/aspectj/bridge/Message.java +++ b/bridge/src/main/java/org/aspectj/bridge/Message.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -33,7 +33,7 @@ public class Message implements IMessage { /** * Create a (compiler) error or warning message - * + * * @param message the String used as the underlying message * @param location the ISourceLocation, if any, associated with this message * @param isError if true, use IMessage.ERROR; else use IMessage.WARNING @@ -49,7 +49,7 @@ public Message(String message, ISourceLocation location, boolean isError, ISourc /** * Create a message, handling null values for message and kind if thrown is not null. - * + * * @param message the String used as the underlying message * @param kind the IMessage.Kind of message - not null * @param thrown the Throwable, if any, associated with this message @@ -89,7 +89,7 @@ public Message(String message, String details, IMessage.Kind kind, ISourceLocati /** * Create a message, handling null values for message and kind if thrown is not null. - * + * * @param message the String used as the underlying message * @param kind the IMessage.Kind of message - not null * @param thrown the Throwable, if any, associated with this message diff --git a/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java b/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java index 95bcf029db..c6e423e7f5 100644 --- a/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java +++ b/bridge/src/main/java/org/aspectj/bridge/MessageHandler.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -22,7 +22,7 @@ * listener/interceptor. The interceptor handles all messages (even null) first, and can halt further processing/accumlation by * returning true. Clients can obtain messages accumulated using the get... methods. XXX this does not permit messages to be * removed. - * + * * @author PARC * @author Andy Clement */ @@ -64,7 +64,7 @@ public void init() { /** * Initialize this, removing any messages accumulated, kinds being ignored, or interceptor. - * + * * @param accumulateOnly boolean value returned from handleMessage after accumulating in list */ public void init(boolean accumulateOnly) { @@ -97,7 +97,7 @@ public void clearMessages() { /** * This implementation accumulates message. If an interceptor is installed and returns true (message handled), then processing * halts and the message is not accumulated. - * + * * @see org.aspectj.bridge.IMessageHandler#handleMessage(IMessage) * @return true on interception or the constructor value otherwise */ @@ -199,7 +199,7 @@ public List getUnmodifiableListView() { /** * Get all messages or those of a specific kind. Pass null to get all kinds. - * + * * @param kind the IMessage.Kind expected, or null for all messages * @return IMessage[] of messages of the right kind */ @@ -243,7 +243,7 @@ public IMessage[] getWarnings() { /** * Set the interceptor which gets any message before we process it. - * + * * @param interceptor the IMessageHandler passed the message. Pass null to remove the old interceptor. */ public void setInterceptor(IMessageHandler interceptor) { diff --git a/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java b/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java index 1b822395de..8c17cd9472 100644 --- a/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java +++ b/bridge/src/main/java/org/aspectj/bridge/MessageUtil.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/bridge/src/main/java/org/aspectj/bridge/MessageWriter.java b/bridge/src/main/java/org/aspectj/bridge/MessageWriter.java index 3fbeb91b0d..5f3389d972 100644 --- a/bridge/src/main/java/org/aspectj/bridge/MessageWriter.java +++ b/bridge/src/main/java/org/aspectj/bridge/MessageWriter.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -22,17 +22,17 @@ * are rendered by overriding render(IMessage). */ public class MessageWriter implements IMessageHandler { - + protected PrintWriter writer; protected boolean abortOnFailure; public MessageWriter(PrintWriter writer, boolean abortOnFailure) { this.writer = (null != writer ? writer : new PrintWriter(System.out)); this.abortOnFailure = abortOnFailure; } - + /** * Handle message by printing and - * (if abortOnFailure) throwing an AbortException if + * (if abortOnFailure) throwing an AbortException if * the messages is a failure or an abort (but not for errors). * @see org.aspectj.bridge.IMessageHandler#handleMessage(IMessage) */ @@ -50,11 +50,11 @@ public boolean handleMessage(IMessage message) throws AbortException { } return true; } - + /** * @see org.aspectj.bridge.IMessageHandler#isIgnoring(org.aspectj.bridge.IMessage.Kind) */ - public boolean isIgnoring(IMessage.Kind kind) { + public boolean isIgnoring(IMessage.Kind kind) { // XXX share MessageHandler implementation in superclass return false; } @@ -65,7 +65,7 @@ public boolean isIgnoring(IMessage.Kind kind) { * @param kind */ public void dontIgnore(IMessage.Kind kind) { - + } /** @@ -78,7 +78,7 @@ public void ignore(IMessage.Kind kind) { /** @return null to not print, or message rendering (including newlines) */ protected String render(IMessage message) { - return message.toString(); + return message.toString(); } } diff --git a/bridge/src/main/java/org/aspectj/bridge/ReflectionFactory.java b/bridge/src/main/java/org/aspectj/bridge/ReflectionFactory.java index 73f063dc43..9d0307d6eb 100644 --- a/bridge/src/main/java/org/aspectj/bridge/ReflectionFactory.java +++ b/bridge/src/main/java/org/aspectj/bridge/ReflectionFactory.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -17,7 +17,7 @@ import java.util.Arrays; /** - * + * */ public class ReflectionFactory { // XXX lease, pool public static final String OLD_AJC = "bridge.tools.impl.OldAjc"; @@ -27,7 +27,7 @@ public class ReflectionFactory { // XXX lease, pool /** * Produce a compiler as an ICommand. - * + * * @param cname the fully-qualified class name of the command to create by reflection (assuming a public no-argument * constructor). * @return ICommand compiler or null diff --git a/bridge/src/main/java/org/aspectj/bridge/SourceLocation.java b/bridge/src/main/java/org/aspectj/bridge/SourceLocation.java index d3d8f128c2..e6cbe0bc2c 100644 --- a/bridge/src/main/java/org/aspectj/bridge/SourceLocation.java +++ b/bridge/src/main/java/org/aspectj/bridge/SourceLocation.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -20,7 +20,7 @@ /** * Immutable source location. This guarantees that the source file is not null and that the numeric values are positive and line ≤ * endLine. - * + * * @see org.aspectj.lang.reflect.SourceLocation */ public class SourceLocation implements ISourceLocation { diff --git a/bridge/src/main/java/org/aspectj/bridge/Version.java b/bridge/src/main/java/org/aspectj/bridge/Version.java index 3217411208..07139048f8 100644 --- a/bridge/src/main/java/org/aspectj/bridge/Version.java +++ b/bridge/src/main/java/org/aspectj/bridge/Version.java @@ -1,12 +1,12 @@ /* ******************************************************************** - * Copyright (c) 1998-2001 Xerox Corporation, + * Copyright (c) 1998-2001 Xerox Corporation, * 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 v1.0 + * 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 - * http://www.eclipse.org/legal/epl-v10.html - * + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + * * Contributors: * Xerox/PARC initial implementation * *******************************************************************/ @@ -22,7 +22,7 @@ /** release-specific version information */ public class Version { - + // generated from build/lib/BridgeVersion.java /** default version value for development version */ @@ -31,29 +31,29 @@ public class Version { /** default time value for development version */ public static final long NOTIME = 0L; - + public static final String UNREPLACED_TEXT = "${project.version}"; public static final String UNREPLACED_TIME_TEXT = "${version.time_text}"; - + /** set by build script */ private static String text;// = "DEVELOPMENT"; // VersionUptodate.java scans for "static final String text = " - - /** + + /** * Time text set by build script using SIMPLE_DATE_FORMAT. * (if DEVELOPMENT version, invalid) */ private static String time_text;// = "Tuesday Jan 15, 2019 at 00:53:54 GMT"; - - /** + + /** * time in seconds-since-... format, used by programmatic clients. * (if DEVELOPMENT version, NOTIME) */ private static long time = -1; // -1 == uninitialized - + /** format used by build script to set time_text */ public static final String SIMPLE_DATE_FORMAT = "EEEE MMM d, yyyy 'at' HH:mm:ss z"; - + static { try { URL resource = Version.class.getResource("version.properties"); @@ -70,19 +70,19 @@ public class Version { } catch (IOException e) { text="DEVELOPMENT"; time_text = ""; - } + } } - + public static long getTime() { if (time==-1) { long foundTime = NOTIME; - // if not DEVELOPMENT version, read time text using format used to set time + // if not DEVELOPMENT version, read time text using format used to set time try { SimpleDateFormat format = new SimpleDateFormat(SIMPLE_DATE_FORMAT); ParsePosition pos = new ParsePosition(0); Date date = format.parse(time_text, pos); if (date!=null) foundTime = date.getTime(); - } catch (Throwable t) { + } catch (Throwable t) { } time = foundTime; } @@ -98,10 +98,10 @@ public static long getTime() { public static void main(String[] args) { if ((null != args) && (0 < args.length)) { if (!Version.text.equals(args[0])) { - System.err.println("version expected: \"" - + args[0] - + "\" actual=\"" - + Version.text + System.err.println("version expected: \"" + + args[0] + + "\" actual=\"" + + Version.text + "\""); } } @@ -115,7 +115,7 @@ public static String getText() { return text; } } - + diff --git a/bridge/src/main/java/org/aspectj/bridge/WeaveMessage.java b/bridge/src/main/java/org/aspectj/bridge/WeaveMessage.java index 2c697a8113..ba6baab5b4 100644 --- a/bridge/src/main/java/org/aspectj/bridge/WeaveMessage.java +++ b/bridge/src/main/java/org/aspectj/bridge/WeaveMessage.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2004 IBM Corporation - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Andy Clement IBM initial implementation 30-May-2004 * ******************************************************************/ @@ -51,7 +51,7 @@ private WeaveMessage(String message, String affectedtypename, String aspectname) /** * Static helper method for constructing weaving messages. - * + * * @param kind what kind of message (e.g. declare parents) * @param inserts inserts for the message (inserts are marked %n in the message) * @return new weaving message @@ -68,7 +68,7 @@ public static WeaveMessage constructWeavingMessage(WeaveMessageKind kind, String /** * Static helper method for constructing weaving messages. - * + * * @param kind what kind of message (e.g. declare parents) * @param inserts inserts for the message (inserts are marked %n in the message) * @param affectedtypename the type which is being advised/declaredUpon diff --git a/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java b/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java index e1ea09a99e..cd750e4ab4 100644 --- a/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java +++ b/bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005-2012 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * Andy Clement various fixes * Trask Stanalker #373195 @@ -19,10 +19,10 @@ import java.util.Stack; /** - * This class is responsible for tracking progress through the various phases of compilation and weaving. - * When an exception occurs (or a message is issued, if desired), you can ask this class for a - * "stack trace" that gives information about what the compiler was doing at the time. - * The trace will say something like: + * This class is responsible for tracking progress through the various phases of compilation and weaving. + * When an exception occurs (or a message is issued, if desired), you can ask this class for a + * "stack trace" that gives information about what the compiler was doing at the time. + * The trace will say something like: * "when matching pointcut xyz when matching shadow sss when weaving type ABC when weaving shadow mungers" */ public class CompilationAndWeavingContext { diff --git a/bridge/src/main/java/org/aspectj/bridge/context/ContextFormatter.java b/bridge/src/main/java/org/aspectj/bridge/context/ContextFormatter.java index 9f1b591d75..5d34a0dec1 100644 --- a/bridge/src/main/java/org/aspectj/bridge/context/ContextFormatter.java +++ b/bridge/src/main/java/org/aspectj/bridge/context/ContextFormatter.java @@ -1,19 +1,19 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.bridge.context; /** * @author colyer - * Implementors of this interface know how to turn the "Object" data and phase id + * Implementors of this interface know how to turn the "Object" data and phase id * associated with a context stack entry into a meaningful string. */ public interface ContextFormatter { diff --git a/bridge/src/main/java/org/aspectj/bridge/context/ContextToken.java b/bridge/src/main/java/org/aspectj/bridge/context/ContextToken.java index 2415fa72e6..b9e4d0ebc5 100644 --- a/bridge/src/main/java/org/aspectj/bridge/context/ContextToken.java +++ b/bridge/src/main/java/org/aspectj/bridge/context/ContextToken.java @@ -1,19 +1,19 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.bridge.context; /** * When an entry is added to the CompilationAndWeavingContext stack, - * a ContextToken is returned. + * a ContextToken is returned. * When leaving a compilation or weaving phase, this token must be supplied. * The token details are opaque to clients */ diff --git a/bridge/src/main/java/org/aspectj/bridge/context/PinpointingMessageHandler.java b/bridge/src/main/java/org/aspectj/bridge/context/PinpointingMessageHandler.java index b8c975cd01..fe2239d7a8 100644 --- a/bridge/src/main/java/org/aspectj/bridge/context/PinpointingMessageHandler.java +++ b/bridge/src/main/java/org/aspectj/bridge/context/PinpointingMessageHandler.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.bridge.context; @@ -24,13 +24,13 @@ /** * @author colyer * Facade for an IMessageHandler - * Extends message with details of exactly what the compiler / weaver was doing at the + * Extends message with details of exactly what the compiler / weaver was doing at the * time. Use the -Xdev:Pinpoint option to turn this facility on. */ public class PinpointingMessageHandler implements IMessageHandler { private IMessageHandler delegate; - + public PinpointingMessageHandler(IMessageHandler delegate) { this.delegate = delegate; } @@ -75,17 +75,17 @@ public void dontIgnore(Kind kind) { public void ignore(Kind kind) { delegate.ignore(kind); } - + private static class PinpointedMessage implements IMessage { private IMessage delegate; private String message; - + public PinpointedMessage(IMessage delegate, String pinpoint) { this.delegate = delegate; this.message = delegate.getMessage() + "\n" + pinpoint; } - + public String getMessage() { return this.message; } public Kind getKind() { return delegate.getKind();} public boolean isError() { return delegate.isError(); } diff --git a/bridge/src/test/java/org/aspectj/bridge/BridgeModuleTests.java b/bridge/src/test/java/org/aspectj/bridge/BridgeModuleTests.java index 39671f319c..2c088ea692 100644 --- a/bridge/src/test/java/org/aspectj/bridge/BridgeModuleTests.java +++ b/bridge/src/test/java/org/aspectj/bridge/BridgeModuleTests.java @@ -1,15 +1,15 @@ package org.aspectj.bridge; /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ @@ -23,15 +23,15 @@ public class BridgeModuleTests extends TestCase { - public static Test suite() { + public static Test suite() { TestSuite suite = new TestSuite(BridgeModuleTests.class.getName()); - suite.addTestSuite(CountingMessageHandlerTest.class); - suite.addTestSuite(MessageTest.class); - suite.addTestSuite(VersionTest.class); + suite.addTestSuite(CountingMessageHandlerTest.class); + suite.addTestSuite(MessageTest.class); + suite.addTestSuite(VersionTest.class); suite.addTestSuite(CompilationAndWeavingContextTest.class); return suite; } public BridgeModuleTests(String name) { super(name); } -} +} diff --git a/bridge/src/test/java/org/aspectj/bridge/CountingMessageHandlerTest.java b/bridge/src/test/java/org/aspectj/bridge/CountingMessageHandlerTest.java index dc357a8b16..981b928417 100644 --- a/bridge/src/test/java/org/aspectj/bridge/CountingMessageHandlerTest.java +++ b/bridge/src/test/java/org/aspectj/bridge/CountingMessageHandlerTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -18,11 +18,11 @@ import junit.textui.TestRunner; /** - * + * */ public class CountingMessageHandlerTest extends TestCase { - private static final String ME + private static final String ME = "org.aspectj.bridge.CountingMessageHandlerTest"; // XXX /** @param args ignored */ @@ -60,7 +60,7 @@ void checkCountingMessageHandler(CountingMessageHandler me) { assertEquals(0 , me.numMessages(IMessage.ERROR, true)); assertEquals(1 , me.numMessages(IMessage.WARNING, true)); assertEquals(1 , me.numMessages(IMessage.INFO, true)); - + MessageUtil.info(me, "info 1"); assertTrue(!me.hasErrors()); assertEquals(0 , me.numMessages(IMessage.ERROR, false)); @@ -78,5 +78,5 @@ void checkCountingMessageHandler(CountingMessageHandler me) { assertEquals(1 , me.numMessages(IMessage.ERROR, true)); assertEquals(2 , me.numMessages(IMessage.WARNING, true)); assertEquals(3 , me.numMessages(IMessage.INFO, true)); - } + } } diff --git a/bridge/src/test/java/org/aspectj/bridge/MessageTest.java b/bridge/src/test/java/org/aspectj/bridge/MessageTest.java index 7ef2eafb47..c4e6b6a3cb 100644 --- a/bridge/src/test/java/org/aspectj/bridge/MessageTest.java +++ b/bridge/src/test/java/org/aspectj/bridge/MessageTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -25,11 +25,11 @@ import junit.textui.TestRunner; /** - * + * */ public class MessageTest extends TestCase { - private static final String ME + private static final String ME = "org.aspectj.bridge.MessageTest"; // XXX /** @param args ignored */ @@ -44,7 +44,7 @@ public static void main(String[] args) { public MessageTest(String name) { super(name); } - + void checkListOrder(List list, Comparator c) { // XXX util assertNotNull(list); assertNotNull(c); @@ -57,19 +57,19 @@ void checkListOrder(List list, Comparator c) { // XXX util int i = c.compare(last, current); if (i > 0) { assertTrue( last + " > " + current + " (" + i + ")", false); - } - } + } + } last = current; } } - + public void testKindOrder() { // first briefly validate the checker checkListOrder(Arrays.asList(new String[] { "a", "b", "C" }), String.CASE_INSENSITIVE_ORDER); checkListOrder(IMessage.KINDS, IMessage.Kind.COMPARATOR); } - + public void testKind_isSameOrLessThan() { IMessage.Kind last; IMessage.Kind next = null; @@ -86,31 +86,31 @@ public void testKind_isSameOrLessThan() { assertTrue(label, next.isSameOrLessThan(next)); } } - + public void testMessageHandler() { boolean handleMessageResult = true; checkEmptyMessageHolder(new MessageHandler(handleMessageResult), handleMessageResult); handleMessageResult = false; checkEmptyMessageHolder(new MessageHandler(handleMessageResult), handleMessageResult); } - + public void checkEmptyMessageHolder( - IMessageHolder h, + IMessageHolder h, final boolean handleMessageResult) { - // { INFO, DEBUG, WARNING, ERROR, FAIL, ABORT })); + // { INFO, DEBUG, WARNING, ERROR, FAIL, ABORT })); assertNotNull(h); assertTrue(!h.hasAnyMessage(null, true)); assertTrue(!h.hasAnyMessage(null, false)); assertTrue(!h.hasAnyMessage(IMessage.INFO, true)); assertTrue(!h.hasAnyMessage(IMessage.INFO, false)); - + assertTrue(handleMessageResult == h.handleMessage(make("error 1", IMessage.ERROR))); assertTrue(handleMessageResult == h.handleMessage(make("error 2", IMessage.ERROR))); assertTrue(handleMessageResult == h.handleMessage(make("fail 1", IMessage.FAIL))); assertTrue(handleMessageResult == h.handleMessage(make("fail 2", IMessage.FAIL))); assertTrue(handleMessageResult == h.handleMessage(make("debug 1", IMessage.DEBUG))); assertTrue(handleMessageResult == h.handleMessage(make("debug 2", IMessage.DEBUG))); - + assertTrue(h.hasAnyMessage(null, true)); assertTrue(h.hasAnyMessage(null, false)); assertTrue(h.hasAnyMessage(IMessage.ERROR, true)); @@ -119,14 +119,14 @@ public void checkEmptyMessageHolder( assertTrue(h.hasAnyMessage(IMessage.FAIL, false)); assertTrue(h.hasAnyMessage(IMessage.DEBUG, true)); assertTrue(h.hasAnyMessage(IMessage.DEBUG, false)); - + assertTrue(!h.hasAnyMessage(IMessage.INFO, IMessageHolder.EQUAL)); assertTrue(!h.hasAnyMessage(IMessage.WARNING, IMessageHolder.EQUAL)); assertTrue(!h.hasAnyMessage(IMessage.ABORT, IMessageHolder.EQUAL)); assertTrue(h.hasAnyMessage(IMessage.INFO, IMessageHolder.ORGREATER)); assertTrue(h.hasAnyMessage(IMessage.WARNING, IMessageHolder.ORGREATER)); assertTrue(!h.hasAnyMessage(IMessage.ABORT, IMessageHolder.ORGREATER)); - + assertTrue(0 == h.numMessages(IMessage.INFO, IMessageHolder.EQUAL)); assertTrue(0 == h.numMessages(IMessage.WARNING, IMessageHolder.EQUAL)); assertTrue(0 == h.numMessages(IMessage.ABORT, IMessageHolder.EQUAL)); @@ -139,9 +139,9 @@ public void checkEmptyMessageHolder( assertTrue(4 == h.numMessages(IMessage.ERROR, IMessageHolder.ORGREATER)); assertTrue(2 == h.numMessages(IMessage.FAIL, IMessageHolder.ORGREATER)); assertTrue(0 == h.numMessages(IMessage.ABORT, IMessageHolder.ORGREATER)); - - } - + + } + public void testMessage() { String input = "input"; Throwable thrown = null; @@ -183,16 +183,16 @@ public void testMessage() { roundTrip(input, kind, thrown, sl, descriptor, exClass); input = null; kind = IMessage.INFO; - roundTrip(input, kind, thrown, sl, descriptor, exClass); + roundTrip(input, kind, thrown, sl, descriptor, exClass); } - + protected IMessage make(String message, IMessage.Kind kind) { return new Message(message, kind, null, null); } /** make a Message per descriptor and input */ protected IMessage make(String input, IMessage.Kind kind, - Throwable thrown, ISourceLocation sourceLocation, + Throwable thrown, ISourceLocation sourceLocation, String descriptor) { // XXX ignored for now return new Message(input, kind, thrown, sourceLocation); } @@ -201,7 +201,7 @@ protected IMessage make(String input, IMessage.Kind kind, * Simple round-trip on the message */ protected void roundTrip(String input, IMessage.Kind kind, - Throwable thrown, ISourceLocation sourceLocation, + Throwable thrown, ISourceLocation sourceLocation, String descriptor, Class exClass) { try { IMessage m = make(input, kind, thrown, sourceLocation, descriptor); @@ -224,14 +224,14 @@ protected void roundTripCheck(IMessage message, String input, IMessage.Kind kind assertEquals(input, m.getMessage()); assertTrue(""+kind, kind == m.getKind()); assertTrue(""+thrown, equals(thrown, m.getThrown())); - assertTrue(""+sourceLocation, + assertTrue(""+sourceLocation, equals(sourceLocation, m.getSourceLocation())); String err = new KindTest().testKindSet(message, kind); if (null != err) { assertTrue(err, false); } } - + protected static boolean equals(Object one, Object two) { if (null == one) { return (null == two); @@ -246,8 +246,8 @@ protected static boolean equals(Object one, Object two) { /** test correlation between message and enclosed kind */ class KindTest { /** order tracked in checkKindMethods() */ - static final IMessage.Kind[] KINDS = new IMessage.Kind[] - { IMessage.ABORT, IMessage.DEBUG, IMessage.ERROR, + static final IMessage.Kind[] KINDS = new IMessage.Kind[] + { IMessage.ABORT, IMessage.DEBUG, IMessage.ERROR, IMessage.INFO, IMessage.WARNING, IMessage.FAIL }; static final List KINDLIST = Arrays.asList(KINDS); @@ -258,7 +258,7 @@ class KindTest { final BitSet expected = new BitSet(KINDS.length); IMessage.Kind kind = IMessage.INFO; - + /** @return error if failed */ public String testKindSet(IMessage m, IMessage.Kind newKind) { IMessage.Kind oldKind = this.kind; @@ -271,7 +271,7 @@ public String testKindSet(IMessage m, IMessage.Kind newKind) { } return (null != result? result : setKind(oldKind)); } - + /** @return error if failed */ private String setKind(IMessage.Kind kind) { this.kind = kind; @@ -283,7 +283,7 @@ private String setKind(IMessage.Kind kind) { expected.set(index); return null; } - + /** @return error if failed */ String checkExpectedKind(IMessage m) { StringBuffer result = new StringBuffer(); @@ -292,29 +292,29 @@ String checkExpectedKind(IMessage m) { String s = "expected " + expected.get(i) + " for is{Method} for " + KINDS[i]; result.append(s + "\n"); - } - } - return (0 < result.length() ? result.toString() : null); + } + } + return (0 < result.length() ? result.toString() : null); } - + String checkKindSet(IMessage m, IMessage.Kind kind) { if (kind != m.getKind()) { return "expected kind " + kind + " got " + m.getKind(); } return null; } - + /** @return true if index matches isFoo() reporting */ boolean checkKindMethods(IMessage m, int index) { switch (index) { - case (0) : return m.isAbort(); - case (1) : return m.isDebug(); - case (2) : return m.isError(); - case (3) : return m.isInfo(); - case (4) : return m.isWarning(); - case (5) : return m.isFailed(); + case (0) : return m.isAbort(); + case (1) : return m.isDebug(); + case (2) : return m.isError(); + case (3) : return m.isInfo(); + case (4) : return m.isWarning(); + case (5) : return m.isFailed(); default : throw new IllegalArgumentException("index=" + index); - + } } } diff --git a/bridge/src/test/java/org/aspectj/bridge/VersionTest.java b/bridge/src/test/java/org/aspectj/bridge/VersionTest.java index 70eb9d3806..ecf3b230b9 100644 --- a/bridge/src/test/java/org/aspectj/bridge/VersionTest.java +++ b/bridge/src/test/java/org/aspectj/bridge/VersionTest.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.bridge; @@ -24,7 +24,7 @@ import junit.textui.TestRunner; /** - * + * */ public class VersionTest extends TestCase { @@ -37,7 +37,7 @@ public static void main(String[] args) { /** * Constructor for MessageTest. - * + * * @param name */ public VersionTest(String name) { diff --git a/bridge/src/test/java/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java b/bridge/src/test/java/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java index 825a52b61e..fbb10e094b 100644 --- a/bridge/src/test/java/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java +++ b/bridge/src/test/java/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java @@ -1,12 +1,12 @@ /* ******************************************************************* * Copyright (c) 2005 Contributors. - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://eclipse.org/legal/epl-v10.html - * - * 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 + * + * Contributors: * Adrian Colyer Initial implementation * ******************************************************************/ package org.aspectj.bridge.context; @@ -23,45 +23,45 @@ public void testEnteringPhase() { CompilationAndWeavingContext.enteringPhase(1,"XYZ"); assertEquals("when fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext()); } - + public void testDoubleEntry() { CompilationAndWeavingContext.enteringPhase(1,"XYZ"); CompilationAndWeavingContext.enteringPhase(2, "ABC"); - assertEquals("when mucking about with ABC\nwhen fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext()); + assertEquals("when mucking about with ABC\nwhen fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext()); } - + public void testEntryEntryExit() { CompilationAndWeavingContext.enteringPhase(1,"XYZ"); ContextToken ct = CompilationAndWeavingContext.enteringPhase(2, "ABC"); CompilationAndWeavingContext.leavingPhase(ct); - assertEquals("when fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext()); + assertEquals("when fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext()); } - + public void testEntryExitTop() { ContextToken ct = CompilationAndWeavingContext.enteringPhase(1,"XYZ"); CompilationAndWeavingContext.enteringPhase(2, "ABC"); CompilationAndWeavingContext.leavingPhase(ct); - assertEquals("",CompilationAndWeavingContext.getCurrentContext()); + assertEquals("",CompilationAndWeavingContext.getCurrentContext()); } - + protected void setUp() throws Exception { CompilationAndWeavingContext.reset(); CompilationAndWeavingContext.registerFormatter(1, new MyContextFormatter("fiddling ")); CompilationAndWeavingContext.registerFormatter(2, new MyContextFormatter("mucking about with ")); } - + private static class MyContextFormatter implements ContextFormatter { private String prefix; - + public MyContextFormatter(String prefix) { this.prefix = prefix; } - + public String formatEntry(int phaseId, Object data) { return prefix + data.toString(); } - + } } diff --git a/build/build-properties.xml b/build/build-properties.xml index acfcac2c57..c735b855be 100644 --- a/build/build-properties.xml +++ b/build/build-properties.xml @@ -1,12 +1,12 @@ - + - + - + @@ -16,7 +16,7 @@ - + @@ -24,7 +24,7 @@ - - - - - - + + + + + - - + + - - - + - + - - - - - - - - - - - - - - + - - @@ -107,19 +107,19 @@ location="${aspectj.modules.dir}/tests"/> - + - + - + - - - - - @@ -155,12 +155,12 @@ - - + value="true"> @@ -172,12 +172,12 @@ - - @@ -193,20 +193,20 @@ unless="init-filters.done" > - - - - + + + + - - + + - - + @@ -214,11 +214,11 @@ - + - - @@ -226,30 +226,30 @@ - + - - - - - - + + + + + + - + - + - + - + @@ -267,13 +267,13 @@ - + - @@ -283,8 +283,8 @@ - - + + @@ -318,12 +318,12 @@ - + - + @@ -335,13 +335,13 @@ - - + @@ -415,7 +415,7 @@ - @@ -425,19 +425,19 @@ description="fail if ${failureFile} exists and is not empty"> - - -# @{failureFile} failures: +# @{failureFile} failures: ${failures} - + @@ -452,15 +452,15 @@ ${failures} message="unable to find @{name}: ${@{name}}"/> - + - - + @@ -475,12 +475,12 @@ ${failures} - + @{message} (property "@{property}" not at "@{path}") - + diff --git a/build/build.xml b/build/build.xml index a24ced7292..1ea2f5aa74 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,12 +2,12 @@ - + - + - + diff --git a/build/lib/BridgeVersion.java.txt b/build/lib/BridgeVersion.java.txt index 36c1e0df42..047854cc6f 100644 --- a/build/lib/BridgeVersion.java.txt +++ b/build/lib/BridgeVersion.java.txt @@ -2,10 +2,10 @@ * Copyright (c) 1998-2001 Xerox Corporation, * 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 v1.0 + * 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 - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/build/products/aspectj/install/intro.html b/build/products/aspectj/install/intro.html index b29bb9484b..d5b5437053 100644 --- a/build/products/aspectj/install/intro.html +++ b/build/products/aspectj/install/intro.html @@ -7,8 +7,8 @@

Installer for AspectJ 9 Development KitTM

This installs the complete AspectJ 9 Development Kit (AJDK) distribution, with the compiler, aspect libraries, structure browser, ant tasks, documentation, and examples. -This distribution is covered by the Eclipse Public License (see - http://www.eclipse.org/legal/epl-v10.html). +This distribution is covered by the Eclipse Public License v 2.0 (see +https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt).

For IDE integrations or source code, see the project home page at http://eclipse.org/aspectj

diff --git a/build/release/aspectj-cc.xml b/build/release/aspectj-cc.xml index 9b6c8bede6..79f13ec8fc 100644 --- a/build/release/aspectj-cc.xml +++ b/build/release/aspectj-cc.xml @@ -3,27 +3,27 @@ - + - + - + - - + + @@ -31,7 +31,7 @@ description="post-process cruise control build"> - + @@ -54,55 +54,55 @@ - + + location="${basedir}/${aspectj.modules.rdir}/build"/> + location="${aspectj.build.dir}/local.properties"/> - + - - + - - - - - - - + + + + + + + - + - - + diff --git a/build/release/build.xml b/build/release/build.xml index 43196f63fb..52ec9e7702 100644 --- a/build/release/build.xml +++ b/build/release/build.xml @@ -2,9 +2,9 @@ - + - + @@ -13,23 +13,23 @@ - + - + - + - + @@ -42,7 +42,7 @@ - + @@ -51,13 +51,13 @@ - + - + @@ -66,11 +66,11 @@ - + - + @@ -78,15 +78,15 @@ - + - + - + - + @@ -95,17 +95,17 @@ - - - + @@ -114,20 +114,20 @@ - + - - - + - @@ -196,16 +196,16 @@ - + - + - + @@ -220,7 +220,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -259,4 +259,4 @@ - \ No newline at end of file + diff --git a/build/release/release-tests.xml b/build/release/release-tests.xml index 3caf9eaeba..6e2a334a4e 100644 --- a/build/release/release-tests.xml +++ b/build/release/release-tests.xml @@ -2,25 +2,25 @@ - + - + - + - + + path="${aj.dist.dir}/aspectj-${build.version}.jar"/> - + - @@ -41,11 +41,11 @@ - - - @@ -63,21 +63,21 @@ - + - + - + - + do-run-harness ${suite.filename}.xml with options @@ -91,18 +91,18 @@ - + - + - - @@ -110,20 +110,20 @@ - - - - - + @@ -134,12 +134,12 @@ - - - @@ -169,7 +169,7 @@ - + - @@ -194,10 +194,10 @@ - + @@ -206,15 +206,15 @@ - + - - - \ No newline at end of file + + diff --git a/build/src/main/java/$installer$/org/aspectj/Main.java b/build/src/main/java/$installer$/org/aspectj/Main.java index a307be930f..745c9d715d 100644 --- a/build/src/main/java/$installer$/org/aspectj/Main.java +++ b/build/src/main/java/$installer$/org/aspectj/Main.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java index a67872e8c7..f432af1592 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJPush.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJPush.java index 81e5925535..3d4c0caa37 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJPush.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJPush.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java index 82edad5ea2..1bfdf8a63c 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java @@ -2,9 +2,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/BuildModule.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/BuildModule.java index 6ac6b5ba62..5fc4b39438 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/BuildModule.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/BuildModule.java @@ -1,17 +1,17 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ - + package org.aspectj.internal.tools.ant.taskdefs; import java.io.File; @@ -31,7 +31,7 @@ public class BuildModule extends Task { // quickie hack... public static void main(String[] args) { TestBuildModule.main(args); - } + } private static File pathToFile(Path path) { if (null != path) { @@ -49,47 +49,47 @@ public BuildModule() { buildSpec = new BuildSpec(); setTaskName("ajbuild"); } - + public void setModuledir(Path moduleDir) { buildSpec.moduleDir = pathToFile(moduleDir); } - + public void setModule(String module) { // XXX handle multiple modules, same builder buildSpec.module = module; } - + public void setVersion(String version) { buildSpec.version = version; } public void setBasedir(Path baseDir) { buildSpec.baseDir = pathToFile(baseDir); } - + public void setJardir(Path jarDir) { buildSpec.jarDir = pathToFile(jarDir); } - + public void setTrimtesting(boolean trimTesting) { buildSpec.trimTesting = trimTesting; } - + public void setAssembleall(boolean assembleAll) { buildSpec.assembleAll = assembleAll; } - - public void setRebuild(boolean rebuild) { + + public void setRebuild(boolean rebuild) { buildSpec.rebuild = rebuild; } - - public void setFailonerror(boolean failonerror) { + + public void setFailonerror(boolean failonerror) { buildSpec.failonerror = failonerror; } - - public void setCreateinstaller(boolean create) { + + public void setCreateinstaller(boolean create) { buildSpec.createInstaller = create; } - - public void setVerbose(boolean verbose) { + + public void setVerbose(boolean verbose) { buildSpec.verbose = verbose; } @@ -98,47 +98,47 @@ public void setBuildConfig(String buildConfig) { } // --------------------------------------------------------- product build - + public void setProductdir(Path productDir) { buildSpec.productDir = pathToFile(productDir); } - + public void setTempdir(Path tempDir) { buildSpec.tempDir = pathToFile(tempDir); } - + public void setDistdir(Path distdir) { buildSpec.distDir = pathToFile(distdir); } - + public void execute() throws BuildException { final BuildSpec buildSpec = this.buildSpec; this.buildSpec = new BuildSpec(); - build(buildSpec); + build(buildSpec); } - + private void build(BuildSpec buildSpec) throws BuildException { final boolean failonerror = buildSpec.failonerror; Builder builder = null; try { // try using script first if not a product boolean built = false; - if ((null == buildSpec.productDir) && (null != buildSpec.moduleDir)) { + if ((null == buildSpec.productDir) && (null != buildSpec.moduleDir)) { File buildScript = new File(buildSpec.moduleDir, "build.xml"); // XXXFileLiteral if (buildScript.canRead()) { built = buildByScript(buildSpec, buildScript); if (!built) { - log("unable to build " - + buildSpec - + " using script: " + log("unable to build " + + buildSpec + + " using script: " + buildScript.getAbsolutePath()); } - } + } } if (!built) { builder = AntBuilder.getBuilder( - buildSpec.buildConfig, - getProject(), + buildSpec.buildConfig, + getProject(), buildSpec.tempDir); if (!builder.build(buildSpec) && failonerror) { Location loc = getLocation(); @@ -157,9 +157,8 @@ private void build(BuildSpec buildSpec) throws BuildException { } } - boolean buildByScript(BuildSpec buildSpec, File buildScript) + boolean buildByScript(BuildSpec buildSpec, File buildScript) throws BuildException { return false; } } - \ No newline at end of file diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java index 1f9b132ec7..20b4b8353a 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java @@ -2,9 +2,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation @@ -524,14 +524,14 @@ public void writeHeader(PrintWriter writer) { } void writeRest(PrintWriter writer) { - writer.println(" * All rights reserved. "); - writer.println(" * This program and the accompanying materials are made available "); - writer.println(" * under the terms of the Eclipse Public License v1.0 "); - writer.println(" * which accompanies this distribution and is available at "); - writer.println(" * http://www.eclipse.org/legal/epl-v10.html "); - writer.println(" * "); - writer.println(" * Contributors: "); - writer.println(" * Xerox/PARC initial implementation "); + writer.println(" * All rights reserved."); + writer.println(" * This program and the accompanying materials are made available"); + writer.println(" * under the terms of the Eclipse Public License v 2.0"); + writer.println(" * which accompanies this distribution and is available at"); + writer.println(" * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt"); + writer.println(" * "); + writer.println(" * Contributors:"); + writer.println(" * Xerox/PARC initial implementation"); writer.println(" * ******************************************************************/"); writer.println(""); } @@ -541,14 +541,6 @@ void writeRest(PrintWriter writer) { public static final String PARC_ONLY = " * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC)."; public static final String XEROX_PREFIX = " * Copyright (c) "; public static final String XEROX_SUFFIX = " Xerox Corporation"; - /* - * /* ******************************************************************* Copyright (c) 1998-2001 Xerox Corporation, 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 v1.0 which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Xerox/PARC initial implementation ****************************************************************** - */ } /** diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java index 431f9b25bf..fd46c8adc7 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java @@ -3,9 +3,9 @@ * 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 v1.0 + * under the terms of the Eclipse Public License v 2.0 * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt * * Contributors: * Xerox/PARC initial implementation diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/CopyAndInlineStylesheet.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/CopyAndInlineStylesheet.java index 664616c07b..f76eb2b0db 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/CopyAndInlineStylesheet.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/CopyAndInlineStylesheet.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 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 v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * 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: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.internal.tools.ant.taskdefs; @@ -35,7 +35,7 @@ public void setFile(String file) { public void setTodir(String todir) { this.todir = project.resolveFile(todir); } - + public void execute() throws BuildException { try { @@ -46,7 +46,7 @@ public void execute() throws BuildException { throw new BuildException("must set 'file' attribute"); } log("copying html from" + file + " to " + todir.getAbsolutePath()); - + File toFile = new File(todir, file.getName()); Mkdir mkdir = (Mkdir) project.createTask("mkdir"); @@ -71,7 +71,7 @@ public void execute() throws BuildException { out.println(line); } } - + in.close(); out.close(); } catch (IOException e) { @@ -90,7 +90,7 @@ private static void doStyleSheet(String line, PrintStream out, File file) throws out.println("