Browse Source

Merge pull request #41 from kriegaex/libs-refactoring

Libs refactoring (remove libs from Git SCM)
tags/V1_9_7_M2
Andy Clement 3 years ago
parent
commit
48e1b14cb4
No account linked to committer's email address
100 changed files with 5584 additions and 9801 deletions
  1. 13
    5
      .github/workflows/maven.yml
  2. 14
    0
      .gitignore
  3. 25
    0
      .mvn/settings-read-github-packages.xml
  4. 0
    24
      ajbrowser/pom.xml
  5. 6
    11
      ajde.core/pom.xml
  6. 7
    11
      ajde/pom.xml
  7. 16
    39
      ajdoc/pom.xml
  8. 11
    11
      ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java
  9. 53
    20
      ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java
  10. 2
    0
      ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
  11. 82
    70
      ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java
  12. 201
    0
      asm-renamed/pom.xml
  13. 0
    2
      asm/pom.xml
  14. 2
    2
      asm/src/main/java/org/aspectj/asm/AsmManager.java
  15. 11
    11
      asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java
  16. 4
    4
      aspectjmatcher/aspectjmatcher-assembly.xml
  17. 3
    2
      aspectjmatcher/aspectjmatcher-sources-assembly.xml
  18. 49
    37
      aspectjmatcher/pom.xml
  19. 2
    2
      aspectjrt/aspectjrt-assembly.xml
  20. 3
    2
      aspectjrt/aspectjrt-sources-assembly.xml
  21. 51
    13
      aspectjrt/pom.xml
  22. 16
    20
      aspectjtools/aspectjtools-assembly.xml
  23. 10
    11
      aspectjtools/aspectjtools-sources-assembly.xml
  24. 77
    64
      aspectjtools/pom.xml
  25. 15
    13
      aspectjweaver/aspectjweaver-assembly.xml
  26. 5
    5
      aspectjweaver/aspectjweaver-sources-assembly.xml
  27. 75
    35
      aspectjweaver/pom.xml
  28. 6
    10
      bcel-builder/pom.xml
  29. 6
    0
      bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java
  30. 7
    7
      bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java
  31. 1
    1
      bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
  32. 1
    1
      bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java
  33. 2
    4
      bridge/pom.xml
  34. 6
    2
      bridge/src/main/java/org/aspectj/bridge/IMessage.java
  35. 7
    0
      bridge/src/main/java/org/aspectj/bridge/Message.java
  36. 1
    1
      bridge/src/main/java/org/aspectj/bridge/ReflectionFactory.java
  37. 1
    0
      bridge/src/main/java/org/aspectj/bridge/context/PinpointingMessageHandler.java
  38. 96
    96
      build/build.xml
  39. 8
    19
      build/pom.xml
  40. 0
    56
      build/scripts/compareBuildScripts.sh
  41. 0
    78
      build/scripts/compileTest.sh
  42. 0
    41
      build/scripts/jikesInc.sh
  43. 0
    2
      build/scripts/lcp.bat
  44. 0
    19
      build/scripts/localSetup.bat.txt
  45. 0
    180
      build/scripts/makeAspectjtoolsLstFile.sh
  46. 0
    100
      build/scripts/quicklook.bat
  47. 0
    7
      build/scripts/runQuicklook.bat
  48. 1
    1
      build/src/main/java/$installer$/org/aspectj/Main.java
  49. 2
    2
      build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
  50. 1
    1
      build/src/main/java/org/aspectj/internal/tools/build/Builder.properties
  51. 484
    509
      docs/adk15ProgGuideDB/annotations.xml
  52. 407
    414
      docs/adk15ProgGuideDB/ataspectj.xml
  53. 33
    33
      docs/adk15ProgGuideDB/autoboxing.xml
  54. 42
    42
      docs/adk15ProgGuideDB/covariance.xml
  55. 16
    16
      docs/adk15ProgGuideDB/enumeratedtypes.xml
  56. 535
    566
      docs/adk15ProgGuideDB/generics.xml
  57. 182
    184
      docs/adk15ProgGuideDB/grammar.xml
  58. 162
    165
      docs/adk15ProgGuideDB/joinpointsignatures.xml
  59. 44
    48
      docs/adk15ProgGuideDB/miscellaneous.xml
  60. 55
    55
      docs/adk15ProgGuideDB/pertypewithin.xml
  61. 71
    72
      docs/adk15ProgGuideDB/varargs.xml
  62. 6
    12
      docs/build.xml
  63. 19
    19
      docs/devGuideDB/aj.xml
  64. 85
    81
      docs/devGuideDB/ajbrowser.xml
  65. 140
    139
      docs/devGuideDB/ajc.xml
  66. 37
    37
      docs/devGuideDB/ajdb.xml
  67. 39
    36
      docs/devGuideDB/ajdee.xml
  68. 459
    488
      docs/devGuideDB/antsupport.xml
  69. 12
    11
      docs/devGuideDB/aspectj-mode.xml
  70. 165
    164
      docs/devGuideDB/ltw.xml
  71. 1
    0
      docs/developer/ram-disk/maven.config
  72. 68
    0
      docs/developer/ram-disk/settings-ramdisk.xml
  73. BIN
      docs/developer/ram-disk/windows-recycle-bin-remove-immediately.png
  74. 660
    682
      docs/faq/faq.xml
  75. 13
    13
      docs/pdGuideDB/ajcore.xml
  76. 34
    34
      docs/pdGuideDB/ltwdump.xml
  77. 63
    63
      docs/pdGuideDB/messages.xml
  78. 49
    49
      docs/pdGuideDB/trace.xml
  79. 1
    83
      docs/pom.xml
  80. 202
    201
      docs/progGuideDB/examples.xml
  81. 46
    46
      docs/progGuideDB/implementation.xml
  82. 137
    137
      docs/progGuideDB/language.xml
  83. 9
    9
      docs/progGuideDB/progguide.html.xsl
  84. 372
    371
      docs/progGuideDB/semantics.xml
  85. 4
    3
      installer/aspectjinstaller-assembly.xml
  86. 33
    7
      installer/pom.xml
  87. 0
    2
      lib/ant/INSTALL
  88. 0
    310
      lib/ant/KEYS
  89. 0
    203
      lib/ant/LICENSE
  90. 0
    71
      lib/ant/LICENSE.dom
  91. 0
    20
      lib/ant/LICENSE.sax
  92. 0
    56
      lib/ant/LICENSE.xerces
  93. 0
    15
      lib/ant/NOTICE
  94. 0
    70
      lib/ant/README
  95. 0
    9
      lib/ant/TODO
  96. 0
    2901
      lib/ant/WHATSNEW
  97. BIN
      lib/ant/ant-src.zip
  98. 0
    14
      lib/ant/aspectj-ant-readme.txt
  99. 0
    299
      lib/ant/bin/ant
  100. 0
    0
      lib/ant/bin/ant.bat

+ 13
- 5
.github/workflows/maven.yml View File

@@ -1,13 +1,14 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven
name: Build AspectJ

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:
@@ -15,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 8, 11, 15 ]
java: [ 8, 11, 16 ]
steps:
- uses: actions/checkout@v2

@@ -30,8 +31,15 @@ jobs:
./mvnw -B --version
ant -version

- name: Compile code
run: ./mvnw -B -DskipTests package --file pom.xml
- name: Download + install test libraries
run: ./mvnw -B --settings .mvn/settings-read-github-packages.xml --file lib/pom.xml compile

- name: Compile + package code
run: ./mvnw -B --settings .mvn/settings-read-github-packages.xml --file pom.xml -DskipTests package

- name: Run Tests
run: ./mvnw -B -Daspectj.tests.verbose=false verify --file pom.xml
# Tests in module ajde call Swing/AWT classes. Without frame buffer they throw
# HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
uses: GabrielBB/xvfb-action@v1
with:
run: ./mvnw -B --settings .mvn/settings-read-github-packages.xml --file pom.xml -Daspectj.tests.verbose=false verify

+ 14
- 0
.gitignore View File

@@ -30,3 +30,17 @@ log.txt

# No idea where these come from
bin/

# Downloaded libraries used during tests
/lib/ant/
/lib/commons/
/lib/docbook/
/lib/jarjar/
/lib/jdtcore-aj/
/lib/junit/
/lib/regexp/
/lib/saxon/

# When using a RAM disk to speed up development, see how-to in docs/developer/ram-disk/settings-ramdisk.xml
/.mvn/maven.config
/.mvn/settings-ramdisk.xml

+ 25
- 0
.mvn/settings-read-github-packages.xml View File

@@ -0,0 +1,25 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">

<!--
GitHub Actions currently requires authentication even for read-only access to Maven artifacts stored in GitHub
Packages. There is no such thing as public package repositories without authentication. See here:
https://github.community/t/how-to-allow-unauthorised-read-access-to-github-packages-maven-repository/115517/4

How to use it:
https://github.com/jcansdale-test/maven-consume

How to XML-encode an access token online (no problem to use the website, it is meant for public access anyway):
https://coderstoolbox.net/string/#!encoding=xml&action=encode&charset=none
-->

<servers>
<server>
<id>github</id>
<username>kriegaex</username>
<!-- Public access token with 'read:packages' scope -->
<password>&#103;&#104;&#112;&#95;&#68;&#74;&#97;&#71;&#119;&#108;&#80;&#75;&#55;&#116;&#68;&#55;&#102;&#73;&#51;&#107;&#103;&#111;&#109;&#71;&#100;&#78;&#115;&#86;&#105;&#88;&#67;&#100;&#50;&#98;&#50;&#55;&#74;&#104;&#66;&#77;</password>
</server>
</servers>

</settings>

+ 0
- 24
ajbrowser/pom.xml View File

@@ -10,8 +10,6 @@
</parent>

<artifactId>ajbrowser</artifactId>
<packaging>jar</packaging>
<name>ajbrowser</name>

<dependencies>
<dependency>
@@ -34,37 +32,15 @@
<artifactId>asm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>taskdefs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>ajdoc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>loadtime</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>ajde.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>weaver</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.ajdt.core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 6
- 11
ajde.core/pom.xml View File

@@ -10,8 +10,6 @@
</parent>

<artifactId>ajde.core</artifactId>
<packaging>jar</packaging>
<name>ajde.core</name>

<dependencies>
<dependency>
@@ -34,22 +32,19 @@
<artifactId>org.aspectj.ajdt.core</artifactId>
<version>${project.version}</version>
</dependency>



<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.eclipse.jdt.core/jdtcore-for-aspectj.jar</systemPath>
</dependency>
<!--
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<artifactId>asm-renamed</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>testing-util</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
-->
</dependencies>
</project>

+ 7
- 11
ajde/pom.xml View File

@@ -10,8 +10,6 @@
</parent>

<artifactId>ajde</artifactId>
<packaging>jar</packaging>
<name>ajde</name>

<dependencies>
<dependency>
@@ -34,6 +32,10 @@
<artifactId>org.aspectj.ajdt.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>asm-renamed</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.ajdt.core</artifactId>
@@ -41,26 +43,20 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>


<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.eclipse.jdt.core/jdtcore-for-aspectj.jar</systemPath>
</dependency>
<!--
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<artifactId>ajde.core</artifactId>
<version>${project.version}</version>
</dependency>
-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>ajde.core</artifactId>
<artifactId>testing-util</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 16
- 39
ajdoc/pom.xml View File

@@ -10,8 +10,21 @@
</parent>

<artifactId>ajdoc</artifactId>
<packaging>jar</packaging>
<name>ajdoc</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<usedDependencies>
<!-- The tests need this during runtime, even though no direct usage is in our classes -->
<usedDependency>com.github.olivergondza:maven-jdk-tools-wrapper</usedDependency>
</usedDependencies>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
@@ -40,45 +53,9 @@
<artifactId>maven-jdk-tools-wrapper</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath>
</dependency>

<!-- Dependencies needed for running tests in this module independently of complete reactor build -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.eclipse.jdt.core/jdtcore-for-aspectj.jar</systemPath>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.matcher</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>weaver</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>bcel-builder</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>runtime</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<artifactId>asm-renamed</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>

+ 11
- 11
ajdoc/src/main/java/org/aspectj/tools/ajdoc/CompilerWrapper.java View File

@@ -1,25 +1,25 @@
/* *******************************************************************
* 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 v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Mik Kersten initial implementation
* ******************************************************************/
package org.aspectj.tools.ajdoc;

import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
import org.aspectj.tools.ajc.Main;
/**
* Wrapper for ajdoc's use of the AspectJ compiler.
*
*
* @author Mik Kersten
*/
public class CompilerWrapper extends org.aspectj.tools.ajc.Main {
public class CompilerWrapper extends Main {

private static CompilerWrapper INSTANCE = null;


+ 53
- 20
ajdoc/src/main/java/org/aspectj/tools/ajdoc/HtmlDecorator.java View File

@@ -39,9 +39,24 @@ import org.aspectj.util.TypeSafeEnum;
*/
class HtmlDecorator {

public static final String TYPE_NAME_LABEL = LangUtil.is15VMOrGreater()
? "type-name-label"
: (LangUtil.is1dot8VMOrGreater() ? "typeNameLabel" : "strong");
public static final String TYPE_NAME_LABEL;
public static final String CLOSING_SPAN;

static {
if (LangUtil.is16VMOrGreater())
TYPE_NAME_LABEL = "element-name type-name-label";
else if (LangUtil.is15VMOrGreater())
TYPE_NAME_LABEL = "type-name-label";
else if (LangUtil.is1dot8VMOrGreater())
TYPE_NAME_LABEL = "typeNameLabel";
else
TYPE_NAME_LABEL = "strong";

if (LangUtil.is16VMOrGreater())
CLOSING_SPAN = "</span>";
else
CLOSING_SPAN = "";
}

private static final String POINTCUT_DETAIL = "Pointcut Detail";
private static final String ADVICE_DETAIL = "Advice Detail";
@@ -223,33 +238,35 @@ class HtmlDecorator {
}

boolean br = true;
int classStartIndex = fileContents.toString().indexOf("<BR>\nClass ");
contents = fileContents.toString();
int classStartIndex = contents.indexOf("<BR>\nClass ");
if (classStartIndex == -1) {
classStartIndex = fileContents.toString().indexOf("<H2>\nClass ");
classStartIndex = contents.indexOf("<H2>\nClass ");
br = false;
}
if (classStartIndex == -1) {
// Java8 looks more like this:
// <h2 title="Class A" class="title">Class A</h2>
classStartIndex = fileContents.toString().indexOf("<h2 title=\"Class ");
int classEndIndex = fileContents.toString().indexOf("</h2>", classStartIndex);
classStartIndex = contents.indexOf("<h2 title=\"Class ");
int classEndIndex = contents.indexOf("</h2>", classStartIndex);
if (classStartIndex == -1) {
// Java 13 - replaced h2 with h1 here
classStartIndex = fileContents.toString().indexOf("<h1 title=\"Class ");
classEndIndex = fileContents.toString().indexOf("</h1>", classStartIndex);
classStartIndex = contents.indexOf("<h1 title=\"Class ");
classEndIndex = contents.indexOf("</h1>", classStartIndex);
}
if (classEndIndex != -1) {
// Convert it to "<h2 title="Aspect A" class="title">Aspect A</h2>"
String classLine = fileContents.toString().substring(classStartIndex, classEndIndex);
String classLine = contents.substring(classStartIndex, classEndIndex);
String aspectLine = classLine.replaceAll("Class ","Aspect ");
fileContents.delete(classStartIndex, classEndIndex);
fileContents.insert(classStartIndex, aspectLine);
}
}
else if (classStartIndex != -1) {
int classEndIndex = fileContents.toString().indexOf("</H2>", classStartIndex);
if (classStartIndex != -1 && classEndIndex != -1) {
String classLine = fileContents.toString().substring(classStartIndex, classEndIndex);
contents = fileContents.toString();
int classEndIndex = contents.indexOf("</H2>", classStartIndex);
if (classEndIndex != -1) {
String classLine = contents.substring(classStartIndex, classEndIndex);
String aspectLine = "";
if (br) {
aspectLine += "<BR>\n" + "Aspect " + classLine.substring(11, classLine.length());
@@ -260,26 +277,42 @@ class HtmlDecorator {
fileContents.insert(classStartIndex, aspectLine);
}
}
int secondClassStartIndex = fileContents.toString().indexOf("class <B>");
contents = fileContents.toString();
int secondClassStartIndex = contents.indexOf("class <B>");
if (secondClassStartIndex != -1) {
String name = decl.toSignatureString();
int classEndIndex = fileContents.toString().indexOf(name + "</B><DT>");
if (secondClassStartIndex != -1 && classEndIndex != -1) {
StringBuffer sb = new StringBuffer(fileContents.toString().substring(secondClassStartIndex, classEndIndex));
int classEndIndex = contents.indexOf(name + "</B><DT>");
if (classEndIndex != -1) {
StringBuffer sb = new StringBuffer(contents.substring(secondClassStartIndex, classEndIndex));
sb.replace(0, 5, "aspect");
fileContents.delete(secondClassStartIndex, classEndIndex);
fileContents.insert(secondClassStartIndex, sb.toString());
}
}
else {
contents = fileContents.toString();
// Java16: <span class="modifiers">static class </span><span class="type-name-label">ClassA.InnerAspect</span>
// Java15: <pre>static class <span class="type-name-label">ClassA.InnerAspect</span>
// Java8: <pre>static class <span class="typeNameLabel">ClassA.InnerAspect</span>
// Java7 (464604): <pre>public class <span class="strong">Azpect</span>
classStartIndex = fileContents.toString().indexOf("class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">");
int classEndIndex = fileContents.toString().indexOf("</span>", classStartIndex);
String startString = "class " + CLOSING_SPAN + "<span class=\"";
classStartIndex = contents.indexOf(startString + TYPE_NAME_LABEL + "\">");
int classEndIndex = contents.indexOf("</span>", classStartIndex + startString.length());

// This is where after Java version upgrades usually tests fail or the first time.
// Logging context information helps fixing the issue quickly.
if (classStartIndex == -1 || classEndIndex == -1) {
System.out.println(
"Something unexpected went wrong in HtmlDecorator. Here is the full file causing the problem:\n\n" +
"------------------------------------------------------------------------\n\n" +
contents + "\n" +
"------------------------------------------------------------------------\n"
);
}

if (classEndIndex != -1) {
// Convert it to "aspect <span class="TYPE_NAME_LABEL">ClassA.InnerAspect</span>"
String aspectLine = "aspect" + fileContents.substring(classStartIndex + 5, classEndIndex);
String aspectLine = "aspect" + contents.substring(classStartIndex + 5, classEndIndex);
fileContents.delete(classStartIndex, classEndIndex);
fileContents.insert(classStartIndex, aspectLine);
}

+ 2
- 0
ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java View File

@@ -148,6 +148,8 @@ public class Main implements Config {
System.out.println("> Finished.");
} catch (Throwable e) {
handleInternalError(e);
// TODO: Is this really necessary? Why not just re-throw the exception after logging the error message?
// This interrupts tests, making them exit hard, eg. stopping a whole Maven build somewhere in the middle.
exit(-2);
}
}

+ 82
- 70
ajdoc/src/test/java/org/aspectj/tools/ajdoc/CoverageTestCase.java View File

@@ -16,6 +16,9 @@ import java.util.List;

import org.aspectj.util.LangUtil;

import static org.aspectj.tools.ajdoc.HtmlDecorator.CLOSING_SPAN;
import static org.aspectj.tools.ajdoc.HtmlDecorator.TYPE_NAME_LABEL;

/**
* A long way to go until full coverage, but this is the place to add more.
*
@@ -115,67 +118,76 @@ public class CoverageTestCase extends AjdocTestCase {
* Test that the ajdoc for an inner aspect is entitled "Aspect" rather
* than "Class", but that the enclosing class is still "Class"
*/
public void testInnerAspect() throws Exception {
File[] files = {file1, file2};
runAjdoc("private",AJDocConstants.VERSION,files);

File htmlFile = new File(getAbsolutePathOutdir() + "/foo/ClassA.InnerAspect.html");
if (!htmlFile.exists()) {
fail("couldn't find " + htmlFile.getAbsolutePath()
+ " - were there compilation errors?");
}

// ensure that the file is entitled "Aspect ClassA.InnerAspect" rather
// than "Class ClassA.InnerAspect"
public void testInnerAspect() throws Exception {
File[] files = { file1, file2 };
runAjdoc("private", AJDocConstants.VERSION, files);

String[] strings = null;
strings = new String[] {
"Aspect ClassA.InnerAspect",
"<pre>static aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>",
"Class ClassA.InnerAspect",
"<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>"};
List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings);
StringBuilder buf = new StringBuilder();
for (String str:missingStrings) {
buf.append(str).append("\n");
}
buf.append("HTMLFILE=\n").append(htmlFile).append("\n");
assertEquals("There should be 2 missing strings:\n"+buf.toString(), 2, missingStrings.size());
assertTrue(htmlFile.getName() + " should not have Class as it's title",
missingStrings.contains("Class ClassA.InnerAspect"));
assertTrue(htmlFile.getName() + " should not have class in its subtitle",
missingStrings.contains("<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>"));
// Get the HTML file for the inner aspect
File htmlFile = new File(getAbsolutePathOutdir() + "/foo/ClassA.InnerAspect.html");
if (!htmlFile.exists()) {
fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?");
}

// get the html file for the enclosing class
File htmlFileClass = new File(getAbsolutePathOutdir() + "/foo/ClassA.html");
if (!htmlFileClass.exists()) {
fail("couldn't find " + htmlFileClass.getAbsolutePath()
+ " - were there compilation errors?");
}
// Ensure that the file is entitled "Aspect ClassA.InnerAspect" rather than "Class ClassA.InnerAspect"

String[] strings = new String[] {
// These 2 should be missing because they reference "class", not "aspect"
"Class ClassA.InnerAspect",
"static class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>",
// These 2 should be present (i.e. 0 missing) after AJ doc creation
"Aspect ClassA.InnerAspect",
"static aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassA.InnerAspect</span>"
};
List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile, strings);

StringBuilder buf = new StringBuilder();
buf.append("HTML file = ").append(htmlFile).append("\nMissing strings:\n");
for (String str : missingStrings)
buf.append(str).append("\n");

assertEquals(
"In " + htmlFile.getName() + " there should be 2 missing strings:\n" + buf,
2, missingStrings.size()
);
assertEquals(
"In " + htmlFile.getName() + " no missing string should be aspect-related:\n" + buf,
0, missingStrings.stream().filter(s -> s.contains("static aspect")).count()
);

// Get the HTML file for the enclosing class
htmlFile = new File(getAbsolutePathOutdir() + "/foo/ClassA.html");
if (!htmlFile.exists()) {
fail("couldn't find " + htmlFile.getAbsolutePath() + " - were there compilation errors?");
}

// ensure that the file is entitled "Class ClassA" and
// has not been changed to "Aspect ClassA"
String[] classStrings = null;
// Ensure that the file is entitled "Class ClassA" and has not been changed to "Aspect ClassA"

if (LangUtil.is13VMOrGreater()) {
classStrings = new String[] {
"Class ClassA</h1>",
"public abstract class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>",
strings = new String[] {
// These 3 should be missing because they reference "aspect", not "class"
"Aspect ClassA</H2>",
"public abstract aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>"};
} else {
classStrings = new String[] {
"Aspect ClassA</h2>",
"public abstract aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassA</span>",
// Of these 3, 2 should be present (i.e. 1 missing) after AJ doc creation
"Class ClassA</h1>",
"Class ClassA</h2>",
"public abstract class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>",
"Aspect ClassA</H2>",
"public abstract aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>"};
"public abstract class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassA</span>"
};
missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile, strings);

buf = new StringBuilder();
buf.append("HTML file = ").append(htmlFile).append("\nMissing strings:\n");
for (String str : missingStrings)
buf.append(str).append("\n");

assertEquals(
"In " + htmlFile.getName() + " there should be 4 missing strings:\n" + buf,
4, missingStrings.size()
);
assertEquals(
"In " + htmlFile.getName() + " 3 missing string should be aspect-related:\n" + buf,
3, missingStrings.stream().filter(s -> s.contains("abstract aspect") || s.contains("Aspect ClassA")).count()
);
}
List<String> classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings);
assertEquals("There should be 2 missing strings:\n"+classMissing,2,classMissing.size());
assertTrue(htmlFileClass.getName() + " should not have Aspect as it's title",classMissing.contains("Aspect ClassA</H2>"));
assertTrue(htmlFileClass.getName() + " should not have aspect in its subtitle",
classMissing.contains("public abstract aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassA</span>"));
}

/**
* Test that all the different types of advice appear
@@ -657,9 +669,9 @@ public class CoverageTestCase extends AjdocTestCase {
String[] strings = null;
strings = new String[] {
"Aspect PkgVisibleClass.NestedAspect",
"<pre>static aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>",
"static aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>",
"Class PkgVisibleClass.NestedAspect",
"<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>"};
"static class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>"};
List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings);
StringBuilder buf = new StringBuilder();
for (String str:missingStrings) {
@@ -669,7 +681,7 @@ public class CoverageTestCase extends AjdocTestCase {
assertEquals("There should be 2 missing strings",2,missingStrings.size());
assertTrue(htmlFile.getName() + " should not have Class as it's title",missingStrings.contains("Class PkgVisibleClass.NestedAspect"));
assertTrue(htmlFile.getName() + " should not have class in its subtitle",
missingStrings.contains("<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>"));
missingStrings.contains("static class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass.NestedAspect</span>"));
// get the html file for the enclosing class
File htmlFileClass = new File(getAbsolutePathOutdir() + "/PkgVisibleClass.html");
if (!htmlFileClass.exists()) {
@@ -683,22 +695,22 @@ public class CoverageTestCase extends AjdocTestCase {
if (LangUtil.is13VMOrGreater()) {
classStrings = new String[] {
"Class PkgVisibleClass</h1>",
"<pre>class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>",
"class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass</span>",
"Aspect PkgVisibleClass</h2>",
"<pre>aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"};
"aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"};
} else {
classStrings = new String[] {
"Class PkgVisibleClass</h2>",
"<pre>class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>",
"class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass</span>",
"Aspect PkgVisibleClass</h2>",
"<pre>aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"};
"aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"};
}
List<String> classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings);
assertEquals("There should be 2 missing strings",2,classMissing.size());
assertTrue(htmlFileClass.getName() + " should not have Aspect as it's title",
classMissing.contains("Aspect PkgVisibleClass</h2>"));
assertTrue(htmlFileClass.getName() + " should not have aspect in its subtitle",
classMissing.contains("<pre>aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"));
classMissing.contains("aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">PkgVisibleClass</span>"));
}

/**
@@ -721,9 +733,9 @@ public class CoverageTestCase extends AjdocTestCase {
String[] strings = null;
strings = new String [] {
"Aspect ClassWithNestedAspect.NestedAspect",
"<pre>static aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>",
"static aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>",
"Class ClassWithNestedAspect.NestedAspect",
"<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>"};
"static class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>"};
List<String> missingStrings = AjdocOutputChecker.getMissingStringsInFile(htmlFile,strings);
StringBuilder buf = new StringBuilder();
for (String str:missingStrings) {
@@ -733,7 +745,7 @@ public class CoverageTestCase extends AjdocTestCase {
assertEquals("There should be 2 missing strings",2,missingStrings.size());
assertTrue(htmlFile.getName() + " should not have Class as it's title",missingStrings.contains("Class ClassWithNestedAspect.NestedAspect"));
assertTrue(htmlFile.getName() + " should not have class in its subtitle",
missingStrings.contains("<pre>static class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>"));
missingStrings.contains("static class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect.NestedAspect</span>"));

// get the html file for the enclosing class
File htmlFileClass = new File(getAbsolutePathOutdir() + "/pkg/ClassWithNestedAspect.html");
@@ -748,22 +760,22 @@ public class CoverageTestCase extends AjdocTestCase {
if (LangUtil.is13VMOrGreater()) {
classStrings = new String[] {
"Class ClassWithNestedAspect</h1>",
"public class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>",
"public class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>",
"Aspect ClassWithNestedAspect</h2>",
"public aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"};
"public aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"};
} else {
classStrings = new String[] {
"Class ClassWithNestedAspect</h2>",
"public class <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>",
"public class " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>",
"Aspect ClassWithNestedAspect</h2>",
"public aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"};
"public aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"};
}
List<String> classMissing = AjdocOutputChecker.getMissingStringsInFile(htmlFileClass,classStrings);
assertEquals("There should be 2 missing strings",2,classMissing.size());
assertTrue(htmlFileClass.getName() + " should not have Aspect as it's title",
classMissing.contains("Aspect ClassWithNestedAspect</h2>"));
assertTrue(htmlFileClass.getName() + " should not have aspect in its subtitle",
classMissing.contains("public aspect <span class=\"" + HtmlDecorator.TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"));
classMissing.contains("public aspect " + CLOSING_SPAN + "<span class=\"" + TYPE_NAME_LABEL + "\">ClassWithNestedAspect</span>"));
}

/**

+ 201
- 0
asm-renamed/pom.xml View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- The AspectJ root POM is the parent, but this module is not a submodule -->
<parent>
<groupId>org.aspectj</groupId>
<artifactId>aspectj-parent</artifactId>
<version>1.9.7.BUILD-SNAPSHOT</version>
</parent>

<artifactId>asm-renamed</artifactId>
<version>${asm.version}</version>

<name>ASM for AspectJ</name>
<description>
This module relocates the original ASM artifact from package name 'org.objectweb.asm' to 'aj.org.objectweb.asm',
using Maven Shade Plugin.

In order to avoid committing the binary to the AspectJ SCM repository and using it as a system-scoped dependency, we
deploy it to GitHub Packages.

Whenever it is necessary to upgrade to a new ASM version in order to make AspectJ compatible with a new Java
version, please build and deploy this module after upgrading property 'asm.version'. Make sure you have a GitHub
token with the necessary access rights and section like this in your settings.xml:

<![CDATA[
<server>
<id>github</id>
<username>MY_GITHUB_USER</username>
<password>MY_GITHUB_TOKEN</password>
</server>
]]>

Then you should be able to run 'mvn clean deploy' for this module and be fine.

Caveat for IntelliJ IDEA: The project cannot be built in IDEA (Ctrl-F9) if this module is visible in the Maven view.
If so, right-click it and select "Unlink Maven Projects". Unfortunately, "Ignore Projects" is not enough. If Maven
knows of this Maven module, it cannot compile other modules depending on shaded class names, because it cannot find
the binaries. IDEA will just stop looking at the local Maven repository in this case.
</description>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages Release</name>
<url>https://maven.pkg.github.com/kriegaex/aspectj-packages</url>
<uniqueVersion>false</uniqueVersion>
</repository>
<snapshotRepository>
<id>github</id>
<name>GitHub Packages Snapshot</name>
<url>https://maven.pkg.github.com/kriegaex/aspectj-packages</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
</distributionManagement>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<!-- Nothing to compile in this module -->
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<!-- Re-create original source JAR in order to avoid re-shading already shaded JAR in non-clean builds -->
<forceCreation>true</forceCreation>
<!--
Avoid attaching the source JAR here, because Maven Shade will add the source uber JAR later. Because both
JARs have the same final name, Maven Install/Deploy would see two artifacts attached to the build, which
would lead to double deployment and hence to an error "Transfer failed for ...-sources.jar 409 Conflict".
See also https://issues.apache.org/jira/browse/MDEPLOY-254 and comments by Alexander Kriegisch.
-->
<attach>false</attach>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<!-- Re-create original JAR in order to avoid re-shading already shaded JAR in non-clean builds -->
<forceCreation>true</forceCreation>
</configuration>
<executions>
<execution>
<!-- Avoid creating test JAR -->
<id>test-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createSourcesJar>true</createSourcesJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
</configuration>
<executions>
<execution>
<id>asm-relocate</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
<shadeSourcesContent>true</shadeSourcesContent>
<artifactSet>
<excludes>
<exclude>${project.groupId}</exclude>
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>*</artifact>
<excludes>
<exclude>META-INF/*</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>aj.org.objectweb.asm</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<!-- Remove shaded dependencies from uber JAR -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<flattenMode>defaults</flattenMode>
<pomElements>
<dependencies>remove</dependencies>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</dependency>
</dependencies>

</project>

+ 0
- 2
asm/pom.xml View File

@@ -10,8 +10,6 @@
</parent>

<artifactId>asm</artifactId>
<packaging>jar</packaging>
<name>asm</name>

<dependencies>
<dependency>

+ 2
- 2
asm/src/main/java/org/aspectj/asm/AsmManager.java View File

@@ -1173,8 +1173,8 @@ public class AsmManager implements IStructureModel {
private ModelInfo(IHierarchy hierarchy, IRelationshipMap relationshipMap) {
IProgramElement ipe = hierarchy.getRoot();
walkModel(ipe);
recordStat("FileMapSize", new Integer(hierarchy.getFileMapEntrySet().size()).toString());
recordStat("RelationshipMapSize", new Integer(relationshipMap.getEntries().size()).toString());
recordStat("FileMapSize", Integer.toString(hierarchy.getFileMapEntrySet().size()));
recordStat("RelationshipMapSize", Integer.toString(relationshipMap.getEntries().size()));
}

private void walkModel(IProgramElement ipe) {

+ 11
- 11
asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java View File

@@ -171,7 +171,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
String existingHandle = object.getHandleIdentifier();
int suffixPosition = existingHandle.indexOf('!');
if (suffixPosition != -1) {
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1;
count = Integer.parseInt(existingHandle.substring(suffixPosition + 1)) + 1;
} else {
if (count == 1) {
count = 2;
@@ -181,13 +181,13 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
}
}
if (count > 1) {
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray());
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray());
}
} else if (ipe.getKind().isDeclare()) {
// // look at peer declares
int count = computeCountBasedOnPeers(ipe);
if (count > 1) {
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray());
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray());
}
} else if (ipe.getKind().equals(IProgramElement.Kind.ADVICE)) {
// Look at any peer advice
@@ -227,7 +227,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
String existingHandle = object.getHandleIdentifier();
int suffixPosition = existingHandle.indexOf('!');
if (suffixPosition != -1) {
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1;
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1;
} else {
if (count == 1) {
count = 2;
@@ -238,7 +238,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
}
}
if (count > 1) {
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray());
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray());
}
} else if (ipe.getKind().equals(IProgramElement.Kind.INITIALIZER)) {
// return String.valueOf(++initializerCounter).toCharArray();
@@ -279,7 +279,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
String existingHandle = object.getHandleIdentifier();
int suffixPosition = existingHandle.indexOf('!');
if (suffixPosition != -1) {
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1;
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1;
} else {
if (count == 1) {
count = 2;
@@ -290,7 +290,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
}
}
// if (count > 1) {
return new Integer(count).toString().toCharArray();
return Integer.toString(count).toCharArray();
// return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray());
// }
} else if (ipe.getKind().equals(IProgramElement.Kind.CODE)) {
@@ -314,7 +314,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
int suffixPosition = existingHandle.lastIndexOf('!');
int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter
if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1;
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1;
} else {
if (count == 1) {
count = 2;
@@ -334,7 +334,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
int suffixPosition = existingHandle.lastIndexOf('!');
int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter
if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1;
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1;
} else {
if (count == 1) {
count = 2;
@@ -345,7 +345,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
}
}
if (count > 1) {
return CharOperation.concat(countDelim, new Integer(count).toString().toCharArray());
return CharOperation.concat(countDelim, Integer.toString(count).toCharArray());
}
}
return empty;
@@ -383,7 +383,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider {
String existingHandle = object.getHandleIdentifier();
int suffixPosition = existingHandle.indexOf('!');
if (suffixPosition != -1) {
count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1;
count = Integer.valueOf(existingHandle.substring(suffixPosition + 1)) + 1;
} else {
if (count == 1) {
count = 2;

+ 4
- 4
aspectjmatcher/aspectjmatcher-assembly.xml View File

@@ -1,13 +1,13 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<id>aspectjmatcher</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>

+ 3
- 2
aspectjmatcher/aspectjmatcher-sources-assembly.xml View File

@@ -1,7 +1,8 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<!-- Do not change this ID. It becomes the artifact classifier with appendAssemblyId=true. -->
<id>sources</id>

<formats>

+ 49
- 37
aspectjmatcher/pom.xml View File

@@ -11,57 +11,30 @@
</parent>

<artifactId>aspectjmatcher</artifactId>
<packaging>pom</packaging>
<name>AspectJ Matcher</name>

<build>
<plugins>

<!-- skip creation of test-jar in here -->
<!-- Skip creation of main + test JARs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-jar</id>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>


<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>unzipasm</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="unzip jarjar'd asm" />
<unzip
src="${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar"
dest="target/asm-unzipped" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
<id>test-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!--
Set version manually in order to override version from super POM, e.g. 2.2-beta-5 from
https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom
-->
<version>3.1.1</version>
<executions>
<execution>
<id>aspectjmatcher-assembly</id>
@@ -98,9 +71,23 @@

<Bundle-Name>AspectJ Matcher</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated (PARC),
2003-2020 Contributors. All Rights Reserved</Bundle-Copyright>
<!--
WARNING: Please avoid line breaks in manifest values! They are passed on like this:
Assembly Plugin -> Plexus Archiver -> JRE java.util.jar.Manifest.write(OutputStream).

The JRE Manifest class inserts hard line breaks always after 72 characters, no matter if those
72 characters contain line feeds, tabs or spaces. Hence, it can happen that unwanted blank lines
end up in the middle of a manifest section, making the manifest invalid. Calls like e.g.
'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then fail with the absolutely
unexpected error 'Could not find or load main class org.aspectj.tools.ajc.Main'.

Alexander Kriegisch created this bug ticket:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8263924

In IntelliJ IDEA you can deactivate wrapping text inside XML tags like this:
File | Settings | Editor | Code Style | XML | Wrap text -> deactivate
-->
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC), 2003-2020 Contributors. All Rights Reserved</Bundle-Copyright>
</manifestEntries>
</manifestSection>
</manifestSections>
@@ -119,8 +106,8 @@
<goal>single</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<finalName>aspectjmatcher-${project.version}</finalName>
<!-- The assembly ID 'sources' becomes the artifact classifier, exactly what we want -->
<appendAssemblyId>true</appendAssemblyId>
<archive>
</archive>
<descriptors>
@@ -132,6 +119,31 @@
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<!-- Remove dependencies declared in this POM (if any) from uber JAR and strip down POM -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<flattenMode>oss</flattenMode>
<pomElements>
<dependencies>remove</dependencies>
<repositories>remove</repositories>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>

+ 2
- 2
aspectjrt/aspectjrt-assembly.xml View File

@@ -1,6 +1,6 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<id>aspectjrt</id>


+ 3
- 2
aspectjrt/aspectjrt-sources-assembly.xml View File

@@ -1,7 +1,8 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<!-- Do not change this ID. It becomes the artifact classifier with appendAssemblyId=true. -->
<id>sources</id>

<formats>

+ 51
- 13
aspectjrt/pom.xml View File

@@ -11,7 +11,6 @@
</parent>

<artifactId>aspectjrt</artifactId>
<packaging>pom</packaging>
<name>AspectJ Runtime</name>

<dependencies>
@@ -25,11 +24,15 @@
<build>
<plugins>

<!-- skip creation of test-jar in here -->
<!-- Skip creation of main + test JARs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<id>test-jar</id>
<phase>none</phase>
@@ -38,12 +41,8 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!--
Set version manually in order to override version from super POM, e.g. 2.2-beta-5 from
https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom
-->
<version>3.1.1</version>
<executions>
<execution>
<id>aspectjrt-assembly</id>
@@ -74,9 +73,23 @@

<Bundle-Name>AspectJ Runtime</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated (PARC),
2003-2019 Contributors. All Rights Reserved</Bundle-Copyright>
<!--
WARNING: Please avoid line breaks in manifest values! They are passed on like this:
Assembly Plugin -> Plexus Archiver -> JRE java.util.jar.Manifest.write(OutputStream).

The JRE Manifest class inserts hard line breaks always after 72 characters, no matter if those
72 characters contain line feeds, tabs or spaces. Hence, it can happen that unwanted blank lines
end up in the middle of a manifest section, making the manifest invalid. Calls like e.g.
'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then fail with the absolutely
unexpected error 'Could not find or load main class org.aspectj.tools.ajc.Main'.

Alexander Kriegisch created this bug ticket:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8263924

In IntelliJ IDEA you can deactivate wrapping text inside XML tags like this:
File | Settings | Editor | Code Style | XML | Wrap text -> deactivate
-->
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC), 2003-2020 Contributors. All Rights Reserved</Bundle-Copyright>
</manifestEntries>
</manifestSection>
</manifestSections>
@@ -89,14 +102,14 @@
</execution>

<execution>
<id>aspectjrt-src-assembly</id>
<id>aspectjrt-sources-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<finalName>aspectjrt-${project.version}</finalName>
<!-- The assembly ID 'sources' becomes the artifact classifier, exactly what we want -->
<appendAssemblyId>true</appendAssemblyId>
<archive>
</archive>
<descriptors>
@@ -108,6 +121,31 @@
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<!-- Remove dependencies declared in this POM (if any) from uber JAR and strip down POM -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<flattenMode>oss</flattenMode>
<pomElements>
<dependencies>remove</dependencies>
<repositories>remove</repositories>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>

+ 16
- 20
aspectjtools/aspectjtools-assembly.xml View File

@@ -1,15 +1,27 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<id>aspectjtools</id>
<formats>
<format>jar</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<dependencySet>
<unpack>true</unpack>
<!-- Avoid warning when trying to add non-existing main artifact JAR -->
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>org.aspectj:org.eclipse.jdt.core</include>
<include>org.aspectj:asm-renamed</include>
</includes>
</dependencySet>
</dependencySets>

<fileSets>
<!-- runtime -->
<fileSet>
@@ -70,16 +82,7 @@
<exclude>META-INF/maven/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target/asm-unzipped</directory>
<outputDirectory>.</outputDirectory>
<excludes>
<exclude>META-INF/maven/**</exclude>
<exclude>org/**</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</fileSet>

<!-- tools -->
<fileSet>
<directory>../ajbrowser/target/classes</directory>
@@ -123,13 +126,6 @@
<exclude>META-INF/maven/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target/jdtcore-unzipped</directory>
<outputDirectory>.</outputDirectory>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</fileSet>
</fileSets>

</assembly>

+ 10
- 11
aspectjtools/aspectjtools-sources-assembly.xml View File

@@ -1,7 +1,8 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<!-- Do not change this ID. It becomes the artifact classifier with appendAssemblyId=true. -->
<id>sources</id>

<formats>
@@ -11,6 +12,7 @@
<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>

<fileSet>
<directory>../weaver/src/main/java</directory>
<outputDirectory>.</outputDirectory>
@@ -43,14 +45,8 @@
<directory>../loadtime/src/main/java</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
<!--
<fileSet>
<directory>target/asm-unzipped</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
-->
<!-- tools -->

<!-- Tools -->
<fileSet>
<directory>../ajbrowser/src/main/java</directory>
<outputDirectory>.</outputDirectory>
@@ -75,10 +71,13 @@
<directory>../taskdefs/src/main/java</directory>
<outputDirectory>.</outputDirectory>
</fileSet>

<!-- Dependencies -->
<fileSet>
<directory>target/jdtcore-unzipped-src</directory>
<directory>target/unzipped-sources</directory>
<outputDirectory>.</outputDirectory>
</fileSet>

</fileSets>

</assembly>

+ 77
- 64
aspectjtools/pom.xml View File

@@ -11,25 +11,20 @@
</parent>

<artifactId>aspectjtools</artifactId>
<packaging>pom</packaging>
<name>AspectJ Compiler</name>

<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.ajdt.core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>

<!-- skip creation of test-jar in here -->
<!-- Skip creation of main + test JARs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<id>test-jar</id>
<phase>none</phase>
@@ -37,69 +32,31 @@
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unzipasm</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="unzip jarjar'd asm" />
<unzip
src="${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar"
dest="target/asm-unzipped" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>

<execution>
<id>unzipjdt</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="unzip patched jdtcore" />
<unzip
src="${project.basedir}/../org.eclipse.jdt.core/jdtcore-for-aspectj.jar"
dest="target/jdtcore-unzipped" />
</tasks>
</configuration>
<id>unzip-dependency-sources</id>
<goals>
<goal>run</goal>
<goal>unpack-dependencies</goal>
</goals>
</execution>

<execution>
<id>unzipjdtsrc</id>
<phase>validate</phase>
<phase>prepare-package</phase>
<configuration>
<tasks>
<echo message="unzip patched jdtcore sources" />
<unzip
src="${project.basedir}/../org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip"
dest="target/jdtcore-unzipped-src" />
</tasks>
<classifier>sources</classifier>
<!--<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>-->
<includeArtifactIds>org.eclipse.jdt.core,asm-renamed</includeArtifactIds>
<outputDirectory>${project.build.directory}/unzipped-sources</outputDirectory>
<!-- Avoid accidentally shading test-scoped dependencies like JUnit -->
<includeScope>runtime</includeScope>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!--
Set version manually in order to override version from super POM, e.g. 2.2-beta-5 from
https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom
-->
<version>3.1.1</version>
<executions>
<execution>
<id>aspectjtools-assembly</id>
@@ -130,9 +87,23 @@

<Bundle-Name>AspectJ Tools</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated (PARC),
2003-2019 Contributors. All Rights Reserved</Bundle-Copyright>
<!--
WARNING: Please avoid line breaks in manifest values! They are passed on like this:
Assembly Plugin -> Plexus Archiver -> JRE java.util.jar.Manifest.write(OutputStream).

The JRE Manifest class inserts hard line breaks always after 72 characters, no matter if those
72 characters contain line feeds, tabs or spaces. Hence, it can happen that unwanted blank lines
end up in the middle of a manifest section, making the manifest invalid. Calls like e.g.
'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then fail with the absolutely
unexpected error 'Could not find or load main class org.aspectj.tools.ajc.Main'.

Alexander Kriegisch created this bug ticket:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8263924

In IntelliJ IDEA you can deactivate wrapping text inside XML tags like this:
File | Settings | Editor | Code Style | XML | Wrap text -> deactivate
-->
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC), 2003-2020 Contributors. All Rights Reserved</Bundle-Copyright>
</manifestEntries>
</manifestSection>
</manifestSections>
@@ -151,8 +122,8 @@
<goal>single</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<finalName>aspectjtools-${project.version}</finalName>
<!-- The assembly ID 'sources' becomes the artifact classifier, exactly what we want -->
<appendAssemblyId>true</appendAssemblyId>
<archive>
</archive>
<descriptors>
@@ -164,6 +135,48 @@
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<!-- Remove dependencies declared in this POM (if any) from uber JAR and strip down POM -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<flattenMode>oss</flattenMode>
<pomElements>
<dependencies>remove</dependencies>
<repositories>remove</repositories>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.ajdt.core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>asm-renamed</artifactId>
</dependency>
</dependencies>

</project>

+ 15
- 13
aspectjweaver/aspectjweaver-assembly.xml View File

@@ -1,15 +1,26 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<id>aspectjweaver</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<dependencySet>
<unpack>true</unpack>
<!-- Avoid warning when trying to add non-existing main artifact JAR -->
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>org.aspectj:asm-renamed</include>
</includes>
</dependencySet>
</dependencySets>

<fileSets>
<fileSet>
<directory>../weaver/target/classes</directory>
@@ -67,15 +78,6 @@
<exclude>META-INF/maven/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target/asm-unzipped</directory>
<outputDirectory>.</outputDirectory>
<excludes>
<exclude>META-INF/maven/**</exclude>
<exclude>org/**</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</fileSet>
</fileSets>

</assembly>

+ 5
- 5
aspectjweaver/aspectjweaver-sources-assembly.xml View File

@@ -1,7 +1,8 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<!-- Do not change this ID. It becomes the artifact classifier with appendAssemblyId=true. -->
<id>sources</id>

<formats>
@@ -43,12 +44,11 @@
<directory>../loadtime/src/main/java</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
<!--
<!-- Dependencies -->
<fileSet>
<directory>target/asm-unzipped</directory>
<directory>target/unzipped-sources</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
-->
</fileSets>

</assembly>

+ 75
- 35
aspectjweaver/pom.xml View File

@@ -11,25 +11,20 @@
</parent>

<artifactId>aspectjweaver</artifactId>
<packaging>pom</packaging>
<name>AspectJ Weaver</name>

<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>weaver</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>

<!-- skip creation of test-jar in here -->
<!-- Skip creation of main + test JARs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<id>test-jar</id>
<phase>none</phase>
@@ -37,37 +32,31 @@
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unzipasm</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="unzip jarjar'd asm" />
<unzip
src="${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar"
dest="target/asm-unzipped" />
</tasks>
</configuration>
<id>unzip-dependency-sources</id>
<goals>
<goal>run</goal>
<goal>unpack-dependencies</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<classifier>sources</classifier>
<!--<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>-->
<includeArtifactIds>asm-renamed</includeArtifactIds>
<outputDirectory>${project.build.directory}/unzipped-sources</outputDirectory>
<!-- Avoid accidentally shading test-scoped dependencies like JUnit -->
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!--
Set version manually in order to override version from super POM, e.g. 2.2-beta-5 from
https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom
-->
<version>3.1.1</version>
<executions>
<execution>
<id>aspectjweaver-assembly</id>
@@ -86,7 +75,6 @@
<Can-Redefine-Classes>true</Can-Redefine-Classes>
</manifestEntries>


<manifestSections>
<manifestSection>
<name>org/aspectj/weaver/</name>
@@ -102,9 +90,23 @@

<Bundle-Name>AspectJ Weaver</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation,
2002 Palo Alto Research Center, Incorporated (PARC),
2003-2019 Contributors. All Rights Reserved</Bundle-Copyright>
<!--
WARNING: Please avoid line breaks in manifest values! They are passed on like this:
Assembly Plugin -> Plexus Archiver -> JRE java.util.jar.Manifest.write(OutputStream).

The JRE Manifest class inserts hard line breaks always after 72 characters, no matter if those
72 characters contain line feeds, tabs or spaces. Hence, it can happen that unwanted blank lines
end up in the middle of a manifest section, making the manifest invalid. Calls like e.g.
'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then fail with the absolutely
unexpected error 'Could not find or load main class org.aspectj.tools.ajc.Main'.

Alexander Kriegisch created this bug ticket:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8263924

In IntelliJ IDEA you can deactivate wrapping text inside XML tags like this:
File | Settings | Editor | Code Style | XML | Wrap text -> deactivate
-->
<Bundle-Copyright>(C) Copyright 1999-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated (PARC), 2003-2020 Contributors. All Rights Reserved</Bundle-Copyright>
</manifestEntries>
</manifestSection>
</manifestSections>
@@ -123,8 +125,8 @@
<goal>single</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<finalName>aspectjweaver-${project.version}</finalName>
<!-- The assembly ID 'sources' becomes the artifact classifier, exactly what we want -->
<appendAssemblyId>true</appendAssemblyId>
<archive>
</archive>
<descriptors>
@@ -136,6 +138,44 @@
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<!-- Remove dependencies declared in this POM (if any) from uber JAR and strip down POM -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<flattenMode>oss</flattenMode>
<pomElements>
<dependencies>remove</dependencies>
<repositories>remove</repositories>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>weaver</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>asm-renamed</artifactId>
</dependency>
</dependencies>

</project>

+ 6
- 10
bcel-builder/pom.xml View File

@@ -1,18 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.aspectj</groupId>
<artifactId>bcel-builder</artifactId>
<packaging>jar</packaging>
<name>bcel-builder</name>
<url>http://maven.apache.org</url>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.aspectj</groupId>
<artifactId>aspectj-parent</artifactId>
<version>1.9.7.BUILD-SNAPSHOT</version>
<version>1.9.7.BUILD-SNAPSHOT</version>
</parent>

<artifactId>bcel-builder</artifactId>

</project>

+ 6
- 0
bcel-builder/src/main/java/org/aspectj/apache/bcel/Constants.java View File

@@ -92,6 +92,12 @@ public interface Constants {
short MINOR_13 = 0;
short MAJOR_14 = 58;
short MINOR_14 = 0;
short MAJOR_15 = 59;
short MINOR_15 = 0;
short MAJOR_16 = 60;
short MINOR_16 = 0;
// short MAJOR_17 = 61;
// short MINOR_17 = 0;

int PREVIEW_MINOR_VERSION = 65535;


+ 7
- 7
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java View File

@@ -239,7 +239,7 @@ public class SimpleElementValue extends ElementValue {
return Integer.toString(b.getValue());
case PRIMITIVE_CHAR:
ConstantInteger ch = (ConstantInteger) cpool.getConstant(idx);
return new Character((char) ch.getIntValue()).toString();
return Character.toString((char) ch.getIntValue());
case PRIMITIVE_BOOLEAN:
ConstantInteger bo = (ConstantInteger) cpool.getConstant(idx);
if (bo.getValue() == 0) {
@@ -262,11 +262,11 @@ public class SimpleElementValue extends ElementValue {
switch (type) {
case PRIMITIVE_INT:
ConstantInteger c = (ConstantInteger) cpool.getConstant(idx);
s.append("(int)").append(Integer.toString(c.getValue()));
s.append("(int)").append(c.getValue());
break;
case PRIMITIVE_LONG:
ConstantLong j = (ConstantLong) cpool.getConstant(idx);
s.append("(long)").append(Long.toString(j.getValue()));
s.append("(long)").append(j.getValue());
break;
case PRIMITIVE_DOUBLE:
ConstantDouble d = (ConstantDouble) cpool.getConstant(idx);
@@ -274,19 +274,19 @@ public class SimpleElementValue extends ElementValue {
break;
case PRIMITIVE_FLOAT:
ConstantFloat f = (ConstantFloat) cpool.getConstant(idx);
s.append("(float)").append(Float.toString(f.getValue()));
s.append("(float)").append(f.getValue());
break;
case PRIMITIVE_SHORT:
ConstantInteger ci = (ConstantInteger) cpool.getConstant(idx);
s.append("(short)").append(Integer.toString(ci.getValue()));
s.append("(short)").append(ci.getValue());
break;
case PRIMITIVE_BYTE:
ConstantInteger b = (ConstantInteger) cpool.getConstant(idx);
s.append("(byte)").append(Integer.toString(b.getValue()));
s.append("(byte)").append(b.getValue());
break;
case PRIMITIVE_CHAR:
ConstantInteger ch = (ConstantInteger) cpool.getConstant(idx);
s.append("(char)").append(new Character((char) ch.getIntValue()).toString());
s.append("(char)").append((char) ch.getIntValue());
break;
case PRIMITIVE_BOOLEAN:
ConstantInteger bo = (ConstantInteger) cpool.getConstant(idx);

+ 1
- 1
bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java View File

@@ -227,7 +227,7 @@ public class ClassPath implements Serializable {
}

// On Java9 the sun.boot.class.path won't be set. System classes accessible through JRT filesystem
if (vm_version.matches("^(9|10|11|12|13|14|15).*")) {
if (vm_version.matches("^(9|10|11|12|13|14|15|16|17|18|19).*")) {
buf.insert(0, File.pathSeparatorChar);
buf.insert(0, System.getProperty("java.home") + File.separator + "lib" + File.separator + JRT_FS);
}

+ 1
- 1
bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java View File

@@ -201,7 +201,7 @@ public class RuntimeVisibleAnnotationAttributeTest extends BcelTestCase {
checkValue(ann,"dval","33.4");
checkValue(ann,"sval","99");
checkValue(ann,"bval","2");
checkValue(ann,"cval",new Character('5').toString());
checkValue(ann,"cval", Character.toString('5'));
checkValue(ann,"zval","false");
}

+ 2
- 4
bridge/pom.xml View File

@@ -10,8 +10,6 @@
</parent>

<artifactId>bridge</artifactId>
<packaging>jar</packaging>
<name>bridge</name>

<dependencies>
<dependency>
@@ -26,7 +24,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>build.time</id>
@@ -34,10 +31,11 @@
<goal>timestamp-property</goal>
</goals>
<configuration>
<!-- Timestamp format: Thursday Apr 8, 2021 at 20:04:07 PDT -->
<name>version.time_text</name>
<pattern>EEEE MMM d, yyyy 'at' HH:mm:ss z</pattern>
<timeZone>America/Los_Angeles</timeZone>
<!-- build.time: Monday Feb 4, 2019 at 23:50:25 GMT -->
<locale>en_US</locale>
</configuration>
</execution>
</executions>

+ 6
- 2
bridge/src/main/java/org/aspectj/bridge/IMessage.java View File

@@ -28,8 +28,9 @@ public interface IMessage {
// int values must sync with KINDS order below
Kind WEAVEINFO = new Kind("weaveinfo", 5);
Kind INFO = new Kind("info", 10);
Kind USAGE = new Kind("usage", 15);
Kind DEBUG = new Kind("debug", 20);
Kind TASKTAG = new Kind("task", 25); // represents a 'TODO' from eclipse - producted by the compiler and
Kind TASKTAG = new Kind("task", 25); // represents a 'TODO' from eclipse - produced by the compiler and
// consumed by AJDT
Kind WARNING = new Kind("warning", 30);
Kind ERROR = new Kind("error", 40);
@@ -42,7 +43,7 @@ public interface IMessage {
/**
* list of Kind in precedence order. 0 is less than IMessage.Kind#COMPARATOR.compareTo(KINDS.get(i), KINDS.get(i + 1))
*/
List<Kind> KINDS = Collections.unmodifiableList(Arrays.asList(new Kind[] { WEAVEINFO, INFO, DEBUG, TASKTAG,
List<Kind> KINDS = Collections.unmodifiableList(Arrays.asList(new Kind[] { WEAVEINFO, INFO, USAGE, DEBUG, TASKTAG,
WARNING, ERROR, FAIL, ABORT }));

/** @return non-null String with simple message */
@@ -60,6 +61,9 @@ public interface IMessage {
/** @return true if this is an internal debug message */
boolean isDebug();

/** @return true if this is a compiler usage message */
boolean isUsage();

/** @return true if this is information for the user */
boolean isInfo();


+ 7
- 0
bridge/src/main/java/org/aspectj/bridge/Message.java View File

@@ -121,6 +121,13 @@ public class Message implements IMessage {
return kind == IMessage.DEBUG;
}

/**
* @return true if kind == IMessage.USAGE
*/
public boolean isUsage() {
return kind == IMessage.USAGE;
}

public boolean isTaskTag() {
return kind == IMessage.TASKTAG;
}

+ 1
- 1
bridge/src/main/java/org/aspectj/bridge/ReflectionFactory.java View File

@@ -47,7 +47,7 @@ public class ReflectionFactory { // XXX lease, pool
final Class<?> cfn = Class.forName(cname);
String error = null;
if (args == NONE) {
result = cfn.newInstance();
result = cfn.getDeclaredConstructor().newInstance();
} else {
Class<?>[] types = getTypes(args);
Constructor<?> constructor = cfn.getConstructor(types);

+ 1
- 0
bridge/src/main/java/org/aspectj/bridge/context/PinpointingMessageHandler.java View File

@@ -91,6 +91,7 @@ public class PinpointingMessageHandler implements IMessageHandler {
public boolean isError() { return delegate.isError(); }
public boolean isWarning() { return delegate.isWarning();}
public boolean isDebug() { return delegate.isDebug();}
public boolean isUsage() { return delegate.isUsage();}
public boolean isInfo() { return delegate.isInfo();}
public boolean isAbort() { return delegate.isAbort();}
public boolean isTaskTag() { return delegate.isTaskTag();}

+ 96
- 96
build/build.xml View File

@@ -20,7 +20,7 @@
<antcall target="eclipse.plugins"/>
</target>
<target name="clean" depends="clean-directories"/>
<target name="compile" depends="build-module"
description="compile module ${module.name} (without tests, by default)"/>

@@ -38,11 +38,11 @@
<!-- ===================================================================== -->
<property name="modules.dir" location="${basedir}/.."/>
<property name="module.name" value="${ant.project.name}"/>
<import file="${modules.dir}/build/build-properties.xml"/>
<target name="init" depends="init-properties,init-directories">
<property name="build.config" value=""/>
<property name="build.config" value=""/>
<property name="trim.testing.default" value="true"/>
<property name="aj.installer.jar" location="${aj.dist.dir}/aspectj-${build.version.long}.jar"/>

@@ -66,7 +66,7 @@
version="${build.version}"
versionSourceFile="${aspectj.modules.dir}/bridge/src/org/aspectj/bridge/Version.java"
versionTagFile="${aj.temp.dir}/versionUptodate"/>
<available file="${aj.temp.dir}/versionUptodate"
property="version.uptodate"/>
<property name="version-uptodate.done" value="done"/>
@@ -87,21 +87,21 @@
<!-- ===================================================================== -->

<target name="warn.ant.lib.aspectjrt" if="ant.lib.aspectjrt">
<echo message="----- WARNING: ${ant.lib.aspectjrt}" />
<echo message="----- WARNING: ${ant.lib.aspectjrt}" />
</target>

<target name="warn.ant.lib.aspectjtools" if="ant.lib.aspectjtools">
<echo message="----- WARNING: ${ant.lib.aspectjtools}" />
<echo message="----- WARNING: ${ant.lib.aspectjtools}" />
</target>

<target name="fail-unless-boot-libraries-uptodate" depends="init"
description="fail unless all boot libraries are up-to-date">
<antcall target="verify-boot-lib">
<param name="boot.lib" value="test/aspectjrt.jar"/>
<param name="vbl.module.name" value="runtime"/>
</antcall>
<antcall target="verify-boot-lib">
<param name="boot.lib" value="build/build.jar"/>
<param name="vbl.module.name" value="build"/>
@@ -117,40 +117,40 @@
<param name="boot.lib" value="test/testing-client.jar"/>
<param name="vbl.module.name" value="util"/>
</antcall>
<antcall target="verify-boot-lib">
<param name="boot.lib" value="test/testing-client.jar"/>
<param name="vbl.module.name" value="bridge"/>
</antcall>

<echo message="all boot libraries verified"/>
<echo message="all boot libraries verified"/>
</target>

<target name="update-tree" depends="init"
description="update tree">
<fail unless="CVSROOT"
<fail unless="CVSROOT"
message="required: {ant} -DCVSROOT=... ..."/>
<cvs cvsRoot="${CVSROOT}"
dest="${aspectj.modules.dir}"
quiet="on"
failonerror="on"
quiet="on"
failonerror="on"
command="update -dP" />
</target>
<!-- ===================================================================== -->
<!-- antcall targets -->
<!-- ===================================================================== -->
<!-- ===================================================================== -->
<target name="build-product" depends="init,init-taskdefs,init-version" description="build $${product.name}">
<ajbuild jarDir="${aj.jar.dir}"
baseDir="${aspectj.modules.dir}"
distDir="${aj.dist.dir}"
productDir="${aspectj.modules.dir}/build/products/${product.name}"
trimTesting="true"
buildConfig="${build.config}"
buildConfig="${build.config}"
version="${build.version.long}"
verbose="${build.verbose}"
failonerror="true"/>
failonerror="true"/>
</target>

<target name="build-module" depends="init,init-taskdefs,init-version">
@@ -159,11 +159,11 @@
distDir="${aj.dist.dir}"
jarDir="${aj.jar.dir}"
trimTesting="${trim.testing}"
buildConfig="${build.config}"
buildConfig="${build.config}"
version="${build.version.long}"
verbose="${build.verbose}"
assembleall="${assemble}"
failonerror="true"/>
failonerror="true"/>
</target>

<macrodef name="build-module-all">
@@ -189,7 +189,7 @@
</antcall>
</sequential>
</macrodef>
<macrodef name="assemble-module-test">
<attribute name="module"/>
<sequential>
@@ -197,11 +197,11 @@
</sequential>
</macrodef>

<target name="create-installer" depends="init,init-taskdefs,init-filters"
description="create ${installer.file} from ${staging.dir} using ${htmlSrc.dir} and ${simpleClassName}">
<!-- init-filters: filter on copy used by ajinstaller taskdef -->
<delete quiet="on" file="${installer.file}"/>
<ajinstaller zipfile="${installer.file}"
installerclassjar="${aspectj.build.jar}"
@@ -218,7 +218,7 @@
<srcfiles dir="${aspectj.modules.dir}/${vbl.module.name}/src"
includes="**/*.java"/>
</uptodate>
<fail unless="lib-warning-${vbl.module.name}"
message="${boot.lib} out of date wrt module ${vbl.module.name}"/>

@@ -226,16 +226,16 @@

<!-- ===================================================================== -->
<!-- test targets -->
<!-- ===================================================================== -->
<target name="test-run-all-junit-tests"
<!-- ===================================================================== -->
<target name="test-run-all-junit-tests"
depends="init"
description="run unit tests via run-all-junit-tests module">
<antcall target="test">
<param name="module.name" value="run-all-junit-tests"/>
</antcall>
</target>
<target name="test-compiler-tests"
<target name="test-compiler-tests"
depends="init"
description="run compiler tests via tests module">
<antcall target="test">
@@ -243,7 +243,7 @@
</antcall>
</target>

<target name="test-each-module"
<target name="test-each-module"
depends="init"
description="run JUnit tests for each module">
<subant target="test">
@@ -294,7 +294,7 @@
</target>


<target name="junitreport" depends="init,init-taskdefs"
if="junitreport.available">
<clean-dir dir="${aj.junit.dir}/html"/>
@@ -309,9 +309,9 @@
</pathconvert>
<echo message="see file:${jur.url}"/>
</target>
<target name="do-test-junit"
depends="init-taskdefs"
<target name="do-test-junit"
depends="init-taskdefs"
description="run junit tests for a module using module root or leaves">
<property name="dtj.dir"
location="${aj.junit.dir}/${module.name}"/>
@@ -327,24 +327,24 @@
else="">
<istrue value="${junit.leaves}"/>
</condition>
<junit
<junit
dir="${aspectj.modules.build.dir}"
failureproperty="test-junit-${module.name}.failed"
fork="on"
fork="on"
forkmode="perTest"
maxmemory="400m"
includeAntRuntime="off"
printsummary="yes"
includeAntRuntime="off"
printsummary="yes"
haltonfailure="${haltOnTestFailure}" >
<classpath>
<pathelement location="${aj.jar.dir}/${module.name}-test-all.jar"/>
<!-- see skipped libraries in Builder.properties -->
<pathelement location="${jdk.tools.jar}"/>
<pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar"/>
<pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar"/>
<fileset dir="${aspectj.modules.lib.dir}/commons" includes="commons.jar"/>
<!-- XML api's used by loadtime, also needed when running under 1.3 per Ant FAQ -->
<fileset dir="${aspectj.modules.lib.dir}/ant/lib"
<fileset dir="${aspectj.modules.lib.dir}/ant/lib"
includes="ant.jar,ant-junit.jar,xml-apis.jar,xercesImpl.jar"/>
</classpath>
<jvmarg value="-Daspectjrtpath=${lib.test.aspectjrt.jar}" />
@@ -353,13 +353,13 @@
<fileset dir="${modules.dir}/${module.name}/testsrc"
includes="${dtj.includes}"
excludes="${dtj.excludes}"/>
</batchtest>
</batchtest>
</junit>
<report-if-failed text="JUnit tests for ${module.name} failed"
property="test-junit-${module.name}.failed"/>
</target>

<!-- ===================================================================== -->
<!-- custom targets -->
<!-- ===================================================================== -->
@@ -369,7 +369,7 @@
<antcall target="clean-jars"/>
<assemble-module-test module="testing-drivers"/>
</target>
<target name="build-testing-jars" depends="init"
description="build testing jars from scratch">
<antcall target="build-harness-jar"/>
@@ -379,7 +379,7 @@
<build-module module="testing-client" assemble="true"/>
<assemble-module-test module="testing-client"/>
<echo>
To use testing client jar in tests,
To use testing client jar in tests,
mv ../aj-build/jars/testing-client-all.jar ../lib/tests/testing-client.jar
</echo>
</target>
@@ -391,23 +391,23 @@ To use testing client jar in tests,
<fileset dir="${aj.dist.dir}/tools"/>
<fileset dir="${aj.dist.dir}/docs"/>
</copy>
<antcall target="create-installer">
<param name="installer.file" location="${aj.installer.jar}"/>
<param name="staging.dir" location="${installer.staging.dir}"/>
<param name="htmlSrc.dir" location="${aspectj.modules.build.dir}/products/aspectj/install"/>
<param name="simpleClassName" value="ToolsInstaller"/>
</antcall>
<delete dir="${installer.staging.dir}"/>
<delete dir="${installer.staging.dir}"/>
</target>
<target name="docs-dist" depends="init">
<ant dir="${aspectj.modules.dir}/docs"
antfile="build.xml"
target="local-dist"
inheritAll="false"/>
</target>
<target name="aspectjrt" depends="init"
description="build aspectjrt.jar (differently than release)">
<build-module-all module="aspectj5rt"/>
@@ -423,12 +423,12 @@ To use testing client jar in tests,
<antcall target="compile-runtime-11-flag-unless13"/>
<antcall target="compile-runtime-11-do-if13"/>
</target>
<target name="compile-runtime-11-flag-unless13" depends="init-properties"
unless="cr1.in13">
<echo message="Skipping compile-runtime-11 unless 1.3"/>
</target>
<target name="compile-runtime-11-do-if13" depends="init-properties"
if="cr1.in13">
<mkdir dir="${aj.build.dir}/classes-1.1"/>
@@ -451,7 +451,7 @@ To use testing client jar in tests,
/>
<delete dir="${aj.build.dir}/classes-1.1"/>
</target>
<!-- ===================================================================== -->
<!-- boilerplate antcalls -->
<!-- ===================================================================== -->
@@ -497,12 +497,12 @@ To use testing client jar in tests,
<!-- ===================================================================== -->

<target name="eclipse.plugins" depends="init"
description="create the Eclipse distribution plugins">
description="create the Eclipse distribution plugins">
<ant dir="${aspectj.modules.dir}/eclipse.plugin" inheritAll="false"/>
</target>
<target name="src" depends="init" description="build src modules">
<mkdir dir="${aj.src.dir}"/>
<jar destfile="${aj.src.dir}/aspectjrt${build.version}-src.jar">
<fileset dir="${aspectj.modules.dir}/aspectj5rt/java5-src">
@@ -564,9 +564,9 @@ To use testing client jar in tests,
<exclude name="**/.cvsignore"/>
</fileset>
</jar>
<!-- missing from this are the jdtDepends.jar src files -->
<unzip dest="${aj.src.dir}/jdtsrc" src="${aspectj.modules.dir}/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip"/>
<unzip dest="${aj.src.dir}/jdtsrc" src="${aspectj.modules.dir}/lib/jdtcore-aj/jdtcore-for-aspectj-src.zip"/>
<!-- ajde/ajde.core/ajdoc/asm/bridge/loadtime/org.aspectj.ajdt.core/taskdefs/util/weaver5 -->
<jar destfile="${aj.src.dir}/aspectjtools${build.version}-src.jar">
<fileset dir="${aj.src.dir}/jdtsrc">
@@ -644,7 +644,7 @@ To use testing client jar in tests,
</jar>
<delete dir="${aj.src.dir}/bcelsrc" failonerror="false"/>
<delete dir="${aj.src.dir}/jdtsrc" failonerror="false"/>
<jar destfile="${aj.src.dir}/org.aspectj.matcher-${build.version}-src.jar">
<fileset dir="${aspectj.modules.dir}/bridge/src">
<exclude name="CVS"/>
@@ -721,28 +721,28 @@ To use testing client jar in tests,
</fileset>
-->
</jar>
<jar destfile="${aj.src.dir}/org.aspectj-${build.version}-src.jar">
<fileset dir="${aj.src.dir}">
<include name="aspectjrt${build.version}-src.jar"/>
<include name="aspectjweaver${build.version}-src.jar"/>
<include name="aspectjrt${build.version}-src.jar"/>
<include name="aspectjweaver${build.version}-src.jar"/>
<include name="aspectjtools${build.version}-src.jar"/>
<include name="org.aspectj.matcher-${build.version}-src.jar"/>
</fileset>
</jar>
<delete file="{aj.src.dir}/aspectjrt${build.version}-src.jar"/>
<delete file="{aj.src.dir}/aspectjweaver${build.version}-src.jar"/>
<delete file="{aj.src.dir}/aspectjtools${build.version}-src.jar"/>
<delete file="{aj.src.dir}/org.aspectj.matcher${build.version}-src.jar"/>
<delete file="{aj.src.dir}/aspectjrt${build.version}-src.jar"/>
<delete file="{aj.src.dir}/aspectjweaver${build.version}-src.jar"/>
<delete file="{aj.src.dir}/aspectjtools${build.version}-src.jar"/>
<delete file="{aj.src.dir}/org.aspectj.matcher${build.version}-src.jar"/>
</target>


<target name="repo" depends="init" description="deploy maven repo">
<property name="repo.url" value="scp://simonegianni.it/home/mavenrsync/repo"/>
<property name="repo.id" value="simonegianni-rsync"/>
<mkdir dir="${modules.dir}/aj-build/repo"/>
<copy toDir="${modules.dir}/aj-build/repo" file="aspectjtools.pom"/>
<copy toDir="${modules.dir}/aj-build/repo" file="aspectjweaver.pom"/>
@@ -752,45 +752,45 @@ To use testing client jar in tests,
<substitution expression="${repo.version}"/>
<fileset dir="${modules.dir}/aj-build/repo">
<include name="*.pom"/>
</fileset>
</fileset>
</replaceregexp>
<!-- Invoke maven to deploy the jars to the rsynced repo -->
<antcall target="mavenDeployJar">
<param name="file" value="${modules.dir}/aj-build/dist/tools/lib/aspectjtools.jar"/>
<param name="artifact" value="aspectjtools"/>
<param name="desc" value="AspectJ Tools"/>
</antcall>
</antcall>
<antcall target="mavenDeployJar">
<param name="file" value="${modules.dir}/aj-build/dist/tools/lib/aspectjweaver.jar"/>
<param name="artifact" value="aspectjweaver"/>
<param name="desc" value="AspectJ Weaver"/>
</antcall>
</antcall>
<antcall target="mavenDeployJar">
<param name="file" value="${modules.dir}/aj-build/dist/tools/lib/aspectjrt.jar"/>
<param name="artifact" value="aspectjrt"/>
<param name="desc" value="AspectJ Runtime"/>
</antcall>
</antcall>
<antcall target="mavenDeploySource">
<param name="file" value="${modules.dir}/aj-build/src/aspectjtools${build.version}-src.jar"/>
<param name="artifact" value="aspectjtools"/>
<param name="desc" value="AspectJ Tools"/>
</antcall>
</antcall>
<antcall target="mavenDeploySource">
<param name="file" value="${modules.dir}/aj-build/src/aspectjweaver${build.version}-src.jar"/>
<param name="artifact" value="aspectjweaver"/>
<param name="desc" value="AspectJ Weaver"/>
</antcall>
</antcall>
<antcall target="mavenDeploySource">
<param name="file" value="${modules.dir}/aj-build/src/aspectjrt${build.version}-src.jar"/>
<param name="artifact" value="aspectjrt"/>
<param name="desc" value="AspectJ Runtime"/>
</antcall>
</antcall>
</target>

<!--
@@ -838,7 +838,7 @@ ant -propertyfile XXX publishtomaven
<pom file="usedForMavenUpload/aspectjweaver.pom"/>
<attach file="${build.root}/aspectjweaver/target/aspectjweaver-${suffix}-sources.jar" classifier="sources"/>
</maven:deploy>
<!-- ASPECTJMATCHER -->
<maven:deploy file="${build.root}/aspectjmatcher/target/aspectjmatcher-${suffix}.jar">
<remoteRepository url="${maven.central.repository}">
@@ -857,7 +857,7 @@ ant -propertyfile XXX publishtomaven
<target name="publishtomaven_milestone" depends="maven.init">
<property name="build.root" value="/Users/aclement/gits/org.aspectj"/>
<property name="suffix" value="1.9.7.M1"/>
<property name="adjusted.release.type" value="milestone"/>
<property name="maven.central.repository" value="s3://maven.springframework.org/${adjusted.release.type}"/>
<property name="bin.jars.folder" value="${build.root}/dist/tools/lib"/>
@@ -889,7 +889,7 @@ ant -propertyfile XXX publishtomaven
<pom file="usedForMavenUpload_milestone/aspectjweaver.pom"/>
<attach file="${build.root}/aspectjweaver/target/aspectjweaver-${suffix}-sources.jar" classifier="sources"/>
</maven:deploy>
<!-- ASPECTJMATCHER -->
<maven:deploy file="${build.root}/aspectjmatcher/target/aspectjmatcher-${suffix}.jar">
<remoteRepository url="${maven.central.repository}">
@@ -938,13 +938,13 @@ ant -propertyfile XXX publishtomaven
</maven:deploy>
</target>

<target name="repo2" depends="maven.init">
</target>

<target name="mavenDeployJar">
<!--
Currently only an exec is usable, see http://jira.codehaus.org/browse/MANTTASKS-71
<!--
Currently only an exec is usable, see http://jira.codehaus.org/browse/MANTTASKS-71
this mean you need to have maven installed on your system.
-->
<exec executable="n:/tools/apache-maven-2.0.9/bin/mvn.bat" failonerror="true">
@@ -957,15 +957,15 @@ ant -propertyfile XXX publishtomaven
<arg line="-DartifactId=${artifact}"/>
<arg line="-Dpackaging=jar"/>
<arg line="-Dversion=${repo.version}"/>
<arg line="-DpomFile=${modules.dir}/aj-build/repo/${artifact}.pom"/>
</exec>
<arg line="-DpomFile=${modules.dir}/aj-build/repo/${artifact}.pom"/>
</exec>
</target>
<target name="mavenDeploySource">
<!--
Currently only an exec is usable, see http://jira.codehaus.org/browse/MANTTASKS-71
<!--
Currently only an exec is usable, see http://jira.codehaus.org/browse/MANTTASKS-71
this mean you need to have maven installed on your system.
failonerror is set to false because deploy:deploy-file goes NPE for some obscure reason
on recent versions, see http://jira.codehaus.org/browse/MDEPLOY-48
-->
@@ -979,10 +979,10 @@ ant -propertyfile XXX publishtomaven
<arg line="-DartifactId=${artifact}"/>
<arg line="-Dpackaging=java-source"/>
<arg line="-Dversion=${repo.version}"/>
<arg value="-DgeneratePom=false"/>
</exec>
<arg value="-DgeneratePom=false"/>
</exec>
</target>

</project>


+ 8
- 19
build/pom.xml View File

@@ -10,22 +10,13 @@
</parent>

<artifactId>build</artifactId>
<packaging>jar</packaging>
<name>build</name>

<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>testing-util</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<!-- Identical to lib/ant/lib/ant.jar, a former system-scoped dependency -->
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/ant/lib/ant.jar</systemPath>
<version>${lib.ant.version}</version>
</dependency>
</dependencies>

@@ -34,7 +25,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>build.date</id>
@@ -42,11 +32,11 @@
<goal>timestamp-property</goal>
</goals>
<configuration>
<!-- Timestamp format: Thu Apr 8, 2021 -->
<name>build.date</name>
<pattern>E MMM d, YYYY</pattern>
<timeZone>Europe/Zurich</timeZone>
<!-- build.date: Monday Feb 4, 2019 -->
<timeZone>America/Los_Angeles</timeZone>
<locale>en_US</locale>
</configuration>
</execution>
<execution>
@@ -55,13 +45,11 @@
<goal>timestamp-property</goal>
</goals>
<configuration>
<!-- Timestamp format: Thursday Apr 8, 2021 at 20:20:16 PDT -->
<name>build.time</name>
<!--
<pattern>E MMM d, YYYY 'at' HH:MM:SS z</pattern>
-->
<pattern>EEEE MMM d, yyyy 'at' HH:mm:ss z</pattern>
<timeZone>America/Los_Angeles</timeZone>
<!-- build.time: Monday Feb 4, 2019 at 23:50:25 GMT -->
<locale>en_US</locale>
</configuration>
</execution>
<execution>
@@ -70,10 +58,11 @@
<goal>timestamp-property</goal>
</goals>
<configuration>
<!-- Timestamp format: 2021 -->
<name>build.year</name>
<pattern>YYYY</pattern>
<timeZone>America/Los_Angeles</timeZone>
<!-- year: 2019 -->
<locale>en_US</locale>
</configuration>
</execution>
</executions>

+ 0
- 56
build/scripts/compareBuildScripts.sh View File

@@ -1,56 +0,0 @@
#!/bin/bash
# jr4 tf jdtcore-for-aspectj.jar images/ant_logo_large.gif readme.txt

errExit() {
[ -n "$1" ] && echo "ERROR: $1"
[ -n "$2" ] && exit "$2"
}
[ -f build.xml.mine ] || errExit "requires build.xml.mine" 23
[ -f build.xml.head ] || errExit "requires build.xml.head" 23

cp build.xml build.xml.orig

scriptDir=`dirname "${0}"`
cd "$scriptDir/.."

ant=../lib/ant/bin/ant
[ -n "$DEBUG"] || ant="../lib/ant/bin/ant -verbose"
jdk="${JAVA_HOME:-${JDKDIR:-c:/home/apps/jdk14}}"
jr4="$jdk/bin/jar"

rm -rf ../aj-build/*
[ -d ../aj-build/jars ] && exit 23
$ant build
mv ../aj-build/jars/build.jar ../lib/build/build.jar || exit 54

rm -rf build-test
[ -d build-test ] && errExit "rm build-test" 34
mkdir build-test

cp build.xml.head build.xml
rm -rf ../aj-build/*
[ -d ../aj-build/jars ] && errExit "rm aj-build" 23
$ant aspectjtools-dist
mv ../aj-build/dist build-test/dist-head
mv build.xml.orig build.xml

cp build.xml.mine build.xml
rm -rf ../aj-build/*
[ -d ../aj-build/jars ] && errExit "rm aj-build" 23
$ant aspectjtools-dist
mv ../aj-build/dist build-test/dist-mine
mv build.xml.orig build.xml

cd build-test
for i in dist-mine dist-head; do
$jr4 tf $i/tools/lib/aspectjtools.jar \
| sort \
> $i.txt;
done;

# skip
diff dist*.txt
wc -l dist*.txt
grep ant_logo_large dist*.txt
echo "rm -rf build-test"


+ 0
- 78
build/scripts/compileTest.sh View File

@@ -1,78 +0,0 @@
#!/bin/sh
# time compile of sources to aspectjtools and aspectjrt
# using many compilers

[ -n "$DEBUG" ] && set -vx


## redirect to stdout to avoid timing errors from console

### set for your system
jdk14="${jdk14:-d:/jdk14}"
jdk13="${jdk13:-j:/home/apps/jdk13}"
jikes="${jikes:-j:/home/wes/dev/bin/win/jikes.exe}"
aj110="${aj110:-j:/home/wes/dev/tools/aspectj-1.1.0}"
aj111="${aj111:-j:/home/wes/dev/tools/aspectj-1.1.1rc1}"
PS="${PS:-;}"

#################
ajdir=`dirname "$0"`/../..
ajdir=`cd "$ajdir"; pwd`
ajdir=`echo "$ajdir" | sed 's|/cygdrive/\([a-zA-Z]\)/|\1:/|'`
allfiles="$ajdir/allfiles.lst"
onefile="$ajdir/onefile.lst"
srcdirs="ajbrowser ajde asm bridge org.aspectj.ajdt.core runtime taskdefs util weaver"
libs="lib/ant/lib/ant.jar lib/bcel/bcel.jar org.eclipse.jdt.core/jdtcore-for-aspectj.jar"

classesDir="$ajdir/classes"
ajc110=$aj110/bin/ajc
ajc111=$aj111/bin/ajc

classpath=""
for i in $libs; do
classpath="$classpath${PS}$ajdir/$i"
done
sourcepath=""
sep=""
for i in $srcdirs; do
sourcepath="$sourcepath${sep}$ajdir/$i/src"
[ -n "$sep" ] || sep="${PS}"
done


if [ ! -f "$allfiles" ] ; then
for i in $srcdirs; do
find "$ajdir/$i/src" -type f -name \*.java
done > "$allfiles"
fi

if [ ! -f "$onefile" ] ; then
echo "$ajdir/util/src/org/aspectj/util/PartialOrder.java" > "$onefile"
fi

[ -d "$classesDir" ] || mkdir "$classesDir"

for argfile in "$onefile" "$allfiles" ; do
for compiler in "$jdk14"/bin/javac "$jdk13"/bin/javac "$ajc110" "$ajc111" "$jikes" ; do
rm -rf "$classesDir"/*
if [ "$ajc111" = "$compiler" ] ; then
cp="$aj111/lib/aspectjrt.jar$classpath"
elif [ "$jikes" = "$compiler" ] ; then
cp="$aj110/lib/aspectjrt.jar$classpath${PS}$jdk14/jre/lib/rt.jar${PS}$sourcepath"
else
cp="$aj110/lib/aspectjrt.jar$classpath"
fi
echo "##################################### $compiler $cp"
start=`date +%s`
$compiler \
-d "$classesDir" -classpath "$cp" @"$argfile"
end=`date +%s`
duration=`expr $end - $start`
echo "$duration ($start - $end) # $compiler"
done
done

rm -f "$allfiles" "$onefile"
exit



+ 0
- 41
build/scripts/jikesInc.sh View File

@@ -1,41 +0,0 @@
#!/bin/sh
# incrementally-compile AspectJ sources using Jikes

[ -n "$DEBUG" ] && set -vx

### set for your system
jikes="${jikes:-j:/home/wes/dev/bin/win/jikes.exe}"
jdk14="${jdk14:-d:/jdk14}"
PS="${PS:-;}"

#################
ajdir=`dirname "$0"`/../..
ajdir=`cd "$ajdir"; pwd`
ajdir=`echo "$ajdir" | sed 's|/cygdrive/\([a-zA-Z]\)/|\1:/|'`
allfiles="$ajdir/allfiles.lst"
srcdirs="ajbrowser ajde asm bridge org.aspectj.ajdt.core runtime taskdefs util weaver"
libs="lib/ant/lib/ant.jar lib/bcel/bcel.jar org.eclipse.jdt.core/jdtcore-for-aspectj.jar"

classesDir="$ajdir/classes"


[ -f "$allfiles" ] && rm "$allfiles"
sourcepath=""
for i in $srcdirs; do
sourcepath="$sourcepath${PS}$ajdir/$i/src"
find "$ajdir/$i/src" -type f -name \*.java
done > "$allfiles"

classpath=""
for i in $libs; do
classpath="$classpath${PS}$ajdir/$i"
done
classpath="$jdk14/jre/lib/rt.jar$sourcepath$classpath"

[ -d "$classesDir" ] || mkdir "$classesDir"
rm -rf "$classesDir"/*
set -vx
exec "$jikes" -d "$classesDir" -classpath "$classpath" @"$allfiles" ++




+ 0
- 2
build/scripts/lcp.bat View File

@@ -1,2 +0,0 @@
set LCP=%LCP%;%1

+ 0
- 19
build/scripts/localSetup.bat.txt View File

@@ -1,19 +0,0 @@

rem sample local setup, e.g., for quicklook.bat
rem set values and change filename to localSetup.bat

rem -- picked up by ant scripts
set JAVA_HOME=c:\apps\jdk1.3.1

rem -- quicklook.bat adds the following to command line

rem setup from/to for result email
set userEmail=isberg@parc.com
set mailHost=dagobah.parc.xerox.com

rem setup ant cvs task, which execs cvs
set HOME=c:\home\wes
set CVSROOT=:ext:isberg@aspectj.org:/aspectj-home/cvsroot
set CVS_RSH=c:\apps\ssh\ssh
set PATH=c:\home\apps\cygwin\bin;c:\WIN2000\system32;c:\WIN2000


+ 0
- 180
build/scripts/makeAspectjtoolsLstFile.sh View File

@@ -1,180 +0,0 @@
#!/bin/bash
# generate .lst file for aspectjtools.jar
# by compile all non-testing src dirs
# todo: copy ajbrowser manifest
[ -n "$DEBUG" ] && set -vx
usage() {
name=`basename "$0"`
cat<<EOF
Usage: $name { build | manifest }
For compiling aspectjtools-aj.jar using ajc, generate build/aspectjtools.lst
and files it refers to, aspectjtools-sources.lst and aspectj-resources.jar.
To add to aspectjtools.jar a meta-inf/manifest.mf with a main-class,
specify a single argument: "manifest"
To create the .lst file, use ajc to build, and add the manifest,
define ASPECTJ_HOME and specify a single argument: "build"
EOF
}
canonicalPath() {
cygpath -ma "$@"
}
filterOutNonsourceDirs() {
sed '/\/build\//d;/\/testing/d'
}
listSourceDirs() {
for i in ../*/testsrc; do
p=`echo $i \
| filterOutNonsourceDirs \
| sed 's|../\(.*\)/testsrc|\1|'`;
p=`canonicalPath "../$p"`
[ -d "$p/src" ] && echo "$p/src"
done
}
generateSourcesLstFiles() {
[ -n "$DEBUG" ] && set -vx
rm -f aspectjtools-sources.lst;
for i in `listSourceDirs` ; do
find "$i" -type f -name \*.java \
| sed 's|/[^/]*.java|/*.java|' \
| sort -u ;
done > aspectjtools-sources.lst;
# head aspectjtools-sources.lst
}
genResourceJar() { # slow, but hey
[ -n "$DEBUG" ] && set -vx
jarFile=`canonicalPath "$1"`
[ -n "$jarFile" ] || exit 43
"${JAVA_HOME:-c:/home/apps/jdk14}/bin/"jar \
cfM "$jarFile" build.xml
curDir=`pwd`;
for i in `listSourceDirs` ; do
cd "$i"
"${JAVA_HOME:-c:/home/apps/jdk14}/bin/"jar \
ufM "$jarFile" `find . -type f | sed '/CVS/d;/\.java/d'`
cd "$curDir"
done
cd "$curDir"
# mf=`canonicalPath "grj_manifest.txt"`
# sed 's|@build.version.short@|1.1.1|;s|@company.name@|na|' \
# ../ajbrowser/ajbrowser.mf.txt > "$mf"
# "${JAVA_HOME:-c:/home/apps/jdk14}/bin/"jar \
# ufm "$jarFile" "$mf" build.xml
# rm "$mf"
}
addManifest() {
outjar="$1"
mf=`canonicalPath "grj_manifest.txt"`
sed 's|@build.version.short@|1.1.1|;s|@company.name@|na|' \
../ajbrowser/ajbrowser.mf.txt > "$mf"
echo "nothing" > am_nothing
"${JAVA_HOME:-c:/home/apps/jdk14}/bin/"jar \
ufm "$outjar" "$mf" am_nothing
rm "$mf" am_nothing
}
getClasspath() {
[ -n "$DEBUG" ] && set -vx
ajrt=`canonicalPath "${ASPECTJ_HOME:-c:/home/apps/aspectj-1.1.1}/lib/aspectjrt.jar"`
echo "${ajrt};`cygpath -ma ../lib/ant/lib/ant.jar`"
}
getInjars() {
[ -n "$DEBUG" ] && set -vx
cp=""
sep=""
for i in "$1" ../lib/bcel/bcel.jar \
../org.eclipse.jdt.core/jdtcore-for-aspectj.jar \
; do
cp="${cp}${sep}`canonicalPath "$i"`"
[ -z "${sep}" ] && sep=";"
done
echo "$cp"
}
setupManifest() {
[ -n "$DEBUG" ] && set -vx
midir="../ajbrowser/src/META-INF"
[ -d "$midir" ] || mkdir ../ajbrowser/src/META-INF
sed 's|@build.version.short@|1.1.1|;s|@company.name@|na|' \
../ajbrowser/ajbrowser.mf.txt > "$1"
}
generateFile() {
resourceJar="$1"
outputJar="$2"
[ -n "$DEBUG" ] && set -vx
[ -f "$resourceJar" ] || exit 98
[ -n "$outputJar" ] || exit 98
rm -f "$outputJar"
PS=";"
#sourceroots=`getSourceroots`
classpath=`getClasspath`
injars=`getInjars "$resourceJar"`
cat<<EOF
# generated `date` by $0
# remove this line if modifying this file
-outjar
$outputJar
-classpath
$classpath
-injars
$injars
-argfile
`canonicalPath aspectjtools-sources.lst`
EOF
}
errExit() {
[ -n "$1" ] && echo "## error: $1"
[ -n "$2" ] && exit "$2"
}
#########################################################################
#########################################################################
scriptDir=`dirname "$0"`
scriptDir=`cd "$scriptDir"; pwd`
script=`canonicalPath "$0"`
export PS=";" ### XXX platform
ASPECTJ_HOME="${ASPECTJ_HOME:-~/dev/tools/aspectj-1.1.1}"
export ASPECTJ_HOME=`cygpath -m "${ASPECTJ_HOME}"`
cd "$scriptDir/.."
outjar=`canonicalPath aspectjtools-aj.jar`
if [ -f aspectjtools.lst ] ; then
grep -q "remove this line" aspectjtools.lst \
&& rm -f aspectjtools.lst \
|| exit 23
fi
set -e
if [ "$1" = "manifest" ] ; then
addManifest "$outjar"
elif [ "build" = "$1" ] ; then
[ "$script" -ot aspectjtools.lst ] || "$script"
[ -d "$ASPECTJ_HOME" ] || errExit "define ASPECTJ_HOME" 49
"$ASPECTJ_HOME"/bin/ajc -argfile aspectjtools.lst
"$script" manifest
elif [ -n "$1" ] ; then
usage
else
generateSourcesLstFiles
resourceJar=`canonicalPath aspectjtools-resources.jar`
[ -f "$resourceJar" ] || genResourceJar "$resourceJar"
outjar=`canonicalPath aspectjtools-aj.jar`
rm -f aspectjtools.lst
generateFile "$resourceJar" "$outjar" > aspectjtools.lst
ls -ald "$resourceJar" aspectjtools.lst
fi

+ 0
- 100
build/scripts/quicklook.bat View File

@@ -1,100 +0,0 @@
rem be verbose, no @echo off
rem requires existing ajhome install for ant scripts, libs
rem beware - withou DOS linefeeds, DOS won't interpret...
rem ------ read variables from local setup
set scriptPath=%~dp0
set scriptDir=%scriptPath:\quicklook.bat=%
if not exist %scriptDir%\localSetup.bat goto ERR_SETUP
call %scriptDir%\localSetup.bat
if "x" == "x%userEmail%" goto ERR_VARIABLE
if "x" == "x%mailHost%" goto ERR_VARIABLE
if "x" == "x%HOME%" goto ERR_VARIABLE
if "x" == "x%CVS_RSH%" goto ERR_VARIABLE
if "x" == "x%CVSROOT%" goto ERR_VARIABLE
set buildDir=%scriptDir:\scripts=%
set antScript=%buildDir:\build=%\lib\ant\bin\ant.bat
if not exist %antScript% goto ERR_ANT
if not exist %buildDir% goto ERR_BUILDDIR
if not exist %JDKDIR% goto ERR_JDKDIR
rem XXX redo these when web building
rem set SQEDIRPATH=%SQEDRIVE%%SQEDIR%
rem if exist %SQEDIRPATH% goto RUN
rem net use %SQEDRIVE% \\samba\aop /persistent:no
rem if not exist %SQEDIRPATH% goto ERR_MOUNT
rem set mountedDrive=yes
goto RUN
rem build update.tree, quicklook
:RUN
set JAVA_HOME=%JDKDIR%
if not "x" == "x%DEBUG%" set verbose=-verbose
chdir %buildDir% || goto ERR_CD
rem fyi, normal ant.bat script loses any internal "=", so we rely on a patched script
set MAIL_OPTIONS=-logger org.apache.tools.ant.listener.MailLogger -DMailLogger.mailhost=%mailHost% -DMailLogger.success.to=%userEmail% -DMailLogger.failure.to=%userEmail% -DMailLogger.from=%userEmail%
set options=%MAIL_OPTIONS% -DCVSROOT=%CVSROOT%
rem cannot use "|| goto ERR_ANT_UPDATE" b/c ant script returns non-zero for valid builds
call %antScript% -f build.xml update.tree %verbose% %options%
set options=%MAIL_OPTIONS% -Duser.email=%userEmail% -Daop.dir=%SQEDRIVE%
set options=%options% -Drun.ajcTests=runAjcTests -Drun.junit.tests=runJUnitTests
call %antScript% -f build.xml quicklook %verbose% %options%
if "ok%mountedDrive%" == "okyes" net use %SQEDRIVE% /delete
goto QUIT
rem ---------- errors
:ERR_CD
echo "unable to cd to build directory: %buildDir%"
goto QUIT
:ERR_SETUP
echo "expected local setup in %scriptDir%\localSetup.bat"
goto QUIT
:ERR_BUILDDIR
echo "expected build dir: %buildDir%"
goto QUIT
:ERR_VARIABLE
echo "local setup is incorrect - missing variables"
goto QUIT
:ERR_ANT
echo "expected ant script: %antScript%"
goto QUIT
:ERR_JDKDIR
echo "no JDKDIR=%JDKDIR%"
goto QUIT
:ERR_MOUNT
echo "unable to mount or use SQEDIRPATH=%SQEDIRPATH%"
goto QUIT
:ERR_CREATE_FAILED
echo "unable to find quicklook source after running setup build"
goto QUIT
:ERR_ANT_CREATE
echo "FAIL ant create.source failed"
goto QUIT
:ERR_ANT_UPDATE
echo "FAIL ant update.source failed"
goto QUIT
:ERR_ANT_QUICKLOOK
echo "FAIL ant quicklook failed"
goto QUIT
:ERR_ANT_DESTORY
echo "FAIL ant destroy.source failed"
goto QUIT
:QUIT

+ 0
- 7
build/scripts/runQuicklook.bat View File

@@ -1,7 +0,0 @@
rem @echo off
rem %~dp0 is name of current script
set scriptPath=%~dp0
set scriptDir=%scriptPath:\runQuicklook.bat=%
call %scriptDir%quicklook.bat > %scriptDir%quicklook.out 2>&1

+ 1
- 1
build/src/main/java/$installer$/org/aspectj/Main.java View File

@@ -145,7 +145,7 @@ public class Main {
try {
String className = (String) properties.get("installer.main.class");
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
Installer installer = (Installer) Class.forName(className).newInstance();
Installer installer = (Installer) Class.forName(className).getDeclaredConstructor().newInstance();
InstallContext installerContext = new InstallContext(properties);
installerContext.setHasGui(hasGui);
installer.setContext(installerContext);

+ 2
- 2
build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java View File

@@ -599,7 +599,7 @@ public class AntBuilder extends Builder {
ClassLoader parent = Task.class.getClassLoader();
ClassLoader loader = new URLClassLoader(cp, parent);
Class c = loader.loadClass(AJCTASK);
task = c.newInstance();
task = c.getDeclaredConstructor().newInstance();
// Westodo Project project = javac.getProject();
Method m = c.getMethod("setupAjc", new Class[] { Javac.class });
m.invoke(task, new Object[] { javac });
@@ -825,4 +825,4 @@ class ProjectMessager extends Messager {
return true;
}

}
}

+ 1
- 1
build/src/main/java/org/aspectj/internal/tools/build/Builder.properties View File

@@ -10,7 +10,7 @@ alias.org.aspectj.matcher.jar=org.aspectj.matcher-all.jar

# libraries to avoid bundling (IBM JRE different, etc.)
# see build/readme-build-module.html, Builder.SKIP_LIBRARIES
skip.libraries=asm-3.1.jar,core.jar,graphics.jar,ant.jar,tools.jar,bcel-verifier.jar,asm-3.1.jar,junit.jar,xml-apis.jar,xercesImpl.jar,commons.jar,jrockit.jar
skip.libraries=asm-3.1.jar,core.jar,graphics.jar,ant.jar,tools.jar,bcel-verifier.jar,asm-3.1.jar,junit.jar,xml-apis.jar,xercesImpl.jar,commons.jar

# Ant patterns to gather and omit resources
# files copied during module jar assembly

+ 484
- 509
docs/adk15ProgGuideDB/annotations.xml
File diff suppressed because it is too large
View File


+ 407
- 414
docs/adk15ProgGuideDB/ataspectj.xml
File diff suppressed because it is too large
View File


+ 33
- 33
docs/adk15ProgGuideDB/autoboxing.xml View File

@@ -1,54 +1,54 @@
<chapter id="autoboxing" xreflabel="Autoboxing and Unboxing">

<title>Autoboxing and Unboxing</title>
<sect1 id="boxing-inJava5">
<title>Autoboxing and Unboxing in Java 5</title>
<para>
Java 5 (and hence AspectJ 1.5) supports automatic conversion of
Java 5 (and hence AspectJ 1.5) supports automatic conversion of
primitive types (int, float, double etc.) to their object equivalents
(Integer, Float, Double,...) in assignments and method and constructor
invocations. This conversion is know as autoboxing.
</para>
<para>Java 5 also supports automatic unboxing, where wrapper types
are automatically converted into their primitive equivalents if
needed for assignments or method or constructor invocations.</para>
<para>For example:</para>

<programlisting><![CDATA[
int i = 0;
i = new Integer(5); // auto-unboxing
Integer i2 = 5; // autoboxing
]]></programlisting>
int i = 0;
i = new Integer(5); // auto-unboxing
Integer i2 = 5; // autoboxing
]]></programlisting>
</sect1>
<sect1 id="autoboxing-in-aspectj5">
<title>Autoboxing and Join Point matching in AspectJ 5</title>
<para>Most of the pointcut designators match based on signatures, and
hence are unaffected by autoboxing. For example, a call to a method</para>

<programlisting><![CDATA[
public void foo(Integer i);
]]></programlisting>
public void foo(Integer i);
]]></programlisting>
<para>is <emphasis>not</emphasis> matched by a pointcut
<literal>call(void foo(int))</literal> since the signature declares
a single <literal>Integer</literal> parameter, not an <literal>int</literal>.
</para>
<para>The <literal>args</literal> pointcut designator is affected by
autoboxing since it matches based on the runtime type of the arguments.
AspectJ 5 applies autoboxing and unboxing in determining argument matching.
In other words, <literal>args(Integer)</literal> will match any join
point at which there is a single argument of type <literal>Integer</literal>
or of type <literal>int</literal>.</para>
<itemizedlist>
<listitem>args(Integer) and args(int) are equivalent</listitem>
<listitem>args(Float) and args(float) are equivalent</listitem>
@@ -58,29 +58,29 @@
<listitem>args(Long) and args(long) are equivalent</listitem>
<listitem>args(Boolean) and args(boolean) are equivalent</listitem>
</itemizedlist>
<para>
Autoboxing and unboxing are also applied when binding pointcut or
advice parameters, for example:
Autoboxing and unboxing are also applied when binding pointcut or
advice parameters, for example:
</para>

<programlisting><![CDATA[
pointcut foo(int i) : args(i);
before(Integer i) : foo(i) {
...
}
]]></programlisting>
pointcut foo(int i) : args(i);
before(Integer i) : foo(i) {
...
}
]]></programlisting>

</sect1>
<sect1 id="autoboxing-and-method-dispatch">
<title>Inter-type method declarations and method dispatch</title>
<para>Autoboxing, unboxing, and also varargs all affect the method
dispatch algorithm used in Java 5. In AspectJ 5, the target method
of a call is selected according to the following algorithm:</para>
<orderedlist>
<listitem>Attempt to locate a matching method or inter-type declared
method without considering
@@ -90,11 +90,11 @@
<listitem>Finally try again considering both autoboxing, unboxing,
and varargs.</listitem>
</orderedlist>
<para>One consequence is that a directly matching inter-type declared
method will take precedence over a method declared locally in the
method will take precedence over a method declared locally in the
target class but that only matches via autoboxing.</para>
</sect1>
</chapter>


+ 42
- 42
docs/adk15ProgGuideDB/covariance.xml View File

@@ -1,64 +1,64 @@
<chapter id="covariance" xreflabel="Covariance">

<title>Covariance</title>
<sect1 id="covariance-inJava5">
<title>Covariance in Java 5</title>
<para>
Java 5 (and hence AspectJ 5) allows you to narrow the return type
in an overriding method. For example:
</para>

<programlisting><![CDATA[
class A {
public A whoAreYou() {...}
}
class B extends A {
// override A.whoAreYou *and* narrow the return type.
public B whoAreYou() {...}
}
]]></programlisting>
class A {
public A whoAreYou() {...}
}
class B extends A {
// override A.whoAreYou *and* narrow the return type.
public B whoAreYou() {...}
}
]]></programlisting>
</sect1>
<sect1 id="covariance-and-join-point-matching">
<title>Covariant methods and Join Point matching</title>
<para>The join point matching rules for <literal>call</literal>
and <literal>execution</literal> pointcut designators are extended
to match against covariant methods.</para>
<para>
Given the classes <literal>A</literal> and <literal>B</literal>
as defined in the previous section, and the program fragment
</para>

<programlisting><![CDATA[
A a = new A();
B b = new B();
a.whoAreYou();
b.whoAreYou();
]]></programlisting>
<para>The signatures for the call join point <literal>a.whoAreYou()</literal> are
simply:</para>
A a = new A();
B b = new B();
a.whoAreYou();
b.whoAreYou();
]]></programlisting>

<programlisting><![CDATA[
A A.whoAreYou()
]]></programlisting>
<para>The signatures for the call join point <literal>b.whoAreYou()</literal> are:
</para>
<para>The signatures for the call join point <literal>a.whoAreYou()</literal> are
simply:</para>

<programlisting><![CDATA[
A A.whoAreYou()
]]></programlisting>

<para>The signatures for the call join point <literal>b.whoAreYou()</literal> are:
</para>

<programlisting><![CDATA[
A A.whoAreYou()
B B.whoAreYou()
]]></programlisting>

<programlisting><![CDATA[
A A.whoAreYou()
B B.whoAreYou()
]]></programlisting>
<para>Following the join point matching rules given in <xref linkend="jpsigs"/>,</para>

<variablelist>

<varlistentry>
@@ -87,7 +87,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>call(A B.whoAreYou())</term>
<listitem>
@@ -98,22 +98,22 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>call(A+ B.whoAreYou())</term>
<listitem>
<para>Matches the call to <literal>b.whoAreYou()</literal> since
the signature pattern matches the signature <literal>B B.whoAreYou()</literal>.
the signature pattern matches the signature <literal>B B.whoAreYou()</literal>.
A lint warning is given for the call <literal>a.whoAreYou()</literal> ("does not match
because declaring type is A, if match required use target(B)").
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>call(B A.whoAreYou())</term>
<listitem>
<para>Does not match anything since neither join point has a
<para>Does not match anything since neither join point has a
signature matched by this pattern.
</para>
</listitem>
@@ -136,13 +136,13 @@
</varlistentry>

</variablelist>
<para>The rule for signature matching at call and execution join points
is unchanged from AspectJ 1.2: a call or execution pointcut matches if
the signature pattern matches at least one of the signatures of the
join point, and if the modifiers of the method or constructor are matched
by any modifier pattern or annotation pattern that may be present.</para>
</sect1>
</chapter>


+ 16
- 16
docs/adk15ProgGuideDB/enumeratedtypes.xml View File

@@ -1,38 +1,38 @@
<chapter id="enumeratedtypes" xreflabel="Enumerated Types">

<title>Enumerated Types</title>
<sect1 id="enums-in-java5">
<title>Enumerated Types in Java 5</title>
<para>Java 5 (and hence AspectJ 5) provides explicit support for
enumerated types. In the simplest case, you can declare an enumerated
type as follows:</para>
<programlisting><![CDATA[
public enum ProgrammingLanguages {
COBOL,C,JAVA,ASPECTJ
}
]]></programlisting>
public enum ProgrammingLanguages {
COBOL, C, JAVA, ASPECTJ
}
]]></programlisting>
<para>Enumerated types are just classes, and they can contain method
and field declarations, and may implement interfaces. Enums may only
have private constructors, and may not be extended.</para>
<para>Enumerated types in Java 5 all implicitly extend the type
<literal>java.lang.Enum</literal>. It is illegal to explicitly
declare a subtype of this class.</para>
</sect1>
<sect1 id="enums-in-aspectj5">
<title>Enumerated Types in AspectJ 5</title>
<para>
AspectJ 5 supports the declaration of enumerated types just as Java 5
does. Because of the special restrictions Java 5 places around enumerated
types, AspectJ makes the following additional restrictions:
</para>
<itemizedlist>
<listitem>You cannot use declare parents to change the super type of
an enum.</listitem>
@@ -42,23 +42,23 @@
enum.</listitem>
<listitem>You cannot extend the set of values in an enum via any
ITD-like construct.</listitem>
<listitem>You cannot make inter-type method or field declarations on
<listitem>You cannot make inter-type method or field declarations on
an enum.</listitem>
<listitem>You cannot use declare parents to make an enum type implement
an interface.</listitem>
</itemizedlist>
<para>In theory, the last of these two items <emphasis>could</emphasis>
be supported. However, AspectJ 5 follows the simple rule that <emphasis>
an enum type cannot be the target of an inter-type declaration or declare
parents statement</emphasis>. This position may be relaxed in a future
version of AspectJ.</para>
<para>If an enum is named explicitly as the target of a
declare parents statement, a compilation error will result. If an enumerated
type is matched by a non-explicit type pattern used in a declare parents
statement it will be ignored (and an XLint warning issued).</para>
</sect1>
</chapter>


+ 535
- 566
docs/adk15ProgGuideDB/generics.xml
File diff suppressed because it is too large
View File


+ 182
- 184
docs/adk15ProgGuideDB/grammar.xml View File

@@ -1,192 +1,190 @@
<appendix id="grammar" xreflabel="AspectJ 5 Grammar">

<title>A Grammar for the AspectJ 5 Language</title>
<programlisting><![CDATA[
=== type patterns ===
TypePattern := SimpleTypePattern |
'!' TypePattern |
'(' AnnotationPattern? TypePattern ')'
TypePattern '&&' TypePattern |
TypePattern '||' TypePattern
SimpleTypePattern := DottedNamePattern '+'? '[]'*
DottedNamePattern := FullyQualifiedName RestOfNamePattern? |
'*' NotStarNamePattern?
RestOfNamePattern := '..' DottedNamePattern |
'*' NotStarNamePattern?
NotStarNamePattern := FullyQualifiedName RestOfNamePattern? |
'..' DottedNamePattern

FullyQualifiedName := JavaIdentifierCharacter+ ('.' JavaIdentifierCharacter+)*
=== annotation patterns ===
AnnotationPattern := '!'? '@' AnnotationTypePattern AnnotationPattern*

AnnotationTypePattern := FullyQualifiedName |
'(' TypePattern ')'
=== signature patterns ===
-- field --
FieldPattern :=
AnnotationPattern? FieldModifiersPattern?
TypePattern (TypePattern DotOrDotDot)? SimpleNamePattern

FieldModifiersPattern := '!'? FieldModifier FieldModifiersPattern*
FieldModifier := 'public' | 'private' | 'protected' | 'static' |
'transient' | 'final'
DotOrDotDot := '.' | '..'
SimpleNamePattern := JavaIdentifierChar+ ('*' SimpleNamePattern)?
-- method --
MethodPattern :=
AnnotationPattern? MethodModifiersPattern? TypePattern
(TypePattern DotOrDotDot)? SimpleNamePattern
'(' FormalsPattern ')' ThrowsPattern?

MethodModifiersPattern := '!'? MethodModifier MethodModifiersPattern*
MethodModifier := 'public' | 'private' | 'protected' | 'static' |
'synchronized' | 'final'
FormalsPattern := '..' (',' FormalsPatternAfterDotDot)? |
OptionalParensTypePattern (',' FormalsPattern)* |
TypePattern '...'
FormalsPatternAfterDotDot :=
OptionalParensTypePattern (',' FormalsPatternAfterDotDot)* |
TypePattern '...'
ThrowsPattern := 'throws' TypePatternList
TypePatternList := TypePattern (',' TypePattern)*
-- constructor --
ConstructorPattern :=
AnnotationPattern? ConstructorModifiersPattern?
(TypePattern DotOrDotDot)? 'new' '(' FormalsPattern ')'
ThrowsPattern?
ConstructorModifiersPattern := '!'? ConstructorModifier ConstructorModifiersPattern*
ConstructorModifier := 'public' | 'private' | 'protected'
=== Pointcuts ===
PointcutPrimitive :=
Call | Execution | Get | Set | Handler |
Initialization | PreInitialization |
StaticInitialization | AdviceExecution |
This | Target | Args | CFlow | CFlowBelow |
Within | WithinCode | If |
AnnotationPointcut
AnnotationPointcut := AtAnnotation | AtThis | AtTarget |
AtWithin | AtWithinCode | AtArgs
Call := 'call' '(' MethodOrConstructorPattern ')'
MethodOrConstructorPattern := MethodPattern | ConstructorPattern
Execution := 'execution' '(' MethodOrConstructorPattern ')'
Get := 'get' '(' FieldPattern ')'
Set := 'set' '(' FieldPattern ')'
Handler := 'handler' '(' OptionalParensTypePattern ')'
Initialization := 'initialization' '(' ConstructorPattern ')'
PreInitialization := 'preinitialization' '(' ConstructorPattern ')'
StaticInitialization := 'staticinitialization' '(' OptionalParensTypePattern ')'
AdviceExecution := 'adviceexecution' '(' ')'
This := 'this' '(' TypeOrIdentifier ')'
Target := 'target' '(' TypeOrIdentifier ')'
Args := 'args' '(' FormalsOrIdentifiersPattern ')'
CFlow := 'cflow' '(' Pointcut ')'
CFlowBelow := 'cflowbelow' '(' Pointcut ')'
Within := 'within' '(' OptionalParensTypePattern ')'
WithinCode := 'withincode' '(' OptionalParensTypePattern ')'
If := 'if' '(' BooleanJavaExpression ')'
TypeOrIdentifier := FullyQualifiedName ('[' ']')* | Identifier
Identifier := JavaIdentifierChar+
FormalsOrIdentifiersPattern :=
'..' (',' FormalsOrIdentifiersPatternAfterDotDot)? |
TypeOrIdentifier (',' FormalsOrIdentifiersPattern)* |
'*' (',' FormalsOrIdentifiersPattern)*
FormalsOrIdentifiersPatternAfterDotDot :=
TypeOrIdentifier (',' FormalsOrIdentifiersPatternAfterDotDot)* |
'*' (',' FormalsOrIdentifiersPatternAfterDotDot)*
AtAnnotation := '@annotation' '(' AnnotationOrIdentifier ')'
AtThis := '@this' '(' AnnotationOrIdentifer ')'
AtTarget := '@target' '(' AnnotationOrIdentifier ')'
AtWithin := '@within' '(' AnnotationOrIdentifier ')'
AtWithinCode := '@withincode' '(' AnnotationOrIdentifier ')'
AnnotationOrIdentifier := FullyQualifiedName | Identifier
AtArgs := '@args' '(' AnnotationsOrIdentifiersPattern ')'
AnnotationsOrIdentifiersPattern :=
'..' (',' AnnotationsOrIdentifiersPatternAfterDotDot)? |
AnnotationOrIdentifier (',' AnnotationsOrIdentifiersPattern)* |
'*' (',' AnnotationsOrIdentifiersPattern)*
AnnotationsOrIdentifiersPatternAfterDotDot :=
AnnotationOrIdentifier (',' AnnotationsOrIdentifiersPatternAfterDotDot)* |
'*' (',' AnnotationsOrIdentifiersPatternAfterDotDot)*
PointcutDeclaration := PointcutModifiers? 'pointcut' Identifier Formals
':' PointcutExpression
PointcutModifiers := PointcutModifier*
PointcutModifier := 'public' | 'private' | 'protected' | 'abstract'
Formals := '(' ParamList? ')'
ParamList := FullyQualifiedName Identifier (',' ParamList)*
ReferencePointcut := (FullyQualifiedName '.')? Identifier Formals
PointcutExpression := (PointcutPrimitive | ReferencePointcut) |
'!' PointcutExpression |
'(' PointcutExpression ')' |
PointcutExpression '&&' PointcutExpression |
PointcutExpression '||' PointcutExpression
=== Advice ===
to be written...
=== Inter-type Declarations ===
to be written...
=== Declare Statements ===
to be written...
=== Aspects ===
to be written...
]]></programlisting>
=== type patterns ===

TypePattern := SimpleTypePattern |
'!' TypePattern |
'(' AnnotationPattern? TypePattern ')'
TypePattern '&&' TypePattern |
TypePattern '||' TypePattern

SimpleTypePattern := DottedNamePattern '+'? '[]'*

DottedNamePattern := FullyQualifiedName RestOfNamePattern? |
'*' NotStarNamePattern?

RestOfNamePattern := '..' DottedNamePattern |
'*' NotStarNamePattern?

NotStarNamePattern := FullyQualifiedName RestOfNamePattern? |
'..' DottedNamePattern

FullyQualifiedName := JavaIdentifierCharacter+ ('.' JavaIdentifierCharacter+)*

=== annotation patterns ===

AnnotationPattern := '!'? '@' AnnotationTypePattern AnnotationPattern*


AnnotationTypePattern := FullyQualifiedName |
'(' TypePattern ')'

=== signature patterns ===

-- field --

FieldPattern :=
AnnotationPattern? FieldModifiersPattern?
TypePattern (TypePattern DotOrDotDot)? SimpleNamePattern

FieldModifiersPattern := '!'? FieldModifier FieldModifiersPattern*

FieldModifier := 'public' | 'private' | 'protected' | 'static' |
'transient' | 'final'

DotOrDotDot := '.' | '..'

SimpleNamePattern := JavaIdentifierChar+ ('*' SimpleNamePattern)?

-- method --

MethodPattern :=
AnnotationPattern? MethodModifiersPattern? TypePattern
(TypePattern DotOrDotDot)? SimpleNamePattern
'(' FormalsPattern ')' ThrowsPattern?

MethodModifiersPattern := '!'? MethodModifier MethodModifiersPattern*

MethodModifier := 'public' | 'private' | 'protected' | 'static' |
'synchronized' | 'final'

FormalsPattern := '..' (',' FormalsPatternAfterDotDot)? |
OptionalParensTypePattern (',' FormalsPattern)* |
TypePattern '...'

FormalsPatternAfterDotDot :=
OptionalParensTypePattern (',' FormalsPatternAfterDotDot)* |
TypePattern '...'

ThrowsPattern := 'throws' TypePatternList

TypePatternList := TypePattern (',' TypePattern)*

-- constructor --

ConstructorPattern :=
AnnotationPattern? ConstructorModifiersPattern?
(TypePattern DotOrDotDot)? 'new' '(' FormalsPattern ')'
ThrowsPattern?

ConstructorModifiersPattern := '!'? ConstructorModifier ConstructorModifiersPattern*

ConstructorModifier := 'public' | 'private' | 'protected'

=== Pointcuts ===

PointcutPrimitive :=
Call | Execution | Get | Set | Handler |
Initialization | PreInitialization |
StaticInitialization | AdviceExecution |
This | Target | Args | CFlow | CFlowBelow |
Within | WithinCode | If |
AnnotationPointcut

AnnotationPointcut := AtAnnotation | AtThis | AtTarget |
AtWithin | AtWithinCode | AtArgs


Call := 'call' '(' MethodOrConstructorPattern ')'

MethodOrConstructorPattern := MethodPattern | ConstructorPattern

Execution := 'execution' '(' MethodOrConstructorPattern ')'

Get := 'get' '(' FieldPattern ')'
Set := 'set' '(' FieldPattern ')'
Handler := 'handler' '(' OptionalParensTypePattern ')'
Initialization := 'initialization' '(' ConstructorPattern ')'
PreInitialization := 'preinitialization' '(' ConstructorPattern ')'
StaticInitialization := 'staticinitialization' '(' OptionalParensTypePattern ')'
AdviceExecution := 'adviceexecution' '(' ')'
This := 'this' '(' TypeOrIdentifier ')'
Target := 'target' '(' TypeOrIdentifier ')'
Args := 'args' '(' FormalsOrIdentifiersPattern ')'
CFlow := 'cflow' '(' Pointcut ')'
CFlowBelow := 'cflowbelow' '(' Pointcut ')'
Within := 'within' '(' OptionalParensTypePattern ')'
WithinCode := 'withincode' '(' OptionalParensTypePattern ')'
If := 'if' '(' BooleanJavaExpression ')'

TypeOrIdentifier := FullyQualifiedName ('[' ']')* | Identifier
Identifier := JavaIdentifierChar+

FormalsOrIdentifiersPattern :=
'..' (',' FormalsOrIdentifiersPatternAfterDotDot)? |
TypeOrIdentifier (',' FormalsOrIdentifiersPattern)* |
'*' (',' FormalsOrIdentifiersPattern)*

FormalsOrIdentifiersPatternAfterDotDot :=
TypeOrIdentifier (',' FormalsOrIdentifiersPatternAfterDotDot)* |
'*' (',' FormalsOrIdentifiersPatternAfterDotDot)*

AtAnnotation := '@annotation' '(' AnnotationOrIdentifier ')'
AtThis := '@this' '(' AnnotationOrIdentifer ')'
AtTarget := '@target' '(' AnnotationOrIdentifier ')'
AtWithin := '@within' '(' AnnotationOrIdentifier ')'
AtWithinCode := '@withincode' '(' AnnotationOrIdentifier ')'

AnnotationOrIdentifier := FullyQualifiedName | Identifier

AtArgs := '@args' '(' AnnotationsOrIdentifiersPattern ')'

AnnotationsOrIdentifiersPattern :=
'..' (',' AnnotationsOrIdentifiersPatternAfterDotDot)? |
AnnotationOrIdentifier (',' AnnotationsOrIdentifiersPattern)* |
'*' (',' AnnotationsOrIdentifiersPattern)*

AnnotationsOrIdentifiersPatternAfterDotDot :=
AnnotationOrIdentifier (',' AnnotationsOrIdentifiersPatternAfterDotDot)* |
'*' (',' AnnotationsOrIdentifiersPatternAfterDotDot)*

PointcutDeclaration := PointcutModifiers? 'pointcut' Identifier Formals
':' PointcutExpression

PointcutModifiers := PointcutModifier*

PointcutModifier := 'public' | 'private' | 'protected' | 'abstract'

Formals := '(' ParamList? ')'
ParamList := FullyQualifiedName Identifier (',' ParamList)*

ReferencePointcut := (FullyQualifiedName '.')? Identifier Formals

PointcutExpression := (PointcutPrimitive | ReferencePointcut) |
'!' PointcutExpression |
'(' PointcutExpression ')' |
PointcutExpression '&&' PointcutExpression |
PointcutExpression '||' PointcutExpression

=== Advice ===

to be written...

=== Inter-type Declarations ===

to be written...

=== Declare Statements ===

to be written...

=== Aspects ===

to be written...
]]></programlisting>

</appendix>


+ 162
- 165
docs/adk15ProgGuideDB/joinpointsignatures.xml View File

@@ -9,76 +9,76 @@
for understanding the matching rules in the presence of annotations,
generics, covariance, varargs, and autoboxing.
</para>
<sect1 id="join-point-matching">
<title>Join Point Matching</title>
<para>AspectJ supports 11 different kinds of join points. These are
the <literal>method call, method execution, constructor call,
constructor execution, field get, field set, pre-initialization,
initialization, static initialization, handler,</literal> and
<literal>advice execution</literal> join points.</para>
<para>The <emphasis>kinded</emphasis> pointcut designators match
based on the kind of a join point. These are the <literal>call,
execution, get, set, preinitialization, initialization,
execution, get, set, preinitialization, initialization,
staticinitialization, handler,</literal> and <literal>adviceexecution</literal>
designators.</para>
<para>A kinded pointcut is written using patterns, some of which
<para>A kinded pointcut is written using patterns, some of which
match based on <emphasis>signature</emphasis>, and some of which
match based on <emphasis>modifiers</emphasis>. For example, in
match based on <emphasis>modifiers</emphasis>. For example, in
the <literal>call</literal> pointcut designator:</para>
<programlisting><![CDATA[
call(ModifierPattern TypePattern TypePattern.IdPattern(TypePatternList) ThrowsPattern)
]]></programlisting>
call(ModifierPattern TypePattern TypePattern.IdPattern(TypePatternList) ThrowsPattern)
]]></programlisting>
<para>the modifiers matching patterns are <literal>ModifierPattern</literal>
and <literal>ThrowsPattern</literal>, and the signature matching patterns
are <literal>TypePattern TypePattern.IdPattern(TypePatternList)</literal>.
</para>
<para>
A join point has potentially multiple signatures, but only one set of
modifiers. <emphasis>A kinded primitive pointcut matches a particular join point
modifiers. <emphasis>A kinded primitive pointcut matches a particular join point
if and only if</emphasis>:
</para>
<orderedlist>
<listitem>They are of the same kind</listitem>
<listitem>The signature pattern (exactly) matches at least one
<listitem>The signature pattern (exactly) matches at least one
signature of the join point</listitem>
<listitem>The modifiers pattern matches the modifiers of the
subject of the join point</listitem>
</orderedlist>
<para>These rules make it very easily to quickly determine whether a
<para>These rules make it very easily to quickly determine whether a
given pointcut matches a given join point. In the next two sections,
we describe what the signature(s) of a join point are, and what the
subjects of join points are.</para>
</sect1>
<sect1 id="join-point-signatures">
<title>Join Point Signatures</title>
<para>Call, execution, get, and set join points may potentially have multiple
signatures. All other join points have exactly one signature. The
following table summarizes the constituent parts of a join point
signature for the different kinds of join point.</para>
<informaltable>
<tgroup cols="7">
<thead>
<row>
<entry>Join Point Kind</entry>
<entry>Return Type</entry>
<entry>Declaring Type</entry>
<entry>Id</entry>
<entry>Parameter Types</entry>
<entry>Field Type</entry>
<entry>Exception Type</entry>
<entry>Return Type</entry>
<entry>Declaring Type</entry>
<entry>Id</entry>
<entry>Parameter Types</entry>
<entry>Field Type</entry>
<entry>Exception Type</entry>
</row>
</thead>
<tbody>
@@ -184,25 +184,25 @@
</tbody>
</tgroup>
</informaltable>
<para>Note that whilst an advice execution join point has a
signature comprising the declaring type of the advice and the
advice parameter types, the <literal>adviceexecution</literal>
pointcut designator does not support matching based on this
signature.</para>
<para>The signatures for most of the join point kinds should be
self-explanatory, except for field get and set, and method call and execution
join points, which can have multiple signatures. Each signature of
join points, which can have multiple signatures. Each signature of
a method call or execution join point has the same id and parameter
types, but the declaring type and return type (with covariance) may vary.
Each signature of a field get or set join point has the same id and field
type, but the declaring type may vary.
</para>
<para>The following sections examine signatures for these join points
<para>The following sections examine signatures for these join points
in more detail.</para>
<sect2 id="method-call-join-point-signatures" xreflabel="method-call-join-point-signatures">
<title>Method call join point signatures</title>

@@ -213,72 +213,71 @@
</para>

<programlisting><![CDATA[
T t = new T();
t.m("hello"); <= call join point occurs when this line is executed
]]></programlisting>
T t = new T();
t.m("hello"); <= call join point occurs when this line is executed
]]></programlisting>
<para>
Then the signature <literal>R(T) T.m(parameter_types)</literal> is a signature
of the call join point, where <literal>R(T)</literal> is the return
type of <literal>m</literal> in <literal>T</literal>, and
type of <literal>m</literal> in <literal>T</literal>, and
<literal>parameter_types</literal> are the parameter types of
<literal>m</literal>. If <literal>T</literal> itself does not
declare a definition of <literal>m(parameter_types)</literal>, then
<literal>R(T)</literal> is the return type in the definition of
declare a definition of <literal>m(parameter_types)</literal>, then
<literal>R(T)</literal> is the return type in the definition of
<literal>m</literal> that <literal>T</literal> inherits. Given the
call above, and the definition of <literal>T.m</literal>:
call above, and the definition of <literal>T.m</literal>:
</para>
<programlisting><![CDATA[
interface Q {
R m(String s);
}
class P implements Q {
R m(String s) {...}
}
class S extends P {
R' m(String s) {...}
}
class T extends S {}
]]></programlisting>
interface Q {
R m(String s);
}

class P implements Q {
R m(String s) {...}
}

class S extends P {
R' m(String s) {...}
}

class T extends S {}
]]></programlisting>

<para>Then <literal>R' T.m(String)</literal> is a signature of the
call join point for <literal>t.m("hello")</literal>.</para>
<para>
For each ancestor (super-type) <literal>A</literal> of <literal>T</literal>,
For each ancestor (super-type) <literal>A</literal> of <literal>T</literal>,
if <literal>m(parameter_types)</literal> is defined for that super-type, then
<literal>R(A) A.m(parameter_types)</literal> is a signature of the call join
point, where <literal>R(A)</literal> is the return type of <literal>
m(parameter_types)</literal> as defined in <literal>A</literal>, or as inherited
by <literal>A</literal> if <literal>A</literal> itself does not
provide a definition of <literal>m(parameter_types)</literal>.
provide a definition of <literal>m(parameter_types)</literal>.
</para>
<para>
Continuing the example from above,we can deduce that
</para>

<programlisting><![CDATA[
R' S.m(String)
R P.m(String)
R Q.m(String)
]]></programlisting>
R' S.m(String)
R P.m(String)
R Q.m(String)
]]></programlisting>
<para>are all additional signatures for the call join point arising
from the call <literal>t.m("hello")</literal>. Thus this call
join point has four signatures in total. Every signature has the same
id and parameter types, and a different declaring type.</para>
</sect2>
<sect2 id="method-execution-join-point-signatures" xreflabel="method-execution-join-point-signatures">
<title>Method execution join point signatures</title>
<para>Join point signatures for execution join points are defined
in a similar manner to signatures for call join points. Given the
hierarchy:
@@ -286,39 +285,38 @@


<programlisting><![CDATA[
interface Q {
R m(String s);
}
class P implements Q {
R m(String s) {...}
}
class S extends P {
R' m(String s) {...}
}
class T extends S { }
class U extends T {
R' m(String s) {...}
}
]]></programlisting>
interface Q {
R m(String s);
}

class P implements Q {
R m(String s) {...}
}

class S extends P {
R' m(String s) {...}
}

class T extends S { }

class U extends T {
R' m(String s) {...}
}
]]></programlisting>

<para>Then the execution join point signatures arising as a result
of the call to <literal>u.m("hello")</literal> are: </para>

<programlisting><![CDATA[
R' U.m(String)
R' S.m(String)
R P.m(String)
R Q.m(String)
]]></programlisting>
R' U.m(String)
R' S.m(String)
R P.m(String)
R Q.m(String)
]]></programlisting>

<para>Each signature has the same id and parameter types, and a
<para>Each signature has the same id and parameter types, and a
different declaring type. There is one signature for each type
that provides its own declaration of the method. Hence in this
that provides its own declaration of the method. Hence in this
example there is no signature <literal>R' T.m(String)</literal>
as <literal>T</literal> does not provide its own declaration of
the method.</para>
@@ -330,11 +328,11 @@

<para>
For a field get join point where an access is made to a field
<literal>f</literal> of type <literal>F</literal>
<literal>f</literal> of type <literal>F</literal>
on a object with declared type <literal>T</literal>, then
<literal>F T.f</literal> is a signature of the get join point.
<literal>F T.f</literal> is a signature of the get join point.
</para>
<para>
If <literal>T</literal> does not directly declare a member
<literal>f</literal>, then for each super type <literal>S</literal>
@@ -344,18 +342,18 @@
of the join point. For example, given the hierarchy:
</para>

<programlisting><![CDATA[
class P {
F f;
}
class S extends P {
F f;
}
class T extends S { }
]]></programlisting>
<programlisting><![CDATA[
class P {
F f;
}
class S extends P {
F f;
}
class T extends S { }
]]></programlisting>
<para>
Then the join point signatures for a field get join point of
the field <literal>f</literal> on an object with declared type
@@ -363,26 +361,26 @@
</para>

<programlisting><![CDATA[
F S.f
F T.f
]]></programlisting>
F S.f
F T.f
]]></programlisting>

<para>The signatures for a field set join point are derived in an
identical manner.</para>
</sect2>
</sect1>
<sect1 id="join-point-modifiers">
<title>Join Point Modifiers</title>
<para>Every join point has a single set of modifiers - these include
the standard Java modifiers such as <literal>public, private,
static, abstract</literal> etc., any annotations, and the throws
clauses of methods and constructors. These modifiers are the
modifiers of the <emphasis>subject</emphasis> of the join point.</para>
<para>
The following table defines the join point subject for each kind
of join point.
@@ -447,40 +445,40 @@
</row>
</tbody>
</tgroup>
</informaltable>
</informaltable>

<para>For example, given the following types</para>

<programlisting><![CDATA[
public class X {
@Foo
protected void doIt() {...}
}
public class Y extends X {
public void doIt() {...}
}
]]></programlisting>
public class X {
@Foo
protected void doIt() {...}
}
public class Y extends X {
public void doIt() {...}
}
]]></programlisting>
<para>Then the modifiers for a call to <literal>(Y y) y.doIt()</literal>
are simply <literal>{public}</literal>. The modifiers for a call to
<literal>(X x) x.doIt()</literal> are <literal>{@Foo,protected}</literal>.
</para>
</sect1>
<sect1 id="join-point-matching-summary">
<title>Summary of Join Point Matching</title>

<para>
A join point has potentially multiple signatures, but only one set of
modifiers. <emphasis>A kinded primitive pointcut matches a particular join point
modifiers. <emphasis>A kinded primitive pointcut matches a particular join point
if and only if</emphasis>:
</para>
<orderedlist>
<listitem>They are of the same kind</listitem>
<listitem>The signature pattern (exactly) matches at least one
<listitem>The signature pattern (exactly) matches at least one
signature of the join point</listitem>
<listitem>The modifiers pattern matches the modifiers of the
subject of the join point</listitem>
@@ -489,39 +487,38 @@
<para>Given the hierarchy</para>

<programlisting><![CDATA[
interface Q {
R m(String s);
}
class P implements Q {
@Foo
public R m(String s) {...}
}
class S extends P {
@Bar
public R' m(String s) {...}
}
class T extends S {}
]]></programlisting>
interface Q {
R m(String s);
}

class P implements Q {
@Foo
public R m(String s) {...}
}

class S extends P {
@Bar
public R' m(String s) {...}
}

class T extends S {}
]]></programlisting>

<para>and the program fragment:</para>
<programlisting><![CDATA[
P p = new P();
S s = new S();
T t = new T();
...
p.m("hello");
s.m("hello");
t.m("hello");
]]></programlisting>
P p = new P();
S s = new S();
T t = new T();
...
p.m("hello");
s.m("hello");
t.m("hello");
]]></programlisting>
<para>
The the pointcut <literal>call(@Foo R P.m(String))</literal> matches the
call <literal>p.m("hello")</literal> since both the signature and the
call <literal>p.m("hello")</literal> since both the signature and the
modifiers match. It does not match the call <literal>s.m("hello")</literal>
because even though the signature pattern matches one of the signatures
of the join point, the modifiers pattern does not match the modifiers of
@@ -534,6 +531,6 @@
signature pattern does not match any signature for the call join point
of m in P.</para>
</sect1>
</chapter>


+ 44
- 48
docs/adk15ProgGuideDB/miscellaneous.xml View File

@@ -1,10 +1,10 @@
<chapter id="miscellaneous" xreflabel="Miscellaneous Changes">

<title>Other Changes in AspectJ 5</title>
<sect1 id="pointcuts-change">
<title>Pointcuts</title>
<para>
AspectJ 5 is more liberal than AspectJ 1.2.1 in accepting pointcut expressions
that bind context variables in more than one location. For example, AspectJ
@@ -12,10 +12,10 @@
</para>

<programlisting><![CDATA[
pointcut foo(Foo foo) : (execution(* *(..)) && this(foo) ) ||
(set(* *) && target(foo));
]]></programlisting>
pointcut foo(Foo foo) : (execution(* *(..)) && this(foo) ) ||
(set(* *) && target(foo));
]]></programlisting>
<para>
whereas this expression is permitted in AspectJ 5. Each context variable must
be bound exactly once in each branch of a disjunction, and the disjunctive branches
@@ -23,63 +23,59 @@
can be both an execution join point and a set join point so the two branches
are mutually exclusive.
</para>
</sect1>
<sect1 id="declare-soft-change">
<title>Declare Soft</title>
<para>
The semantics of the <literal>declare soft</literal> statement have been
refined in AspectJ 5 to only soften exceptions that are not already runtime
The semantics of the <literal>declare soft</literal> statement have been
refined in AspectJ 5 to only soften exceptions that are not already runtime
exceptions. If the exception type specified in a declare soft statement is <literal>RuntimeException</literal>
or a subtype of <literal>RuntimeException</literal> then a new XLint warning will be issued:</para>
<programlisting><![CDATA[
declare soft : SomeRuntimeException : execution(* *(..));
>> "SomeRuntimeException will not be softened as it is already a RuntimeException" [XLint:runtimeExceptionNotSoftened]
]]></programlisting>
declare soft : SomeRuntimeException : execution(* *(..));
>> "SomeRuntimeException will not be softened as it is already a RuntimeException" [XLint:runtimeExceptionNotSoftened]
]]></programlisting>
<para>
This XLint message can be controlled by setting the <literal>runtimeExceptionNotSoftened</literal> XLint parameter.
</para>
<para>
If the exception type specified in a declare soft statement is a super type of <literal>RuntimeException</literal>
(such as <literal>Exception</literal> for example) then any <emphasis>checked</emphasis> exception thrown at a matched join point,
where the exception is an instance of the softened exception, will be softened to an
<literal>org.aspectj.lang.SoftException</literal>.
(such as <literal>Exception</literal> for example) then any <emphasis>checked</emphasis> exception thrown at a matched join point,
where the exception is an instance of the softened exception, will be softened to an
<literal>org.aspectj.lang.SoftException</literal>.
</para>
<programlisting><![CDATA[
public aspect SoftenExample {
declare soft : Exception : execution(* Foo.*(..));
}
class Foo {
public static void main(String[] args) {
Foo foo = new Foo();
foo.foo();
foo.bar();
}
void foo() throws Exception {
throw new Exception(); // this will be converted to a SoftException
}
void bar() throws Exception {
throw new RuntimeException(); // this will remain a RuntimeException
}
}
]]></programlisting>
public aspect SoftenExample {
declare soft : Exception : execution(* Foo.*(..));
}

class Foo {
public static void main(String[] args) {
Foo foo = new Foo();
foo.foo();
foo.bar();
}

void foo() throws Exception {
throw new Exception(); // this will be converted to a SoftException
}

void bar() throws Exception {
throw new RuntimeException(); // this will remain a RuntimeException
}
}
]]></programlisting>


</sect1>


</chapter>


+ 55
- 55
docs/adk15ProgGuideDB/pertypewithin.xml View File

@@ -3,61 +3,61 @@
<title>The pertypewithin Aspect Instantiation Model</title>

<para>
AspectJ 5 defines a new per-clause type for aspect instantiation:
AspectJ 5 defines a new per-clause type for aspect instantiation:
<literal>pertypewithin</literal>. Unlike the other per-clauses,
<literal>pertypewithin</literal> takes a type pattern:
<literal>pertypewithin</literal> takes a type pattern:
</para>
<programlisting><![CDATA[
PerTypeWithin := 'pertypewithin' '(' OptionalParensTypePattern ')'
]]></programlisting>
PerTypeWithin := 'pertypewithin' '(' OptionalParensTypePattern ')'
]]></programlisting>
<para>
When an aspect is declared using the <literal>pertypewithin</literal>
instantiation model, one new aspect instance will be created for each
type matched by the associated type pattern.
</para>
<para>
Pertypewithin aspects have <literal>aspectOf</literal> and
Pertypewithin aspects have <literal>aspectOf</literal> and
<literal>hasAspect</literal> methods with the following signatures:
</para>
<programlisting><![CDATA[
/**
* return true if this aspect has an instance associated with
* the given type.
*/
public static boolean hasAspect(Class clazz)
/**
* return the instance associated with the given type.
* Throws NoAspectBoundException if there is no such
* aspect.
*/
public static P aspectOf(Class clazz)
]]></programlisting>
/**
* return true if this aspect has an instance associated with
* the given type.
*/
public static boolean hasAspect(Class clazz)
/**
* return the instance associated with the given type.
* Throws NoAspectBoundException if there is no such
* aspect.
*/
public static P aspectOf(Class clazz)
]]></programlisting>
<para>
Where <literal>P</literal> is the type of the <literal>pertypewithin</literal>
aspect.
</para>
<para>
In addition, <literal>pertypewithin</literal> aspects have a
In addition, <literal>pertypewithin</literal> aspects have a
<literal>getWithinTypeName</literal> method that can be called
to return the package qualified name of the type for which the
aspect instance has been created.
</para>
<programlisting><![CDATA[
/**
* return the package qualified name (eg. com.foo.MyClass) of the type
* for which the aspect instance has been instantiated.
*/
public String getWithinTypeName()
]]></programlisting>
/**
* return the package qualified name (eg. com.foo.MyClass) of the type
* for which the aspect instance has been instantiated.
*/
public String getWithinTypeName()
]]></programlisting>
<para>
In common with the other per-clause instantiation models, the execution
of any advice declared within a <literal>pertypewithin</literal> aspect
@@ -68,24 +68,24 @@
</para>

<programlisting><![CDATA[
import java.util.*;
public aspect InstanceTracking pertypewithin(org.xyz..*) {
// use WeakHashMap for auto-garbage collection of keys
private Map<Object,Boolean> instances = new WeakHashMap<Object,Boolean>();
after(Object o) returning() : execution(new(..)) && this(o) {
instances.put(o,true);
}
public Set<?> getInstances() {
return instances.keySet();
}
}
]]></programlisting>
import java.util.*;
public aspect InstanceTracking pertypewithin(org.xyz..*) {
// use WeakHashMap for auto-garbage collection of keys
private Map<Object,Boolean> instances = new WeakHashMap<Object,Boolean>();
after(Object o) returning() : execution(new(..)) && this(o) {
instances.put(o,true);
}
public Set<?> getInstances() {
return instances.keySet();
}
}
]]></programlisting>
<para>
Then one aspect instance will be created for each type within
<literal>org.xyz..*</literal>. For each aspect instance, the
@@ -93,18 +93,18 @@
within the matched per-type-within type. The net result is that
the aspect tracks all known instances of each type within
<literal>org.xyz..*</literal>. To get access to the instances, a
programmer can simply write
programmer can simply write
<literal>InstanceTracking.aspectOf(org.xyz.SomeType.class).getInstances()</literal>.
</para>
<para>
The <literal>pertypewithin</literal> aspect instantiation model should
be used when the implementation of a crosscutting concern requires that
some state be maintained for each type in a set of types. To maintain
state for a single type, it is easier to use a static inter-type declared
field. Examples of usage include instance tracking, profiling, and the
implementation of a common tracing idiom that uses one Logger per
implementation of a common tracing idiom that uses one Logger per
traced class.
</para>
</para>
</chapter>


+ 71
- 72
docs/adk15ProgGuideDB/varargs.xml View File

@@ -1,21 +1,21 @@
<chapter id="varargs" xreflabel="Varargs">

<title>Varargs</title>
<sect1 id="varargs-inJava5" xreflabel="Varargs in Java 5">
<title>Variable-length Argument Lists in Java 5</title>
<para>
Java 5 (and hence AspectJ 5) allows you to specify methods that take a
Java 5 (and hence AspectJ 5) allows you to specify methods that take a
variable number of arguments of a specified type. This is achieved using
an ellipsis (...) in the method signature as shown:
an ellipsis (...) in the method signature as shown:
</para>

<programlisting><![CDATA[
public void foo(int i, String... strings) {
}
]]></programlisting>
public void foo(int i, String... strings) {
}
]]></programlisting>
<para>
A method or constructor may take at most one variable length argument, and
this must always be the last declared argument in the signature.
@@ -23,82 +23,81 @@

<sect2 id="calling-methods-and-constructors-with-variable-length-arguments" xreflabel="calling-methods-and-constructors-with-variable-length-arguments">
<title>Calling Methods and Constructors with variable-length arguments</title>
<para>
A <emphasis>varargs</emphasis> method may be called with zero or more arguments
in the variable argument position. For example, given the definition of
in the variable argument position. For example, given the definition of
<literal>foo</literal> above, the following calls are all legal:
</para>

<programlisting><![CDATA[
foo(5);
foo(5,"One String");
foo(7,"One String","Two Strings");
foo(3,"One String","Two Strings","Three Strings");
]]></programlisting>
foo(5);
foo(5,"One String");
foo(7,"One String","Two Strings");
foo(3,"One String","Two Strings","Three Strings");
]]></programlisting>

<para>A <emphasis>varargs</emphasis> parameter is treated as an array within the
<para>A <emphasis>varargs</emphasis> parameter is treated as an array within the
defining member. So in the body of <literal>foo</literal> we could write for example:
</para>

<programlisting><![CDATA[
public void foo(int i, String... strings) {
String[] someStrings = strings;
// rest of method body
}
]]></programlisting>
public void foo(int i, String... strings) {
String[] someStrings = strings;
// rest of method body
}
]]></programlisting>

<para>One consequence of this treatment of a varargs parameter as an array
is that you can also call a varargs method with an array:</para>

<programlisting><![CDATA[
foo(7,new String[] {"One String","Two Strings"});
]]></programlisting>
foo(7,new String[] {"One String","Two Strings"});
]]></programlisting>
</sect2>
</sect1>

<sect1 id="varargs-in-pcds">
<title>Using Variable-length arguments in advice and pointcut expressions</title>
<para>AspectJ 5 allows variable-length arguments to be used for methods declared within
aspects, and for inter-type declared methods and constructors, in accordance with the rules
outlined in the previous section.</para>
<para>
AspectJ 5 also allows variable length arguments to be matched by pointcut expressions and
bound as formals in advice.
</para>
<sect2 id="matching-signatures-based-on-variable-length-argument-types" xreflabel="matching-signatures-based-on-variable-length-argument-types">
<title>Matching signatures based on variable length argument types</title>
<para>
Recall from the definition of signature patterns given in the chapter on
annotations (<xref linkend="signaturePatterns"/>), that <literal>MethodPattern</literal>
and <literal>ConstructorPattern</literal> are extended to allow a <literal>varargs</literal>
pattern in the last argument position of a method or constructor signature.
</para>
<programlisting><![CDATA[
FormalsPattern := '..' (',' FormalsPatternAfterDotDot)? |
OptionalParensTypePattern (',' FormalsPattern)* |
TypePattern '...'
FormalsPatternAfterDotDot :=
OptionalParensTypePattern (',' FormalsPatternAfterDotDot)* |
TypePattern '...'

]]></programlisting>

<programlisting><![CDATA[
FormalsPattern := '..' (',' FormalsPatternAfterDotDot)? |
OptionalParensTypePattern (',' FormalsPattern)* |
TypePattern '...'

FormalsPatternAfterDotDot :=
OptionalParensTypePattern (',' FormalsPatternAfterDotDot)* |
TypePattern '...'
]]></programlisting>

<para>
Method and constructor patterns are used in the <literal>call</literal>,
<literal>execution</literal>, <literal>initialization</literal>,
<literal>preinitialization</literal>, and <literal>withincode</literal>
pointcut designators. Some examples of usage follow:
</para>
</para>
<variablelist>

<varlistentry>
@@ -121,7 +120,7 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>initialization(org.xyz.*.new((Foo || Goo)...))</term>
<listitem>
@@ -134,30 +133,30 @@
</para>
</listitem>
</varlistentry>
</variablelist>
<para>A variable argument parameter and an array parameter are treated as distinct
signature elements, so given the method definitions:
</para>

<programlisting><![CDATA[
void foo(String...);
void bar(String[]);
]]></programlisting>
void foo(String...);
void bar(String[]);
]]></programlisting>
<para>
The pointcut <literal>execution(* *.*(String...))</literal> matches the execution join point
for <literal>foo</literal>, but not <literal>bar</literal>. The pointcut
for <literal>foo</literal>, but not <literal>bar</literal>. The pointcut
<literal>execution(* *.*(String[]))</literal> matches the execution join point
for <literal>bar</literal> but not <literal>foo</literal>.
</para>
</sect2>
<sect2 id="exposing-variable-length-arguments-as-context-in-pointcuts-and-advice" xreflabel="exposing-variable-length-arguments-as-context-in-pointcuts-and-advice">
<title>Exposing variable-length arguments as context in pointcuts and advice</title>
<para>
When a varargs parameter is used within the body of a method, it has
an array type, as discussed in the introduction to this section. We follow the
@@ -166,9 +165,9 @@
</para>

<programlisting><![CDATA[
public void foo(int i, String... strings) {
}
]]></programlisting>
public void foo(int i, String... strings) {
}
]]></programlisting>

<para>
The call or execution join points for <literal>foo</literal> will be matched
@@ -176,34 +175,34 @@
to use the varargs syntax within an args pointcut designator - so you
<emphasis>cannot</emphasis> write <literal>args(int,String...)</literal>.
</para>
<para>
Binding of a varargs parameter in an advice statement is straightforward:
</para>
<programlisting><![CDATA[
before(int i, String[] ss) : call(* foo(int,String...)) && args(i,ss) {
// varargs String... argument is accessible in advice body through ss
// ...
}
]]></programlisting>
before(int i, String[] ss) : call(* foo(int,String...)) && args(i,ss) {
// varargs String... argument is accessible in advice body through ss
// ...
}
]]></programlisting>
<para>Since you cannot use the varargs syntax in the <literal>args</literal>
pointcut designator, you also cannot use the varargs syntax to declare
advice parameters.</para>
<para>Note: the proposal in this section does not allow you to
advice parameters.</para>
<para>Note: the proposal in this section does not allow you to
distinguish between a join point with a signature (int, String...)
and a join point with a signature (int, String[]) based
and a join point with a signature (int, String[]) based
<emphasis>solely</emphasis> on the use of the <literal>args</literal>
pointcut designator. If this distinction is required, <literal>args</literal>
can always be coupled with <literal>call</literal> or
can always be coupled with <literal>call</literal> or
<literal>execution</literal>.</para>

</sect2>
</sect1>
</chapter>



+ 6
- 12
docs/build.xml View File

@@ -382,10 +382,10 @@
</antcall>
<!-- pdf TODO pdf rendering completes, result is awful
<antcall target="xml-pdf">
<param name="xml-source-dir"
<param name="xml-source-dir"
value="${docs.src.dir}/${guide.dir}"/>
<param name="xml-source-root" value="${guide.name}.xml"/>
<param name="pdf-target-file"
<param name="pdf-target-file"
value="${docs.dist.dir}/doc/${guide.name}.pdf"/>
</antcall>
-->
@@ -463,15 +463,9 @@
classname="org.apache.fop.tools.anttasks.Fop"
>
<classpath>
<fileset dir="${aspectj.modules.lib.dir}/docbook/fop">
<fileset dir="${aspectj.modules.lib.dir}/docbook">
<include name="fop.jar" />
<include name="batik.jar" />
<include name="avalon.jar" />
</fileset>
<fileset dir="${aspectj.modules.lib.dir}/ant">
<include name="xalan.jar" />
<include name="xercesImpl.jar" />
<include name="xml-apis.jar" />
</fileset>
</classpath>
</taskdef>
@@ -488,10 +482,10 @@

<target name="xml-html"
description="antcall(xml-source-dir, xml-source-root, xml-target-dir, xml-target-file)
convert xml to html using docbook. parameters:
xml-source-dir # base directory of source
convert xml to html using docbook. parameters:
xml-source-dir # base directory of source
xml-source-root # base file of source (relative to xml-source-dir)
xsl-source-file # xsl transform to apply (use chunk.xsl.source by default)
xsl-source-file # xsl transform to apply (use chunk.xsl.source by default)
xml-target-dir # target directory for output (used as xsl param base.dir)
xml-target-file # full path to output file in xml-source-dir, ignored when chunking
xml-html-copy # copy files to target (defaults to *.gif,*.png)

+ 19
- 19
docs/devGuideDB/aj.xml View File

@@ -1,9 +1,9 @@
<refentry id="aj-ref" xreflabel="The aj Command-line Reference">
<refnamediv>
<refnamediv>
<refname>aj</refname>
<refpurpose>command-line launcher for basic load-time weaving</refpurpose>
</refnamediv>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
@@ -16,39 +16,39 @@
</refsynopsisdiv>
<refsect1 id="aj" xreflabel="aj">
<title>Description</title>
<para>The
<command>aj</command> command runs Java programs in Java 1.4 or
later by setting up
<literal>WeavingURLClassLoader</literal> as the system class
loader, to do load-time bytecode weaving. </para>
<para> The arguments are the same as those used to launch the Java program.
Users should define the environment variables
<literal>CLASSPATH</literal> and
<literal>ASPECTPATH</literal>. </para>
<para>For more information and alternatives for load-time weaving,
see <xref linkend="ltw"/>.
</para>
<refsect2>
<title>Examples</title>
<example id="simpleajexample">
<title>A simple example</title>
<para>Use ajc to build a library, then weave at load time</para>
<programlisting><![CDATA[
REM compile library
${ASPECTJ_HOME}\bin\ajc.bat -outjar lib\aspects.jar @aspects.lst
REM run, weaving into application at load-time set
ASPECTPATH=lib\aspects.jar set CLASSPATH=app\app.jar
${ASPECTJ_HOME}\bin\aj.bat com.company.app.Main "Hello, World!"
]]> </programlisting>
<programlisting><![CDATA[
REM compile library
${ASPECTJ_HOME}\bin\ajc.bat -outjar lib\aspects.jar @aspects.lst
REM run, weaving into application at load-time set
ASPECTPATH=lib\aspects.jar set CLASSPATH=app\app.jar
${ASPECTJ_HOME}\bin\aj.bat com.company.app.Main "Hello, World!"
]]> </programlisting>
</example>
</refsect2>
</refsect1>

+ 85
- 81
docs/devGuideDB/ajbrowser.xml View File

@@ -5,33 +5,33 @@
<sect1 id="ajbrowser-intro">
<title>Introduction</title>
<para>
AJBrowser presents a GUI for compiling programs with ajc
AJBrowser presents a GUI for compiling programs with ajc
and navigating crosscutting structure.
</para>
<para>
The AspectJ Browser can edit program source files,
compile using the AspectJ compiler <literal>ajc</literal>
run a program,
and graphically navigate the program's
and graphically navigate the program's
crosscutting structure.
For more information on <literal>ajc</literal>,
For more information on <literal>ajc</literal>,
see <xref linkend="ajc-ref"/>.
</para>
<para>
Launch the browser from the command line either
by typing "ajbrowser" to invoke the script in
<literal>{aspectj}/bin</literal>
(if AspectJ is installed correctly)
(if AspectJ is installed correctly)
or by using the
<literal>aspectjtools.jar</literal> directly,
and specifying no arguments or some number of
build configuration files
build configuration files
(suffix <literal>.lst</literal>):
<programlisting>
java -jar aspectj1.1/lib/aspectjtools.jar aspectj1.1/doc/examples/spacewar/debug.lst
java -jar aspectj1.1/lib/aspectjtools.jar aspectj1.1/doc/examples/spacewar/debug.lst
</programlisting>
</para>

@@ -47,35 +47,35 @@
Because <literal>ajc</literal> requires all sources to be specified
(at least using the <literal>-sourceroots</literal> option),
most users create <literal>.lst</literal> files that list
the files to compile (one argument per line, globbing
the files to compile (one argument per line, globbing
permitted - for more details, see <xref linkend="ajc-ref"/>).
</para>
<para>
To work with a particular program, select the
To work with a particular program, select the
corresponding ".lst" build configuration file
from the GUI using the File menu, "open" item,
or by using the
from the GUI using the File menu, "open" item,
or by using the
"Open Build Configuration" button
(<inlinemediaobject>
<imageobject>
<imagedata fileref="openConfig.gif"/>
</imageobject>
</inlinemediaobject>).
You can populate the build list from the command line
by passing any number of ".lst" paths.
(However, if you pass in any non-".lst" arguments,
by passing any number of ".lst" paths.
(However, if you pass in any non-".lst" arguments,
it will run the command-line compiler directly.)
</para>
<para>
To switch between build configurations,
select, add, or remove them
using the corresponding toolbar buttons.
using the corresponding toolbar buttons.
</para>
<para>Global build options are stored in an
<para>Global build options are stored in an
<literal>.ajbrowser</literal> file in your HOME directory.
Edit these from the GUI by clicking the "Options" button
or selecting the Tools menu item "Options...".
Edit these from the GUI by clicking the "Options" button
or selecting the Tools menu item "Options...".
This is how to set classpath, aspectpath, etc.
</para>
<para>The following sections walk through a build.
@@ -90,8 +90,8 @@
<imageobject>
<imagedata fileref="build.gif"/>
</imageobject>
</inlinemediaobject>), or
or use the tools menu.
</inlinemediaobject>), or
or use the tools menu.
</para>
<!--
<para>To build using AspectJ 1.1's incremental mode,
@@ -99,7 +99,7 @@
the <literal>AspectJ Build Options</literal> tab
of the <literal>Options</literal> dialog.
Once in incremental mode, you can force a full rebuild
by holding the shift key down when selecting the
by holding the shift key down when selecting the
build menu item or button.
</para>
-->
@@ -109,18 +109,20 @@
(see label 1 in the graphic below).
(If you get classpath or other errors, set up the
global build options as described above.)
<inlinemediaobject>
<imageobject>
<imagedata fileref="ajbrowser-building.gif"/>
</imageobject>
</inlinemediaobject>
</para>
<para>
<inlinemediaobject>
<imageobject>
<imagedata fileref="ajbrowser-building.gif"/>
</imageobject>
</inlinemediaobject>
</para>
</sect2>
</sect1>

<sect1 id="ajbrowser-navigating">
<title>Navigating Program Structure</title>
<para>
Select nodes in the program structure by clicking them (see label 2).
If one node is related to one or more other nodes by an association the
@@ -128,11 +130,13 @@
displayed in italics. Links to other structure nodes appear in blue
below the association. If there is no corresponding source for the
link it will appear light-blue.
<inlinemediaobject>
<imageobject>
<imagedata fileref="ajbrowser-building.gif"/>
</imageobject>
</inlinemediaobject>
</para>
<para>
<inlinemediaobject>
<imageobject>
<imagedata fileref="ajbrowser-building.gif"/>
</imageobject>
</inlinemediaobject>
</para>

<sect2 id="example" xreflabel="example">
@@ -175,22 +179,22 @@
</inlinemediaobject>). Click the <literal>Build Options</literal> tab
to view the Build Paths pane. Edit the classpath entry to use your
install location. For example, if you ran from the base Aspectj
directory, the classpath need only include
directory, the classpath need only include
<literal>lib/aspectjrt.jar</literal> (though the browser may populate
the classpath with the bootclasspath and classpath initially.)
the classpath with the bootclasspath and classpath initially.)
Be sure to use the
<literal>lib/aspectjrt.jar</literal> that came with the browser.
</para>

<para>
<inlinemediaobject>
<imageobject>
<imagedata fileref="ajbrowser-options.gif"/>
</imageobject>
</inlinemediaobject>>
</para>
<para>
<inlinemediaobject>
<imageobject>
<imagedata fileref="ajbrowser-options.gif"/>
</imageobject>
</inlinemediaobject>
</para>

</listitem>
</listitem>

<listitem> <para>Different structure views: The structure tree at the
left can display different orderings and granularity for structure:
@@ -274,13 +278,13 @@
<literal>affects</literal> relations will list different
kinds of join points - constructor or method calls, etc.
</para>
<para>Note that the AspectJ browser can only display
<para>Note that the AspectJ browser can only display
static structure (whether hierarchical or crosscutting).
That means that dynamicly-determined pointcuts (like
<literal>cflow(pointcut)</literal>)
<literal>cflow(pointcut)</literal>)
will not be shown as picking out static points in
source code. Displayable pointcuts roughly correspond
to those that can be used in a
to those that can be used in a
<literal>declare error</literal> statement.
</para>
</listitem>
@@ -297,19 +301,19 @@
You can run in the same VM or spawn a new process;
the latter is generally better for GUI programs.
</para>
<para>Both require that any classpath you set be specified
<para>Both require that any classpath you set be specified
using platform-specific paths and path separators (the
compiler might be more tolerant).
Output and error streams will be
merged into the streams of the browser (using separate
threads, so it may take a few seconds for the pipe
threads to gain control.) Errors should
threads to gain control.) Errors should
be detected and displayed in a dialog.
</para>
<para>
The GUI does not support killing a running program,
so if your program might hang,
be sure to save your files since you may need to
be sure to save your files since you may need to
kill the browser itself to kill its child processes.
</para>
</sect1>
@@ -318,36 +322,36 @@
<title>Isolating problems running the AspectJ browser</title>

<para>
If you have problems with the browser not solved by the documentation,
please try to see if you have the same problems when running ajc
If you have problems with the browser not solved by the documentation,
please try to see if you have the same problems when running ajc
directly on the command line.
</para>
<itemizedlist>
<listitem><para>
If the problem occurs on the command line also, then the problem
is not in the browser.
If the problem occurs on the command line also, then the problem
is not in the browser.
(It may be in the compiler; please send bug reports.)
</para></listitem>
<listitem><para>
If the problem does not occur on the command line, then it may
If the problem does not occur on the command line, then it may
lie in the parameters you are supplying in the build options.
</para></listitem>
<listitem><para>
If the build options look correct and the problem only occurs
If the build options look correct and the problem only occurs
when building from the browser, then please submit a bug report.
</para></listitem>
</para></listitem>
</itemizedlist>

<sect2 id="ajbrowser-knownProblems">
<title>Known issues with the AspectJ browser</title>
<para>
For the most up-to-date information on known problems,
see the
For the most up-to-date information on known problems,
see the
<ulink url="http://bugs.eclipse.org/bugs">bug database</ulink>
for unresolved
for unresolved
<ulink url="http://bugs.eclipse.org/bugs/buglist.cgi?&amp;product=AspectJ&amp;component=Compiler&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">
compiler bugs
</ulink> or
</ulink> or
<ulink url="http://bugs.eclipse.org/bugs/buglist.cgi?&amp;product=AspectJ&amp;component=IDE&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">
IDE bugs
</ulink>.
@@ -355,55 +359,55 @@
<para>
<itemizedlist>
<listitem><para>
Memory and forking: Users email most about the browser task running
out of memory.
This is not a problem with the browser; some compiles take a lot of
Memory and forking: Users email most about the browser task running
out of memory.
This is not a problem with the browser; some compiles take a lot of
memory, often more than similar compiles using javac.
The browser does not support forking, so the only solution is to
edit the java command line or script that launches the browser
to add memory.
</para></listitem>
</para></listitem>
<listitem><para>
Editing build configuration files: this is not currently supported.
</para></listitem>
</para></listitem>
<listitem><para>
The structure model is incomplete after incremental compiles.
To get a complete structure model requires a full build.
</para></listitem>
</para></listitem>
<listitem><para>
If you change the output directory, you must do a
full build.
</para></listitem>
full build.
</para></listitem>
</itemizedlist>
</para>
</para>
</sect2>
<sect2 id="ajbrowser-limitations">
<title>Limitations</title>
<para>
<para>
<itemizedlist>
<listitem><para>
The AJBrowser expects the package and directory structure to match. If they do not
The AJBrowser expects the package and directory structure to match. If they do not
it will be unable to browse to the corresponding file.
</para></listitem>
</para></listitem>
<listitem><para>
The "Run" feature launches applications in the same VM. As a result, if a Swing application
is disposed the AJBrowser will be disposed as well.
</para></listitem>
</para></listitem>
</itemizedlist>
</para>
</sect2>
<sect2 id="ajbrowser-feedback">
<title>AspectJ Browser questions and bugs</title>
<para>
You can send email to
<para>
You can send email to
<ulink url="mailto:aspectj-users@dev.eclipse.org">
aspectj-users@dev.eclipse.org</ulink>.
(Do join the list to participate!)
We also welcome any bug reports, patches, and feature requests;
you can submit them to the bug database at
aspectj-users@dev.eclipse.org</ulink>.
(Do join the list to participate!)
We also welcome any bug reports, patches, and feature requests;
you can submit them to the bug database at
<ulink url="http://bugs.eclipse.org/bugs">
http://bugs.eclipse.org/bugs</ulink>
using the AspectJ product and IDE component.
using the AspectJ product and IDE component.
</para>
</sect2>
</sect1>

+ 140
- 139
docs/devGuideDB/ajc.xml View File

@@ -1,9 +1,9 @@
<refentry id="ajc-ref" xreflabel="The ajc Command-line Reference">
<refnamediv>
<refnamediv>
<refname>ajc</refname>
<refpurpose>compiler and bytecode weaver for the AspectJ and Java languages</refpurpose>
</refnamediv>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
@@ -19,8 +19,8 @@
<refsect1 id="ajc" xreflabel="ajc">
<title>Description</title>

<para>The <command>ajc</command> command compiles and weaves AspectJ and
Java source and .class files, producing .class files compliant with any
<para>The <command>ajc</command> command compiles and weaves AspectJ and
Java source and .class files, producing .class files compliant with any
Java VM (1.1 or later). It combines compilation and bytecode weaving
and supports incremental builds; you can also weave bytecode
at run-time using <xref linkend="ltw"/>.
@@ -29,28 +29,28 @@
<para> The arguments after the options specify the source file(s) to compile.
To specify source classes, use <parameter>-inpath</parameter> (below).
Files may be listed directly on the command line or in a file.
The <parameter>-argfile <replaceable>file</replaceable></parameter>
The <parameter>-argfile <replaceable>file</replaceable></parameter>
and <parameter>@<replaceable>file</replaceable></parameter> forms
are equivalent, and are interpreted as meaning all the arguments
listed in the specified file.
are equivalent, and are interpreted as meaning all the arguments
listed in the specified file.
</para>

<para>
<command>Note:</command>
<para>
<command>Note:</command>
You must explicitly pass <command>ajc</command> all necessary sources.
Be sure to include the source not only for the
aspects or pointcuts but also for any affected types.
Specifying all sources is necessary because, unlike javac, ajc does not
aspects or pointcuts but also for any affected types.
Specifying all sources is necessary because, unlike javac, ajc does not
search the sourcepath for classes.
(For a discussion of what affected types might be required,
see <ulink url="../progguide/implementation.html">The AspectJ
Programming Guide, Implementation Appendix</ulink>.)
</para>
<para>
To specify sources, you can list source files as arguments or use the
To specify sources, you can list source files as arguments or use the
options <parameter>-sourceroots</parameter> or <parameter>-inpath</parameter>.
If there are multiple sources for any type, the result is undefined
since ajc has no way to determine which source is correct. (This
since ajc has no way to determine which source is correct. (This
happens most often when users include the destination directory
on the inpath and rebuild.)
</para>
@@ -71,12 +71,12 @@
<varlistentry>
<term>-inpath <replaceable>Path</replaceable></term>
<listitem><para>
Accept as source bytecode any .class files in the
.jar files or directories on Path.
Accept as source bytecode any .class files in the
.jar files or directories on Path.
The output will include these
classes, possibly as woven with any applicable aspects.
Path is a single argument containing
a list of paths to zip files or directories,
a list of paths to zip files or directories,
delimited by the platform-specific path delimiter.
</para></listitem>
</varlistentry>
@@ -87,7 +87,7 @@
Weave binary aspects from jar files and directories on path into all sources.
The aspects should have been output by the same version
of the compiler.
When running the output classes, the run classpath should contain
When running the output classes, the run classpath should contain
all aspectpath entries.
Path, like classpath, is a single argument containing
a list of paths to jar files, delimited by the platform-
@@ -100,7 +100,7 @@
<listitem><para>
The file contains a line-delimited list of arguments.
Each line in the file should contain one option, filename, or
argument string (e.g., a classpath or inpath).
argument string (e.g., a classpath or inpath).
Arguments read from the file are inserted into the argument list
for the command. Relative paths in the file are calculated from
the directory containing the file (not the current working directory).
@@ -146,8 +146,8 @@

<varlistentry>
<term>-sourceroots <replaceable>DirPaths</replaceable></term>
<listitem><para>Find and build all .java or .aj source files under
any directory listed in DirPaths.
<listitem><para>Find and build all .java or .aj source files under
any directory listed in DirPaths.
DirPaths, like classpath, is a single argument containing
a list of paths to directories, delimited by the platform-
specific classpath delimiter.
@@ -183,7 +183,7 @@
<listitem><para>Set default level for messages about potential
programming mistakes in crosscutting code.
{level} may be ignore, warning, or error.
This overrides entries in
This overrides entries in
org/aspectj/weaver/XlintDefault.properties
from aspectjtools.jar, but does not override levels set
using the -Xlintfile option.
@@ -193,7 +193,7 @@
<varlistentry>
<term>-Xlintfile <replaceable>PropertyFile</replaceable></term>
<listitem><para>Specify properties file to set levels for
specific crosscutting messages.
specific crosscutting messages.
PropertyFile is a path to a Java .properties file that
takes the same property names and values as
org/aspectj/weaver/XlintDefault.properties
@@ -220,7 +220,7 @@
<listitem><para>
Specify where to find user class files.
Path is a single argument containing
a list of paths to zip files or directories,
a list of paths to zip files or directories,
delimited by the platform-specific path delimiter.
</para></listitem>
</varlistentry>
@@ -228,10 +228,10 @@
<varlistentry>
<term>-bootclasspath <replaceable>Path</replaceable></term>
<listitem><para>
Override location of VM's bootclasspath
Override location of VM's bootclasspath
for purposes of evaluating types when compiling.
Path is a single argument containing
a list of paths to zip files or directories,
a list of paths to zip files or directories,
delimited by the platform-specific path delimiter.
</para></listitem>
</varlistentry>
@@ -239,10 +239,10 @@
<varlistentry>
<term>-extdirs <replaceable>Path</replaceable></term>
<listitem><para>
Override location of VM's extension directories
Override location of VM's extension directories
for purposes of evaluating types when compiling.
Path is a single argument containing
a list of paths to directories,
a list of paths to directories,
delimited by the platform-specific path delimiter.
</para></listitem>
</varlistentry>
@@ -251,7 +251,7 @@
<term>-d <replaceable>Directory</replaceable></term>
<listitem><para>
Specify where to place generated .class files.
If not specified, <replaceable>Directory</replaceable>
If not specified, <replaceable>Directory</replaceable>
defaults to the current working dir.
</para></listitem>
</varlistentry>
@@ -264,7 +264,7 @@

<varlistentry>
<term>-1.3</term>
<listitem><para>Set compliance level to 1.3
<listitem><para>Set compliance level to 1.3
This implies -source 1.3 and -target 1.1.
</para></listitem>
</varlistentry>
@@ -288,11 +288,11 @@
<listitem><para>Toggle assertions (1.3, 1.4, or 1.5 - default is 1.4).
When using -source 1.3, an assert() statement valid under
Java 1.4 will result in a compiler error.
When using -source 1.4,
treat <literal>assert</literal> as a keyword and
When using -source 1.4,
treat <literal>assert</literal> as a keyword and
implement assertions according to the 1.4 language spec.
When using -source 1.5,
Java 5 language features are permitted.
Java 5 language features are permitted.
</para></listitem>
</varlistentry>

@@ -308,22 +308,22 @@
<varlistentry>
<term>-warn: <replaceable>items</replaceable></term>
<listitem><para>Emit warnings for any instances of
the comma-delimited list of questionable code
the comma-delimited list of questionable code
(eg '-warn:unusedLocals,deprecation'):
<programlisting><!-- unable to embed itemizedlist? -->
constructorName method with constructor name
packageDefaultMethod attempt to override package-default method
deprecation usage of deprecated type or member
maskedCatchBlocks hidden catch block
unusedLocals local variable never read
unusedArguments method argument never read
unusedImports import statement not used by code in file
none suppress all compiler warnings
constructorName method with constructor name
packageDefaultMethod attempt to override package-default method
deprecation usage of deprecated type or member
maskedCatchBlocks hidden catch block
unusedLocals local variable never read
unusedArguments method argument never read
unusedImports import statement not used by code in file
none suppress all compiler warnings
</programlisting>
<literal>-warn:none</literal> does not suppress messages
generated by <literal>declare warning</literal> or
<literal>Xlint</literal>.
</para></listitem>
</varlistentry>

@@ -341,7 +341,7 @@

<varlistentry>
<term>-proceedOnError</term>
<listitem><para>Keep compiling after error,
<listitem><para>Keep compiling after error,
dumping class files with problem methods
</para></listitem>
</varlistentry>
@@ -351,12 +351,12 @@
<listitem>
<para>debug attributes level, that may take three forms:
<programlisting>
-g all debug info ('-g:lines,vars,source')
-g:none no debug info
-g:{items} debug info for any/all of [lines, vars, source], e.g.,
-g:lines,source
-g all debug info ('-g:lines,vars,source')
-g:none no debug info
-g:{items} debug info for any/all of [lines, vars, source], e.g.,
-g:lines,source
</programlisting>
</para></listitem>
</varlistentry>

@@ -383,16 +383,16 @@

<varlistentry>
<term>-verbose</term>
<listitem><para>Emit messages about accessed/processed compilation units
<listitem><para>Emit messages about accessed/processed compilation units
</para></listitem>
</varlistentry>

<varlistentry>
<term>-showWeaveInfo</term>
<listitem><para>Emit messages about weaving
<listitem><para>Emit messages about weaving
</para></listitem>
</varlistentry>
<varlistentry>
<term>-log <replaceable>file</replaceable></term>
<listitem><para>Specify a log file for compiler messages.
@@ -420,7 +420,7 @@

<varlistentry>
<term>-repeat <replaceable>N</replaceable></term>
<listitem><para>Repeat compilation process N times
<listitem><para>Repeat compilation process N times
(typically to do performance analysis).
</para></listitem>
</varlistentry>
@@ -430,7 +430,7 @@
<listitem><para>Causes compiler to terminate before weaving
</para></listitem>
</varlistentry>
<varlistentry>
<term>-XaddSerialVersionUID</term>
<listitem><para>Causes the compiler to calculate and add
@@ -440,10 +440,10 @@
taken place.
</para></listitem>
</varlistentry>
<varlistentry>
<term>-Xreweavable[:compress]</term>
<listitem><para>(Experimental - deprecated as now default)
<listitem><para>(Experimental - deprecated as now default)
Runs weaver in reweavable mode which causes
it to create woven classes that can be rewoven, subject to the restriction that
on attempting a reweave all the types that advised the woven type must be accessible.
@@ -458,8 +458,8 @@

<varlistentry>
<term>-XincrementalFile <replaceable>file</replaceable></term>
<listitem><para>(Experimental) This works like incremental mode,
but using a file rather than standard input to control the compiler.
<listitem><para>(Experimental) This works like incremental mode,
but using a file rather than standard input to control the compiler.
It will recompile each time file is changed and
and halt when file is deleted.
</para></listitem>
@@ -497,7 +497,7 @@

</refsect2>

<refsect2>
<refsect2>
<title>File names</title>

<para>ajc accepts source files with either the <filename>.java</filename>
@@ -511,7 +511,7 @@
<para>We'd like to discourage other means of mechanical distinction such as
naming conventions or sub-packages in favor of the <filename>.aj</filename>
extension.</para>
<itemizedlist>

<listitem><para>Filename conventions are hard to enforce and lead to awkward names
@@ -560,7 +560,7 @@
<para>Compile two files:</para>

<programlisting>
ajc HelloWorld.java Trace.java
ajc HelloWorld.java Trace.java
</programlisting>

</example>
@@ -569,28 +569,29 @@
<title>An example using -argfile/@</title>

<para>
To avoid specifying file names on the command line,
To avoid specifying file names on the command line,
list source files in a line-delimited text argfile.
Source file paths may be absolute or relative to the argfile,
and may include other argfiles by @-reference.
The following file <literal>sources.lst</literal>
contains absolute and relative files and @-references:
</para>
<programlisting>
<programlisting>
Gui.java
/home/user/src/Library.java
data/Repository.java
data/Access.java
@../../common/common.lst
@/home/user/src/lib.lst
view/body/ArrayView.java</programlisting>
view/body/ArrayView.java
</programlisting>

<para>Compile the files using either the -argfile or @ form:</para>
<programlisting>
ajc -argfile sources.lst
ajc @sources.lst</programlisting>
<para>
Argfiles are also supported by jikes and javac, so you
Argfiles are also supported by jikes and javac, so you
can use the files in hybrid builds. However, the support varies:
</para>
<itemizedlist>
@@ -604,110 +605,110 @@ ajc @sources.lst</programlisting>
<example id="examplebytecode">
<title>An example using -inpath and -aspectpath</title>
<para>Bytecode weaving using -inpath:
AspectJ 1.2 supports weaving .class files in input zip/jar files
and directories.
Using input jars is like compiling the corresponding
source files, and all binaries are emitted to output. Although
Java-compliant compilers may differ in their output, ajc should
take as input any class files produced by javac, jikes, eclipse,
AspectJ 1.2 supports weaving .class files in input zip/jar files
and directories.
Using input jars is like compiling the corresponding
source files, and all binaries are emitted to output. Although
Java-compliant compilers may differ in their output, ajc should
take as input any class files produced by javac, jikes, eclipse,
and, of course, ajc. Aspects included in -inpath will be woven into
like other .class files, and they will affect other types as usual.
</para>
<para>Aspect libraries using -aspectpath:
AspectJ 1.1 supports weaving from read-only libraries containing
aspects. Like input jars, they affect all input; unlike input
jars, they themselves are not affected or emitted as output.
Sources compiled with aspect libraries must be run with the same
aspect libraries on their classpath.
AspectJ 1.1 supports weaving from read-only libraries containing
aspects. Like input jars, they affect all input; unlike input
jars, they themselves are not affected or emitted as output.
Sources compiled with aspect libraries must be run with the same
aspect libraries on their classpath.
</para>
<para>The following example builds the tracing example in a
command-line environment; it creates a read-only aspect library,
compiles some classes for use as input bytecode, and
<para>The following example builds the tracing example in a
command-line environment; it creates a read-only aspect library,
compiles some classes for use as input bytecode, and
compiles the classes and other sources with the aspect library.
</para>
<para>The tracing example is in the AspectJ distribution
<para>The tracing example is in the AspectJ distribution
({aspectj}/doc/examples/tracing). This uses the following files:
</para>
<para><programlisting>
aspectj1.1/
bin/
ajc
lib/
aspectjrt.jar
examples/
tracing/
Circle.java
ExampleMain.java
lib/
AbstractTrace.java
TraceMyClasses.java
notrace.lst
Square.java
tracelib.lst
tracev3.lst
TwoDShape.java
version3/
Trace.java
TraceMyClasses.java
aspectj1.1/
bin/
ajc
lib/
aspectjrt.jar
examples/
tracing/
Circle.java
ExampleMain.java
lib/
AbstractTrace.java
TraceMyClasses.java
notrace.lst
Square.java
tracelib.lst
tracev3.lst
TwoDShape.java
version3/
Trace.java
TraceMyClasses.java
</programlisting></para>

<para>Below, the path separator is taken as ";", but file separators
are "/". All commands are on one line. Adjust paths and
commands to your environment as needed.
<para>Below, the path separator is taken as ";", but file separators
are "/". All commands are on one line. Adjust paths and
commands to your environment as needed.

</para><para>Setup the path, classpath, and current directory:</para>

</para><para>Setup the path, classpath, and current directory:</para>
<programlisting>
cd examples
export ajrt=../lib/aspectjrt.jar
export CLASSPATH="$ajrt"
export PATH="../bin:$PATH"
cd examples
export ajrt=../lib/aspectjrt.jar
export CLASSPATH="$ajrt"
export PATH="../bin:$PATH"
</programlisting>

<para>Build a read-only tracing library:</para>
<para>Build a read-only tracing library:</para>
<programlisting>
ajc -argfile tracing/tracelib.lst -outjar tracelib.jar
ajc -argfile tracing/tracelib.lst -outjar tracelib.jar
</programlisting>

<para>Build the application with tracing in one step:</para>
<para>Build the application with tracing in one step:</para>

<programlisting>
ajc -aspectpath tracelib.jar -argfile tracing/notrace.lst -outjar tracedapp.jar
ajc -aspectpath tracelib.jar -argfile tracing/notrace.lst -outjar tracedapp.jar
</programlisting>

<para>Run the application with tracing:</para>
<para>Run the application with tracing:</para>

<programlisting>
java -classpath "$ajrt;tracedapp.jar;tracelib.jar" tracing.ExampleMain
java -classpath "$ajrt;tracedapp.jar;tracelib.jar" tracing.ExampleMain
</programlisting>

<para>Build the application with tracing from binaries in two steps:</para>
<para>Build the application with tracing from binaries in two steps:</para>
<itemizedlist><listitem><para>
(a) Build the application classes (using javac for demonstration's sake):</para>
(a) Build the application classes (using javac for demonstration's sake):</para>
<programlisting>
mkdir classes
javac -d classes tracing/*.java
jar cfM app.jar -C classes .
mkdir classes
javac -d classes tracing/*.java
jar cfM app.jar -C classes .
</programlisting>

</listitem>
<listitem><para>
(b) Build the application with tracing:</para>
(b) Build the application with tracing:</para>
<programlisting>
ajc -inpath app.jar -aspectpath tracelib.jar -outjar tracedapp.jar
ajc -inpath app.jar -aspectpath tracelib.jar -outjar tracedapp.jar
</programlisting>
</listitem></itemizedlist>

<para>Run the application with tracing (same as above):</para>
<para>Run the application with tracing (same as above):</para>

<programlisting>
java -classpath "$ajrt;tracedapp.jar;tracelib.jar" tracing.ExampleMain
java -classpath "$ajrt;tracedapp.jar;tracelib.jar" tracing.ExampleMain
</programlisting>

<para>Run the application without tracing:</para>
<para>Run the application without tracing:</para>

<programlisting>
java -classpath "app.jar" tracing.ExampleMain
java -classpath "app.jar" tracing.ExampleMain
</programlisting>

</example>
@@ -721,7 +722,7 @@ commands to your environment as needed.
called as a Java class. The only interface that should be considered
public are the public methods in <literal>org.aspectj.tools.ajc.Main</literal>.
E.g., <literal>main(String[] args)</literal> takes the
the standard <command>ajc</command> command line arguments.
the standard <command>ajc</command> command line arguments.
This means that an alternative way to run the
compiler is </para>

@@ -736,9 +737,9 @@ commands to your environment as needed.
<literal>ajc</literal> reports each message to the holder
using <literal>IMessageHolder.handleMessage(..)</literal>.
If you just want to collect the messages, use
<literal>MessageHandler</literal> as your
<literal>MessageHandler</literal> as your
<literal>IMessageHolder</literal>.
For example, compile and run the following with
For example, compile and run the following with
<literal>aspectjtools.jar</literal> on the classpath:
</para>
<programlisting>
@@ -763,19 +764,19 @@ public class WrapAjc {

<para>Unlike traditional java compilers, the AspectJ compiler may in
certain cases generate classfiles from multiple source files.
Unfortunately, the original Java class file format does not support
Unfortunately, the original Java class file format does not support
multiple
SourceFile attributes. In order to make sure all source file
information is available, the AspectJ compiler may in some cases
encode multiple filenames in the SourceFile attribute.
encode multiple filenames in the SourceFile attribute.
When the Java VM generates stack traces, it uses this attribute
to specify the source file.
</para>
<para>(The AspectJ 1.0 compiler also supports the .class file extensions of JSR-45.
These permit compliant debuggers (such as jdb in Java 1.4.1) to identify
These permit compliant debuggers (such as jdb in Java 1.4.1) to identify
the right file and line even given many source files for a single class.
JSR-45 support is planned for ajc in AspectJ 1.1, but is not in the initial
release. To get fully debuggable .class files, use the -XnoInline option.)
release. To get fully debuggable .class files, use the -XnoInline option.)
</para>

<para>Probably the only time you may see this format is when you view
@@ -787,7 +788,7 @@ java.lang.NullPointerException
at Main.new$constructor_call37(Main.java;SynchAspect.java[1k]:1030)
</programlisting>

<para>where instead of the usual
<para>where instead of the usual
</para>

<programlisting>
@@ -801,14 +802,14 @@ File:LineNumber
File0;File1[Number1];File2[Number2] ... :LineNumber
</programlisting>

<para>In this case, LineNumber is the usual offset in lines plus the
"start line" of the actual source file. That means you use LineNumber
both to identify the source file and to find the line at issue.
<para>In this case, LineNumber is the usual offset in lines plus the
"start line" of the actual source file. That means you use LineNumber
both to identify the source file and to find the line at issue.
The number in [brackets] after each file tells you the
virtual "start line" for that file (the first file has a start of 0).
virtual "start line" for that file (the first file has a start of 0).
</para>

<para> In our example from the null pointer exception trace,
<para> In our example from the null pointer exception trace,
the virtual start line is 1030. Since the file SynchAspect.java
"starts" at line 1000 [1k], the LineNumber points to line 30 of
SynchAspect.java.

+ 37
- 37
docs/devGuideDB/ajdb.xml View File

@@ -43,11 +43,11 @@
<para>
Note: As of the 1.0.3 release, AspectJ supports JSR-45, which provides
source-level debugging from many source files per class
and non-Java source files.
JSR-45 is implemented in the J2SE 1.4 debugger support, so
and non-Java source files.
JSR-45 is implemented in the J2SE 1.4 debugger support, so
you may be able to use your existing debugger to step through
AspectJ source code if both the source and target VM's are
running under Java 1.4 or later.
running under Java 1.4 or later.
However, existing debuggers will display synthetic methods
in the stack frame.
</para> <!-- todo find docs on JSR-45 -->
@@ -132,23 +132,23 @@
spacewar/Ship.java</userinput> which generates the following
output:
<programlisting>
209 void fire() {
210 // firing a shot takes energy
211 if (!expendEnergy(BULLET_ENERGY))
212 return;
213
214 //create a bullet object so it doesn't hit the ship that's firing it
215 double xV = getXVel() + BULLET_SPEED * (Math.cos(orientation));
216 double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation));
217
218 // create the actual bullet
219 new Bullet(
220 getGame(),
221 (getXPos() + ((getSize()/2 + 2) * (Math.cos(orientation))) + xV),
222 (getYPos() + ((getSize()/2 + 2) * (Math.sin(orientation))) + yV),
223 xV,
224 yV);
225 }
209 void fire() {
210 // firing a shot takes energy
211 if (!expendEnergy(BULLET_ENERGY))
212 return;
213
214 //create a bullet object so it doesn't hit the ship that's firing it
215 double xV = getXVel() + BULLET_SPEED * (Math.cos(orientation));
216 double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation));
217
218 // create the actual bullet
219 new Bullet(
220 getGame(),
221 (getXPos() + ((getSize()/2 + 2) * (Math.cos(orientation))) + xV),
222 (getYPos() + ((getSize()/2 + 2) * (Math.sin(orientation))) + yV),
223 xV,
224 yV);
225 }
</programlisting>
</para>
<para>This is different from <command>jdb</command> because it allows
@@ -187,8 +187,8 @@
breakpoint has been noted but will not be set until the class has
been loaded by the VM: </para>
<programlisting>
Deferring breakpoint spacewar.Ship.fire()
It will be set after the class is loaded.
Deferring breakpoint spacewar.Ship.fire()
It will be set after the class is loaded.
</programlisting>

<para>
@@ -198,14 +198,14 @@
<para>
When the breakpoint is set, the following message appears:
<programlisting>
Set deferred breakpoint spacewar.Ship.fire()
Set deferred breakpoint spacewar.Ship.fire()
</programlisting>
</para>

<para> We are notified that we've hit the breakpoint:

<programlisting>
Breakpoint hit: thread="Thread-2", spacewar.Ship.fire(), line=174, bci=0 209 void fire() {
Breakpoint hit: thread="Thread-2", spacewar.Ship.fire(), line=174, bci=0 209 void fire() {
</programlisting></para>

<para>
@@ -213,10 +213,10 @@
can view the current stack with the <literal>where</literal>
command, as follows:
<programlisting>
Thread-2[1] where
[1] fire (spacewar\Ship.java:209)
[2] run (spacewar\Robot.java:100)
[3] run [class java.lang.Thread]
Thread-2[1] where
[1] fire (spacewar\Ship.java:209)
[2] run (spacewar\Robot.java:100)
[3] run [class java.lang.Thread]
</programlisting>
</para>

@@ -228,23 +228,23 @@
<para>
The following message tells us the breakpoint was set:
<programlisting>
Set breakpoint Ship.java:216
Set breakpoint Ship.java:216
</programlisting>
</para>
<para>
To continue execution, we type <userinput>cont</userinput> and the
breakpoint at line 216 is hit
<programlisting>
Breakpoint hit: thread="Thread-2", spacewar.Ship.fire(), line=216, bci=28
216 double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation));
Breakpoint hit: thread="Thread-2", spacewar.Ship.fire(), line=216, bci=28
216 double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation));
</programlisting></para>

<para>
To view the visible local variables, we type
<userinput>locals</userinput> and ajdb responds with:
<programlisting>
Local variables
xV = 12.242462584304468
Local variables
xV = 12.242462584304468
</programlisting></para>

<para>
@@ -252,22 +252,22 @@
<userinput>set xV = 16.1</userinput>

<programlisting>
Changed 'xV' from '12.242462584304468' to '16.1'
Changed 'xV' from '12.242462584304468' to '16.1'
</programlisting></para>

<para>
To see our changes we can print the value of <literal>i</literal>
by the following:
<programlisting>
print xV
Value for printing 'xV' = 12.242462584304468
print xV
Value for printing 'xV' = 12.242462584304468
</programlisting></para>

<para>We can now type exit or quit to leave the debugger, and we
receive the following message:

<programlisting>
The application has exited.
The application has exited.
</programlisting></para>
</example>


+ 39
- 36
docs/devGuideDB/ajdee.xml View File

@@ -274,22 +274,23 @@
your <literal>load-path</literal> and are ``required''. This is an
example for the 1.0 release:
<programlisting>
;; I keep my emacs packages in C:/Emacs
(setq load-path
(append
'(
"C:/Emacs/aspectj-emacsMode-1.0" ; for AJDEE
"C:/Emacs/aspectj-emacsAJDEE-1.0"
"C:/Emacs/jde-2.2.9beta6/lisp"
"C:/Emacs/elib-1.0" ; for JDEE
"C:/Emacs/speedbar-0.14beta2" ; for JDEE
"C:/Emacs/semantic-1.4beta12" ; for JDEE/speedbar
"C:/Emacs/eieio-0.17beta3" ; for JDEE
)
load-path))

(require 'jde)
(require 'ajdee) ; can also appear in prj.el</programlisting>
;; I keep my emacs packages in C:/Emacs
(setq load-path
(append
'(
"C:/Emacs/aspectj-emacsMode-1.0" ; for AJDEE
"C:/Emacs/aspectj-emacsAJDEE-1.0"
"C:/Emacs/jde-2.2.9beta6/lisp"
"C:/Emacs/elib-1.0" ; for JDEE
"C:/Emacs/speedbar-0.14beta2" ; for JDEE
"C:/Emacs/semantic-1.4beta12" ; for JDEE/speedbar
"C:/Emacs/eieio-0.17beta3" ; for JDEE
)
load-path))

(require 'jde)
(require 'ajdee) ; can also appear in prj.el
</programlisting>
</para>
</listitem>

@@ -315,31 +316,33 @@
Here is a simple example:

<programlisting>
;; A default version for simple projects, maybe good for
;;; .emacs file.
(custom-set-variables
'(jde-compiler '("ajc" "ajc"))
'(jde-javadoc-command-path "ajdoc")
;; A default version for simple projects, maybe good for
;;; .emacs file.
(custom-set-variables
'(jde-compiler '("ajc" "ajc"))
'(jde-javadoc-command-path "ajdoc")

;; ajc requires all files to be named for a compile
'(aspectj-compile-file-specification "*.java"))</programlisting>
;; ajc requires all files to be named for a compile
'(aspectj-compile-file-specification "*.java"))
</programlisting>

Here is an example for spacewar, in
<filename>examples/spacewar</filename>.
<programlisting>
;;; These options are for the spacewar, in examples/spacewar.
(custom-set-variables
'(jde-compiler '("ajc" "ajc"))
'(jde-javadoc-command-path "ajdoc")

;; ajc provides an ``argfile'' mechanism for specifying all files.
'(aspectj-compile-file-specification "-argfile demo.lst")

;; *if* compiling packages, name root dir for package hierarchy
;; to tell ajc where .class files should go.
'(jde-compile-option-directory "..")
'(jde-run-working-directory ".."))
'(jde-run-application-class "spacewar.Game")</programlisting>
;;; These options are for the spacewar, in examples/spacewar.
(custom-set-variables
'(jde-compiler '("ajc" "ajc"))
'(jde-javadoc-command-path "ajdoc")

;; ajc provides an ``argfile'' mechanism for specifying all files.
'(aspectj-compile-file-specification "-argfile demo.lst")

;; *if* compiling packages, name root dir for package hierarchy
;; to tell ajc where .class files should go.
'(jde-compile-option-directory "..")
'(jde-run-working-directory ".."))
'(jde-run-application-class "spacewar.Game")
</programlisting>
</para>
</listitem>
<listitem>

+ 459
- 488
docs/devGuideDB/antsupport.xml
File diff suppressed because it is too large
View File


+ 12
- 11
docs/devGuideDB/aspectj-mode.xml View File

@@ -118,7 +118,7 @@
<entry>M-x aspectj-jump-menu (C-x C-j)</entry>
<entry>
Display popup menu of advisers, advisees, and inter-type declarations.
Navigate to item by selecting with mouse
Navigate to item by selecting with mouse
(see <link linkend="aspectjmodescreenshot2">figure</link> below).
</entry>
</row>
@@ -208,9 +208,10 @@
The files in this package need to be in the load-path and
``required''. For example, for the 1.0 release:
<programlisting>
;; I keep my emacs packages in C:/Emacs
(setq load-path (cons "C:/Emacs/aspectj-emacsMode-1.0" load-path))
(require 'aspectj-mode)</programlisting>
;; I keep my emacs packages in C:/Emacs
(setq load-path (cons "C:/Emacs/aspectj-emacsMode-1.0" load-path))
(require 'aspectj-mode)
</programlisting>
</para>
</listitem>

@@ -329,17 +330,17 @@ Error in init file: File error: "Cannot open load file", "aspectj-mode"

<listitem>
<para><emphasis>Symptom</emphasis>: When trying to get a jump menu,
I get the message "No crosscut elements at point" even though
I get the message "No crosscut elements at point" even though
there is a [list] on the same line.
</para>

<para>The caret (point) is probably on or after the list.
To see the crosscut elements you need to hit the jump menu
on the same line that the annotated elements appear as a list
of items surrounded by '[' and ']' on the same line as the
affected declaration. If the caret is on the same line as the
elements and before the list (i.e. not at the end of the
list of elements) the jump menu should work.
To see the crosscut elements you need to hit the jump menu
on the same line that the annotated elements appear as a list
of items surrounded by '[' and ']' on the same line as the
affected declaration. If the caret is on the same line as the
elements and before the list (i.e. not at the end of the
list of elements) the jump menu should work.
</para>
</listitem>
</itemizedlist>

+ 165
- 164
docs/devGuideDB/ltw.xml View File

@@ -1,23 +1,23 @@
<chapter id="ltw" xreflabel="Load-Time Weaving">
<title>Load-Time Weaving</title>
<sect1 id="ltw-introduction">
<title>Introduction</title>
<para> The AspectJ weaver takes class files as input and produces class files as output.
The weaving process itself can take place at one of three different times: compile-time,
post-compile time, and load-time. The class files produced by the weaving process (and
hence the run-time behaviour of an application) are the same regardless of the approach
chosen. </para>
<itemizedlist>
<listitem> <para>Compile-time weaving is the simplest approach. When you have the source code
for an application, ajc will compile from source and produce woven class files as
output. The invocation of the weaver is integral to the ajc compilation process. The
aspects themselves may be in source or binary form.
aspects themselves may be in source or binary form.
If the aspects are required for the affected classes to compile, then
you must weave at compile-time. Aspects are required, e.g., when they
add members to a class and other classes being compiled reference the
add members to a class and other classes being compiled reference the
added members.
</para></listitem>
<listitem> <para>Post-compile weaving (also sometimes called binary weaving) is used to weave
@@ -29,32 +29,32 @@
one or more "weaving class loaders", either provided explicitly by the run-time
environment or enabled through a "weaving agent" are required. </para></listitem>
</itemizedlist>
<para> You may also hear the term "run-time weaving". We define this as the weaving of
classes that have already been defined to the JVM (without reloading those
classes). AspectJ 5 does not provide explicit support for run-time weaving although
simple coding patterns can support dynamically enabling and disabling advice in aspects. </para>
<sect2 id="weaving-class-files-more-than-once" xreflabel="weaving-class-files-more-than-once">
<title>Weaving class files more than once</title>
<para> As of AspectJ 5 aspects (code style or annotation style) and woven classes are
reweavable by default. If you are developing AspectJ applications that are to be used
reweavable by default. If you are developing AspectJ applications that are to be used
in a load-time weaving environment with an older version of the compiler you
need to specify the <literal>-Xreweavable</literal> compiler option when building
them. This causes AspectJ to save additional state in the class files that is used
to support subsequent reweaving. </para>
</sect2>
</sect1>
<sect1 id="ltw-rules">
<title>Load-time Weaving Requirements</title>
<para> All load-time weaving is done in the context of a class loader, and hence the set of
aspects used for weaving and the types that can be woven are affected by the class
loader delegation model. This ensures that LTW complies with the Java 2 security model.
The following rules govern the interaction of load-time weaving with class loading: </para>
<orderedlist>
<listitem> <para>All aspects to be used for weaving must be defined to the weaver before any
types to be woven are loaded. This avoids types being "missed" by aspects added
@@ -66,19 +66,19 @@
may be extended.
</para></listitem>
<listitem><para>A class loader may only weave classes that it defines. It may not weave
classes loaded by a delegate or parent class loader.</para></listitem>
classes loaded by a delegate or parent class loader.</para></listitem>
</orderedlist>
</sect1>
<sect1 id="ltw-configuration">
<title>Configuration</title>
<para>New in AspectJ 5 are a number of mechanisms to make load-time weaving
easy to use. The load-time weaving mechanism is chosen through JVM startup options.
Configuration files determine the set of aspects to be used for weaving and which
types will be woven. Additional diagnostic options allow the user to debug the configuration and
easy to use. The load-time weaving mechanism is chosen through JVM startup options.
Configuration files determine the set of aspects to be used for weaving and which
types will be woven. Additional diagnostic options allow the user to debug the configuration and
weaving process. </para>
<sect2 id="enabling-load-time-weaving" xreflabel="enabling-load-time-weaving">
<title>Enabling Load-time Weaving</title>
<para> AspectJ 5 supports several ways of enabling load-time weaving for
@@ -88,15 +88,16 @@
<varlistentry>
<term>Agents</term>
<listitem>
<para>AspectJ 5 ships with a number of load-time weaving agents that
enable load-time weaving. These agents and their configuration
are execution environment dependent. Configuration for the supported environments is discussed
<para>AspectJ 5 ships with a load-time weaving agent that
enables load-time weaving. This agent and its configuration
is execution environment dependent. Configuration for the supported environments is discussed
later in this chapter.</para>
<para>
Using Java 5 JVMTI you can specify the <literal>-javaagent:pathto/aspectjweaver.jar</literal> option
to the JVM.</para><para>
Using BEA JRockit and Java 1.3/1.4, the very same behavior can be obtained using BEA JRockit JMAPI features with
the <literal>-Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent</literal>
Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer part of AspectJ.
JRockit JDK never supported Java versions higher than 1.6. Several JRockit JVM features are
now part of HotSpot and tools like Mission Control available for OpenJDK and Oracle JDK.
</para>
</listitem>
</varlistentry>
@@ -104,12 +105,12 @@
<term>Command-line wrapper scripts <literal>aj</literal></term>
<listitem>
<para>The <command>aj</command> command runs Java programs in Java 1.4 or
later by setting up <literal>WeavingURLClassLoader</literal> as the
system class loader.
later by setting up <literal>WeavingURLClassLoader</literal> as the
system class loader.
For more information, see <xref linkend="aj"/>.
</para>
<para>The <command>aj5</command> command runs Java programs in Java 5
by using the <literal>-javaagent:pathto/aspectjweaver.jar</literal> option
by using the <literal>-javaagent:pathto/aspectjweaver.jar</literal> option
described above.
For more information, see <xref linkend="aj"/>.
</para>
@@ -132,10 +133,10 @@
</varlistentry>
</variablelist>
</sect2>
<sect2 id="configuring-load-time-weaving-with-aopxml-files" xreflabel="configuring-load-time-weaving-with-aopxml-files">
<title>Configuring Load-time Weaving with aop.xml files</title>
<para>The weaver is configured using one or more <literal>META-INF/aop.xml</literal>
files located on the class loader search path. Each file may declare a list of
aspects to be used for weaving, type patterns describing which types
@@ -145,58 +146,57 @@
may define abstract pointcuts (but not abstract
methods). The following example shows a simple aop.xml file: </para>
<programlisting><![CDATA[
<aspectj>

<aspects>
<!-- declare two existing aspects to the weaver -->
<aspect name="com.MyAspect"/>
<aspect name="com.MyAspect.Inner"/>

<!-- define a concrete aspect inline -->
<concrete-aspect name="com.xyz.tracing.MyTracing"
extends="tracing.AbstractTracing"
precedence="com.xyz.first, *">
<pointcut name="tracingScope" expression="within(org.maw.*)"/>
</concrete-aspect>

<!-- Of the set of aspects declared to the weaver
use aspects matching the type pattern "com..*" for weaving. -->
<include within="com..*"/>

<!-- Of the set of aspects declared to the weaver
do not use any aspects with the @CoolAspect annotation for weaving -->
<exclude within="@CoolAspect *"/>

</aspects>

<weaver options="-verbose">
<!-- Weave types that are within the javax.* or org.aspectj.*
packages. Also weave all types in the foo package that do
not have the @NoWeave annotation. -->
<include within="javax.*"/>
<include within="org.aspectj.*"/>
<include within="(!@NoWeave foo.*) AND foo.*"/>

<!-- Do not weave types within the "bar" pakage -->
<exclude within="bar.*"/>

<!-- Dump all types within the "com.foo.bar" package
to the "./_ajdump" folder on disk (for diagnostic purposes) -->
<dump within="com.foo.bar.*"/>

<!-- Dump all types within the "com.foo.bar" package and sub-packages,
both before are after they are woven,
which can be used for byte-code generated at runtime
<dump within="com.foo.bar..*" beforeandafter="true"/>
</weaver>

</aspectj>

]]></programlisting>
<aspectj>

<aspects>
<!-- declare two existing aspects to the weaver -->
<aspect name="com.MyAspect"/>
<aspect name="com.MyAspect.Inner"/>

<!-- define a concrete aspect inline -->
<concrete-aspect name="com.xyz.tracing.MyTracing"
extends="tracing.AbstractTracing"
precedence="com.xyz.first, *">
<pointcut name="tracingScope" expression="within(org.maw.*)"/>
</concrete-aspect>

<!-- Of the set of aspects declared to the weaver
use aspects matching the type pattern "com..*" for weaving. -->
<include within="com..*"/>

<!-- Of the set of aspects declared to the weaver
do not use any aspects with the @CoolAspect annotation for weaving -->
<exclude within="@CoolAspect *"/>

</aspects>

<weaver options="-verbose">
<!-- Weave types that are within the javax.* or org.aspectj.*
packages. Also weave all types in the foo package that do
not have the @NoWeave annotation. -->
<include within="javax.*"/>
<include within="org.aspectj.*"/>
<include within="(!@NoWeave foo.*) AND foo.*"/>

<!-- Do not weave types within the "bar" pakage -->
<exclude within="bar.*"/>

<!-- Dump all types within the "com.foo.bar" package
to the "./_ajdump" folder on disk (for diagnostic purposes) -->
<dump within="com.foo.bar.*"/>

<!-- Dump all types within the "com.foo.bar" package and sub-packages,
both before are after they are woven,
which can be used for byte-code generated at runtime
<dump within="com.foo.bar..*" beforeandafter="true"/>
</weaver>

</aspectj>
]]></programlisting>

<para>
The DTD defining the format of this file is available here:
http://www.eclipse.org/aspectj/dtd/aspectj.dtd.
The DTD defining the format of this file is available here:
http://www.eclipse.org/aspectj/dtd/aspectj.dtd.
</para>
<para>
An aop.xml file contains two key sections: <literal>aspects</literal> defines one
@@ -204,15 +204,15 @@
used in the weaving process; <literal>weaver</literal> defines weaver options and which
types should be woven.
</para>
<para>
The simplest way to define an aspect to the weaver is to
specify the fully-qualified name of the aspect type in an aspect element.
The simplest way to define an aspect to the weaver is to
specify the fully-qualified name of the aspect type in an aspect element.
You can also
declare (and define to the weaver) aspects inline in the aop.xml file.
This is done using the <literal>concrete-aspect</literal> element. A concrete-aspect
declaration must provide a pointcut definition for every abstract
pointcut in the abstract aspect it extends. This mechanism is a
declaration must provide a pointcut definition for every abstract
pointcut in the abstract aspect it extends. This mechanism is a
useful way of externalizing configuration for infrastructure and
auxiliary aspects where the pointcut definitions themselves can be
considered part of the configuration of the service.
@@ -229,15 +229,15 @@
and || are replaced by 'AND' and 'OR'.
</para>
<para>
Note that <literal>include</literal> and <literal>exclude</literal> elements affect all aspects
declared to the weaver including those in other aop.xml files. To help avoid unexpected
Note that <literal>include</literal> and <literal>exclude</literal> elements affect all aspects
declared to the weaver including those in other aop.xml files. To help avoid unexpected
behaviour a lint warning is issued
if an aspect is not declared as a result of of applying these filters.
Also note <literal>aspect</literal> and <literal>concrete-aspect</literal> elements
must be used to declare aspects to the weaver i.e. <literal>include</literal> and <literal>exclude</literal>
elements cannot be used find aspects on the class loader search path.
</para>
<para>
The <literal>weaver</literal> element is used to pass options to the weaver and to specify
the set of types that should be woven. If no include elements are specified
@@ -245,10 +245,10 @@
element can be used capture on disk byte-code of woven classes for diagnostic purposes both before,
in the case of those generated at runtime, and after the weaving process.
</para>
<para> When several configuration files are visible from a given weaving class loader
their contents are conceptually merged.
their contents are conceptually merged.
The files are merged in the order they are
found on the search path (with a regular <literal>getResourceAsStream</literal> lookup)
according to the following rules: </para>
@@ -263,7 +263,7 @@
by any exclude statements. If there are no include statements then all non-excluded
aspects are included.</para></listitem>
<listitem> <para> The set of types to be woven are those types matched by at
least one weaver <literal>include</literal> element and not matched by any
least one weaver <literal>include</literal> element and not matched by any
weaver <literal>exclude</literal> element. If there are no weaver include
statements then all non-excluded types are included.</para></listitem>
<listitem> <para> The weaver options are derived by taking the union of the
@@ -272,19 +272,19 @@
will be used.</para></listitem>
</itemizedlist>

<para>It is not an error for the same aspect to be defined to the weaver in
more than one visible <literal>META-INF/aop.xml</literal> file.
<para>It is not an error for the same aspect to be defined to the weaver in
more than one visible <literal>META-INF/aop.xml</literal> file.
However, if the same concrete aspect
is defined in more than one aop.xml file then an error will be issued.
A concrete aspect
A concrete aspect
defined in this way will be used to weave types loaded by the
class loader that loaded the aop.xml file in which it was defined.
class loader that loaded the aop.xml file in which it was defined.
</para>
<para> A <literal>META-INF/aop.xml</literal> can be generated by
using either the <literal>-outxml</literal> or <literal>-outxmlfile</literal> options of the AspectJ compiler.
using either the <literal>-outxml</literal> or <literal>-outxmlfile</literal> options of the AspectJ compiler.
It will simply contain a (possibly empty) set of aspect elements; one for
each abstract or concrete aspect defined.
each abstract or concrete aspect defined.
When used in conjuction with the <literal>-outjar</literal> option
a JAR is produced that can be used
with the <command>aj5</command> command or a load-time weaving environment.</para>
@@ -300,40 +300,40 @@
Consider the following:
</para>
<programlisting><![CDATA[
package mypack;
package mypack;

@Aspect
public abstract class AbstractAspect {
@Aspect
public abstract class AbstractAspect {

// abstract pointcut: no expression is defined
@Pointcut
abstract void scope();
// abstract pointcut: no expression is defined
@Pointcut
abstract void scope();

@Before("scope() && execution(* *..doSome(..))")
public void before(JoinPoint jp) {
....
}
}
]]></programlisting>
@Before("scope() && execution(* *..doSome(..))")
public void before(JoinPoint jp) {
....
}
}
]]></programlisting>
<para>
This aspect is equivalent to the following in code style:
</para>
<programlisting><![CDATA[
package mypack;
package mypack;

public abstract aspect AbstractAspect {
public abstract aspect AbstractAspect {

// abstract pointcut: no expression is defined
abstract pointcut scope();
// abstract pointcut: no expression is defined
abstract pointcut scope();

before() : scope() && execution(* *..doSome(..)) {
....
}
}
]]></programlisting>
before() : scope() && execution(* *..doSome(..)) {
....
}
}
]]></programlisting>
<para>
This aspect (in either style) can be made concrete using <literal>META-INF/aop.xml</literal>.
It defines the abstract pointcut <literal>scope()</literal>. When using this mechanism the
It defines the abstract pointcut <literal>scope()</literal>. When using this mechanism the
following rules apply:
<itemizedlist>
<listitem><para>The parent aspect must be abstract. It can be an @AspectJ or a
@@ -343,31 +343,31 @@
as illustrated in this sample, this means the method that hosts the pointcut must be abstract,
have no arguments, and return void.</para></listitem>
<listitem><para>The concrete aspect must implement all inherited abstract pointcuts.</para></listitem>
<listitem><para>The concrete aspect may not implement methods so the abstract aspect it
<listitem><para>The concrete aspect may not implement methods so the abstract aspect it
extends may not contain any abstract methods.</para></listitem>
</itemizedlist>
</para>
<para>
<emphasis>A limitation of the implementation of this feature in AspectJ 1.5.0 is that aspects defined using
aop.xml are not exposed to the weaver. This means that they are not affected by advice and ITDs defined in
other aspects. Support for this capability will be considered in a future release.</emphasis>
</para>
<para>
If more complex aspect inheritance is required use regular aspect
inheritance instead of XML.
The following XML definition shows a valid concrete sub-aspect for the abstract aspects above:
</para>
<programlisting><![CDATA[
<aspectj>
<aspects>
<concrete-aspect name="mypack.__My__AbstractAspect" extends="mypack.AbstractAspect">
<pointcut name="scope" expression="within(yourpackage..*)"/>
</concrete-aspect>
<aspects>
</aspectj>
]]></programlisting>
<aspectj>
<aspects>
<concrete-aspect name="mypack.__My__AbstractAspect" extends="mypack.AbstractAspect">
<pointcut name="scope" expression="within(yourpackage..*)"/>
</concrete-aspect>
<aspects>
</aspectj>
]]></programlisting>
<para>
It is important to remember that the <literal>name</literal> attribute in the
<literal>concrete-aspect</literal> directive defines the fully qualified name that will be given to the
@@ -380,12 +380,12 @@
as in:
</para>
<programlisting><![CDATA[
// exception handling omitted
Class myConcreteAspectClass = Class.forName("mypack.__My__AbstractAspect");
// exception handling omitted
Class myConcreteAspectClass = Class.forName("mypack.__My__AbstractAspect");

// here we are using a singleton aspect
AbstractAspect concreteInstance = Aspects.aspectOf(myConcreteAspectClass);
]]></programlisting>
// here we are using a singleton aspect
AbstractAspect concreteInstance = Aspects.aspectOf(myConcreteAspectClass);
]]></programlisting>
</sect2>

<sect2 id="concrete-aspect-precedence" xreflabel="concrete-aspect-precedence">
@@ -405,13 +405,13 @@
Consider the following:
</para>
<programlisting><![CDATA[
<aspectj>
<aspects>
<concrete-aspect name="mypack.__MyDeclarePrecedence"
precedence="*..*Security*, Logging+, *"/>
</aspects>
</aspectj>
]]></programlisting>
<aspectj>
<aspects>
<concrete-aspect name="mypack.__MyDeclarePrecedence"
precedence="*..*Security*, Logging+, *"/>
</aspects>
</aspectj>
]]></programlisting>
<para>
This deployment time definitions is only declaring a precedence rule. You have to remember
that the <literal>name</literal> attribute must be a valid fully qualified class name
@@ -429,13 +429,13 @@
search path. Everything that can be configured through XML can be configured using a
Properties file, with the exception of declarative concrete aspects. For example: </para>
<programlisting><![CDATA[
aspects.names=com.MyAspect,com.MyAspect.Inner
aspects.include=com..*
aspects.exclude=@CoolAspect
aspects.names=com.MyAspect,com.MyAspect.Inner
aspects.include=com..*
aspects.exclude=@CoolAspect

weaver.options=-verbose
weaver.include=javax.* OR org.aspectj.*
]]></programlisting>
weaver.options=-verbose
weaver.include=javax.* OR org.aspectj.*
]]></programlisting>
</sect2>
-->

@@ -456,7 +456,7 @@
<entry>
<literal>-verbose</literal>
</entry>
<entry>Issue informational messages about the weaving process. Messages issued while the weaver is being
<entry>Issue informational messages about the weaving process. Messages issued while the weaver is being
bootstrapped are accumulated until all options are parsed. If the messages are required to be output
immediately you can use the option <literal>-Daj.weaving.verbose=true</literal> on the JVM startup command line.
</entry>
@@ -466,11 +466,11 @@
<literal>-debug</literal>
</entry>
<entry>
Issue a messages for each class passed to the weaver
indicating whether it was woven, excluded or ignored.
Issue a messages for each class passed to the weaver
indicating whether it was woven, excluded or ignored.
Also issue messages for classes
defined during the weaving process such as around advice
closures and concrete aspects defined in
closures and concrete aspects defined in
<literal>META-INF/aop.xml</literal>.
</entry>
</row>
@@ -542,7 +542,7 @@
The given value must be the full qualified class name of a class that implements the
<literal>org.aspectj.bridge.IMessageHandler</literal> interface
and is visible to the classloader with which the weaver being configured is associated.
Exercise caution when packaging a custom message handler with an application that is to
Exercise caution when packaging a custom message handler with an application that is to
be woven. The handler (as well as classes on which it depends) cannot itself be woven
by the aspects that are declared to the same weaver.
</entry>
@@ -556,7 +556,7 @@
<sect1 id="ltw-specialcases">
<title>Special cases</title>
<para>
The following classes are not exposed to the LTW infrastructure regardless of
The following classes are not exposed to the LTW infrastructure regardless of
the <literal>aop.xml</literal> file(s) used:
<itemizedlist>
<listitem> <para>All <literal>org.aspectj.*</literal> classes (and subpackages) - as those are needed by the infrastructure itself</para></listitem>
@@ -578,14 +578,14 @@
won't be handled as a warn (as during compile time) but as an info message.
</para>
</sect1>
<sect1 id="ltw-packaging">
<title>Runtime Requirements for Load-time Weaving</title>
<para> To use LTW the <literal>aspectjweaver.jar</literal> library must be added to the
classpath. This contains the AspectJ 5 runtime, weaver, weaving class loader and
weaving agents. It also contains the DTD for parsing XML weaving configuration files. </para>
</sect1>
<sect1 id="ltw-agents">
<title>Supported Agents</title>
<sect2 id="jvmti" xreflabel="jvmti">
@@ -593,15 +593,16 @@
<para> When using Java 5 the JVMTI agent can be used by starting the JVM with the
following option (adapt according to the path to aspectjweaver.jar): </para>
<programlisting><![CDATA[
-javaagent:pathto/aspectjweaver.jar
]]></programlisting>
-javaagent:pathto/aspectjweaver.jar
]]></programlisting>
</sect2>
<sect2 id="jrockit" xreflabel="jrockit">
<title>JRockit with Java 1.3/1.4 (use JVMTI on Java 5)</title>
<para> The JRockit agent is configured with the following JVM option: </para>
<programlisting><![CDATA[
-Xmanagement:class=org.aspectj.weaver.loadtime.JRockitAgent
]]></programlisting>
<para>
Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer part of AspectJ.
JRockit JDK never supported Java versions higher than 1.6. Several JRockit JVM features are
now part of HotSpot and tools like Mission Control available for OpenJDK and Oracle JDK.
</para>
</sect2>
</sect1>
</chapter>

+ 1
- 0
docs/developer/ram-disk/maven.config View File

@@ -0,0 +1 @@
--settings R:/AspectJ/.mvn/settings-ramdisk.xml

+ 68
- 0
docs/developer/ram-disk/settings-ramdisk.xml View File

@@ -0,0 +1,68 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">

<!--
RAM disk (RD) how-to:

1. Make sure the cloned project moves its local Git repository to a place outside the working directory on a
physical drive:
# Remove the "_" in between the two dashes in "-_-", two dashes are forbidden inside XML tags
git init -_-separate-git-dir=../MyProject.git
This ensures that your local Git commits are not lost if the computer reboots unexpectedly, even if you did not
push those commits to a remote yet. Ideally, make the Git repository directory a sibling right beside the
actual working directory and give it the same name as the workdir + ".git", as shown above.

2. Set up a RD, bind it to a drive letter (Windows) or mount it into an empty local folder (Linux, can also be
done on Windows). The RD should be big enough to house
- the project's working directory,
- all plugins, dependencies and artifacts needed and created by your Maven build,
- plus all the space needed during the build of your project for target folders, temporary files used while
creating assemblies or fat JARs, files created during tests etc.
On Windows, you might want to deactivate the Recycle Bin for the RAM disk drive. Screenshot
docs/developer/ram-disk/windows-recycle-bin-remove-immediately.png explains how to do that in English and
German.

3. Make sure to commit all your changes before shutting down the RD and/or the computer. You can skip that step
(at your own risk), if you make sure to save the RD contents to a shapshot file before unmounting.
- On Windows, products like Dataram RAMDisk (free up to 1 GB, needs licence otherwise, limited to a single
mounted RD) can do that for you. With RAMMap, you can mount any number of drives and have no size limit
(other than physical RAM), but have to save snapshots manually.
- On Linux, setting up a RD should be easy with on-board means. Mounting, unmounting and saving snapshots can
be done via start/stop scripts, which optionally can also be integrated into the Linux start-up and
shutdown processes. You could even regularly save snapshots using a cron job.

4. Copy the working directory to the root folder (e.g. R:/MyProject) of the RD and also create the base folder
specified here under "<localRepository>" for the local Maven repository.

5. Copy this file to <workdir>/.mvn/settings-ramdisk.xml.

6. Create a file <workdir>/.mvn/maven.config which will be found automatically by Maven - see
https://maven.apache.org/configure.html. Add this line, pointing Maven to this settings file with the
corresponding absolute path on your RD:
# Remove the "_" in between the two dashes in "-_-", two dashes are forbidden inside XML tags
-_-settings R:/MyProject/.mvn/settings-ramdisk.xml
Using relative paths will not work reliably, this Maven option will be added to each "mvn" call. So depending
on the current directory (e.g. submodule folder), you will get into trouble.

7. Download all plugins Maven needs and do a full build, checking if your RD is big enough:
mvn dependency:go-offline
mvn clean install

8. Enjoy, if the previous step was successful. Otherwise, start over with an increased RD size.

You may want to put .mvn/settings-ramdisk.xml and .mvn/maven.config on your project's .gitignore so as not to
commit them accidentally, if you or other project members do not permanently work with the RD or their
configuration differs. You may commit this file to another safe place in your project and put some information
into a development environment setup guide.
-->

<!-- Default - use if you want to switch to the default local Maven repo temporarily for some reason -->
<!--<localRepository>${user.home}/.m2/repository</localRepository>-->

<!-- RAM disk Windows -->
<localRepository>r:/.m2/repository</localRepository>

<!-- RAM disk Linux (Ubuntu via Windows Subsystem for Linux 2) -->
<!--<localRepository>/mnt/r/.m2/repository</localRepository>-->

</settings>

BIN
docs/developer/ram-disk/windows-recycle-bin-remove-immediately.png View File


+ 660
- 682
docs/faq/faq.xml
File diff suppressed because it is too large
View File


+ 13
- 13
docs/pdGuideDB/ajcore.xml View File

@@ -1,26 +1,26 @@
<chapter id="ajcore" xreflabel="AspectJ Core Files">
<title>AspectJ Core Files</title>
<sect1 id="ajcore-introduction">
<title>Introduction</title>
<para> When the compiler terminates abnormally, either because a particular kind of message was
issued or an exception was thrown, an AspectJ core file will be produced. You will
find it the working directory of the compiler and it will have a name that contains
the date and time that the file was produced
the date and time that the file was produced
e.g. <literal>ajcore.20060810.173655.626.txt</literal>. The file contains details
of the problem such as the exception thrown as well as information about the
environment such as operating system and Java version. When submitting a bug,
include this file whenever it is available.</para>
<sect2 id="configuration" xreflabel="configuration">
<title>Configuring dump files</title>
<para> By default AspectJ will only create an <literal>ajcore</literal> file
when an unexpected exception is thrown by the weaver or an
<para> By default AspectJ will only create an <literal>ajcore</literal> file
when an unexpected exception is thrown by the weaver or an
<literal>abort</literal> message is
issued. However it is possible to disable this feature or enable files to
be produced under different circumstances. The table below lists the System
be produced under different circumstances. The table below lists the System
properties that can be used to configure <literal>ajcore</literal> files. </para>
<informaltable>
<tgroup cols="3">
@@ -52,7 +52,7 @@
</entry>
<entry>
Message kind for which to generate <literal>ajcore</literal>
e.g. <literal>error</literal>.
e.g. <literal>error</literal>.
</entry>
</row>
<row>
@@ -63,7 +63,7 @@
<literal>none</literal>
</entry>
<entry>
The directory used for ajcore files.
The directory used for ajcore files.
</entry>
</row>
</tbody>
@@ -73,7 +73,7 @@

<sect2 id="ajcore-examples" xreflabel="AJCore File Examples">
<title>AJCore File Examples</title>
<para> Below is an extract from an <literal>ajcore</literal> file. You will see
details of the dump configuration as well as the exception (with stack trace) that
is the source of the problem and any messages issued by the compiler. Most importantly
@@ -191,8 +191,8 @@ java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.aspectj.tools.ajc.Main.run(Main.java:367)
at org.aspectj.tools.ajc.Main.runMain(Main.java:246)
at org.aspectj.tools.ajc.Main.main(Main.java:86)
]]></programlisting>
]]> </programlisting>
</sect2>
</sect1>
</chapter>

+ 34
- 34
docs/pdGuideDB/ltwdump.xml View File

@@ -1,55 +1,55 @@
<chapter id="ltwdump" xreflabel="Dumping classes during load-time weaving">
<title>Dumping classes during load-time weaving</title>
<sect1 id="ltwdump-introduction">
<title>Introduction</title>
<para>
Very rarely problems may be encountered with classes that have been
<para>
Very rarely problems may be encountered with classes that have been
load-time woven.
Symptoms will include incorrect program function or a Java exception such as
Symptoms will include incorrect program function or a Java exception such as
<literal>java.lang.VerifyError</literal>.
In these situations it's most helpful to include the offending class
in the bug report. When using load-time weaving the woven classes are
In these situations it's most helpful to include the offending class
in the bug report. When using load-time weaving the woven classes are
in memory only so to save them to disk configure
<literal>META-INF/aop.xml</literal> to dump the classes (by default
to an <literal>_ajdump</literal> subdirectory of the current working
directory). Also if the input class file is not available
<literal>META-INF/aop.xml</literal> to dump the classes (by default
to an <literal>_ajdump</literal> subdirectory of the current working
directory). Also if the input class file is not available
(e.g. it is a generated proxy or has already been instrumented by another agent)
you can configure the weaver to dump the input classes as well.
</para>
<sect2 id="ltw-examples" xreflabel="ltwdump-configuration">
<title>Configuring bytecode dumping in load-time weaving</title>
<para>
For details of how to configure byte-code dumping, see the
AspectJ Development Environment Guide section on
For details of how to configure byte-code dumping, see the
AspectJ Development Environment Guide section on
<ulink url="../devguide/ltw-configuration.html#configuring-load-time-weaving-with-aopxml-files">
Configuring Load-time Weaving</ulink>.
Configuring Load-time Weaving</ulink>.
Following is a simple example.
</para>
</sect2>

<sect2 id="ltwdump-examples" xreflabel="LTW Dump Examples">
<title>LTW Dump Examples</title>
<para> The following <literal>META-INF/aop.xml</literal> will
<para> The following <literal>META-INF/aop.xml</literal> will
weave classes in the <literal>com.foo</literal> package (and subpackages) but not
CGLIB generated classes in the <literal>com.foo.bar</literal> package (and subpackages).
CGLIB generated classes in the <literal>com.foo.bar</literal> package (and subpackages).
It will also ensure all
woven byte-code is dumped both before and after weaving. </para>
<programlisting><![CDATA[
<aspectj>
<aspects>
<aspect name="ataspectj.EmptyAspect"/>
</aspects>
<weaver options="-verbose -debug">
<dump within="com.foo.bar..*" beforeandafter="true"/>
<include within="com.foo..*"/>
<exclude within="com.foo.bar..*CGLIB*"/>
</weaver>
</aspectj>
]]></programlisting>
<aspectj>
<aspects>
<aspect name="ataspectj.EmptyAspect"/>
</aspects>
<weaver options="-verbose -debug">
<dump within="com.foo.bar..*" beforeandafter="true"/>
<include within="com.foo..*"/>
<exclude within="com.foo.bar..*CGLIB*"/>
</weaver>
</aspectj>
]]></programlisting>
<para> You should see messages similar to this: </para>

<programlisting><![CDATA[
@@ -59,15 +59,15 @@
[WeavingURLClassLoader] info register aspect ataspectj.EmptyAspect
[WeavingURLClassLoader] debug not weaving 'com.foo.bar.Test$$EnhancerByCGLIB$$12345'
[WeavingURLClassLoader] debug weaving 'com.foo.bar.Test'
]]></programlisting>
]]></programlisting>
<para> On disk you would find the following files: </para>

<programlisting><![CDATA[
_ajdump/_before/com/foo/bar/Test.class
_ajdump/com/foo/bar/Test.class
]]></programlisting>
_ajdump/_before/com/foo/bar/Test.class
_ajdump/com/foo/bar/Test.class
]]></programlisting>
</sect2>
</sect1>
</chapter>

+ 63
- 63
docs/pdGuideDB/messages.xml View File

@@ -1,6 +1,6 @@
<chapter id="messages" xreflabel="Messages">
<title>Messages</title>
<sect1 id="messages-introduction">
<title>Introduction</title>
<para>
@@ -11,47 +11,47 @@
which are hidden. However, when investigating
unexpected behavior it's helpful to show them. This section describes how
to configure messages, presents some problem scenarios when
compiling or doing load-time weaving, and summarizes some of the
compiling or doing load-time weaving, and summarizes some of the
more relevant messages.
</para>
<sect2 id="messages-introduction-config"
<sect2 id="messages-introduction-config"
xreflabel="messages-configuration">
<title>Configuring Messages</title>
<para>
The compiler offers <literal>-verbose</literal>,
<literal>-warning</literal>, and <literal>-XLint</literal> options
when invoked using the command-line, Ant, or embedded in an IDE.
All options are listed in the AspectJ Development Environment Guide
sections for
<ulink url="../devguide/ajc-ref.html">Ajc</ulink> and
The compiler offers <literal>-verbose</literal>,
<literal>-warning</literal>, and <literal>-XLint</literal> options
when invoked using the command-line, Ant, or embedded in an IDE.
All options are listed in the AspectJ Development Environment Guide
sections for
<ulink url="../devguide/ajc-ref.html">Ajc</ulink> and
<ulink url="../devguide/antTasks-iajc.html">Ant Tasks</ulink>.
The <ulink url="../devguide/ltw.html">Load-time Weaving</ulink>
The <ulink url="../devguide/ltw.html">Load-time Weaving</ulink>
section describes how to use XML configuration files and
system properties to pass options to the weaver. (You can also
pass options to the weaver using system properties in build-
time weaving.)
time weaving.)
The <literal>-verbose</literal> option has the effect of including
messages level "info", which are normally ignored.
Both <literal>warning</literal> and <literal>XLint</literal>
enable you to identify specific messages to emit, but warning
messages tend to be the same provided by the underlying Eclipse
JDT (Java) compiler, while XLint messages are emitted by the
enable you to identify specific messages to emit, but warning
messages tend to be the same provided by the underlying Eclipse
JDT (Java) compiler, while XLint messages are emitted by the
AspectJ compiler or weaver. Obviously, during load-time weaving
only weaver messages will be emitted. Similarly, if aspects
are compiled but not woven, then only compiler messages will be
emitted. However, the usual case for the compiler/weaver working
at build time is to emit both compiler and weaver messages.
</para>
<para> The tables below list some options, System Properties (for LTW only) and Java 5 annotations
<para> The tables below list some options, System Properties (for LTW only) and Java 5 annotations
used to control AspectJ messages. The method
of configuration depends on your environment so please refer to the relevant
documentation for
<ulink url="../devguide/ajc-ref.html">ajc</ulink>,
<ulink url="../devguide/antTasks.html">Ant</ulink> or
<ulink url="../devguide/ltw-configuration.html#weaver-options">LTW</ulink>.
of configuration depends on your environment so please refer to the relevant
documentation for
<ulink url="../devguide/ajc-ref.html">ajc</ulink>,
<ulink url="../devguide/antTasks.html">Ant</ulink> or
<ulink url="../devguide/ltw-configuration.html#weaver-options">LTW</ulink>.
</para>
<para>
<informaltable>
<tgroup cols="2">
@@ -105,15 +105,15 @@
</entry>
<entry>
In Ant tasks and LTW respectively specify the class to receive all messages.
See
See
<ulink url="../devguide/antTasks-iajc.html#antTasks-iajc-options">
iajc task options</ulink> or
<ulink url="../devguide/ltw-configuration.html#weaver-options">
Weaver Options</ulink>.
</entry>
</row>
<!-- We need full javadoc for this API
<!-- We need full javadoc for this API
<row>
<entry>
<literal>org.aspectj.tools.Main.setMessageHolder(..)</literal>
@@ -123,7 +123,7 @@
outside of Ant.
</entry>
</row>
-->
-->
</tbody>
</tgroup>
</informaltable>
@@ -144,7 +144,7 @@
<literal>aj.weaving.verbose</literal>
</entry>
<entry>
Show informational messages including AspectJ version and build date
Show informational messages including AspectJ version and build date
(same as <literal>-verbose</literal> option).
</entry>
</row>
@@ -162,7 +162,7 @@
<literal>org.aspectj.weaving.messages</literal>
</entry>
<entry>
Set this system property to enable tracing of all compiler
Set this system property to enable tracing of all compiler
messages. See <xref linkend="trace-configuration"/>.
</entry>
</row>
@@ -170,7 +170,7 @@
</tgroup>
</informaltable>
</para>
<para>
<informaltable>
<tgroup cols="2">
@@ -194,39 +194,39 @@
</tgroup>
</informaltable>
</para>
</sect2>
</sect1>
</sect2>
</sect1>
<sect1 id="messages-scenarios">
<title>Message scenarios</title>
<sect2 id="messages-scenarios-ct">
<title>Compile-time weaving scenarios</title>
<sect3 id="messages-scenarios-ct-adviceNotWoven">
<title>Advice not woven</title>
<para>This means that the pointcut for the advice did not match,
and it should be debugged as described in
and it should be debugged as described in
<xref linkend="pointcuts"/>.</para>
</sect3>
</sect2>
<sect2 id="messages-scenarios-ltw">
<title>Load-time weaving scenarios</title>
<para> You can use <literal>META-INF/aop.xml</literal> to control which
messages are produced during LTW. The following example will produce
basic informational messages about the lifecyle of the weaver in
addition to any warning or error messages. </para>

<programlisting><![CDATA[
<aspectj>
<weaver options="-verbose">
</weaver>
</aspectj>
]]></programlisting>
<para>The messages indicate which <literal>META-INF/aop.xml</literal>
configurations file(s) are being used. Each message is also preceeded by the
<aspectj>
<weaver options="-verbose">
</weaver>
</aspectj>
]]></programlisting>
<para>The messages indicate which <literal>META-INF/aop.xml</literal>
configurations file(s) are being used. Each message is also preceeded by the
name of the defining class loader associated with weaver. You can use this
information in a large system to distinguish between different applications each
of which will typically have its own class loader. </para>
@@ -238,25 +238,25 @@
[AppClassLoader@92e78c] info using configuration /C:/temp/META-INF/aop-ajc.xml
[AppClassLoader@92e78c] info register aspect ExceptionHandler
[AppClassLoader@92e78c] info processing reweavable type ExceptionHandler: ExceptionHandler.aj
]]></programlisting>
]]></programlisting>
<sect3 id="messages-scenarios-ltw-adviceNotWoven">
<title>Advice not woven</title>
<para> It is often difficult to determine, especially when using load-time weaving (LTW),
why advice has not been woven. Here is a quick guide to the messages to
look for. Firstly if you use the <literal>-verbose</literal> option you
look for. Firstly if you use the <literal>-verbose</literal> option you
should see the following message when your aspect is registered: </para>

<programlisting><![CDATA[
info register aspect MyAspect
]]></programlisting>
info register aspect MyAspect
]]></programlisting>

<para> Secondly if you use the <literal>-debug</literal> option you should
<para> Secondly if you use the <literal>-debug</literal> option you should
see a message indicating that you class is being woven: </para>

<programlisting><![CDATA[
debug weaving 'HelloWorld'
]]></programlisting>
debug weaving 'HelloWorld'
]]></programlisting>

<para> However this does not mean that advice has actually been woven into
your class; it says that the class has been passed to the weaver. To determine
@@ -264,18 +264,18 @@
option which will cause a message to be issued each time a join point is woven: </para>

<programlisting><![CDATA[
weaveinfo Join point 'method-execution(void HelloWorld.main(java.lang.String[]))' ...
]]></programlisting>
<para>If advice is woven at this join point you should get the
weaveinfo Join point 'method-execution(void HelloWorld.main(java.lang.String[]))' ...
]]></programlisting>
<para>If advice is woven at this join point you should get the
corresponding message.</para>
</sect3>
</sect2>
</sect1>
<sect1 id="messages-xlint">
<title>Lint messages</title>
<para>
<para>
The table below lists some useful <literal>-Xlint</literal> messages. </para>
<informaltable>
<tgroup cols="3">
@@ -297,8 +297,8 @@
<entry>
If an aspect is not being woven, despite being
registered, it could be that it has been excluded
by either an <literal>include</literal> or <literal>exclude</literal>
element in the
by either an <literal>include</literal> or <literal>exclude</literal>
element in the
<literal>aspects</literal> section of <literal>META-INF/aop.xml</literal>.
Enable this message to determine whether an aspect has
been excluded.
@@ -314,7 +314,7 @@
<entry>
Issued when advice did not potentially affect any join points.
This means the corresponding pointcut did not match any join
points in the program. This may be valid e.g., in library
points in the program. This may be valid e.g., in library
aspects or code picking up error conditions, but often the
programmer simply made a mistake in the pointcut. The best
approach is to debug the pointcut.
@@ -356,7 +356,7 @@
</entry>
<entry>
Before AspectJ 5, declare soft used to soften runtime exceptions
(unnecessarily). Since then, it does not but does issue this
(unnecessarily). Since then, it does not but does issue this
warning in case the programmer did intend for the exception
to be wrapped.
</entry>
@@ -381,5 +381,5 @@
</tgroup>
</informaltable>
</sect1>
</chapter>

+ 49
- 49
docs/pdGuideDB/trace.xml View File

@@ -1,29 +1,29 @@
<chapter id="trace" xreflabel="Tracing">
<title>Tracing</title>
<sect1 id="trace-introduction">
<title>Introduction</title>
<para>
<para>
The AspectJ developers have instrumented the compiler/weaver with
many "trace" messages for their own debugging use. These remain in
the production releases because tracing helps when it is hard to
the production releases because tracing helps when it is hard to
isolate the problem in a test case. This sections describes how
to enable tracing so you can provide trace information on bug reports.
</para>
<para>
The usual approach to opening a report on Bugzilla is to describe the symptoms of the
</para>
<para>
The usual approach to opening a report on Bugzilla is to describe the symptoms of the
problem and attach a simple testcase. This allows the AspectJ team to try and reproduce the problem in
an attempt to fix it as well as improve the test suite. Unfortunately it may not be possible
to produce such a testcase either because your program is too large or is commercially sensitive. Alternatively
to produce such a testcase either because your program is too large or is commercially sensitive. Alternatively
the problem may relate to your specific environment where AspectJ is being used and will not be
reproducible by the AspectJ team. In each of these situations you can produce a
trace of the compiler when the problem occurs instead. This can then be attached to the bug report. </para>

<sect2 id="trace-configuration" xreflabel="Configuring Tracing">
<title>Configuring Tracing</title>
<para> When available (Java 5 or later) AspectJ will use the
<para> When available (Java 5 or later) AspectJ will use the
<ulink url="http://java.sun.com/j2se/1.5.0/docs/guide/logging/index.html">
java.util.logging</ulink> infrastructure
configured using a <literal>logging.properties</literal> file. By default only error
@@ -31,14 +31,14 @@
method entry and exit events can be obtained using the appropriate configuration. All
regular compiler messages can also be logged through the infrastructure by setting the
<literal>org.aspectj.weaving.messages</literal> System property. </para>
<para> If you are running the AspectJ compiler/weaver under JDK 1.4 or earlier,
<para> If you are running the AspectJ compiler/weaver under JDK 1.4 or earlier,
AspectJ will use a simple built-in trace
infrastructure that logs to stderr. This is enabled by setting the
infrastructure that logs to stderr. This is enabled by setting the
<literal>org.aspectj.weaving.tracing.enabled</literal> System property. You may also override
the default behaviour or provide your own trace implementation using the
<literal>org.aspectj.weaving.tracing.factory</literal> System property. </para>
<para> The table below lists the System properties that can be used to configure tracing. </para>
<informaltable>
<tgroup cols="2">
@@ -73,10 +73,10 @@
</entry>
<entry>
Select trace infrastructure. Specify the fully qualified class name
of the <literal>org.aspectj.weaver.tools.TraceFactory</literal>
of the <literal>org.aspectj.weaver.tools.TraceFactory</literal>
interface to use a custom infrastructure. Specify a value of
<literal>default</literal> to force AspectJ to use it's
built-in infrastructure.
built-in infrastructure.
</entry>
</row>
<row>
@@ -97,68 +97,68 @@

<sect2 id="trace-examples" xreflabel="trace-examples">
<title>Examples</title>
<para> Using <literal>-Dorg.aspectj.tracing.factory=default</literal>
to force AspectJ to use its internal infrastructure,
<literal>-Dorg.aspectj.tracing.enabled=true</literal> to turn it on and
<literal>-Dorg.aspectj.tracing.enabled=true</literal> to turn it on and
<literal>-Dorg.aspectj.tracing.messages=true</literal> to include messages
running a simple HelloWorld with LTW will generate tracing to stderr. Below
is an extract from that trace with method arguments removed.
is an extract from that trace with method arguments removed.
You will notice the millisecond time stamp,
thread id and indication of entry/exit/event or message type for each line
of trace.
</para>
<programlisting><![CDATA[
15:44:18.630 main > org.aspectj.weaver.loadtime.Aj.<init>
15:44:18.630 main > org.aspectj.weaver.loadtime.Aj.<init>
15:44:18.660 main < org.aspectj.weaver.loadtime.Aj.<init>
15:44:18.660 main > org.aspectj.weaver.loadtime.Aj.preProcess
15:44:18.660 main - org.aspectj.weaver.loadtime.Aj.preProcess
15:44:18.730 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.<init>
15:44:18.730 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.<init>
15:44:18.730 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize
15:44:18.730 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize
15:44:18.821 main I [AppClassLoader@92e78c] info AspectJ Weaver Version DEVELOPMENT ...
15:44:18.821 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:18.821 main I [AppClassLoader@92e78c] info register classloader ...
15:44:18.821 main - org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:18.841 main - org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:18.821 main - org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:18.841 main - org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:18.841 main I [AppClassLoader@92e78c] info using configuration ...
15:44:18.891 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:18.891 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions
15:44:19.021 main > org.aspectj.weaver.World$TypeMap.<init>
15:44:19.021 main < org.aspectj.weaver.World$TypeMap.<init>
15:44:19.021 main > org.aspectj.weaver.CrosscuttingMembersSet.<init>
15:44:19.021 main < org.aspectj.weaver.CrosscuttingMembersSet.<init>
15:44:19.021 main > org.aspectj.weaver.Lint.<init>
15:44:19.021 main < org.aspectj.weaver.Lint.<init>
15:44:19.021 main > org.aspectj.weaver.World.<init>
15:44:19.021 main > org.aspectj.weaver.World.<init>
15:44:19.111 main < org.aspectj.weaver.World.<init>
15:44:19.201 main > org.aspectj.weaver.bcel.BcelWeaver.<init>
15:44:19.201 main > org.aspectj.weaver.bcel.BcelWeaver.<init>
15:44:19.201 main < org.aspectj.weaver.bcel.BcelWeaver.<init>
15:44:19.201 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions
15:44:19.211 main > org.aspectj.weaver.bcel.BcelWeaver.setReweavableMode
15:44:19.201 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions
15:44:19.211 main > org.aspectj.weaver.bcel.BcelWeaver.setReweavableMode
15:44:19.351 main < org.aspectj.weaver.bcel.BcelWeaver.setReweavableMode
15:44:19.351 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects
15:44:19.351 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects
15:44:19.351 main I [AppClassLoader@92e78c] info register aspect Aspect
15:44:19.351 main > org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect
15:44:19.501 main - org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass
15:44:19.632 main > org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect
15:44:19.792 main < org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect
15:44:19.792 main < org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect
15:44:19.792 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects
15:44:19.792 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions
15:44:19.792 main > org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave
15:44:19.351 main > org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect
15:44:19.501 main - org.aspectj.weaver.bcel.BcelWorld.lookupJavaClass
15:44:19.632 main > org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect
15:44:19.792 main < org.aspectj.weaver.CrosscuttingMembersSet.addOrReplaceAspect
15:44:19.792 main < org.aspectj.weaver.bcel.BcelWeaver.addLibraryAspect
15:44:19.792 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerAspects
15:44:19.792 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.registerDefinitions
15:44:19.792 main > org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave
15:44:19.822 main < org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave
15:44:19.822 main > org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.weaveAndDefineConcete...
15:44:19.822 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.weaveAndDefineConcete...
15:44:19.822 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize
15:44:19.822 main > org.aspectj.weaver.tools.WeavingAdaptor.weaveClass
...
]]></programlisting>
15:44:19.822 main < org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize
15:44:19.822 main > org.aspectj.weaver.tools.WeavingAdaptor.weaveClass
...
]]></programlisting>
<para> Alternatively when running under Java 5 the <literal>logging.properties</literal>
file below could be used to configure Java Logging. The resulting
file, just containing trace for the
file, just containing trace for the
<literal>org.aspectj.weaver.loadtime</literal> package, will be
written to <literal>java0.log</literal> in your <literal>user.home</literal> directory.
written to <literal>java0.log</literal> in your <literal>user.home</literal> directory.
</para>

<programlisting><![CDATA[
@@ -172,15 +172,15 @@ java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = FINER

org.aspectj.weaver.loadtime.level = FINER
]]></programlisting>
<para>
]]></programlisting>
<para>
By setting the System property <literal>-Dorg.aspectj.tracing.debug=true</literal>
you should see a message confirming which trace infrastructure is being used.
</para>
<programlisting><![CDATA[
TraceFactory.instance=org.aspectj.weaver.tools.Jdk14TraceFactory@12dacd1
]]></programlisting>
TraceFactory.instance=org.aspectj.weaver.tools.Jdk14TraceFactory@12dacd1
]]></programlisting>
</sect2>
</sect1>
</chapter>

+ 1
- 83
docs/pom.xml View File

@@ -9,8 +9,6 @@
</parent>

<artifactId>docs</artifactId>
<packaging>jar</packaging>
<name>docs</name>

<profiles>
<profile>
@@ -19,77 +17,6 @@
<activeByDefault>true</activeByDefault>
</activation>

<dependencies>
<!--
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>runtime</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>testing-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>bridge</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>asm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.matcher</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>runtime</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>org.aspectj.matcher</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>bcel-builder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons</groupId>
<artifactId>commons</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/commons/commons.jar</systemPath>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath>
</dependency>
-->
</dependencies>

<build>
<resources>
<resource>
@@ -99,15 +26,6 @@
<include>**/local.properties</include>
</includes>
</resource>
<!--
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/local.properties</exclude>
</excludes>
</resource>
-->
</resources>

<pluginManagement>
@@ -143,7 +61,7 @@
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<version>3.0.0</version>
<executions>
<execution>
<id>make-docs</id>

+ 202
- 201
docs/progGuideDB/examples.xml View File

@@ -541,14 +541,14 @@ public aspect ComparablePoint {
</para>

<para>
The method <literal>Object.hashCode</literal> returns an
The method <literal>Object.hashCode</literal> returns an
integer, suitable for use as a hash table key. It is not required
that two objects which are not equal (according to the
that two objects which are not equal (according to the
<literal>equals</literal> method) return different integer
results from <literal>hashCode</literal> but it can
improve performance when the integer is used as a key into a
data structure. However, any two objects which are equal
must return the same integer value from a call to
improve performance when the integer is used as a key into a
data structure. However, any two objects which are equal
must return the same integer value from a call to
<literal>hashCode</literal>. Since the default implementation
of <literal>Object.equals</literal> returns <literal>true</literal>
only when two objects are identical, we need to redefine both
@@ -851,7 +851,7 @@ aspect TraceMyClasses {
</para>

<programlisting><![CDATA[
ajc -argfile tracing/tracev1.lst
ajc -argfile tracing/tracev1.lst
]]></programlisting>

<para>
@@ -969,7 +969,7 @@ public aspect TraceMyClasses extends Trace {
</para>

<programlisting><![CDATA[
ajc -argfile tracing/tracev2.lst
ajc -argfile tracing/tracev2.lst
]]></programlisting>

<para>
@@ -1099,7 +1099,7 @@ abstract aspect Trace {
</para>

<para>
This example examines an aspect that makes Point objects into
This example examines an aspect that makes Point objects into
Java beans with bound properties.
</para>

@@ -1190,10 +1190,10 @@ class Point {
<literal>Point</literal>'s "beanness". The first thing it does is
privately declare that each <literal>Point</literal> has a
<literal>support</literal> field that holds reference to an
instance of <classname>PropertyChangeSupport</classname>.
instance of <classname>PropertyChangeSupport</classname>.

<programlisting><![CDATA[
private PropertyChangeSupport Point.support = new PropertyChangeSupport(this);
private PropertyChangeSupport Point.support = new PropertyChangeSupport(this);
]]></programlisting>

The property change support object must be constructed with a
@@ -1210,24 +1210,24 @@ class Point {
which delegate the work to the property change support object:

<programlisting><![CDATA[
public void Point.addPropertyChangeListener(PropertyChangeListener listener){
support.addPropertyChangeListener(listener);
}
public void Point.addPropertyChangeListener(String propertyName,
PropertyChangeListener listener){
public void Point.addPropertyChangeListener(PropertyChangeListener listener){
support.addPropertyChangeListener(listener);
}
public void Point.addPropertyChangeListener(String propertyName,
PropertyChangeListener listener){

support.addPropertyChangeListener(propertyName, listener);
}
public void Point.removePropertyChangeListener(String propertyName,
PropertyChangeListener listener) {
support.removePropertyChangeListener(propertyName, listener);
}
public void Point.removePropertyChangeListener(PropertyChangeListener listener) {
support.removePropertyChangeListener(listener);
}
public void Point.hasListeners(String propertyName) {
support.hasListeners(propertyName);
}
support.addPropertyChangeListener(propertyName, listener);
}
public void Point.removePropertyChangeListener(String propertyName,
PropertyChangeListener listener) {
support.removePropertyChangeListener(propertyName, listener);
}
public void Point.removePropertyChangeListener(PropertyChangeListener listener) {
support.removePropertyChangeListener(listener);
}
public void Point.hasListeners(String propertyName) {
support.hasListeners(propertyName);
}
]]></programlisting>
</para>

@@ -1237,7 +1237,7 @@ class Point {
<classname>Serializable</classname> interface:

<programlisting><![CDATA[
declare parents: Point implements Serializable;
declare parents: Point implements Serializable;
]]></programlisting>

Implementing this interface in Java does not require any methods to
@@ -1254,7 +1254,7 @@ class Point {
<literal>Y</literal> properties, calls the original
<literal>set</literal> method and then fires the appropriate
property change event according to which set method was
called.
called.
</para>

<programlisting><![CDATA[
@@ -1323,33 +1323,33 @@ aspect BoundPoint {
</para>

<programlisting><![CDATA[
class Demo implements PropertyChangeListener {
class Demo implements PropertyChangeListener {

static final String fileName = "test.tmp";
static final String fileName = "test.tmp";

public void propertyChange(PropertyChangeEvent e){
System.out.println("Property " + e.getPropertyName() + " changed from " +
e.getOldValue() + " to " + e.getNewValue() );
}

public static void main(String[] args){
Point p1 = new Point();
p1.addPropertyChangeListener(new Demo());
System.out.println("p1 =" + p1);
p1.setRectangular(5,2);
System.out.println("p1 =" + p1);
p1.setX( 6 );
p1.setY( 3 );
System.out.println("p1 =" + p1);
p1.offset(6,4);
System.out.println("p1 =" + p1);
save(p1, fileName);
Point p2 = (Point) restore(fileName);
System.out.println("Had: " + p1);
System.out.println("Got: " + p2);
}
...
public void propertyChange(PropertyChangeEvent e){
System.out.println("Property " + e.getPropertyName() + " changed from " +
e.getOldValue() + " to " + e.getNewValue() );
}

public static void main(String[] args){
Point p1 = new Point();
p1.addPropertyChangeListener(new Demo());
System.out.println("p1 =" + p1);
p1.setRectangular(5,2);
System.out.println("p1 =" + p1);
p1.setX( 6 );
p1.setY( 3 );
System.out.println("p1 =" + p1);
p1.offset(6,4);
System.out.println("p1 =" + p1);
save(p1, fileName);
Point p2 = (Point) restore(fileName);
System.out.println("Had: " + p1);
System.out.println("Got: " + p2);
}
...
}
]]></programlisting>

</sect3>
@@ -1381,7 +1381,7 @@ java bean.Demo

<para>
This demo illustrates how the Subject/Observer design pattern can be
coded with aspects.
coded with aspects.
</para>

<para>
@@ -1419,26 +1419,26 @@ java bean.Demo
</para>

<programlisting><![CDATA[
interface Subject {
void addObserver(Observer obs);
void removeObserver(Observer obs);
Vector getObservers();
Object getData();
}
interface Subject {
void addObserver(Observer obs);
void removeObserver(Observer obs);
Vector getObservers();
Object getData();
}
]]></programlisting>

<para>
<para>
The <classname>Observer</classname> interface is just as simple,
with methods to set and get <classname>Subject</classname> objects,
and a method to call when the subject gets updated.
</para>

<programlisting><![CDATA[
interface Observer {
void setSubject(Subject s);
Subject getSubject();
void update();
}
interface Observer {
void setSubject(Subject s);
Subject getSubject();
void update();
}
]]></programlisting>

<para>
@@ -1449,32 +1449,32 @@ java bean.Demo
</para>

<programlisting><![CDATA[
abstract aspect SubjectObserverProtocol {
abstract aspect SubjectObserverProtocol {

abstract pointcut stateChanges(Subject s);
abstract pointcut stateChanges(Subject s);

after(Subject s): stateChanges(s) {
for (int i = 0; i < s.getObservers().size(); i++) {
((Observer)s.getObservers().elementAt(i)).update();
}
}
after(Subject s): stateChanges(s) {
for (int i = 0; i < s.getObservers().size(); i++) {
((Observer)s.getObservers().elementAt(i)).update();
}
}

private Vector Subject.observers = new Vector();
public void Subject.addObserver(Observer obs) {
observers.addElement(obs);
obs.setSubject(this);
}
public void Subject.removeObserver(Observer obs) {
observers.removeElement(obs);
obs.setSubject(null);
}
public Vector Subject.getObservers() { return observers; }
private Vector Subject.observers = new Vector();
public void Subject.addObserver(Observer obs) {
observers.addElement(obs);
obs.setSubject(this);
}
public void Subject.removeObserver(Observer obs) {
observers.removeElement(obs);
obs.setSubject(null);
}
public Vector Subject.getObservers() { return observers; }

private Subject Observer.subject = null;
public void Observer.setSubject(Subject s) { subject = s; }
public Subject Observer.getSubject() { return subject; }
private Subject Observer.subject = null;
public void Observer.setSubject(Subject s) { subject = s; }
public Subject Observer.getSubject() { return subject; }

}
}
]]></programlisting>

<para>
@@ -1482,7 +1482,7 @@ java bean.Demo
pointcut that extending aspects can override. It defines advice
that should run after the join points of the pointcut. And it
declares an inter-type field and two inter-type methods so that
each <literal>Observer</literal> can hold onto its <literal>Subject</literal>.
each <literal>Observer</literal> can hold onto its <literal>Subject</literal>.
</para>
</sect3>

@@ -1497,28 +1497,28 @@ java bean.Demo
</para>

<programlisting><![CDATA[
class Button extends java.awt.Button {
static final Color defaultBackgroundColor = Color.gray;
static final Color defaultForegroundColor = Color.black;
static final String defaultText = "cycle color";
Button(Display display) {
super();
setLabel(defaultText);
setBackground(defaultBackgroundColor);
setForeground(defaultForegroundColor);
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Button.this.click();
}
});
display.addToFrame(this);
}
class Button extends java.awt.Button {
static final Color defaultBackgroundColor = Color.gray;
static final Color defaultForegroundColor = Color.black;
static final String defaultText = "cycle color";
Button(Display display) {
super();
setLabel(defaultText);
setBackground(defaultBackgroundColor);
setForeground(defaultForegroundColor);
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Button.this.click();
}
});
display.addToFrame(this);
}

public void click() {}
public void click() {}

}
}
]]></programlisting>

<para>
@@ -1531,24 +1531,24 @@ java bean.Demo
</para>

<programlisting><![CDATA[
class ColorLabel extends Label {
class ColorLabel extends Label {

ColorLabel(Display display) {
super();
display.addToFrame(this);
}
ColorLabel(Display display) {
super();
display.addToFrame(this);
}

final static Color[] colors = {Color.red, Color.blue,
Color.green, Color.magenta};
private int colorIndex = 0;
private int cycleCount = 0;
void colorCycle() {
cycleCount++;
colorIndex = (colorIndex + 1) % colors.length;
setBackground(colors[colorIndex]);
setText("" + cycleCount);
}
}
final static Color[] colors = {Color.red, Color.blue,
Color.green, Color.magenta};
private int colorIndex = 0;
private int cycleCount = 0;
void colorCycle() {
cycleCount++;
colorIndex = (colorIndex + 1) % colors.length;
setBackground(colors[colorIndex]);
setText("" + cycleCount);
}
}
]]></programlisting>

<para>
@@ -1577,7 +1577,8 @@ aspect SubjectObserverProtocolImpl extends SubjectObserverProtocol {
target(s) &&
call(void Button.click());

}]]></programlisting>
}
]]></programlisting>

<para>
It does this by assuring that <classname>Button</classname> and
@@ -1594,7 +1595,7 @@ aspect SubjectObserverProtocolImpl extends SubjectObserverProtocol {
<sect3>
<title>Compiling and Running</title>

<para>
<para>
<classname>Demo</classname> is the top class that starts this
demo. It instantiates a two buttons and three observers and links
them together as subjects and observers. So to run the demo, go to
@@ -1602,8 +1603,8 @@ aspect SubjectObserverProtocolImpl extends SubjectObserverProtocol {
</para>

<programlisting><![CDATA[
ajc -argfile observer/files.lst
java observer.Demo
ajc -argfile observer/files.lst
java observer.Demo
]]></programlisting>

</sect3>
@@ -1803,43 +1804,43 @@ public class Customer {
</para>

<programlisting><![CDATA[
abstract class Connection {
abstract class Connection {

public static final int PENDING = 0;
public static final int COMPLETE = 1;
public static final int DROPPED = 2;
public static final int PENDING = 0;
public static final int COMPLETE = 1;
public static final int DROPPED = 2;

Customer caller, receiver;
private int state = PENDING;
Customer caller, receiver;
private int state = PENDING;

Connection(Customer a, Customer b) {
this.caller = a;
this.receiver = b;
}
Connection(Customer a, Customer b) {
this.caller = a;
this.receiver = b;
}

public int getState(){
return state;
}
public int getState(){
return state;
}

public Customer getCaller() { return caller; }
public Customer getCaller() { return caller; }

public Customer getReceiver() { return receiver; }
public Customer getReceiver() { return receiver; }

void complete() {
state = COMPLETE;
System.out.println("connection completed");
}
void complete() {
state = COMPLETE;
System.out.println("connection completed");
}

void drop() {
state = DROPPED;
System.out.println("connection dropped");
}
void drop() {
state = DROPPED;
System.out.println("connection dropped");
}

public boolean connects(Customer c){
return (caller == c || receiver == c);
}
public boolean connects(Customer c){
return (caller == c || receiver == c);
}

}
}
]]></programlisting>

</sect3>
@@ -1854,23 +1855,23 @@ public class Customer {
</para>

<programlisting><![CDATA[
class Local extends Connection {
Local(Customer a, Customer b) {
super(a, b);
System.out.println("[new local connection from " +
a + " to " + b + "]");
}
}
class Local extends Connection {
Local(Customer a, Customer b) {
super(a, b);
System.out.println("[new local connection from " +
a + " to " + b + "]");
}
}
]]></programlisting>

<programlisting><![CDATA[
class LongDistance extends Connection {
LongDistance(Customer a, Customer b) {
super(a, b);
System.out.println("[new long distance connection from " +
a + " to " + b + "]");
}
}
class LongDistance extends Connection {
LongDistance(Customer a, Customer b) {
super(a, b);
System.out.println("[new long distance connection from " +
a + " to " + b + "]");
}
}
]]></programlisting>

</sect3>
@@ -1913,22 +1914,22 @@ java telecom.BasicSimulation
</para>

<programlisting><![CDATA[
class Timer {
long startTime, stopTime;
class Timer {
long startTime, stopTime;

public void start() {
startTime = System.currentTimeMillis();
stopTime = startTime;
}
public void start() {
startTime = System.currentTimeMillis();
stopTime = startTime;
}

public void stop() {
stopTime = System.currentTimeMillis();
}
public void stop() {
stopTime = System.currentTimeMillis();
}

public long getTime() {
return stopTime - startTime;
}
}
public long getTime() {
return stopTime - startTime;
}
}
]]></programlisting>

</sect4>
@@ -1963,14 +1964,14 @@ public aspect TimerLog {

<para>
The <classname>Timing</classname> aspect is declares an
inter-type field <literal>totalConnectTime</literal> for
inter-type field <literal>totalConnectTime</literal> for
<classname>Customer</classname> to store the accumulated connection
time per <classname>Customer</classname>. It also declares that
each <classname>Connection</classname> object has a timer.
each <classname>Connection</classname> object has a timer.

<programlisting><![CDATA[
public long Customer.totalConnectTime = 0;
private Timer Connection.timer = new Timer();
public long Customer.totalConnectTime = 0;
private Timer Connection.timer = new Timer();
]]></programlisting>

Two pieces of after advice ensure that the timer is started when
@@ -2029,7 +2030,7 @@ public aspect Timing {
runs after <classname>Timing</classname>'s advice on the same join
point. Finally, it declares inter-type methods and fields for
<classname>Customer</classname> to handle the
<literal>totalCharge</literal>.
<literal>totalCharge</literal>.
</para>

<programlisting><![CDATA[
@@ -2097,10 +2098,10 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
protected void report(Customer c){
Timing t = Timing.aspectOf();
System.out.println(c + " spent " + t.getTotalConnectTime(c));
}
protected void report(Customer c){
Timing t = Timing.aspectOf();
System.out.println(c + " spent " + t.getTotalConnectTime(c));
}
]]></programlisting>
</sect3>

@@ -2115,8 +2116,8 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
ajc -argfile telecom/timing.lst
java telecom.TimingSimulation
ajc -argfile telecom/timing.lst
java telecom.TimingSimulation
]]></programlisting>

<para>
@@ -2125,8 +2126,8 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
ajc -argfile telecom/billing.lst
java telecom.BillingSimulation
ajc -argfile telecom/billing.lst
java telecom.BillingSimulation
]]></programlisting>

</sect3>
@@ -2199,8 +2200,8 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
public static void traceEntry(String str);
public static void traceExit(String str);
public static void traceEntry(String str);
public static void traceExit(String str);
]]></programlisting>

<para>
@@ -2210,7 +2211,7 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
Trace.traceEntry("Square.distance in " + toString());
Trace.traceEntry("Square.distance in " + toString());
]]></programlisting>

<para>
@@ -2219,8 +2220,8 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
public static void traceEntry(String str, Object obj);
public static void traceExit(String str, Object obj);
public static void traceEntry(String str, Object obj);
public static void traceExit(String str, Object obj);
]]></programlisting>

<para>
@@ -2230,7 +2231,7 @@ public aspect Billing {
</para>

<programlisting><![CDATA[
Trace.traceEntry("Square.distance", this);
Trace.traceEntry("Square.distance", this);
]]></programlisting>

<para>

+ 46
- 46
docs/progGuideDB/implementation.xml View File

@@ -5,7 +5,7 @@
<sect1>
<title>Compiler Notes</title>

<para>
<para>
The initial implementations of AspectJ have all been
compiler-based implementations. Certain elements of AspectJ's
semantics are difficult to implement without making modifications
@@ -25,7 +25,7 @@
</para>

<programlisting><![CDATA[
before(): get(int Point.x) { System.out.println("got x"); }
before(): get(int Point.x) { System.out.println("got x"); }
]]></programlisting>

<para>
@@ -36,7 +36,7 @@
compiled, whether changes were made later, etc.
</para>

<para>
<para>
But AspectJ implementations are permitted to deviate from this in
a well-defined way -- they are permitted to advise only accesses
in <emphasis>code the implementation controls</emphasis>. Each
@@ -67,11 +67,11 @@
can be advised only if ajc controls the bytecode for the method or
constructor body in question.
The end of an exception handler is underdetermined in bytecode,
so ajc will not implement after or around advice on handler join
so ajc will not implement after or around advice on handler join
points.
Similarly, ajc cannot implement around advice on initialization
or preinitialization join points.
In cases where ajc cannot implement advice, it will emit a
Similarly, ajc cannot implement around advice on initialization
or preinitialization join points.
In cases where ajc cannot implement advice, it will emit a
compile-time error noting this as a compiler limitation.
</para>

@@ -100,35 +100,35 @@
</para>
<para>
When declaring members on interfaces, the implementation must
control both the interface and the top-level implementors of
control both the interface and the top-level implementors of
that interface (the classes that implement the interface but
do not have a superclass that implements the interface).
You may weave these separately, but be aware that you will get
runtime exceptions if you run the affected top-level classes
without the interface as produced by the same ajc implementation.
Any intertype declaration of an abstract method on an interface
must be specified as public, you will get a compile time error
message indicating this is a compiler limitation if you do not
without the interface as produced by the same ajc implementation.
Any intertype declaration of an abstract method on an interface
must be specified as public, you will get a compile time error
message indicating this is a compiler limitation if you do not
specify public. A non-abstract method declared on an interface
can use any access modifier except protected. Note that this is
different to normal Java rules where all members declared in
different to normal Java rules where all members declared in
an interface are implicitly public.
Finally, note that one cannot define static fields or methods
Finally, note that one cannot define static fields or methods
on interfaces.
</para>
<para>
When declaring methods on target types, only methods declared
public are recognizable in the bytecode, so methods must be
declared public to be overridden in any subtype or to be called
When declaring methods on target types, only methods declared
public are recognizable in the bytecode, so methods must be
declared public to be overridden in any subtype or to be called
from code in a later compile using the target type as a library.
</para>
<para>
Other AspectJ implementations, indeed, future versions of ajc, may
define <emphasis>code the implementation controls</emphasis> more
liberally or restrictively, so long as they comport with the Java
language. For example, the <literal>call</literal> pointcut does
not pick out reflective calls to a method implemented in
not pick out reflective calls to a method implemented in
<literal>java.lang.reflect.Method.invoke(Object, Object[])</literal>.
Some suggest that the call "happens" and the call pointcut should
pick it out, but the AspectJ language shouldn't anticipate what happens
@@ -172,12 +172,12 @@
</para>

<programlisting><![CDATA[
class Test {
void main(String[] args) {
System.out.println(Test.class); // calls Class.forName
System.out.println(args[0] + args[1]); // calls StringBuffer.append
}
}
class Test {
void main(String[] args) {
System.out.println(Test.class); // calls Class.forName
System.out.println(args[0] + args[1]); // calls StringBuffer.append
}
}
]]></programlisting>

<para>In short, the join point model of the current AspectJ
@@ -217,7 +217,7 @@
</para>

<programlisting><![CDATA[
cflow(call(void foo()) || handler(java.io.IOException))
cflow(call(void foo()) || handler(java.io.IOException))
]]></programlisting>

<para> will capture all join points in the control flow of a call to
@@ -236,9 +236,9 @@
</para>

<programlisting><![CDATA[
before(): handler(java.io.IOException) && cflow(void parse()) {
System.out.println("about to handle an exception while parsing");
}
before(): handler(java.io.IOException) && cflow(void parse()) {
System.out.println("about to handle an exception while parsing");
}
]]></programlisting>

<para>
@@ -258,16 +258,16 @@
</para>

<programlisting><![CDATA[
class C {
double d = Math.sqrt(2);
}
class C {
double d = Math.sqrt(2);
}
]]></programlisting>

<para>
are considered part of constructors by the time AspectJ gets ahold
of bytecode. That is, the assignment of d to the square root of
two happens <emphasis>inside</emphasis> the default constructor of
C.
C.
</para>

<para>
@@ -280,15 +280,15 @@
</para>

<programlisting><![CDATA[
aspect A {
C.new(Object o) {} // implicitly calls super()
aspect A {
C.new(Object o) {} // implicitly calls super()

public static void main(String[] args) {
System.out.println((new C() ).d); // prints 1.414...
System.out.println((new C(null)).d); // prints 0.0
}
public static void main(String[] args) {
System.out.println((new C() ).d); // prints 1.414...
System.out.println((new C(null)).d); // prints 0.0
}
]]></programlisting>
<para>
It is the job of an inter-type constructor to do all the required
initialization, or to delegate to a <literal>this</literal>
@@ -302,8 +302,8 @@
<para>Writing aspects in annotation-style is subject to the same
bytecode limitations since the binary aspects take the same
form and are woven in the same way. However, the implementation
differences (e.g., the mechanism for implementing around advice)
may be apparent at runtime. See the documentation on annotation-style
differences (e.g., the mechanism for implementing around advice)
may be apparent at runtime. See the documentation on annotation-style
for more information.
</para>
</sect1>
@@ -311,7 +311,7 @@
<title>Summary of implementation requirements</title>
<para>
This summarizes the requirements of our implementation of AspectJ.
For more details, see the relevant sections of this guide.
For more details, see the relevant sections of this guide.
</para>
<itemizedlist spacing="compact">
<listitem>
@@ -343,7 +343,7 @@
<para>Implementation Caveats</para>
<itemizedlist spacing="compact">
<listitem>
<para>The initialization and preinitialization join points
<para>The initialization and preinitialization join points
do not support around advice</para>
</listitem>
<listitem>
@@ -355,7 +355,7 @@
</itemizedlist>
</listitem>
<listitem>
<para>Declaring members on an interface in an aspect affects only
<para>Declaring members on an interface in an aspect affects only
the topmost implementing classes the implementation controls.</para>
</listitem>
<listitem>
@@ -363,7 +363,7 @@
</listitem>
<listitem>
<para>
Runtime <literal>ClassCastException</literal> may result
Runtime <literal>ClassCastException</literal> may result
from supplying a supertype of the actual type as an argument
to proceed(..) in around advice.</para>
</listitem>

+ 137
- 137
docs/progGuideDB/language.xml View File

@@ -623,10 +623,10 @@ interface MyInterface { ... }
</para>

<programlisting>
P ---------------------
P ---------------------
\
\ cflow of P
\
\ cflow of P
\
</programlisting>


@@ -639,16 +639,16 @@ interface MyInterface { ... }
</para>

<programlisting>
P ---------------------
P ---------------------
\
\ cflow of P
\
\ cflow of P
\
\
\
\
Q -------------\-------
Q -------------\-------
\ \
\ cflow of Q \ cflow(P) &amp;&amp; cflow(Q)
\ \
\ cflow of Q \ cflow(P) &amp;&amp; cflow(Q)
\ \
</programlisting>

<para>
@@ -666,10 +666,10 @@ interface MyInterface { ... }
</para>

<programlisting>
P &amp;&amp; Q -------------------
\
\ cflow of (P &amp;&amp; Q)
\
P &amp;&amp; Q -------------------
\
\ cflow of (P &amp;&amp; Q)
\
</programlisting>

<para>
@@ -715,7 +715,7 @@ aspect A {

<para>
The <literal>!within(<replaceable>A</replaceable>)</literal>
pointcut above is required to avoid the <literal>printPC</literal>
pointcut above is required to avoid the <literal>printPC</literal>
pointcut applying to the <literal>System.out.println</literal>
call in the advice body. If this was not present a recursive call
would result as the pointcut would apply to its own advice.
@@ -734,9 +734,9 @@ aspect A {
</para>

<programlisting><![CDATA[
pointcut setter(): target(Point) &&
(call(void setX(int)) ||
call(void setY(int)));
pointcut setter(): target(Point) &&
(call(void setX(int)) ||
call(void setY(int)));
]]></programlisting>

<para>
@@ -751,9 +751,9 @@ aspect A {
</para>

<programlisting><![CDATA[
pointcut setter(Point p): target(p) &&
(call(void setX(int)) ||
call(void setY(int)));
pointcut setter(Point p): target(p) &&
(call(void setX(int)) ||
call(void setY(int)));
]]></programlisting>

<para>
@@ -774,9 +774,9 @@ aspect A {
</para>

<programlisting><![CDATA[
pointcut testEquality(Point p): target(Point) &&
args(p) &&
call(boolean equals(Object));
pointcut testEquality(Point p): target(Point) &&
args(p) &&
call(boolean equals(Object));
]]></programlisting>

<para>
@@ -796,9 +796,9 @@ aspect A {
</para>

<programlisting><![CDATA[
pointcut testEquality(Point p1, Point p2): target(p1) &&
args(p2) &&
call(boolean equals(Object));
pointcut testEquality(Point p1, Point p2): target(p1) &&
args(p2) &&
call(boolean equals(Object));
]]></programlisting>

<para>
@@ -828,9 +828,9 @@ pointcut setter(Point p, int newval): target(p) &&
following pointcut definition will result in a compilation error:

<programlisting><![CDATA[
pointcut badPointcut(Point p1, Point p2):
(target(p1) && call(void setX(int))) ||
(target(p2) && call(void setY(int)));
pointcut badPointcut(Point p1, Point p2):
(target(p1) && call(void setX(int))) ||
(target(p2) && call(void setY(int)));
]]></programlisting>

because <literal>p1</literal> is only bound when calling
@@ -856,38 +856,38 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
class Handle {
Partner partner = new Partner();
class Handle {
Partner partner = new Partner();

public void foo() { partner.foo(); }
public void bar(int x) { partner.bar(x); }
public void foo() { partner.foo(); }
public void bar(int x) { partner.bar(x); }

public static void main(String[] args) {
Handle h1 = new Handle();
h1.foo();
h1.bar(2);
}
public static void main(String[] args) {
Handle h1 = new Handle();
h1.foo();
h1.bar(2);
}
}

class Partner {
boolean isAlive() { return true; }
void foo() { System.out.println("foo"); }
void bar(int x) { System.out.println("bar " + x); }
}
class Partner {
boolean isAlive() { return true; }
void foo() { System.out.println("foo"); }
void bar(int x) { System.out.println("bar " + x); }
}

aspect HandleLiveness {
before(Handle handle): target(handle) && call(public * *(..)) {
if ( handle.partner == null || !handle.partner.isAlive() ) {
throw new DeadPartnerException();
}
aspect HandleLiveness {
before(Handle handle): target(handle) && call(public * *(..)) {
if ( handle.partner == null || !handle.partner.isAlive() ) {
throw new DeadPartnerException();
}
}
}

class DeadPartnerException extends RuntimeException {}
class DeadPartnerException extends RuntimeException {}
]]></programlisting>

</sect2>
<sect2 id="pointcut-best-practice" xreflabel="pointcut-best-practice">
<title>Writing good pointcuts</title>

@@ -919,15 +919,15 @@ pointcut setter(Point p, int newval): target(p) &&
</listitem>
</itemizedlist>
<para>
A well written pointcut should
A well written pointcut should
try and include at least the first two types (kinded and scoping), whilst the contextual designators may be included if wishing to
match based on join point context, or bind that context for use in the advice. Supplying either just a kinded designator or
just a contextual designator will work but could affect weaving performance (time and memory used)
due to all the extra processing and analysis.
Scoping designators are very fast to match, they can very quickly dismiss groups of join points that should not be further
match based on join point context, or bind that context for use in the advice. Supplying either just a kinded designator or
just a contextual designator will work but could affect weaving performance (time and memory used)
due to all the extra processing and analysis.
Scoping designators are very fast to match, they can very quickly dismiss groups of join points that should not be further
processed - that is why a good pointcut should always include one if possible.
</para>
</sect2>
</sect1>

@@ -945,14 +945,14 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
pointcut setter(Point p1, int newval): target(p1) && args(newval)
(call(void setX(int) ||
call(void setY(int)));
pointcut setter(Point p1, int newval): target(p1) && args(newval)
(call(void setX(int) ||
call(void setY(int)));

before(Point p1, int newval): setter(p1, newval) {
System.out.println("About to set something in " + p1 +
" to the new value " + newval);
}
before(Point p1, int newval): setter(p1, newval) {
System.out.println("About to set something in " + p1 +
" to the new value " + newval);
}
]]></programlisting>

<para>
@@ -961,12 +961,12 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
before(Point p1, int newval): target(p1) && args(newval)
(call(void setX(int)) ||
call(void setY(int))) {
System.out.println("About to set something in " + p1 +
" to the new value " + newval);
}
before(Point p1, int newval): target(p1) && args(newval)
(call(void setX(int)) ||
call(void setY(int))) {
System.out.println("About to set something in " + p1 +
" to the new value " + newval);
}
]]></programlisting>

<para>
@@ -979,9 +979,9 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
before(Point p, int x): target(p) && args(x) && call(void setX(int)) {
if (!p.assertX(x)) return;
}
before(Point p, int x): target(p) && args(x) && call(void setX(int)) {
if (!p.assertX(x)) return;
}
]]></programlisting>

<para>
@@ -991,9 +991,9 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
after(Point p, int x): target(p) && args(x) && call(void setX(int)) {
if (!p.assertX(x)) throw new PostConditionViolation();
}
after(Point p, int x): target(p) && args(x) && call(void setX(int)) {
if (!p.assertX(x)) throw new PostConditionViolation();
}
]]></programlisting>

<para>
@@ -1004,9 +1004,9 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
after(Point p) returning(int x): target(p) && call(int getX()) {
System.out.println("Returning int value " + x + " for p = " + p);
}
after(Point p) returning(int x): target(p) && call(int getX()) {
System.out.println("Returning int value " + x + " for p = " + p);
}
]]></programlisting>

<para>
@@ -1018,9 +1018,9 @@ pointcut setter(Point p, int newval): target(p) &&
</para>

<programlisting><![CDATA[
after() throwing(Exception e): target(Point) && call(void setX(int)) {
System.out.println(e);
}
after() throwing(Exception e): target(Point) && call(void setX(int)) {
System.out.println(e);
}
]]></programlisting>

<para>
@@ -1059,7 +1059,7 @@ void around(Point p, int x): target(p)
initialized to <literal>false</literal>:

<programlisting><![CDATA[
private boolean Server.disabled = false;
private boolean Server.disabled = false;
]]></programlisting>

It is declared <literal>private</literal>, which means that it is
@@ -1077,7 +1077,7 @@ void around(Point p, int x): target(p)
arguments that returns whatever <literal>this.x</literal> is:

<programlisting><![CDATA[
public int Point.getX() { return this.x; }
public int Point.getX() { return this.x; }
]]></programlisting>

Inside the body, <literal>this</literal> is the
@@ -1092,7 +1092,7 @@ void around(Point p, int x): target(p)
<literal>Point</literal>:

<programlisting><![CDATA[
public Point.new(int x, int y) { this.x = x; this.y = y; }
public Point.new(int x, int y) { this.x = x; this.y = y; }
]]></programlisting>

</para>
@@ -1103,7 +1103,7 @@ void around(Point p, int x): target(p)
to zero:

<programlisting><![CDATA[
public int Point.x = 0;
public int Point.x = 0;
]]></programlisting>

Because this is publically declared, it is an error if
@@ -1117,7 +1117,7 @@ void around(Point p, int x): target(p)
<literal>Comparable</literal> interface:

<programlisting><![CDATA[
declare parents: Point implements Comparable;
declare parents: Point implements Comparable;
]]></programlisting>

Of course, this will be an error unless <literal>Point</literal>
@@ -1129,7 +1129,7 @@ void around(Point p, int x): target(p)
<literal>GeometricObject</literal> class.

<programlisting><![CDATA[
declare parents: Point extends GeometricObject;
declare parents: Point extends GeometricObject;
]]></programlisting>
</para>

@@ -1138,8 +1138,8 @@ void around(Point p, int x): target(p)
following declarations

<programlisting><![CDATA[
public String Point.name;
public void Point.setName(String name) { this.name = name; }
public String Point.name;
public void Point.setName(String name) { this.name = name; }
]]></programlisting>

publicly declare that Point has both a String field
@@ -1155,13 +1155,13 @@ void around(Point p, int x): target(p)
interface:

<programlisting><![CDATA[
aspect A {
private interface HasName {}
declare parents: (Point || Line || Square) implements HasName;
aspect A {
private interface HasName {}
declare parents: (Point || Line || Square) implements HasName;

private String HasName.name;
public String HasName.getName() { return name; }
}
private String HasName.name;
public String HasName.getName() { return name; }
}
]]></programlisting>

This declares a marker interface <literal>HasName</literal>, and also declares that any
@@ -1193,7 +1193,7 @@ void around(Point p, int x): target(p)
aspect makes a private inter-type declaration of a field

<programlisting><![CDATA[
private int Foo.x;
private int Foo.x;
]]></programlisting>

Then code in the aspect can refer to <literal>Foo</literal>'s
@@ -1230,38 +1230,38 @@ void around(Point p, int x): target(p)
</para>

<programlisting><![CDATA[
class Point {
int x, y;
class Point {
int x, y;

public void setX(int x) { this.x = x; }
public void setY(int y) { this.y = y; }
public void setX(int x) { this.x = x; }
public void setY(int y) { this.y = y; }

public static void main(String[] args) {
Point p = new Point();
p.setX(3); p.setY(333);
}
}
public static void main(String[] args) {
Point p = new Point();
p.setX(3); p.setY(333);
}
}

aspect PointAssertions {
private boolean Point.assertX(int x) {
return (x <= 100 && x >= 0);
}
private boolean Point.assertY(int y) {
return (y <= 100 && y >= 0);
}
before(Point p, int x): target(p) && args(x) && call(void setX(int)) {
if (!p.assertX(x)) {
System.out.println("Illegal value for x"); return;
}
}
before(Point p, int y): target(p) && args(y) && call(void setY(int)) {
if (!p.assertY(y)) {
System.out.println("Illegal value for y"); return;
}
}
}
aspect PointAssertions {
private boolean Point.assertX(int x) {
return (x <= 100 && x >= 0);
}
private boolean Point.assertY(int y) {
return (y <= 100 && y >= 0);
}
before(Point p, int x): target(p) && args(x) && call(void setX(int)) {
if (!p.assertX(x)) {
System.out.println("Illegal value for x"); return;
}
}
before(Point p, int y): target(p) && args(y) && call(void setY(int)) {
if (!p.assertY(y)) {
System.out.println("Illegal value for y"); return;
}
}
}
]]></programlisting>

</sect2>
@@ -1290,11 +1290,11 @@ void around(Point p, int x): target(p)
</para>

<programlisting><![CDATA[
aspect TraceNonStaticMethods {
before(Point p): target(p) && call(* *(..)) {
System.out.println("Entering " + thisJoinPoint + " in " + p);
}
}
aspect TraceNonStaticMethods {
before(Point p): target(p) && call(* *(..)) {
System.out.println("Entering " + thisJoinPoint + " in " + p);
}
}
]]></programlisting>

<para>
@@ -1304,7 +1304,7 @@ void around(Point p, int x): target(p)
arguments of the join point:

<programlisting><![CDATA[
thisJoinPoint.getArgs()
thisJoinPoint.getArgs()
]]></programlisting>

In addition, it holds an object consisting of all the static
@@ -1312,7 +1312,7 @@ void around(Point p, int x): target(p)
and static signature:

<programlisting><![CDATA[
thisJoinPoint.getStaticPart()
thisJoinPoint.getStaticPart()
]]></programlisting>

If you only need the static information about the join point, you may
@@ -1327,11 +1327,11 @@ void around(Point p, int x): target(p)
</para>

<programlisting><![CDATA[
thisJoinPointStaticPart == thisJoinPoint.getStaticPart()
thisJoinPointStaticPart == thisJoinPoint.getStaticPart()

thisJoinPoint.getKind() == thisJoinPointStaticPart.getKind()
thisJoinPoint.getSignature() == thisJoinPointStaticPart.getSignature()
thisJoinPoint.getSourceLocation() == thisJoinPointStaticPart.getSourceLocation()
thisJoinPoint.getKind() == thisJoinPointStaticPart.getKind()
thisJoinPoint.getSignature() == thisJoinPointStaticPart.getSignature()
thisJoinPoint.getSourceLocation() == thisJoinPointStaticPart.getSourceLocation()
]]></programlisting>

<para>

+ 9
- 9
docs/progGuideDB/progguide.html.xsl View File

@@ -1,9 +1,9 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../../../aspectj-external-lib/docbook/docbook-xsl/html/chunk.xsl"/>
<xsl:param name="base.dir" select="'html/'"/>
<xsl:param name="html.ext" select="'.html'"/>
</xsl:stylesheet>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../../lib/docbook/docbook-xsl/html/chunk.xsl"/>
<xsl:param name="base.dir" select="'html/'"/>
<xsl:param name="html.ext" select="'.html'"/>
</xsl:stylesheet>

+ 372
- 371
docs/progGuideDB/semantics.xml
File diff suppressed because it is too large
View File


+ 4
- 3
installer/aspectjinstaller-assembly.xml View File

@@ -1,11 +1,13 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">

<id>aspectjinstaller</id>

<formats>
<format>jar</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>
@@ -20,7 +22,6 @@
<directory>../aj-build/dist/docs</directory>
<outputDirectory>files</outputDirectory>
</fileSet>
<fileSet>
<directory>../runtime/target/site/apidocs</directory>
<outputDirectory>files/doc/runtime-apidocs</outputDirectory>

+ 33
- 7
installer/pom.xml View File

@@ -11,7 +11,6 @@
</parent>

<artifactId>installer</artifactId>
<packaging>pom</packaging>
<name>AspectJ Installer</name>

<dependencies>
@@ -24,11 +23,16 @@

<build>
<plugins>
<!-- skip creation of test-jar in here -->

<!-- Skip creation of main + test JARs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<id>test-jar</id>
<phase>none</phase>
@@ -37,12 +41,8 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!--
Set version manually in order to override version from super POM, e.g. 2.2-beta-5 from
https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom
-->
<version>3.1.1</version>
<executions>
<execution>
<id>aspectjinstaller-assembly</id>
@@ -65,6 +65,32 @@
</execution>
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<executions>
<!-- Remove dependencies declared in this POM (if any) from uber JAR and strip down POM -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<flattenMode>oss</flattenMode>
<pomElements>
<dependencies>remove</dependencies>
<repositories>remove</repositories>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>flattened-pom.xml</flattenedPomFilename>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>

+ 0
- 2
lib/ant/INSTALL View File

@@ -1,2 +0,0 @@
For installation instructions see the manual in the docs subdirectory
or online at <http://ant.apache.org/manual/index.html>.

+ 0
- 310
lib/ant/KEYS View File

@@ -1,310 +0,0 @@
This file contains the PGP keys of various developers.

Users: pgp < KEYS
gpg --import KEYS
Developers:
pgp -kxa <your name> and append it to this file.
(pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
(gpg --list-sigs <your name>
&& gpg --armor --export <your name>) >> this file.

Type Bits/KeyID Date User ID
pub 1024/FEECAAED 1998/11/11 Stefan Bodewig <bodewig@bost.de>
Stefan Bodewig <bodewig@apache.org>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3i

mQCNAzZJoiMAAAEEAMzhUxTOC20Nprp6K4nLTiARt+EXii/dovNWWcfzZcYXi/lX
r3zpUTTZxlKQpd4RaHjFmGgoOraZE4jCRFARVcFJgYmGUKpcWJZO7YKL36WUizTM
+dyB2ycOtzlty1W5VmRL3FGqo67pKA9F/QHg3NSu9hY1W9xPPK7Kq3f+7KrtAAUR
tCBTdGVmYW4gQm9kZXdpZyA8Ym9kZXdpZ0Bib3N0LmRlPokAlQIFEDZSrGXHcgyK
jiW9zQEBshEEAMlG4qVjKp4/agdJG56M6izx9oaKecFLXHQJrFUy3w2PvZHFYtXc
osXKorX6bPrE8uB57MxbY2WapKeVRodlG0+j39vAf501duK8q2rktfWt9Cl4JjJ4
DbWhSWfV1ci62u2gCxwYQe22F9Wh+vhOR5NK9RTbSKhupdlFsnrk/i7xiQCVAwUQ
NkmiI67Kq3f+7KrtAQGdxQQAlcFOzSv7G6M4uGbgvw7IGgrhx7rawtIyv9hLXgVC
7ua9xaZV8G0Fl9gh8RnbdcZ4R/aT+KIiAFaslfZ3t6hlC4MTbnAJqvdS/NO98ZkJ
YvnzZSKHflAbd5gyE7IVxBC9/xRlF/Wls5sYNwb6RjoRCaOjxN/y3WCLa3Va101v
zNy0I1N0ZWZhbiBCb2Rld2lnIDxib2Rld2lnQGFwYWNoZS5vcmc+iQCVAwUQOxIo
BK7Kq3f+7KrtAQGn6gP/SBACdHakA4H//otpyESSrk4PmyOaYF0Kyok43Gee2mT+
m9+jZ3jLcC0oav6iH+otL/lhk9t/JDM8LjD2kAkdWWoIvvuPyCx97gOzojIo0Ve2
1wuxJTF/VIjwyOtE8FzE7p4tkc6EubVpeZkV9Pq9HFRBCUcyKJDLnF4tbstScLU=
=OBLe
-----END PGP PUBLIC KEY BLOCK-----


pub 1024D/51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au>
sig 3 51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au>
sig 5F6B8B72 2002-01-11 Stefan Bodewig <bodewig@apache.org>
uid Conor MacNeill <conor@apache.org>
sig 3 51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au>
sig 5F6B8B72 2002-01-11 Stefan Bodewig <bodewig@apache.org>
sub 1024g/D1ECBA5D 2001-05-29
sig 51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.0 (GNU/Linux)

mQGiBDsTqygRBACiZckNdclTlQFonLaIKBFGhMy0KKByw0x8XA4iwdbCXuF6xNIc
HIFHajJ74AHchQ4d8xtomBy6b8yvFgWVeaZensvn69BlLeqGdyeJRzfPt6TgRnzZ
2eWhb0HXdG3JwxL/2BabDhHfs4YJOrgB/vhRFQku6oCMRiBPtJj2werD6wCg0/zp
jacYTw6+CR+sVvneCNyySFED/R3j10c4RnR8djgv1jKT8CKPuHYraupI9INEe+I6
7qWjtJ02GzvMO6TElAtUsf4aysu45GgwkwEBnuG6mYb3Pq0V2c5tJc2A3Tj3DrdR
i3HUNwurbus76I0sPyyENPu12QPeC6mvWLEsxVJ9o0hRKFayGvYUmrwWK9UFLjvp
p9cXBACDHgLn7MAVLqUdYhRrUj/M+GOUpvBikEgoJJrEUmb5X4+++dffMh5HBIO4
5LA11qEKuM2xnKqOilP7NLYXz1Fe0ocqv0jsHB4SprFTTai7ma31uwuRQvCQXVv1
yJ5CLqYda64h/UA2kmmR2dfopmvDogYEMz/HU5voozxe7BEI7bQhQ29ub3IgTWFj
TmVpbGwgPGNvbm9yQGFwYWNoZS5vcmc+iFcEExECABcFAjsTqygFCwcKAwQDFQMC
AxYCAQIXgAAKCRCBBGRPUYmFBDgIAKCZztXqKhK6kXOnoGy7opCNmWU0lwCgsPDa
4m+ruW3ch0rfbqtR75S52R+IRgQQEQIABgUCPD6eTgAKCRCiEVrhX2uLcqCcAKCr
1Wylqju9YjBi5Twej9ze69JFBQCeOaMgo6yjnkcV3PnVInLlaMwPr5q0LUNvbm9y
IE1hY05laWxsIDxjb25vckBjb3J0ZXhlYnVzaW5lc3MuY29tLmF1PohXBBMRAgAX
BQI7E6xMBQsHCgMEAxUDAgMWAgECF4AACgkQgQRkT1GJhQTY0ACgmZmKheHzjPJs
5hybpyvnvEiPYqYAn2+ryxdtz8XyOMExGRmHNlhG7svsiEYEEBECAAYFAjw+nlUA
CgkQohFa4V9ri3JYYACg1WN+NCptfKVP1mbrIa+0ajztsiIAnAn+m70iwRRFZCxr
jcULoY5SjyTLuQENBDsTqy0QBACfsCxJ6iCtgX8zjlVtMsMfDqu72x5sYatWKn8c
u+4Oj5mi0x6azZIhwCa+K3ihLVOyG1mCRnzztGTIxWYRhq3TESIVOfgm+NgLGrmA
XUTFyCT+21TExLCpuVZKmUHsWXLxDtfQ1diPeQpiQ8+Fvb/4jLGFjFIrQ2VjtFQn
kumkSwADBgP9H0bF4hdMuVEcSJ9imxSoJshcOOA3Vd2+YiCTZhBygWM49wY5jNos
/DArIjNCE53IlOu/UtHB2jqkSqjF0soGYsUjeCWouiTP9hLuMKPjnqj9ryJPTDKz
nTCZ4TuB5CtzrKTlWLmPCPpFsGqe4KjMeKg/mqGqjPKl97xgStK9N9GIRgQYEQIA
BgUCOxOrLQAKCRCBBGRPUYmFBMM6AJsF3FFyZGEmbt9aGG1W/u0oI9mcLgCfQyJ+
aalbspazea4J9zgi59SSwOM=
=cBdR
-----END PGP PUBLIC KEY BLOCK-----

pub 1024D/5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org>
sig 3 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org>
sig 51898504 2002-01-11 Conor MacNeill <conor@cortexebusiness.com.au>
sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org>
sig 3 2261D073 2003-03-17 Astrid Keáler (Kess) <kess@kess-net.de>
sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik <dirkx@apache.org>
sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de>
sig B3B2A12C 2003-05-20 ct magazine CERTIFICATE <pgpCA@ct.heise.de>
sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org>
uid Stefan Bodewig <bodewig@bost.de>
sig 3 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org>
sig 51898504 2002-01-11 Conor MacNeill <conor@cortexebusiness.com.au>
sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org>
sig 3 2261D073 2003-03-17 Astrid Keáler (Kess) <kess@kess-net.de>
sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik <dirkx@apache.org>
sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de>
sig B3B2A12C 2003-05-20 ct magazine CERTIFICATE <pgpCA@ct.heise.de>
sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org>
uid Stefan Bodewig <stefan.bodewig@freenet.de>
sig 3 5F6B8B72 2003-03-07 Stefan Bodewig <bodewig@apache.org>
sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org>
sig 3 2261D073 2003-03-17 Astrid Keáler (Kess) <kess@kess-net.de>
sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik <dirkx@apache.org>
sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de>
sig B3B2A12C 2003-05-20 ct magazine CERTIFICATE <pgpCA@ct.heise.de>
sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org>
sub 1024g/24774157 2001-05-28
sig 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.0 (GNU/Linux)

mQGiBDsSIk4RBADSCj6rUjV64tYCGT1DYKYR7GthyWpNdGHSYLbETBcDatAe1dzQ
5NsCgfrlybfyeY+y1lxr3T9bqf6zJWDw/718wff96qmmv1qzexSYtmIrj+h53V82
EXwWOFuYMJisuxdT940iQzosm3GOv4MJdEg3oI2SgfEyRQQ6vO4Ob5rHDwCg5taZ
nrHOrXx2dIGHxpxRZ0SUl30D/jmtttFjYOQ3LBMriikz5mh2sK3ZnoSRF4o5O0zW
Ve6e2SFXOEjVjImKsH6KCbdQNelrAdgiyOoXClyQKsQ27pncbdWo6bO0E3POJZVm
XaeW7iudHVr63rU5PViXObIQrdQl0D59j5brKj4vdlTyUw8kaHPvbKPDEOwvZq4Y
LJQ5BACA1YilTeXRJqwFsNlpcxCHwlULD4QUVP496prQWf1B7Z6g0KvLGrQsO0Vn
Jcn+fEqukysTJixSXCPebosltd4RalJIupVYkp4w6MJ7biaDAlLuNhDcI/AiXTmV
dXUedVXIaM8I3Ne23gucwbAyc0Hvb+3cSAKRhl/azFQhuHBvlrQjU3RlZmFuIEJv
ZGV3aWcgPGJvZGV3aWdAYXBhY2hlLm9yZz6IWgQTEQIAGgULBwoDBAMVAwIDFgIB
AheAAhkBBQI7EiJPAAoJEKIRWuFfa4tyjzgAn3a+nFeNb3mAZQR4lRcXy3F+8eTh
AJ4iuLt4No6TUB9xNETrm3Y/0TvkU4hGBBARAgAGBQI8PtWPAAoJEIEEZE9RiYUE
nZIAnjOkQx1BfxN9+E7Yiz4MOxqZjSUpAKDQi0Alv/VR61fmR7KHZ11J2g+HSIiZ
BBMBAgAGBQI+dd8MAAoJED6Pt/L4g0HZJ2QD5RzYjJ0fi1Gr6NsjmIiU/lvfvPqj
bNoK2A2flkmLo2lk9jSa1AmF0ETOoCg8hZZHCbxyPZRdsmDJFXrZZWVTdUyZHhHb
Wx53DR3HavmVEEdDZBSkxfXdSu1CNq31sbdcumtd03FI6SV827cPzl1/RGUiOkEL
eK0hZb3IvSd5iEYEExECAAYFAj512sEACgkQ7tHqOSJh0HNFuACfb7quMJZHOk5p
pmTxf4GVS5bh3E4AniLa5788ktdcZCBE5Or+G+yuIGooiD8DBRA+daoa/W+IxiHQ
pxsRAkQFAKDmlWVuQnWfaGK9z8CP4vESTfiXyQCgpnf1yJWDgqWvUHOAvOeaTPDR
cOmIRgQQEQIABgUCPnekEAAKCRAVP6DNdaZ2ki/rAJ9Q0x5m4SE3hMNGUoMgS0MN
mYXDOQCdGa0QW2fZW4B1wSjiUIi6VgY+F7GIRgQQEQIABgUCPsoulgAKCRDb0kX8
s7KhLBfwAKDV6uwqf9AMBJlr4aE45rWOnlWAeQCgjBYQVHWFjV1cmpT06vE4bMDV
J6+IRgQTEQIABgUCPo3OLAAKCRDKaTl0gQOjfpFKAJ9TY+mKmq0INLC9iqxbEETj
NwOn0gCgspeNEqX1SUjt932Lj3IvXR6fkAi0IFN0ZWZhbiBCb2Rld2lnIDxib2Rl
d2lnQGJvc3QuZGU+iFcEExECABcFAjsSOYEFCwcKAwQDFQMCAxYCAQIXgAAKCRCi
EVrhX2uLcsm6AKDaA//SYJv2pcXwGBC89OSzGvxy3gCg1kx6qu6zJKaWaE1L9oFq
Vc65OUSIRgQQEQIABgUCPD7VlQAKCRCBBGRPUYmFBNCzAJ9tv7tNS6NwaOZQ8cR0
pGslJGKtuQCgpttMmhhRrUwyVuEXc+dKX7rdQMKImQQTAQIABgUCPnXfDwAKCRA+
j7fy+INB2Vm6A+IDxiYtMvd/mad+7hRoKXvD5AddB1SwnvQdJe0ewStFBYZxZdNO
LXdkVngCwAJziPGZcQmocEHVMrN+Mxe+3OX0PEZ+3KOOsAUi+fTov2xvf8EWKgX9
d0li9iEytVA4M0c52a3bPTC0Kki/KAY3m8oNvAmTwWB9dBSooFFDMIhGBBMRAgAG
BQI+ddrHAAoJEO7R6jkiYdBzruYAnAzvTrvDQNvoAoaDQJ+o/ydqMA8ZAJwNEOQD
Hsz+6ynbMPoQmKmUqfEISIg/AwUQPnWqIf1viMYh0KcbEQIkpwCeInf4o3C5Ykh/
xBodVImrp2Cvcy8AoMn3me5p4Sl2rm2tjVxTJZt2sUr7iEYEEBECAAYFAj53pBoA
CgkQFT+gzXWmdpIpGgCgiTARP6Cf+JKOxUaVFr0L9DC5oUcAoIxF7D5mOVK/AFcp
1cxNk3BLtdq3iEYEEBECAAYFAj7KLjIACgkQ29JF/LOyoSwAbACglNp7V2Pw4U57
5IuooM677bZf8pwAn2U2TcHj7PYprU+qYRkyJ3pa7FyyiEYEExECAAYFAj6NzjUA
CgkQymk5dIEDo35YPwCeJIU/monN96nP4jJjAuflEXMbemUAoJXq7oVCYuOCqWr/
T3VW0DM3W+dntCpTdGVmYW4gQm9kZXdpZyA8c3RlZmFuLmJvZGV3aWdAZnJlZW5l
dC5kZT6IXAQTEQIAHAUCPmiBXAIbAwQLBwMCAxUCAwMWAgECHgECF4AACgkQohFa
4V9ri3JPKACfXhFOr4gMMIQwEGvUb6J/X4asuzIAnje2H9T1r/jSVi1NbIEtQfbp
myQXiJkEEwECAAYFAj513w8ACgkQPo+38viDQdmGkgPnUYJfHlDrQ2jYJWuPDve9
n4pV9OvyIllKyLdfULjsLWXw4Jm+fMQJgWr2GEov1ZYIyS2+rGDZpbz/vxaBVbgq
M8TPdiXzxwU8AFq4k+Em4fKXR58ByLSJjvLLza61spNHJennEUFp3tTpEsr4bNuu
aoRYhtiKzTqNuoC+0x+IRgQTEQIABgUCPnXaxwAKCRDu0eo5ImHQc5lcAJ9FOoAL
4uHMuqHXrrxsEVPJvEJ2/ACggaOR62EziUqcqpdm/1Zy3P4T22iIPwMFED51qjj9
b4jGIdCnGxECWssAoKnkR63bWGCFDB5YJtfZJ+nQq3TAAKD1bzG/kITQpIHsT2vC
Y1yBmlWbBYhGBBARAgAGBQI+d6QaAAoJEBU/oM11pnaS+9IAn0kFlXAzOhhu4r5f
glMVuw5bTAd0AKCtYRX2ESU/+tsE8vuXWtsMCGeI5YhGBBARAgAGBQI+yi67AAoJ
ENvSRfyzsqEsSccAoKqG39X2y6xoQa56nviF5iCj/oTFAJwLKx9GyKEUbSM9f/IQ
7AsZPhHT54hGBBMRAgAGBQI+jc41AAoJEMppOXSBA6N+xYgAn1HbGamcXTDYSFjn
3U5ik2vQa8nuAKC/uUM01gsdn+71EiAkmrjlH6H9MLkBDQQ7EiJUEAQAzVKWS8Qr
kysydbTJu2/14wIbz2Coi93aAGelwCwXSxf50JpYdY3Lkcvd0FqT8bcEnz43MCSx
8vlKubQtUpx9WMGIb4ixtShLJ4lAa6FJldhychz/dnxSNyz5N8W6sby4dTVxac0r
loxjAOurGanhG7TMtgfDi0cEEoXRyAVoKyMAAwUD/j1pJm4Npq2mlJoE7MK3vAhg
KwYHFflmJusmqvSAtRuFdT15pbMJrA5bAK+lA3SVOOhhWTCItlphSR2qxJCAcBTe
OMqUi5ohFcCkSRNvwmDtH+80B3BehlEsEKNk8Z3moa2ch7Oxnb6XEXH5tGJ5Qvx9
Qid6ZfBaXx7bc8yKyCb4iEYEGBECAAYFAjsSIlQACgkQohFa4V9ri3INMgCgnc22
kj8TfjktU6u4SUUqud25ZZcAn0B2b0zPjKjGuiwdKSnkFbNcFS3g
=9dY9
-----END PGP PUBLIC KEY BLOCK-----

pub 1024R/697ECEDD 2000-04-06 Henri Gomez <hgomez@slib.fr>
sig 697ECEDD 2000-04-06 Henri Gomez <hgomez@slib.fr>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.0 (GNU/Linux)

mQCNAzjsydwAAAEEAMpwFU/ci3/wR3ryCGp9Exr+Rx/hTQ7hWAJcVw8ejlBXlT4T
yITlRUs0HGfRWxME2J55PuXXsIEPZzjfozNtvOyq8WlLlJ7iaiyWxVRoPJ25sSEj
C9etm6wjj4E66ZgzuElZkm1m69uEsCHPPNuz1oQ/g1O+SmIVxIYirlxpfs7dAAUR
tBxIZW5yaSBHb21leiA8aGdvbWV6QHNsaWIuZnI+iQCVAwUQOOzJ3IYirlxpfs7d
AQFQyQQAj0D9G0hEL7SQGaSCkkoXwvamQw42N8+tNm+jfWHWdE4HAiVlhJmI2GyD
sdcXVAcR8R7ILIRB5AY7a3bF+qMk0r+vO6oR878RKKn9AvtaAIOnrh6tr0tiPwf5
XDUMySxIWJEF3SmJAy9Lq3bAl5GMzZCFHiS0NW2gtWgmr/u1RuM=
=6l+I
-----END PGP PUBLIC KEY BLOCK-----

pub 1024R/397DCAD5 2002-07-03 Henri Gomez <hgomez@users.sourceforge.net>
sig 397DCAD5 2002-07-03 Henri Gomez <hgomez@users.sourceforge.net>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.0 (GNU/Linux)

mQCNAz0i0UUAAAEEALXePN6IHne0W96YRMnR+4EXB6402QY5f8ZLcnSUZUH55Fb1
qcZGBc3WRKlPiUvwBD+eVYgCpNSXF/H+oV1mawxNJN5XwqBEpfYmY8MRIPcqa61h
bJc3LBSm1qNf05G5Cwxeed+OgVm0r1HBy6DAgDHAqNlkC8DZ/BVgqMA5fcrVAAUR
tCpIZW5yaSBHb21leiA8aGdvbWV6QHVzZXJzLnNvdXJjZWZvcmdlLm5ldD6JAJUD
BRA9ItFFFWCowDl9ytUBASNyA/458T84LUVhqq6Y9fPBAfcFMWY2kehuDWsQEXkO
46XoK+AnFZCkKuyDLqPHchVUO5pK/gZYsDK/xJkfh3u4FTDTsecb9wFmIeyayVIN
SI8o6l8EZzDX/PGwqEwzxHrbQkIgIktNn5ApIoazvdBpbkQfNj1vr2wWoMYPLAWM
8xzecA==
=UmZ8
-----END PGP PUBLIC KEY BLOCK-----

pub 1024D/307A10A5 2002-07-18 Henri Gomez <hgomez@users.sourceforge.net>
sig 3 307A10A5 2002-07-18 Henri Gomez <hgomez@users.sourceforge.net>
sub 2048g/862B8F70 2002-07-18
sig 307A10A5 2002-07-18 Henri Gomez <hgomez@users.sourceforge.net>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.0 (GNU/Linux)

mQGiBD02vbERBAC1v8fR6gjERpaz4UMfdy0hRVWCPSbOdF+Swm/IenjVzErco6zb
MTa13umUNrDPBy/tTWiCCZrOnqi7fgDzWqPEqrXJjKAFVLEWE6MmKylPPEPG1/bm
idkNGERSAZduvhKv777PzvEJJ/8eGe3wy/O8NbgIjCPtr4UklwCZS8cFuwCg8oMO
UdT8qZRtzdxdAyu1m5fUb+MD/3IKJYWXsdtb6iBphCU4f/BoyjVC9EZJ1ywLuiVM
siKbuaDUaXU9nWcbNKv+fx8uZ1NaadpfLokqqhnWcpnSiqw8HNR7SwsF1D33rkXK
O4FSuVss/tIoqGdWFcJyPkP4yP5shxqR335narVw2vDa0+BiWkALbA2qVsSIdZDB
LeFZA/47AMBS0U2BRk2rQT8LmMuFl7mR+wNBM4n7FUGdxsGn3TcYd4pXTNrEQPrV
YNdooKlikgGk4hgFnIFX09Spmimqgq0goFue81rttVdZZ4uep8dTghY6gwmvcOxX
jATbhWStBhdu9B35kzfHc+1QihD5Z94u4uyWIVBIzikcdiY8LbQqSGVucmkgR29t
ZXogPGhnb21lekB1c2Vycy5zb3VyY2Vmb3JnZS5uZXQ+iFcEExECABcFAj02vbEF
CwcKAwQDFQMCAxYCAQIXgAAKCRAZMdaEMHoQpYijAKCCP68ndU/kTXR9XAKLvibC
3S8+1QCfUFQYte3Jo+MHKaWjsu9JGptRzo+5Ag0EPTa93RAIAKlsRJ5gOGTFsmaR
W9k6MIh4c/MCy7J7HUxT5xTdHROa+3zUh+FAE/JaOx9ZtZtH863DFHA8cP4L+tpi
PjBT6g2E94dwGcuH/OiSSCT4JSBukbGbOuLLdmFXqUl8+4gsL90Xal67FtNLwyLG
1n7geLir0byD+OT7VLA5w+6G0NOpJEveV/FIa2qLgdRZ8vz73ybgMh18hBUrUmro
jncp0rln2VU7VCH1C2aClKm7kK4mGAjIFIzKbguK+kM3b8NDHmXKpT6syyCtIM3h
prkV1TUCAFqLI32aSdlTN79lpeA2zDga9k4/4X/RDHsFpRN2neRFGTNUtuUgYpQQ
E5zWBmMAAwUH/RiGxyeBsad923IwE1+GAjxFl2tqF9xWk0J6yTnSK4nfhYAE9evV
jwDEok9jRl4ILCcXx6YN/d/lWNuSbARKHz/3hLiTouPpwd3SSJ8is2x9PgpJz5JX
cD0y1SkbPLvs3jH3ZmdcxZpuAmJeI/typqFKK5pWP44oXIH+XH/8nWDtmLEBkgKQ
/ATQWenMTmZ6MIJ6aWKWGkO9QS6iYRz3PPPGQ1O8W02CeprM2wBtlb8J1Z3RxNhM
rZcg/1Qi3V3D1HI4zw6tAFmDeBb8J4PaBQzqlhzx2EBTbfwNPhV8AlPvpxHEeGGn
v+O1yhZr33SnyZdINNoNDn+owVMdmkobe9GIRgQYEQIABgUCPTa93QAKCRAZMdaE
MHoQpRsTAJ4qst3MhLm48fBAEnzuzi/BIKr+AgCfYaCB/AvPoncQbHc8BcNGRimR
P9A=
=hQhz
-----END PGP PUBLIC KEY BLOCK-----

pub 1024D/EDF62C35 2002-04-10 Magesh Umasankar <umagesh@apache.org>
sig 3 EDF62C35 2002-04-10 Magesh Umasankar <umagesh@apache.org>
sig 3 5F6B8B72 2003-03-07 Stefan Bodewig <bodewig@apache.org>
sub 1024g/B5FFC53F 2002-04-10
sig EDF62C35 2002-04-10 Magesh Umasankar <umagesh@apache.org>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.0 (GNU/Linux)

mQGiBDy0ebgRBADuKIKD8PuJ4wKEV1h2AprwJjxCRx8vn48XNwfLZuvhw8cpArtK
rZwhoGPPUPEEXgtTNerlKq4VwpAwcnvRz7oC/7aWkUbcR2sAyhfe2scohwPgw7Xv
+isWC0NDPdrxvXG/PUOG/cnELunr51ymybBqBxUd2gMhYIxPo67D+YPYLwCgwcZp
yc/6kJa116ESWHrti342GD8D/1srpnRs9CiS1DQF1uZ1wW4vzj4VD61tKsjdWD8D
V573R22iMDLSj4oMB536WxUH7snz8XsAKm/peqJ6G9m0smtmWA1ago5yzQj70WqF
xzWBhHn2I/YfAQ8pb2s9q1lClj8elnCxT65L27ydBAZteejb2VqjtQ6iGy86PUT2
wRUvBADZmoV1eIZJEM5NnxBv1EtvRYZtIQEzZ8dO2A1LOS7qlVr8IypljNPLGhzX
VHNvVsjC9QMUSWeBsDedvQHQ3hJpIMnTI32XE1V4gX06gfVTZdhf2fLTtwnsHZp0
oumqshGDVRhNJJdDYLikxWOxOfkNveKEqJFvtuBR+ZqqluQKebQlTWFnZXNoIFVt
YXNhbmthciA8dW1hZ2VzaEBhcGFjaGUub3JnPohXBBMRAgAXBQI8tHm4BQsHCgME
AxUDAgMWAgECF4AACgkQ76Pnee32LDWSRwCfeASWXvpdt7bSFPMtszU/7uPEktsA
n23mYUN5WKJA1ZreW+0CcZ2ESnOviEYEExECAAYFAj5ogYgACgkQohFa4V9ri3IW
YACgsxGig0PL0M86rJsA/IpXjBdg3ysAoJzsoUZ/7s2BxDfzF/FRTVIzS+TMuQEN
BDy0eb8QBACBVb9YDJRp9Irzmq71Jf9FIPw+4g/cWpF3t/Eb7eSzMcOvTAXyNIWz
aaOjHre7lFctHfq8ls/6gR7uqajiAnfQcfTcu7pp+F5KsU0Embt83SFzZ3aoJwET
mB/LqUyrrGDiue3lU+flJO7UmcsRvtk0+BDkyCeB9HgfdpXbBLCyuwADBQP+PNxX
4e1tg3ZJo/xNEnD2Re3HjmQRrr0RYJLUGjgQrAEONSgowx3IW8/JssmNJVjnYm0q
jSKsb8rergCFJhPNZ8Dd/k00pKcrq+IN6j7WTYLqPce87zrGAZUtmDwDSp5mxy5E
xWJJxsgBPk4YBQLzJt21A3BgK/i24Sze2VLbaZuIRgQYEQIABgUCPLR5vwAKCRDv
o+d57fYsNa8xAJ4mLfonZbd64+YY9rfvhIh3Vsl3AACeLPPKtma2K6XCfhTBEDnj
hzSr4vo=
=lBfF
-----END PGP PUBLIC KEY BLOCK-----
pub 1024D/265B4C63 2003-08-18 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org>
sig 3 265B4C63 2003-12-06 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org>
sig 3 5F6B8B72 2003-12-12 Stefan Bodewig <bodewig@apache.org>
uid Antoine Levy-Lambert (Apache Ant Committer) <antoine@antbuild.com>
sig 3 265B4C63 2003-08-18 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org>
sig 3 5F6B8B72 2003-12-12 Stefan Bodewig <bodewig@apache.org>
sub 1024g/A3060393 2003-08-18
sig 265B4C63 2003-08-18 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.2 (MingW32)

mQGiBD9AzmcRBACMqgb7IFvC/nLxw7mUAgHENeZXY3JOQJ8wVBevIbbMEeFvzHE2
diFydqUXocPexduYr0ahkf033WvWdAiNqDLfVW/HFOsc1TpjbHkqPUHtJ62Ya5tg
nH4UGN9BYZfMbfVDOSz41lYwmfK5HYgpZN/sBQBSKf2qgoFB+LxYaae8YwCgrWlu
fYhf7fkKbbdSf3BGS67ggNkD/0VvkXkw1SEnPaqrkKGkPKomCTb2auGxcYYI3/rP
1m+SGRf0gE1NtocmIEitiR6WvfKUjoMAXSCp5KdnUXmO9rwzkM002KCA7K5CY+e/
2bLDuiQ3rNiD4mFfG6M+UnmZ+GMFba1p9Cp4PqLNLsCHz67t7hEsscTZQ8mZ9xKM
+GCsA/9P+XFM7JDn9MLhYab9qo1CkceBkthUP6jWGjuAZ00elmBCkpkzNv5aIzss
xih2GpaU/tmcMjw8FGp0dTwzqdpmbZBLjunRnuBTir4m4l5G9rwl4JbfK1PVqk4a
VKkh9W7/yqBcEfNcsfJO9cqaQ+PzcnCoDiD9UHEBYzUhrCKwhLRCQW50b2luZSBM
ZXZ5LUxhbWJlcnQgKEFwYWNoZSBBbnQgQ29tbWl0dGVyKSA8YW50b2luZUBhbnRi
dWlsZC5jb20+iFsEExECABsFAj9AzmcGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQ
hhTWqyZbTGMnOgCeJV2gI+1CIxMR7dcIhXjPkiusreIAn2SGOsPS0o89l0EIVuc9
J2F03aB+iEYEExECAAYFAj/ZwioACgkQohFa4V9ri3J8CACgiGlh+td0BAnJPq19
ovEQR2DJ02MAoLP203EF+BLPpykeTcGp8UEWmeGQtEBBbnRvaW5lIExldnktTGFt
YmVydCAoQXBhY2hlIEFudCBDb21taXR0ZXIpIDxhbnRvaW5lQGFwYWNoZS5vcmc+
iF4EExECAB4FAj/SSwYCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQhhTWqyZb
TGOh/QCfbrSoipMlizyGT6c8BOPEd9zzfi0AnRRTqTDzXzsGk4CG/BJME9CCm7Ts
iEYEExECAAYFAj/ZwiMACgkQohFa4V9ri3IOVACgh2QHS1+cVjvM4eLjls1bJwWi
o5IAoLtAszHrwHS5qrhvr2rtnlyyyV2guQENBD9AzmkQBACNpBfqi2PweozCtxoX
PqzKdRDKqCw7TOrDR6lbP3z/ov/1SN5Vc0XqNzBSGqwBcmGWtneABkX7n4uzJrC5
wvX/TZ/DkMvypPyeNVMu+/ZMlzdbx06OUDKr6Fy/NtaI7cN1rw+Igyv22Q8ilhhg
s/5Rdj84EtJkWQjVRml6wXSAZwADBwP/TqyhOC4sA5YrePYGH8i46h0SU9dXjfEF
JijC8vXZ+BNQHQVK3fjEXedZL8Zvvp1bsMu7Muz9SMnqygM1unp2NGxLRd/9315p
Qh0VStYKn0xq13ybOKr0Gsyx5yyl3Nzlu/1qAR0es/zN4jV7/IQi3R2GOvezcpHX
mkbsYiZAhu2IRgQYEQIABgUCP0DOaQAKCRCGFNarJltMYxcsAKCSJJUABlXYnLBj
b+WtmAzu0JjZNACdFJ4KIATJDK/5ajFq5+irOpodoHc=
=UomR
-----END PGP PUBLIC KEY BLOCK-----

+ 0
- 203
lib/ant/LICENSE View File

@@ -1,203 +0,0 @@
/*
* Apache License
* Version 2.0, January 2004
* http://www.apache.org/licenses/
*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
*
* 1. Definitions.
*
* "License" shall mean the terms and conditions for use, reproduction,
* and distribution as defined by Sections 1 through 9 of this document.
*
* "Licensor" shall mean the copyright owner or entity authorized by
* the copyright owner that is granting the License.
*
* "Legal Entity" shall mean the union of the acting entity and all
* other entities that control, are controlled by, or are under common
* control with that entity. For the purposes of this definition,
* "control" means (i) the power, direct or indirect, to cause the
* direction or management of such entity, whether by contract or
* otherwise, or (ii) ownership of fifty percent (50%) or more of the
* outstanding shares, or (iii) beneficial ownership of such entity.
*
* "You" (or "Your") shall mean an individual or Legal Entity
* exercising permissions granted by this License.
*
* "Source" form shall mean the preferred form for making modifications,
* including but not limited to software source code, documentation
* source, and configuration files.
*
* "Object" form shall mean any form resulting from mechanical
* transformation or translation of a Source form, including but
* not limited to compiled object code, generated documentation,
* and conversions to other media types.
*
* "Work" shall mean the work of authorship, whether in Source or
* Object form, made available under the License, as indicated by a
* copyright notice that is included in or attached to the work
* (an example is provided in the Appendix below).
*
* "Derivative Works" shall mean any work, whether in Source or Object
* form, that is based on (or derived from) the Work and for which the
* editorial revisions, annotations, elaborations, or other modifications
* represent, as a whole, an original work of authorship. For the purposes
* of this License, Derivative Works shall not include works that remain
* separable from, or merely link (or bind by name) to the interfaces of,
* the Work and Derivative Works thereof.
*
* "Contribution" shall mean any work of authorship, including
* the original version of the Work and any modifications or additions
* to that Work or Derivative Works thereof, that is intentionally
* submitted to Licensor for inclusion in the Work by the copyright owner
* or by an individual or Legal Entity authorized to submit on behalf of
* the copyright owner. For the purposes of this definition, "submitted"
* means any form of electronic, verbal, or written communication sent
* to the Licensor or its representatives, including but not limited to
* communication on electronic mailing lists, source code control systems,
* and issue tracking systems that are managed by, or on behalf of, the
* Licensor for the purpose of discussing and improving the Work, but
* excluding communication that is conspicuously marked or otherwise
* designated in writing by the copyright owner as "Not a Contribution."
*
* "Contributor" shall mean Licensor and any individual or Legal Entity
* on behalf of whom a Contribution has been received by Licensor and
* subsequently incorporated within the Work.
*
* 2. Grant of Copyright License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* copyright license to reproduce, prepare Derivative Works of,
* publicly display, publicly perform, sublicense, and distribute the
* Work and such Derivative Works in Source or Object form.
*
* 3. Grant of Patent License. Subject to the terms and conditions of
* this License, each Contributor hereby grants to You a perpetual,
* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
* (except as stated in this section) patent license to make, have made,
* use, offer to sell, sell, import, and otherwise transfer the Work,
* where such license applies only to those patent claims licensable
* by such Contributor that are necessarily infringed by their
* Contribution(s) alone or by combination of their Contribution(s)
* with the Work to which such Contribution(s) was submitted. If You
* institute patent litigation against any entity (including a
* cross-claim or counterclaim in a lawsuit) alleging that the Work
* or a Contribution incorporated within the Work constitutes direct
* or contributory patent infringement, then any patent licenses
* granted to You under this License for that Work shall terminate
* as of the date such litigation is filed.
*
* 4. Redistribution. You may reproduce and distribute copies of the
* Work or Derivative Works thereof in any medium, with or without
* modifications, and in Source or Object form, provided that You
* meet the following conditions:
*
* (a) You must give any other recipients of the Work or
* Derivative Works a copy of this License; and
*
* (b) You must cause any modified files to carry prominent notices
* stating that You changed the files; and
*
* (c) You must retain, in the Source form of any Derivative Works
* that You distribute, all copyright, patent, trademark, and
* attribution notices from the Source form of the Work,
* excluding those notices that do not pertain to any part of
* the Derivative Works; and
*
* (d) If the Work includes a "NOTICE" text file as part of its
* distribution, then any Derivative Works that You distribute must
* include a readable copy of the attribution notices contained
* within such NOTICE file, excluding those notices that do not
* pertain to any part of the Derivative Works, in at least one
* of the following places: within a NOTICE text file distributed
* as part of the Derivative Works; within the Source form or
* documentation, if provided along with the Derivative Works; or,
* within a display generated by the Derivative Works, if and
* wherever such third-party notices normally appear. The contents
* of the NOTICE file are for informational purposes only and
* do not modify the License. You may add Your own attribution
* notices within Derivative Works that You distribute, alongside
* or as an addendum to the NOTICE text from the Work, provided
* that such additional attribution notices cannot be construed
* as modifying the License.
*
* You may add Your own copyright statement to Your modifications and
* may provide additional or different license terms and conditions
* for use, reproduction, or distribution of Your modifications, or
* for any such Derivative Works as a whole, provided Your use,
* reproduction, and distribution of the Work otherwise complies with
* the conditions stated in this License.
*
* 5. Submission of Contributions. Unless You explicitly state otherwise,
* any Contribution intentionally submitted for inclusion in the Work
* by You to the Licensor shall be under the terms and conditions of
* this License, without any additional terms or conditions.
* Notwithstanding the above, nothing herein shall supersede or modify
* the terms of any separate license agreement you may have executed
* with Licensor regarding such Contributions.
*
* 6. Trademarks. This License does not grant permission to use the trade
* names, trademarks, service marks, or product names of the Licensor,
* except as required for reasonable and customary use in describing the
* origin of the Work and reproducing the content of the NOTICE file.
*
* 7. Disclaimer of Warranty. Unless required by applicable law or
* agreed to in writing, Licensor provides the Work (and each
* Contributor provides its Contributions) 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. You are solely responsible for determining the
* appropriateness of using or redistributing the Work and assume any
* risks associated with Your exercise of permissions under this License.
*
* 8. Limitation of Liability. In no event and under no legal theory,
* whether in tort (including negligence), contract, or otherwise,
* unless required by applicable law (such as deliberate and grossly
* negligent acts) or agreed to in writing, shall any Contributor be
* liable to You for damages, including any direct, indirect, special,
* incidental, or consequential damages of any character arising as a
* result of this License or out of the use or inability to use the
* Work (including but not limited to damages for loss of goodwill,
* work stoppage, computer failure or malfunction, or any and all
* other commercial damages or losses), even if such Contributor
* has been advised of the possibility of such damages.
*
* 9. Accepting Warranty or Additional Liability. While redistributing
* the Work or Derivative Works thereof, You may choose to offer,
* and charge a fee for, acceptance of support, warranty, indemnity,
* or other liability obligations and/or rights consistent with this
* License. However, in accepting such obligations, You may act only
* on Your own behalf and on Your sole responsibility, not on behalf
* of any other Contributor, and only if You agree to indemnify,
* defend, and hold each Contributor harmless for any liability
* incurred by, or claims asserted against, such Contributor by reason
* of your accepting any such warranty or additional liability.
*
* END OF TERMS AND CONDITIONS
*
* APPENDIX: How to apply the Apache License to your work.
*
* To apply the Apache License to your work, attach the following
* boilerplate notice, with the fields enclosed by brackets "[]"
* replaced with your own identifying information. (Don't include
* the brackets!) The text should be enclosed in the appropriate
* comment syntax for the file format. We also recommend that a
* file or class name and description of purpose be included on the
* same "printed page" as the copyright notice for easier
* identification within third-party archives.
*
* Copyright [yyyy] [name of copyright owner]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

+ 0
- 71
lib/ant/LICENSE.dom View File

@@ -1,71 +0,0 @@
This license came from:
http://www.w3.org/Consortium/Legal/copyright-software-19980720


W3C® SOFTWARE NOTICE AND LICENSE
Copyright © 1994-2001 World
Wide Web Consortium, <a href="http://www.w3.org/">World
Wide Web Consortium</a>, (<a href=
"http://www.lcs.mit.edu/">Massachusetts Institute of
Technology</a>, <a href="http://www.inria.fr/">Institut National de
Recherche en Informatique et en Automatique</a>, <a href=
"http://www.keio.ac.jp/">Keio University</a>). All Rights Reserved.
http://www.w3.org/Consortium/Legal/

This W3C work (including software, documents, or other related
items) is being provided by the copyright holders under the
following license. By obtaining, using and/or copying this work,
you (the licensee) agree that you have read, understood, and will
comply with the following terms and conditions:
Permission to use, copy, modify, and distribute this software
and its documentation, with or without modification,  for any
purpose and without fee or royalty is hereby granted, provided that
you include the following on ALL copies of the software and
documentation or portions thereof, including modifications, that
you make:

The full text of this NOTICE in a location viewable to users of
the redistributed or derivative work.

Any pre-existing intellectual property disclaimers, notices, or
terms and conditions. If none exist, a short notice of the
following form (hypertext is preferred, text is permitted) should
be used within the body of any redistributed or derivative code:
"Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of
Technology, Institut National de
Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
http://www.w3.org/Consortium/Legal/"

Notice of any changes or modifications to the W3C files,
including the date changes were made. (We recommend you provide
URIs to the location from which the code is derived.)

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND
COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD
PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
SOFTWARE OR DOCUMENTATION.

The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to the software without
specific, written prior permission. Title to copyright in this
software and any associated documentation will at all times remain
with copyright holders.
____________________________________
This formulation of W3C's notice and license became active on
August 14 1998 so as to improve compatibility with GPL. This
version ensures that W3C software licensing terms are no more
restrictive than GPL and consequently W3C software may be
distributed in GPL packages. See the older formulation for the
policy prior to this date. Please see our Copyright FAQ for common
questions about using materials from
our site, including specific terms and conditions for packages like
libwww, Amaya, and Jigsaw.
Other questions about this notice can be
directed to site-policy@w3.org.

webmaster

+ 0
- 20
lib/ant/LICENSE.sax View File

@@ -1,20 +0,0 @@
This license came from: http://www.megginson.com/SAX/copying.html
However please note future versions of SAX may be covered
under http://saxproject.org/?selected=pd


This page is now out of date -- see the new SAX site at
http://www.saxproject.org/ for more up-to-date
releases and other information. Please change your bookmarks.


SAX2 is Free!

I hereby abandon any property rights to SAX 2.0 (the Simple API for
XML), and release all of the SAX 2.0 source code, compiled code, and
documentation contained in this distribution into the Public Domain.
SAX comes with NO WARRANTY or guarantee of fitness for any
purpose.

David Megginson, david@megginson.com
2000-05-05

+ 0
- 56
lib/ant/LICENSE.xerces View File

@@ -1,56 +0,0 @@
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 1999, International
* Business Machines, Inc., http://www.ibm.com. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/

+ 0
- 15
lib/ant/NOTICE View File

@@ -1,15 +0,0 @@
=========================================================================
== NOTICE file corresponding to the section 4 d of ==
== the Apache License, Version 2.0, ==
== in this case for the Apache Ant distribution. ==
=========================================================================

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).

This product includes also software developed by :
- the W3C consortium (http://www.w3c.org) ,
- the SAX project (http://www.saxproject.org)

Please read the different LICENSE files present in the root directory of
this distribution.

+ 0
- 70
lib/ant/README View File

@@ -1,70 +0,0 @@

A N T

What is it?
-----------
Ant is a Java based build tool. In theory it is kind of like "make"
without makes wrinkles and with the full portability of pure java code.

Why?
----
Why another build tool when there is already make, gnumake, nmake, jam,
and others? Because all of those tools have limitations that its original
author couldn't live with when developing software across multiple platforms.
Make-like tools are inherently shell based. They evaluate a set of
dependencies and then execute commands not unlike what you would issue on a
shell. This means that you can easily extend these tools by using or writing
any program for the OS that you are working on. However, this also means that
you limit yourself to the OS, or at least the OS type such as Unix, that you
are working on.
Makefiles are inherently evil as well. Anybody who has worked on them for any
time has run into the dreaded tab problem. "Is my command not executing
because I have a space in front of my tab!!!" said the original author of Ant
way too many times. Tools like Jam took care of this to a great degree, but
still use yet another format to use and remember.
Ant is different. Instead a model where it is extended with shell based
commands, it is extended using Java classes. Instead of writing shell
commands, the configuration files are XML based calling out a target tree
where various tasks get executed. Each task is run by an object which
implements a particular Task interface.
Granted, this removes some of the expressive power that is inherent by being
able to construct a shell command such as `find . -name foo -exec rm {}` but
it gives you the ability to be cross platform. To work anywhere and
everywhere. And hey, if you really need to execute a shell command, Ant has
an exec rule that allows different commands to be executed based on the OS
that it is executing on.

The Latest Version
------------------

Details of the latest version can be found on the Apache Ant
Project web site <http://ant.apache.org/>.


Documentation
-------------

Documentation is available in HTML format, in the docs/ directory.
For information about building and installing Ant, see
docs/manual/index.html


Licensing
---------

This software is licensed under the terms you may find in the file
named "LICENSE" in this directory.

Thanks for using Ant.

The Apache Ant Project
<http://ant.apache.org/>

+ 0
- 9
lib/ant/TODO View File

@@ -1,9 +0,0 @@
Things that are scheduled for Ant 1.6.2. Once this list is empty, we
can roll the first beta.

Please go ahead and assign things that are not already assigned to
anybody else (assignments look like [Stefan]) to yourself - and please
remove items from this list once they are complete.




+ 0
- 2901
lib/ant/WHATSNEW
File diff suppressed because it is too large
View File


BIN
lib/ant/ant-src.zip View File


+ 0
- 14
lib/ant/aspectj-ant-readme.txt View File

@@ -1,14 +0,0 @@

The AspectJ tree builds using Ant 1.6.3.
(No longer is a special version of Ant required.)

To run tests using the junit task, junit.jar is added to lib/.

This directory contains:

o The contents of the binary distribution of Ant 1.6.3,
not including the docs directory.

o ant-src.zip, .java extracted from the source distribution of Ant 1.6.3.

For Ant, see http://ant.apache.org.

+ 0
- 299
lib/ant/bin/ant View File

@@ -1,299 +0,0 @@
#! /bin/sh

# Copyright 2001-2005 The Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Extract launch and ant arguments, (see details below).
ant_exec_args=
no_config=false
use_jikes_default=false
ant_exec_debug=false
show_help=false
for arg in "$@" ; do
if [ "$arg" = "--noconfig" ] ; then
no_config=true
elif [ "$arg" = "--usejikes" ] ; then
use_jikes_default=true
elif [ "$arg" = "--execdebug" ] ; then
ant_exec_debug=true
elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then
show_help=true
ant_exec_args="$ant_exec_args -h"
else
if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then
show_help=true
fi
ant_exec_args="$ant_exec_args \"$arg\""
fi
done

# Source/default ant configuration
if $no_config ; then
rpm_mode=false
usejikes=$use_jikes_default
else
# load system-wide ant configuration
if [ -f "/etc/ant.conf" ] ; then
. /etc/ant.conf
fi

# load user ant configuration
if [ -f "$HOME/.ant/ant.conf" ] ; then
. $HOME/.ant/ant.conf
fi
if [ -f "$HOME/.antrc" ] ; then
. "$HOME/.antrc"
fi

# provide default configuration values
if [ -z "$rpm_mode" ] ; then
rpm_mode=false
fi
if [ -z "$usejikes" ] ; then
usejikes=$use_jikes_default
fi
fi

# Setup Java environment in rpm mode
if $rpm_mode ; then
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
set_jvm
set_javacmd
fi
fi

# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
Darwin*) darwin=true
if [ -z "$JAVA_HOME" ] ; then
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
fi
;;
esac

if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
## resolve links - $0 may be a link to ant's home
PRG="$0"
progname=`basename "$0"`

# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done

ANT_HOME=`dirname "$PRG"`/..

# make it fully qualified
ANT_HOME=`cd "$ANT_HOME" && pwd`
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$ANT_HOME" ] &&
ANT_HOME=`cygpath --unix "$ANT_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# set ANT_LIB location
ANT_LIB="${ANT_HOME}/lib"

if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD=`which java 2> /dev/null `
if [ -z "$JAVACMD" ] ; then
JAVACMD=java
fi
fi
fi

if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit 1
fi

# Build local classpath using just the launcher in non-rpm mode or
# use the Jpackage helper in rpm mode with basic and default jars
# specified in the ant.conf configuration. Because the launcher is
# used, libraries linked in ANT_HOME will also be include, but this
# is discouraged as it is not java-version safe. A user should
# request optional jars and their dependencies via the OPT_JAR_LIST
# variable
if $rpm_mode && [ -f /usr/bin/build-classpath ] ; then
LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)"
# If the user requested to try to add some other jars to the classpath
if [ -n "$OPT_JAR_LIST" ] ; then
_OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)"
if [ -n "$_OPTCLASSPATH" ] ; then
LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
fi
fi

# Explicitly add javac path to classpath, assume JAVA_HOME set
# properly in rpm mode
if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
fi
if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
fi

# if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
# user CLASSPATH first and ant-found jars after.
# In that case, the user CLASSPATH will override ant-found jars
#
# if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
# with ant-found jars first and user CLASSPATH after
if [ -n "$CLASSPATH" ] ; then
# merge local and specified classpath
if [ -z "$LOCALCLASSPATH" ] ; then
LOCALCLASSPATH="$CLASSPATH"
elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
else
LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
fi

# remove class path from launcher -cp option
CLASSPATH=""
fi
else
# not using rpm_mode; use launcher to determine classpaths
if [ -z "$LOCALCLASSPATH" ] ; then
LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
else
LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
fi
fi

if [ -n "$JAVA_HOME" ] ; then
# OSX hack to make Ant work with jikes
if $darwin ; then
OSXHACK="${JAVA_HOME}/../Classes"
if [ -d "${OSXHACK}" ] ; then
for i in "${OSXHACK}"/*.jar
do
JIKESPATH="$JIKESPATH:$i"
done
fi
fi
fi

# Allow Jikes support (off by default)
if $usejikes; then
ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
fi

# For Cygwin, switch paths to appropriate format before running java
# For PATHs convert to unix format first, then to windows format to ensure
# both formats are supported. Probably this will fail on directories with ;
# in the name in the path. Let's assume that paths containing ; are more
# rare than windows style paths on cygwin.
if $cygwin; then
if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
format=mixed
else
format=windows
fi
ANT_HOME=`cygpath --$format "$ANT_HOME"`
ANT_LIB=`cygpath --$format "$ANT_LIB"`
JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
if [ -n "$CLASSPATH" ] ; then
CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
fi
CYGHOME=`cygpath --$format "$HOME"`
fi

# Show script help if requested
if $show_help ; then
echo $0 '[script options] [options] [target [target2 [target3] ..]]'
echo 'Script Options:'
echo ' --help, --h print this message and ant help'
echo ' --noconfig suppress sourcing of /etc/ant.conf,'
echo ' $HOME/.ant/ant.conf, and $HOME/.antrc'
echo ' configuration files'
echo ' --usejikes enable use of jikes by default, unless'
echo ' set explicitly in configuration files'
echo ' --execdebug print ant exec line generated by this'
echo ' launch script'
echo ' '
fi
# add a second backslash to variables terminated by a backslash under cygwin
if $cygwin; then
case "$ANT_HOME" in
*\\ )
ANT_HOME="$ANT_HOME\\"
;;
esac
case "$CYGHOME" in
*\\ )
CYGHOME="$CYGHOME\\"
;;
esac
case "$JIKESPATH" in
*\\ )
JIKESPATH="$JIKESPATH\\"
;;
esac
case "$LOCALCLASSPATH" in
*\\ )
LOCALCLASSPATH="$LOCALCLASSPATH\\"
;;
esac
case "$CLASSPATH" in
*\\ )
CLASSPATH="$CLASSPATH\\"
;;
esac
fi
# Execute ant using eval/exec to preserve spaces in paths,
# java options, and ant args
ant_sys_opts=
if [ -n "$CYGHOME" ]; then
if [ -n "$JIKESPATH" ]; then
ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
else
ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
fi
else
if [ -n "$JIKESPATH" ]; then
ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
fi
fi
ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
if $ant_exec_debug ; then
echo $ant_exec_command
fi
eval $ant_exec_command

+ 0
- 0
lib/ant/bin/ant.bat View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save