Skip to content
Commits on Source (4)
......@@ -223,10 +223,12 @@ public class AjdeCoreBuildManager {
if (configFile.exists() && configFile.isFile()) {
args = new String[] { "@" + configFile.getAbsolutePath() };
} else {
List<String> l = compilerConfig.getProjectSourceFiles();
if (l == null) {
List<String> projectSourceFiles = compilerConfig.getProjectSourceFiles();
if (projectSourceFiles == null) {
return null;
}
List<String> l = new ArrayList<>();
l.addAll(projectSourceFiles);
// If the processor options are specified build the command line options for the JDT compiler to see
String processor = compilerConfig.getProcessor();
if (processor != null && processor.length() != 0) {
......@@ -238,20 +240,25 @@ public class AjdeCoreBuildManager {
l.add("-processorpath");
l.add(processorPath);
}
if (compilerConfig.getOutputLocationManager() != null &&
compilerConfig.getOutputLocationManager().getDefaultOutputLocation() != null) {
l.add("-d");
l.add(compilerConfig.getOutputLocationManager().getDefaultOutputLocation().toString());
}
List<String> xmlfiles = compilerConfig.getProjectXmlConfigFiles();
if (xmlfiles != null && !xmlfiles.isEmpty()) {
args = new String[l.size() + xmlfiles.size() + 1];
// TODO speedup
int p = 0;
for (int i = 0; i < l.size(); i++) {
args[p++] = (String) l.get(i);
args[p++] = l.get(i);
}
for (int i = 0; i < xmlfiles.size(); i++) {
args[p++] = (String) xmlfiles.get(i);
args[p++] = xmlfiles.get(i);
}
args[p++] = "-xmlConfigured";
} else {
args = (String[]) l.toArray(new String[l.size()]);
args = l.toArray(new String[l.size()]);
}
}
......@@ -320,7 +327,7 @@ public class AjdeCoreBuildManager {
// Process the JAVA OPTIONS MAP
Map<String,String> jom = compilerConfig.getJavaOptionsMap();
if (jom != null) {
String version = (String) jom.get(CompilerOptions.OPTION_Compliance);
String version = jom.get(CompilerOptions.OPTION_Compliance);
if (version != null && !version.equals(CompilerOptions.VERSION_1_4)) {
config.setBehaveInJava5Way(true);
}
......@@ -383,7 +390,7 @@ public class AjdeCoreBuildManager {
} else {
tokens.addAll(tokenizeString(nonStdOptions));
}
String[] args = (String[]) tokens.toArray(new String[] {});
String[] args = tokens.toArray(new String[] {});
// set the non-standard options in an alternate build config
// (we don't want to lose the settings we already have)
......
......@@ -270,7 +270,7 @@ public class ClassGen extends Modifiers implements Cloneable {
/**
* @return field object with given name, or null if not found
*/
public Field containsField(String name) {
public Field findsField(String name) {
for (Field field : fieldsList) {
if (field.getName().equals(name)) {
return field;
......
......@@ -86,7 +86,7 @@ public class AntBuilder extends Builder {
*/
private static void makeTargetsForResult(final Result result, final Hashtable<String,Target> targets) {
final String resultTargetName = resultToTargetName(result);
Target target = (Target) targets.get(resultTargetName);
Target target = targets.get(resultTargetName);
if (null == target) {
// first add the target
target = new Target();
......@@ -147,6 +147,7 @@ public class AntBuilder extends Builder {
* @param boolean filter if true, enable filtering
* @see org.aspectj.internal.tools.build.Builder#copyFile(File, File, boolean)
*/
@Override
protected boolean copyFile(File fromFile, File toFile, boolean filter) {
Copy copy = makeCopyTask(filter);
copy.setFile(fromFile);
......@@ -160,6 +161,7 @@ public class AntBuilder extends Builder {
*
* @see org.aspectj.internal.tools.ant.taskdefs.Builder#copyFiles(File, File, String, String, boolean)
*/
@Override
protected boolean copyFiles(File fromDir, File toDir, String includes, String excludes, boolean filter) {
Copy copy = makeCopyTask(filter);
copy.setTodir(toDir);
......@@ -226,8 +228,6 @@ public class AntBuilder extends Builder {
boolean isJava5Compile = false;
boolean isJava8Compile = false;
for (File file: result.getSrcDirs()) {
// for (Iterator iter = result.getSrcDirs().iterator(); iter.hasNext();) {
// File file = (File) iter.next();
path.createPathElement().setLocation(file);
if (!isJava5Compile
&& (Util.Constants.JAVA5_SRC.equals(file.getName()) ||
......@@ -270,18 +270,16 @@ public class AntBuilder extends Builder {
// misc
javac.setDebug(true);
if (!isJava5Compile) {
javac.setTarget("1.1"); // 1.1 class files - Javac in 1.4 uses 1.4
javac.setSource("1.3");
} else {
if (isJava8Compile) {
javac.setSource("1.8");
javac.setTarget("1.8");
} else {
// min
} else if (isJava5Compile) {
// *cough*
javac.setSource("1.6");
javac.setTarget("1.6");
}
} else {
javac.setTarget("1.1"); // 1.1 class files - Javac in 1.4 uses 1.4
javac.setSource("1.3");
}
// compile
boolean passed = false;
......@@ -412,6 +410,7 @@ public class AntBuilder extends Builder {
/**
* @see org.aspectj.internal.tools.build.Builder#buildAntecedants(Module)
*/
@Override
protected Result[] getAntecedantResults(Result moduleResult) {
Hashtable<String,Target> targets = new Hashtable<String, Target>();
makeTargetsForResult(moduleResult, targets);
......@@ -425,7 +424,7 @@ public class AntBuilder extends Builder {
}
ArrayList<String> toReturn = new ArrayList<String>();
for (Iterator<Target> iter = result.iterator(); iter.hasNext();) {
Target target = (Target) iter.next();
Target target = iter.next();
String name = target.getName();
if (null == name) {
throw new Error("null name?");
......@@ -437,12 +436,13 @@ public class AntBuilder extends Builder {
if ((1 == size) && targetName.equals(toReturn.get(0)) && !moduleResult.outOfDate()) {
return new Result[0];
}
return Result.getResults((String[]) toReturn.toArray(new String[0]));
return Result.getResults(toReturn.toArray(new String[0]));
}
/**
* Generate Module.assembledJar with merge of itself and all antecedants
*/
@Override
protected boolean assembleAll(Result result, Messager handler) {
if (!buildingEnabled) {
return false;
......@@ -500,6 +500,7 @@ public class AntBuilder extends Builder {
/**
* @see org.aspectj.internal.tools.ant.taskdefs.Builder#buildInstaller(BuildSpec, String)
*/
@Override
protected boolean buildInstaller(BuildSpec buildSpec, String targDirPath) {
return false;
}
......@@ -726,6 +727,7 @@ class ProductBuilder extends AntBuilder {
/**
* Delegate for super.buildProduct(..) template method.
*/
@Override
protected boolean copyBinaries(BuildSpec buildSpec, File distDir, File targDir, String excludes) {
Copy copy = makeCopyTask(false);
copy.setTodir(targDir);
......@@ -742,6 +744,7 @@ class ProductBuilder extends AntBuilder {
/**
* Delegate for super.buildProduct(..) template method.
*/
@Override
protected boolean copyNonBinaries(BuildSpec buildSpec, File distDir, File targDir) {
// filter-copy everything but the binaries
Copy copy = makeCopyTask(true);
......@@ -754,6 +757,7 @@ class ProductBuilder extends AntBuilder {
return executeTask(copy);
}
@Override
protected boolean buildInstaller(BuildSpec buildSpec, String targDirPath) {
if (buildSpec.verbose) {
handler.log("creating installer for " + buildSpec);
......@@ -808,16 +812,19 @@ class ProjectMessager extends Messager {
this.project = project;
}
@Override
public boolean log(String s) {
project.log(s);
return true;
}
@Override
public boolean error(String s) {
project.log(s, Project.MSG_ERR);
return true;
}
@Override
public boolean logException(String context, Throwable thrown) {
project.log(context + Util.renderException(thrown), Project.MSG_ERR);
return true;
......
aspectj (1.9.2-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Updated the symlinks for ASM in debian/rules
-- Emmanuel Bourg <ebourg@apache.org> Fri, 11 Jan 2019 13:08:13 +0100
aspectj (1.9.2~rc2-1) unstable; urgency=medium
* Team upload.
......
......@@ -24,8 +24,8 @@ override_dh_auto_configure:
# asm5
mkdir -p lib/asm
ln -sf /usr/share/java/asm-all.jar lib/asm/asm-6.1.1.jar
ln -sf /usr/share/java/asm-all.jar lib/asm/asm-6.1.1.renamed.jar
ln -sf /usr/share/java/asm-all.jar lib/asm/asm-7.0-beta.20181001.jar
ln -sf /usr/share/java/asm-all.jar lib/asm/asm-7.0-beta.renamed.jar
# regexp
mkdir -p lib/regexp
......
......@@ -536,7 +536,7 @@
AspectJ is a compatible extension to the Java programming language. The
AspectJ compiler adheres to the <ulink
url="http://java.sun.com/docs/books/jls/index.html"> <citetitle
pubwork="book">The Java Language Specfication, Second
pubwork="book">The Java Language Specification, Second
Edition</citetitle></ulink> and to the <ulink
url="http://java.sun.com/docs/books/vmspec/index.html"><citetitle
pubwork="book">The Java Virtual Machine Specification, Second
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html> <head>
<title>AspectJ 1.9.2 Readme</title>
<style type="text/css">
<!--
P { margin-left: 20px; }
PRE { margin-left: 20px; }
LI { margin-left: 20px; }
H4 { margin-left: 20px; }
H3 { margin-left: 10px; }
-->
</style>
</head>
<body>
<div align="right"><small>
&copy; Copyright 2018 Contributors.
All rights reserved.
</small></div>
<p>The full list of resolved issues in 1.9.2 is available
<a href="https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.2">here</a></h2>.</p>
<h1>AspectJ 1.9.2</h1>
<h4>Java 11 support</h4>
<p>AspectJ now supports Java11. It has been updated to a more recent JDT compiler that supports Java 11 (JDTCore #6373b82afa49b).
<p>Available: 1.9.2 available Oct-2018</p>
<br><br>
<!-- ============================== -->
</body>
</html>
......@@ -138,6 +138,7 @@
<tr> <td>README's
</td>
<td>Changes and porting guide for AspectJ
<a href="README-192.html">1.9.2</a>,
<a href="README-191.html">1.9.1</a>,
<a href="README-190.html">1.9.0</a>,
<a href="README-1811.html">1.8.10</a>,
......
No preview for this file type
......@@ -72,19 +72,12 @@ public class Aj implements ClassPreProcessor {
}
private final static String deleLoader = "sun.reflect.DelegatingClassLoader";
private final static String deleLoader2 = "jdk.internal.reflect.DelegatingClassLoader"; // On JDK11+
/**
* Weave
*
* @param className
* @param bytes
* @param loader
* @return woven bytes
*/
@Override
public byte[] preProcess(String className, byte[] bytes, ClassLoader loader, ProtectionDomain protectionDomain) {
// TODO AV needs to doc that
if (loader == null || className == null || loader.getClass().getName().equals(deleLoader)) {
if (loader == null || className == null ||
loader.getClass().getName().equals(deleLoader) || loader.getClass().getName().equals(deleLoader2)) {
// skip boot loader, null classes (hibernate), or those from a reflection loader
return bytes;
}
......
......@@ -11,10 +11,6 @@ package org.aspectj.weaver.loadtime;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.invoke.MethodType;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
......
......@@ -59,10 +59,8 @@ import org.aspectj.weaver.patterns.BasicTokenSource;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.ISignaturePattern;
import org.aspectj.weaver.patterns.ITokenSource;
import org.aspectj.weaver.patterns.NamePattern;
import org.aspectj.weaver.patterns.PatternParser;
import org.aspectj.weaver.patterns.PerClause;
import org.aspectj.weaver.patterns.PerSingleton;
import org.aspectj.weaver.patterns.TypePattern;
/**
......
......@@ -815,33 +815,17 @@ public class BuildArgParser extends Main {
} else if (arg.equals("-timers")) {
buildConfig.setTiming(true);
// swallow - it is dealt with in Main.runMain()
} else if (arg.equals("-1.5")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.5");
// this would enable the '-source 1.5' to do the same as '-1.5' but doesnt sound quite right as
// as an option right now as it doesnt mean we support 1.5 source code - people will get confused...
} else if (arg.equals("-1.6")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.6");
} else if (arg.equals("-1.7")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.7");
} else if (arg.equals("-1.8")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.8");
} else if (arg.equals("-1.9")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.9");
} else if (arg.equals("-10")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-10");
} else if (arg.equals("-1.3")) {
buildConfig.setBehaveInJava5Way(false);
unparsedArgs.add("-1.3");
} else if (arg.equals("-1.4")) {
buildConfig.setBehaveInJava5Way(false);
unparsedArgs.add("-1.4");
} else if (arg.equals("-source")) {
if (args.size() > nextArgIndex) {
String level = args.get(nextArgIndex).getValue();
if (level.equals("1.5") || level.equals("5") || level.equals("1.6") || level.equals("6") || level.equals("1.7")
|| level.equals("7") || level.equals("8") || level.equals("1.8")
|| level.equals("9") || level.equals("1.9") || level.equals("10")) {
buildConfig.setBehaveInJava5Way(true);
if (level.equals("1.3") || level.equals("1.4")) {
buildConfig.setBehaveInJava5Way(false);
}
unparsedArgs.add("-source");
unparsedArgs.add(level);
......
......@@ -5,7 +5,7 @@
org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy.
### AspectJ-specific messages
compiler.name = AspectJ Compiler 1.9.2
compiler.version = Eclipse Compiler #BETA_JAVA11(20Sep2018), 3.14
compiler.version = Eclipse Compiler #6373b82afa49b(1-Oct-2018), 3.16
compiler.copyright =
......
......@@ -71,7 +71,6 @@ import org.aspectj.weaver.ClassAnnotationValue;
import org.aspectj.weaver.EnumAnnotationValue;
import org.aspectj.weaver.ReferenceType;
import org.aspectj.weaver.ResolvedMember;
import org.aspectj.weaver.ResolvedMemberImpl;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.StandardAnnotation;
......@@ -135,11 +134,13 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
resolvedTypeX.setEndPos(declaration.sourceEnd);
}
@Override
public boolean isAspect() {
final boolean isCodeStyle = declaration instanceof AspectDeclaration;
return isCodeStyle ? isCodeStyle : isAnnotationStyleAspect();
}
@Override
public boolean isAnonymous() {
if (declaration.binding != null) {
return declaration.binding.isAnonymousType();
......@@ -147,6 +148,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return ((declaration.modifiers & (ASTNode.IsAnonymousType | ASTNode.IsLocalType)) != 0);
}
@Override
public boolean isNested() {
if (declaration.binding != null) {
return (declaration.binding.isMemberType());
......@@ -154,6 +156,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return ((declaration.modifiers & ASTNode.IsMemberType) != 0);
}
@Override
public ResolvedType getOuterClass() {
if (declaration.binding != null) {
ReferenceBinding enclosingType = declaration.binding.enclosingType();
......@@ -167,6 +170,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return eclipseWorld().fromEclipse(declaration.enclosingType.binding);
}
@Override
public boolean isAnnotationStyleAspect() {
if (declaration.annotations == null) {
return false;
......@@ -234,10 +238,12 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return false;
}
@Override
public WeaverStateInfo getWeaverState() {
return null;
}
@Override
public ResolvedType getSuperclass() {
if (binding.isInterface()) {
return getResolvedTypeX().getWorld().getCoreType(UnresolvedType.OBJECT);
......@@ -246,6 +252,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return eclipseWorld().fromEclipse(binding.superclass());
}
@Override
public ResolvedType[] getDeclaredInterfaces() {
return eclipseWorld().fromEclipse(binding.superInterfaces());
}
......@@ -420,6 +427,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
* This method may not return all fields, for example it may not include the ajc$initFailureCause or ajc$perSingletonInstance
* fields - see bug 129613
*/
@Override
public ResolvedMember[] getDeclaredFields() {
if (declaredFields == null) {
fillDeclaredMembers();
......@@ -431,6 +439,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
* This method may not return all methods, for example it may not include clinit, aspectOf, hasAspect or ajc$postClinit methods
* - see bug 129613
*/
@Override
public ResolvedMember[] getDeclaredMethods() {
if (declaredMethods == null) {
fillDeclaredMembers();
......@@ -438,6 +447,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return declaredMethods;
}
@Override
public ResolvedMember[] getDeclaredPointcuts() {
if (declaredPointcuts == null) {
fillDeclaredMembers();
......@@ -445,11 +455,13 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return declaredPointcuts;
}
@Override
public int getModifiers() {
// only return the real Java modifiers, not the extra eclipse ones
return binding.modifiers & ExtraCompilerModifiers.AccJustFlag;
}
@Override
public String toString() {
return "EclipseSourceType(" + new String(binding.sourceName()) + ")";
}
......@@ -516,6 +528,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
// dec.sourceEnd);
// }
@Override
public boolean isInterface() {
return binding.isInterface();
}
......@@ -525,14 +538,17 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
public final static short ACC_ANNOTATION = 0x2000;
public final static short ACC_ENUM = 0x4000;
@Override
public boolean isEnum() {
return (binding.getAccessFlags() & ACC_ENUM) != 0;
}
@Override
public boolean isAnnotation() {
return (binding.getAccessFlags() & ACC_ANNOTATION) != 0;
}
@Override
public boolean isAnnotationWithRuntimeRetention() {
if (!isAnnotation()) {
return false;
......@@ -541,6 +557,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
}
}
@Override
public String getRetentionPolicy() {
if (isAnnotation()) {
if ((binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention) {
......@@ -556,6 +573,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return null;
}
@Override
public boolean canAnnotationTargetType() {
if (isAnnotation()) {
return ((binding.getAnnotationTagBits() & TagBits.AnnotationForType) != 0);
......@@ -563,6 +581,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return false;
}
@Override
public AnnotationTargetKind[] getAnnotationTargetKinds() {
if (discoveredAnnotationTargetKinds) {
return annotationTargetKinds;
......@@ -655,6 +674,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
}
}
@Override
public boolean hasAnnotation(UnresolvedType ofType) {
ensureAnnotationTypesResolved();
for (int a = 0, max = annotationTypes.length; a < max; a++) {
......@@ -680,6 +700,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
* annotations, this code only needs to deal with converting system annotations that the weaver needs to process
* (RetentionPolicy, Target).
*/
@Override
public AnnotationAJ[] getAnnotations() {
int declarationAnnoCount = (declaration.annotations == null ? 0 : declaration.annotations.length);
if (annotations != null && annotations.length == declarationAnnoCount) {
......@@ -701,6 +722,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return annotations;
}
@Override
public boolean hasAnnotations() {
return (declaration.annotations != null && declaration.annotations.length != 0);
}
......@@ -1002,11 +1024,13 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
}
}
@Override
public ResolvedType[] getAnnotationTypes() {
ensureAnnotationTypesResolved();
return annotationTypes;
}
@Override
public PerClause getPerClause() {
// should probably be: ((AspectDeclaration)declaration).perClause;
// but we don't need this level of detail, and working with real per
......@@ -1147,30 +1171,37 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
return kind;
}
public Collection getDeclares() {
@Override
public Collection<Declare> getDeclares() {
return declares;
}
public Collection getPrivilegedAccesses() {
return Collections.EMPTY_LIST;
@Override
public Collection<ResolvedMember> getPrivilegedAccesses() {
return Collections.emptyList();
}
@Override
public Collection getTypeMungers() {
return typeMungers;
}
@Override
public boolean doesNotExposeShadowMungers() {
return true;
}
@Override
public String getDeclaredGenericSignature() {
return CharOperation.charToString(binding.genericSignature());
}
@Override
public boolean isGeneric() {
return binding.isGenericType();
}
@Override
public TypeVariable[] getTypeVariables() {
if (declaration.typeParameters == null) {
return new TypeVariable[0];
......
......@@ -73,7 +73,7 @@ public class AjCompilerOptions extends CompilerOptions {
public String xOptionalJoinpoints = null;
// If true - autoboxing behaves differently ...
public boolean behaveInJava5Way = false;
public boolean behaveInJava5Way = true;
public boolean timing = false;
......@@ -117,6 +117,7 @@ public class AjCompilerOptions extends CompilerOptions {
set(settings);
}
@Override
public Map<String,String> getMap() {
Map<String,String> map = super.getMap();
// now add AspectJ additional options
......@@ -148,6 +149,7 @@ public class AjCompilerOptions extends CompilerOptions {
return map;
}
@Override
public void set(Map<String,String> optionsMap) {
super.set(optionsMap);
Object optionValue;
......@@ -282,6 +284,7 @@ public class AjCompilerOptions extends CompilerOptions {
super.warningThreshold.set(CompilerOptions.SwallowedExceptionInCatchBlock);
}
@Override
public String toString() {
StringBuffer buf = new StringBuffer(super.toString());
// now add AspectJ additional options
......
......@@ -57,6 +57,9 @@ import org.aspectj.weaver.patterns.TypePatternList;
*/
public class AsmElementFormatter {
private final static String ASPECTJ_ANNOTATION_PACKAGE = "org.aspectj.lang.annotation";
private final static char PACKAGE_INITIAL_CHAR = ASPECTJ_ANNOTATION_PACKAGE.charAt(0);
public void genLabelAndKind(MethodDeclaration methodDeclaration, IProgramElement node) {
if (methodDeclaration instanceof AdviceDeclaration) {
......@@ -219,7 +222,7 @@ public class AsmElementFormatter {
// Note: AV: implicit single advice type support here (should be enforced somewhere as well (APT etc))
Annotation annotation = methodDeclaration.annotations[i];
String annotationSig = new String(annotation.type.getTypeBindingPublic(methodDeclaration.scope).signature());
if (annotationSig.charAt(1) == 'o') {
if (annotationSig.charAt(1) == PACKAGE_INITIAL_CHAR) {
if ("Lorg/aspectj/lang/annotation/Pointcut;".equals(annotationSig)) {
node.setKind(IProgramElement.Kind.POINTCUT);
node.setAnnotationStyleDeclaration(true); // pointcuts don't seem to get handled quite right...
......@@ -418,8 +421,8 @@ public class AsmElementFormatter {
public void setParameters(AbstractMethodDeclaration md, IProgramElement pe) {
Argument[] argArray = md.arguments;
if (argArray == null) {
pe.setParameterNames(Collections.EMPTY_LIST);
pe.setParameterSignatures(Collections.EMPTY_LIST, Collections.EMPTY_LIST);
pe.setParameterNames(Collections.<String>emptyList());
pe.setParameterSignatures(Collections.<char[]>emptyList(), Collections.<String>emptyList());
} else {
List<String> names = new ArrayList<String>();
List<char[]> paramSigs = new ArrayList<char[]>();
......@@ -459,7 +462,7 @@ public class AsmElementFormatter {
// TODO: fix this way of determing ajc-added arguments, make subtype of Argument with extra info
private boolean acceptArgument(String name, String type) {
if (name.charAt(0) != 'a' && type.charAt(0) != 'o') {
if (name.charAt(0) != 'a' && type.charAt(0) != PACKAGE_INITIAL_CHAR) {
return true;
}
return !name.startsWith("ajc$this_") && !type.equals("org.aspectj.lang.JoinPoint.StaticPart")
......
// AspectJ
/*******************************************************************************
* Copyright (c) 2012, 2018 IBM Corporation and others.
*
......@@ -276,7 +277,18 @@ public class LambdaExpression extends FunctionalExpression implements IPolyExpre
if (!skipKosherCheck && (!haveDescriptor || this.descriptor.typeVariables != Binding.NO_TYPE_VARIABLES)) // already complained in kosher*
return this.resolvedType = null;
this.binding = new MethodBinding(ClassFileConstants.AccPrivate | ClassFileConstants.AccSynthetic | ExtraCompilerModifiers.AccUnresolved,
// AspectJ extension - start
int modifiers = 0;
if (methodScope.parent != null && methodScope.parent.isInterTypeScope()) {
modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccSynthetic | ExtraCompilerModifiers.AccUnresolved;
} else {
modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccSynthetic | ExtraCompilerModifiers.AccUnresolved;
}
this.binding = new MethodBinding(modifiers,
// was
// this.binding = new MethodBinding(ClassFileConstants.AccPrivate | ClassFileConstants.AccSynthetic | ExtraCompilerModifiers.AccUnresolved,
// AspectJ extension - end
CharOperation.concat(TypeConstants.ANONYMOUS_METHOD, Integer.toString(this.ordinal).toCharArray()), // will be fixed up later.
haveDescriptor ? this.descriptor.returnType : TypeBinding.VOID,
Binding.NO_PARAMETERS, // for now.
......
......@@ -2307,5 +2307,15 @@ public MethodBinding[] methods() {
else return methodsBase();
}
@Override
public int sourceStart() {
return 0;
}
@Override
public int sourceEnd() {
return 0;
}
//End AspectJ Extension
}