aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2018-10-11 10:50:01 -0700
committerAndy Clement <aclement@pivotal.io>2018-10-11 10:50:01 -0700
commita913ec7fb308c794bd53f33f1d5b7163d144cf23 (patch)
tree17f784d75200d6b843fd5c2a476cf99621de7d92 /org.aspectj.ajdt.core
parentc2b80ea9e24eb61385eb69e426650773cf5a7c7d (diff)
downloadaspectj-a913ec7fb308c794bd53f33f1d5b7163d144cf23.tar.gz
aspectj-a913ec7fb308c794bd53f33f1d5b7163d144cf23.zip
polish
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java13
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java4
2 files changed, 10 insertions, 7 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
index 1c2ea5616..84258cf04 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
@@ -57,7 +57,10 @@ import org.aspectj.weaver.patterns.TypePatternList;
*/
public class AsmElementFormatter {
- public void genLabelAndKind(MethodDeclaration methodDeclaration, IProgramElement node) {
+ 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) {
AdviceDeclaration ad = (AdviceDeclaration) methodDeclaration;
@@ -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")
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java
index 1384358a3..24214cf17 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/AjcTestCase.java
@@ -745,7 +745,7 @@ public class AjcTestCase extends TestCase {
ClassLoader contexClassLoader = Thread.currentThread().getContextClassLoader();
try {
try {
- Class testerClass = sandboxLoader.loadClass("org.aspectj.testing.Tester");
+ Class<?> testerClass = sandboxLoader.loadClass("org.aspectj.testing.Tester");
Method setBaseDir = testerClass.getDeclaredMethod("setBASEDIR", new Class[] { File.class });
setBaseDir.invoke(null, new Object[] { ajc.getSandboxDirectory() });
} catch (InvocationTargetException itEx) {
@@ -758,7 +758,7 @@ public class AjcTestCase extends TestCase {
/* Frameworks like XML use context class loader for dynamic loading */
Thread.currentThread().setContextClassLoader(sandboxLoader);
- Class toRun = sandboxLoader.loadClass(className);
+ Class<?> toRun = sandboxLoader.loadClass(className);
Method mainMethod = toRun.getMethod("main", new Class[] { String[].class });
mainMethod.invoke(null, new Object[] { args });
} catch (ClassNotFoundException cnf) {