Browse Source

Update ASM and fix packaging for matcher artifact

tags/V1_9_6
Andy Clement 3 years ago
parent
commit
199aaba33a

+ 1
- 1
ajdoc/pom.xml View File

@@ -48,7 +48,7 @@
<artifactId>asm</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/asm/asm-7.2.renamed.jar</systemPath>
<systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath>
</dependency>
</dependencies>
</project>

+ 38
- 0
aspectjmatcher/aspectjmatcher-assembly.xml View File

@@ -0,0 +1,38 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.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">

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

<fileSets>
<fileSet>
<directory>../util/target/classes</directory>
<outputDirectory>.</outputDirectory>
<excludes>
<exclude>META-INF/maven/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>../bridge/target/classes</directory>
<outputDirectory>.</outputDirectory>
<excludes>
<exclude>META-INF/maven/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>../org.aspectj.matcher/target/classes</directory>
<outputDirectory>.</outputDirectory>
<excludes>
<exclude>META-INF/maven/**</exclude>
</excludes>
</fileSet>
</fileSets>

</assembly>


+ 29
- 0
aspectjmatcher/aspectjmatcher-sources-assembly.xml View File

@@ -0,0 +1,29 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.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">

<id>sources</id>

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

<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>
<fileSet>
<directory>../util/src/main/java</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
<fileSet>
<directory>../bridge/src/main/java</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
<fileSet>
<directory>../org.aspectj.matcher/src/main/java</directory>
<outputDirectory>.</outputDirectory>
</fileSet>
</fileSets>

</assembly>


+ 140
- 0
aspectjmatcher/pom.xml View File

@@ -0,0 +1,140 @@
<?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>

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

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

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

<build>
<plugins>

<!-- skip creation of test-jar in here -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-jar</id>
<phase></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>
</execution>
</executions>
</plugin>
-->

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>aspectjmatcher-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>aspectjmatcher-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifestEntries>
<Automatic-Module-Name>org.aspectj.matcher</Automatic-Module-Name>
<!--
<Premain-Class>org.aspectj.weaver.loadtime.Agent</Premain-Class>
<Agent-Class>org.aspectj.weaver.loadtime.Agent</Agent-Class>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
-->
</manifestEntries>


<manifestSections>
<manifestSection>
<name>org/aspectj/matcher/</name>
<manifestEntries>

<Specification-Title>AspectJ Matcher Classes</Specification-Title>
<Specification-Version>${project.version}</Specification-Version>
<Specification-Vendor>https://www.eclipse.org/aspectj/</Specification-Vendor>

<Implementation-Title>org.aspectj.matcher</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor>https://www.eclipse.org/aspectj/</Implementation-Vendor>

<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>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>

<descriptors>
<descriptor>aspectjmatcher-assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>

<execution>
<id>aspectjmatcher-sources-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<finalName>aspectjmatcher-${project.version}</finalName>
<archive>
</archive>
<descriptors>
<descriptor>aspectjmatcher-sources-assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>

</executions>
</plugin>

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

+ 1
- 1
aspectjtools/pom.xml View File

@@ -50,7 +50,7 @@
<tasks>
<echo message="unzip jarjar'd asm" />
<unzip
src="${project.basedir}/../lib/asm/asm-7.2.renamed.jar"
src="${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar"
dest="target/asm-unzipped" />
</tasks>
</configuration>

+ 1
- 1
aspectjweaver/pom.xml View File

@@ -50,7 +50,7 @@
<tasks>
<echo message="unzip jarjar'd asm" />
<unzip
src="${project.basedir}/../lib/asm/asm-7.2.renamed.jar"
src="${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar"
dest="target/asm-unzipped" />
</tasks>
</configuration>

+ 23
- 8
build/build.xml View File

@@ -797,40 +797,55 @@ To use testing client jar in tests,
ant -propertyfile XXX publishtomaven
-->
<target name="publishtomaven_snapshot" depends="maven.init">
<property name="build.root" value="/Users/aclement/gits/org.aspectj/aj-build"/>
<property name="build.root" value="/Users/aclement/gits/org.aspectj"/>


<property name="adjusted.release.type" value="snapshot"/>
<property name="maven.central.repository" value="s3://maven.springframework.org/${adjusted.release.type}"/>
<!--
<property name="maven.central.repository" value="https://repo.spring.io/libs-snapshot-local/org/aspectj/aspectjweaver"/>
-->

<!-- aspectjtools/target/aspectjtools-1.9.6.BUILD-SNAPSHOT.jar -->

<property name="bin.jars.folder" value="${build.root}/dist/tools/lib"/>
<property name="src.jars.folder" value="${build.root}/src"/>
<property name="suffix" value="DEVELOPMENT"/>
<property name="suffix" value="1.9.6.BUILD-SNAPSHOT"/>

<!-- ASPECTJRT -->
<maven:deploy file="${bin.jars.folder}/aspectjrt.jar">
<maven:deploy file="${build.root}/aspectjrt/target/aspectjrt-${suffix}.jar">
<remoteRepository url="${maven.central.repository}">
<authentication username="${accessKey}" passphrase="${secretKey}"/>
</remoteRepository>
<pom file="usedForMavenUpload/aspectjrt.pom"/>
<attach file="${src.jars.folder}/aspectjrt${suffix}-src.jar" classifier="sources"/>
<attach file="${build.root}/aspectjrt/target/aspectjrt-${suffix}-sources.jar" classifier="sources"/>
</maven:deploy>

<!-- ASPECTJTOOLS -->
<maven:deploy file="${bin.jars.folder}/aspectjtools.jar">
<maven:deploy file="${build.root}/aspectjtools/target/aspectjtools-${suffix}.jar">
<remoteRepository url="${maven.central.repository}">
<authentication username="${accessKey}" passphrase="${secretKey}"/>
</remoteRepository>
<pom file="usedForMavenUpload/aspectjtools.pom"/>
<attach file="${src.jars.folder}/aspectjtools${suffix}-src.jar" classifier="sources"/>
<attach file="${build.root}/aspectjtools/target/aspectjtools-${suffix}-sources.jar" classifier="sources"/>
</maven:deploy>

<!-- ASPECTJWEAVER -->
<maven:deploy file="${bin.jars.folder}/aspectjweaver.jar">
<maven:deploy file="${build.root}/aspectjweaver/target/aspectjweaver-${suffix}.jar">
<remoteRepository url="${maven.central.repository}">
<authentication username="${accessKey}" passphrase="${secretKey}"/>
</remoteRepository>
<pom file="usedForMavenUpload/aspectjweaver.pom"/>
<attach file="${src.jars.folder}/aspectjweaver${suffix}-src.jar" classifier="sources"/>
<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}">
<authentication username="${accessKey}" passphrase="${secretKey}"/>
</remoteRepository>
<pom file="usedForMavenUpload/aspectjmatcher.pom"/>
<attach file="${build.root}/aspectjmatcher/target/aspectjmatcher-${suffix}-sources.jar" classifier="sources"/>
</maven:deploy>

</target>

+ 25
- 0
build/usedForMavenUpload/aspectjmatcher.pom View File

@@ -0,0 +1,25 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.aspectj</groupId>
<artifactId>aspectjmatcher</artifactId>
<packaging>jar</packaging>
<version>1.9.6.BUILD-SNAPSHOT</version>
<name>AspectJ matcher</name>
<description>The AspectJ matcher can be used for matching pointcuts</description>
<url>http://www.aspectj.org</url>

<licenses>
<license>
<name>Eclipse Public License - v 1.0</name>
<url>http://www.eclipse.org/legal/epl-v10.html</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<url>http://dev.eclipse.org/viewcvs/index.cgi/org.aspectj/?root=Tools_Project</url>
</scm>

</project>

+ 1
- 1
build/usedForMavenUpload/aspectjrt.pom View File

@@ -5,7 +5,7 @@
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<packaging>jar</packaging>
<version>1.9.3.BUILD-SNAPSHOT</version>
<version>1.9.6.BUILD-SNAPSHOT</version>
<name>AspectJ runtime</name>
<description>The runtime needed to execute a program using AspectJ</description>
<url>http://www.aspectj.org</url>

+ 1
- 1
build/usedForMavenUpload/aspectjtools.pom View File

@@ -5,7 +5,7 @@
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<packaging>jar</packaging>
<version>1.9.3.BUILD-SNAPSHOT</version>
<version>1.9.6.BUILD-SNAPSHOT</version>
<name>AspectJ tools</name>
<description>Tools from the AspectJ project</description>
<url>http://www.aspectj.org</url>

+ 1
- 1
build/usedForMavenUpload/aspectjweaver.pom View File

@@ -5,7 +5,7 @@
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<packaging>jar</packaging>
<version>1.9.3.BUILD-SNAPSHOT</version>
<version>1.9.6.BUILD-SNAPSHOT</version>
<name>AspectJ weaver</name>
<description>The AspectJ weaver introduces advices to java classes</description>
<url>http://www.aspectj.org</url>

BIN
lib/asm/asm-4.2.jar View File


BIN
lib/asm/asm-4.2.renamed.jar View File


BIN
lib/asm/asm-5.0.4.jar View File


BIN
lib/asm/asm-5.0.4.renamed.jar View File


BIN
lib/asm/asm-7.2.jar View File


BIN
lib/asm/asm-7.2.renamed.jar View File


BIN
lib/asm/asm-8.0.1.jar View File


BIN
lib/asm/asm-8.0.1.renamed.jar View File


+ 2
- 2
lib/asm/build.xml View File

@@ -4,8 +4,8 @@
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"/>

<target name="package" description="Jarjar asm-NNN.jar and prefix package name with aj">
<jarjar destfile="asm-7.2.renamed.jar">
<zipfileset src="asm-7.2.jar" excludes="module-info.class"/>
<jarjar destfile="asm-8.0.1.renamed.jar">
<zipfileset src="asm-8.0.1.jar" excludes="module-info.class"/>
<rule pattern="org.objectweb.asm.**" result="aj.org.objectweb.asm.@1"/>
</jarjar>
</target>

+ 142
- 142
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java View File

@@ -66,14 +66,14 @@ public abstract class AjcTestCase extends TestCase {
// see Ajc and AntSpec
public static final String DEFAULT_CLASSPATH_ENTRIES =
Ajc.outputFolders("bridge","util","loadtime","weaver","asm","testing-client","runtime","org.aspectj.matcher")
// File.pathSeparator + ".." + File.separator + "bridge" + File.separator
// + "bin" + File.pathSeparator + ".." + File.separator + "util" + File.separator + "bin" + File.pathSeparator + ".."
// + File.separator + "loadtime" + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "weaver"
// + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "weaver5" + File.separator + "bin"
// + File.pathSeparator + ".." + File.separator + "asm" + File.separator + "bin" + File.pathSeparator + ".."
// + File.separator + "testing-client" + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "runtime"
// + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "aspectj5rt" + File.separator + "bin"
// + File.pathSeparator + ".." + File.separator + "org.aspectj.matcher" + File.separator + "bin"
// File.pathSeparator + ".." + File.separator + "bridge" + File.separator
// + "bin" + File.pathSeparator + ".." + File.separator + "util" + File.separator + "bin" + File.pathSeparator + ".."
// + File.separator + "loadtime" + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "weaver"
// + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "weaver5" + File.separator + "bin"
// + File.pathSeparator + ".." + File.separator + "asm" + File.separator + "bin" + File.pathSeparator + ".."
// + File.separator + "testing-client" + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "runtime"
// + File.separator + "bin" + File.pathSeparator + ".." + File.separator + "aspectj5rt" + File.separator + "bin"
// + File.pathSeparator + ".." + File.separator + "org.aspectj.matcher" + File.separator + "bin"
+ File.pathSeparator
+ ".." + File.separator + "lib" + File.separator + "junit" + File.separator
+ "junit.jar"
@@ -94,7 +94,7 @@ public abstract class AjcTestCase extends TestCase {
+ File.separator
+ "bcel-verifier.jar"

+ File.pathSeparator + ".." + File.separator + "lib" + File.separator + "asm" + File.separator + "asm-7.2.renamed.jar"
+ File.pathSeparator + ".." + File.separator + "lib" + File.separator + "asm" + File.separator + "asm-8.0.1.renamed.jar"

// When the build machine executes the tests, it is using code built into jars rather than code build into
// bin directories. This means for the necessary types to be found we have to put these jars on the classpath:
@@ -175,11 +175,11 @@ public abstract class AjcTestCase extends TestCase {
StringBuffer srcFileName = new StringBuffer();
if (srcFile != null) {
char[] chars = srcFile.toCharArray();
for (int i = 0; i < chars.length; i++) {
if ((chars[i] == '\\') || (chars[i] == '/')) {
for (char c : chars) {
if ((c == '\\') || (c == '/')) {
srcFileName.append(File.separator);
} else {
srcFileName.append(chars[i]);
srcFileName.append(c);
}
}
this.sourceFileName = srcFileName.toString();
@@ -233,8 +233,8 @@ public abstract class AjcTestCase extends TestCase {
if (extraLocations.size() != seeAlsos.length) {
return false;
}
for (int i = 0; i < seeAlsos.length; i++) {
if (!hasAMatch(extraLocations, seeAlsos[i])) {
for (ISourceLocation seeAlso : seeAlsos) {
if (!hasAMatch(extraLocations, seeAlso)) {
return false;
}
}
@@ -277,11 +277,11 @@ public abstract class AjcTestCase extends TestCase {
}
if (seeAlsos != null) {
buff.append("\n\twith see alsos:");
for (int i = 0; i < seeAlsos.length; i++) {
for (ISourceLocation seeAlso : seeAlsos) {
buff.append("\t\t");
buff.append(seeAlsos[i].getSourceFile().getPath());
buff.append(seeAlso.getSourceFile().getPath());
buff.append(":");
buff.append(seeAlsos[i].getLine());
buff.append(seeAlso.getLine());
}
}
return buff.toString();
@@ -479,9 +479,9 @@ public abstract class AjcTestCase extends TestCase {
addExtra(failureReport, "weaveInfo", extraWeaves);
failureReport.append("\ncommand was: ajc");
String[] args = result.getArgs();
for (int i = 0; i < args.length; i++) {
for (String arg : args) {
failureReport.append(" ");
failureReport.append(args[i]);
failureReport.append(arg);
}
String report = failureReport.toString();
System.err.println(failureReport);
@@ -524,8 +524,8 @@ public abstract class AjcTestCase extends TestCase {
*/
protected List newMessageList(Message[] messages) {
List ret = new ArrayList();
for (int i = 0; i < messages.length; i++) {
ret.add(messages[i]);
for (Message message : messages) {
ret.add(message);
}
return ret;
}
@@ -618,7 +618,7 @@ public abstract class AjcTestCase extends TestCase {

/* Sandbox -> AspectJ -> Extension -> Bootstrap */
if ( !useFullLTW && useLTW) {
// URLClassLoader testLoader = (URLClassLoader) getClass().getClassLoader();
// URLClassLoader testLoader = (URLClassLoader) getClass().getClassLoader();
/*
* Create a new AspectJ class loader using the existing test CLASSPATH and any missing Java 5 projects
*/
@@ -648,8 +648,8 @@ public abstract class AjcTestCase extends TestCase {
ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command));
pb.directory( new File(ajc.getSandboxDirectory().getAbsolutePath()));
exec = pb.start();
BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
exec.waitFor();
lastRunResult = createResultFromBufferReaders(command,stdInput, stdError);
} catch (Exception e) {
@@ -678,8 +678,8 @@ public abstract class AjcTestCase extends TestCase {
ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command));
pb.directory( new File(ajc.getSandboxDirectory().getAbsolutePath()));
exec = pb.start();
BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
exec.waitFor();
lastRunResult = createResultFromBufferReaders(command,stdInput, stdError);
} catch (Exception e) {
@@ -690,9 +690,9 @@ public abstract class AjcTestCase extends TestCase {
} else if (vmargs!=null && (vmargs.contains("--enable-preview") || vmargs.contains("--add-modules") || vmargs.contains("--limit-modules") || vmargs.contains("--add-reads"))) {
// If --add-modules supplied, need to fork the test
try {
// if (mp.indexOf("$runtime") != -1) {
// mp = mp.replace(mp.indexOf("$runtime"),"$runtime".length(),TestUtil.aspectjrtPath().toString());
// }
// if (mp.indexOf("$runtime") != -1) {
// mp = mp.replace(mp.indexOf("$runtime"),"$runtime".length(),TestUtil.aspectjrtPath().toString());
// }
if (cp.indexOf("aspectjrt")==-1) {
cp.append(File.pathSeparator).append(TestUtil.aspectjrtPath().getPath());
}
@@ -702,8 +702,8 @@ public abstract class AjcTestCase extends TestCase {
ProcessBuilder pb = new ProcessBuilder(tokenizeCommand(command));
pb.directory( new File(ajc.getSandboxDirectory().getAbsolutePath()));
exec = pb.start();
BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
BufferedReader stdInput = new BufferedReader(new InputStreamReader(exec.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
exec.waitFor();
lastRunResult = createResultFromBufferReaders(command,stdInput, stdError);
} catch (Exception e) {
@@ -725,18 +725,18 @@ public abstract class AjcTestCase extends TestCase {
command.append(cp.toString());
command.append(" ");
command.append(className);
for (int i = 0; i < args.length; i++) {
for (String arg : args) {
command.append(" ");
command.append(args[i]);
command.append(arg);
}
// try {
// // Enable the security manager
// Policy.setPolicy(new MyPolicy());
// SecurityManager sm = new SecurityManager();
// System.setSecurityManager(sm);
// } catch (SecurityException se) {
// // SecurityManager already set
// }
// try {
// // Enable the security manager
// Policy.setPolicy(new MyPolicy());
// SecurityManager sm = new SecurityManager();
// System.setSecurityManager(sm);
// } catch (SecurityException se) {
// // SecurityManager already set
// }

ClassLoader contexClassLoader = Thread.currentThread().getContextClassLoader();
try {
@@ -768,14 +768,14 @@ public abstract class AjcTestCase extends TestCase {
fail("Exception thrown by " + className + ".main(String[]) :" + invTgt.getTargetException());
} finally {

// try {
// // Enable the security manager
// SecurityManager sm = new SecurityManager();
// System.setSecurityManager(null);
// } catch (SecurityException se) {
// se.printStackTrace();
// // SecurityManager already set
// }
// try {
// // Enable the security manager
// SecurityManager sm = new SecurityManager();
// System.setSecurityManager(null);
// } catch (SecurityException se) {
// se.printStackTrace();
// // SecurityManager already set
// }
Thread.currentThread().setContextClassLoader(contexClassLoader);
stopCapture(baosErr, baosOut);
lastRunResult = new RunResult(command.toString(), new String(baosOut.toByteArray()), new String(baosErr.toByteArray()));
@@ -803,53 +803,53 @@ public abstract class AjcTestCase extends TestCase {
PrintWriter stdOutWriter = new PrintWriter(baosOut);
PrintWriter stdErrWriter = new PrintWriter(baosErr);

while ((line = stdInput.readLine()) != null) {
stdOutWriter.println(line);
System.out.println(line);
}
stdOutWriter.flush();
while ((line = stdError.readLine()) != null) {
stdErrWriter.println(line);
System.err.println(line);
while ((line = stdInput.readLine()) != null) {
stdOutWriter.println(line);
System.out.println(line);
}
stdOutWriter.flush();
while ((line = stdError.readLine()) != null) {
stdErrWriter.println(line);
System.err.println(line);

}
stdErrWriter.flush();
}
stdErrWriter.flush();

baosOut.close();
baosErr.close();
baosOut.close();
baosErr.close();

return new RunResult(command.toString(), new String(baosOut.toByteArray()), new String(baosErr.toByteArray()));
return new RunResult(command.toString(), new String(baosOut.toByteArray()), new String(baosErr.toByteArray()));
}

// static class MyPolicy extends Policy {
//
// @Override
// public boolean implies(ProtectionDomain domain, Permission permission) {
// // if (permission != SecurityConstants.GET_POLICY_PERMISSION) {
// // // System.out.println(domain + " " + permission.getName());
// // System.out.println(permission.getName());
// // }
// // if (true) {
// // return true;
// // }
// if (permission instanceof PropertyPermission) {
// return true;
// }
// if (permission instanceof RuntimePermission) {
// return true;
// }
// if (permission instanceof FilePermission) {
// // System.out.println(permission);
// return true;
// }
// if (permission instanceof ReflectPermission) {
// return true;
// }
// // System.out.println(permission);
// return super.implies(domain, permission);
// // return true;
// }
// }
// static class MyPolicy extends Policy {
//
// @Override
// public boolean implies(ProtectionDomain domain, Permission permission) {
// // if (permission != SecurityConstants.GET_POLICY_PERMISSION) {
// // // System.out.println(domain + " " + permission.getName());
// // System.out.println(permission.getName());
// // }
// // if (true) {
// // return true;
// // }
// if (permission instanceof PropertyPermission) {
// return true;
// }
// if (permission instanceof RuntimePermission) {
// return true;
// }
// if (permission instanceof FilePermission) {
// // System.out.println(permission);
// return true;
// }
// if (permission instanceof ReflectPermission) {
// return true;
// }
// // System.out.println(permission);
// return super.implies(domain, permission);
// // return true;
// }
// }

/*
* Must create weaving class loader reflectively using new parent so we don't have a reference to a World loaded from CLASSPATH
@@ -906,48 +906,48 @@ public abstract class AjcTestCase extends TestCase {
* @param args the String[] args to fix up
* @return the String[] args to use
*/
protected String[] fixupArgs(String[] args) {
if (null == args) {
return null;
}
int cpIndex = -1;
boolean hasruntime = false;
for (int i = 0; i < args.length - 1; i++) {
args[i] = adaptToPlatform(args[i]);
if ("-classpath".equals(args[i])) {
cpIndex = i;
args[i + 1] = substituteSandbox(args[i + 1]);
String next = args[i + 1];
hasruntime = ((null != next) && (-1 != next.indexOf("aspectjrt.jar")));
} else if ("-p".equals(args[i]) || "--module-path".equals(args[i])) {
args[i + 1] = substituteSandbox(args[i + 1]);
}
}
if (-1 == cpIndex) {
String[] newargs = new String[args.length + 2];
newargs[0] = "-classpath";
newargs[1] = TestUtil.aspectjrtPath(false).getPath();
System.arraycopy(args, 0, newargs, 2, args.length);
args = newargs;
cpIndex = 1;
} else {
if (!hasruntime) {
cpIndex++;
String[] newargs = new String[args.length];
System.arraycopy(args, 0, newargs, 0, args.length);
newargs[cpIndex] = args[cpIndex] + File.pathSeparator + TestUtil.aspectjrtPath().getPath();
args = newargs;
}
}
boolean needsJRTFS = LangUtil.is19VMOrGreater();
if (needsJRTFS) {
if (args[cpIndex].indexOf(LangUtil.JRT_FS) == -1) {
String jrtfsPath = LangUtil.getJrtFsFilePath();
args[cpIndex] = jrtfsPath + File.pathSeparator + args[cpIndex];
}
}
return args;
}
protected String[] fixupArgs(String[] args) {
if (null == args) {
return null;
}
int cpIndex = -1;
boolean hasruntime = false;
for (int i = 0; i < args.length - 1; i++) {
args[i] = adaptToPlatform(args[i]);
if ("-classpath".equals(args[i])) {
cpIndex = i;
args[i + 1] = substituteSandbox(args[i + 1]);
String next = args[i + 1];
hasruntime = ((null != next) && (-1 != next.indexOf("aspectjrt.jar")));
} else if ("-p".equals(args[i]) || "--module-path".equals(args[i])) {
args[i + 1] = substituteSandbox(args[i + 1]);
}
}
if (-1 == cpIndex) {
String[] newargs = new String[args.length + 2];
newargs[0] = "-classpath";
newargs[1] = TestUtil.aspectjrtPath(false).getPath();
System.arraycopy(args, 0, newargs, 2, args.length);
args = newargs;
cpIndex = 1;
} else {
if (!hasruntime) {
cpIndex++;
String[] newargs = new String[args.length];
System.arraycopy(args, 0, newargs, 0, args.length);
newargs[cpIndex] = args[cpIndex] + File.pathSeparator + TestUtil.aspectjrtPath().getPath();
args = newargs;
}
}
boolean needsJRTFS = LangUtil.is19VMOrGreater();
if (needsJRTFS) {
if (args[cpIndex].indexOf(LangUtil.JRT_FS) == -1) {
String jrtfsPath = LangUtil.getJrtFsFilePath();
args[cpIndex] = jrtfsPath + File.pathSeparator + args[cpIndex];
}
}
return args;
}

private String adaptToPlatform(String s) {
String ret = s.replace(';', File.pathSeparatorChar);
@@ -960,8 +960,8 @@ public abstract class AjcTestCase extends TestCase {
return in;

List<T> out = new ArrayList<T>();
for (Iterator<T> iter = in.iterator(); iter.hasNext();) {
out.add(iter.next());
for (T t : in) {
out.add(t);
}
return out;
}
@@ -997,9 +997,9 @@ public abstract class AjcTestCase extends TestCase {
buff.append("Missing expected ");
buff.append(type);
buff.append(" messages:\n");
for (Iterator<AjcTestCase.Message> iter = messages.iterator(); iter.hasNext();) {
for (Message message : messages) {
buff.append("\t");
buff.append(iter.next().toString());
buff.append(message.toString());
buff.append("\n");
}
}
@@ -1021,12 +1021,12 @@ public abstract class AjcTestCase extends TestCase {
// add any jars in the directory to the classpath
private void getAnyJars(File dir, StringBuffer buff) {
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].getName().endsWith(".jar")) {
for (File file : files) {
if (file.getName().endsWith(".jar")) {
buff.append(File.pathSeparator);
buff.append(files[i].getAbsolutePath());
} else if (files[i].isDirectory()) {
getAnyJars(files[i], buff);
buff.append(file.getAbsolutePath());
} else if (file.isDirectory()) {
getAnyJars(file, buff);
}
}
}

+ 1
- 0
pom.xml View File

@@ -44,6 +44,7 @@
<module>aspectjrt</module>
<module>aspectjweaver</module>
<module>aspectjtools</module>
<module>aspectjmatcher</module>

<!-- build the java -jar'able installer -->
<module>installer</module>

+ 1
- 1
tests/pom.xml View File

@@ -55,7 +55,7 @@
<artifactId>asm</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/asm/asm-7.2.renamed.jar</systemPath>
<systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>

+ 1
- 1
weaver/pom.xml View File

@@ -79,7 +79,7 @@
<artifactId>asm</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/asm/asm-7.2.renamed.jar</systemPath>
<systemPath>${project.basedir}/../lib/asm/asm-8.0.1.renamed.jar</systemPath>
</dependency>
</dependencies>
</project>

Loading…
Cancel
Save