From 37c44d35a618695c1abb2e204cc31c5e38bfcbe5 Mon Sep 17 00:00:00 2001 From: mkersten Date: Thu, 25 Aug 2005 14:48:07 +0000 Subject: Fix for Bug #82752: ProgramElement.getSourceSignature returns "public" for "private" members --- .../org/aspectj/ajde/AsmDeclarationsTest.java | 20 ++++++++++---------- asm/src/org/aspectj/asm/internal/ProgramElement.java | 10 ---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java index 621b0c549..e374ba5cd 100644 --- a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java +++ b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java @@ -10,20 +10,16 @@ package org.aspectj.ajde; -//import java.util.Iterator; - -//import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter; import org.aspectj.asm.*; -//import org.aspectj.asm.IProgramElement.Kind; - -// TODO: add tests for java kinds, expand coverage +/** + * @author Mik Kersten + */ public class AsmDeclarationsTest extends AjdeTestCase { private IHierarchy model = null; // TODO-path private static final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst"; -// private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH; public AsmDeclarationsTest(String name) { super(name); @@ -35,6 +31,12 @@ public class AsmDeclarationsTest extends AjdeTestCase { assertEquals(root.toLabelString(), "coverage.lst"); } + public void testAspectAccessibility() { + IProgramElement packageAspect = AsmManager.getDefault().getHierarchy().findElementForType(null, "AdviceNamingCoverage"); + assertNotNull(packageAspect); + assertEquals(IProgramElement.Accessibility.PACKAGE, packageAspect.getAccessibility()); + } + public void testStaticModifiers() { IProgramElement aspect = AsmManager.getDefault().getHierarchy().findElementForType(null, "ModifiersCoverage"); assertNotNull(aspect); @@ -119,7 +121,7 @@ public class AsmDeclarationsTest extends AjdeTestCase { // assertNotNull(constructorNode); // assertEquals(constructorNode.toLabelString(), constructorMsg); } - + public void testPointcuts() { IProgramElement node = (IProgramElement)model.getRoot(); assertNotNull(node); @@ -136,8 +138,6 @@ public class AsmDeclarationsTest extends AjdeTestCase { IProgramElement paramsNode = model.findElementForSignature(aspect, IProgramElement.Kind.POINTCUT, params); assertNotNull(paramsNode); assertEquals(paramsNode.toLabelString(), params); - - } public void testAbstract() { diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java index 31ae40f39..0f8cb6591 100644 --- a/asm/src/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java @@ -11,7 +11,6 @@ * Andy Clement Extensions for better IDE representation * ******************************************************************/ - package org.aspectj.asm.internal; import java.util.ArrayList; @@ -76,7 +75,6 @@ public class ProgramElement implements IProgramElement { this.name = name; this.kind = kind; setChildren(children); -// System.err.println("> created: " + name + ", children: " + children); } public ProgramElement( @@ -341,14 +339,6 @@ public class ProgramElement implements IProgramElement { name = string; } -// private void setParents() { -//// System.err.println(">> setting parents on: " + name); -// if (children == null) return; -// for (Iterator it = children.iterator(); it.hasNext(); ) { -// ((IProgramElement)it.next()).setParent(this); -// } -// } - public IProgramElement walk(HierarchyWalker walker) { if (children!=null) { for (Iterator it = children.iterator(); it.hasNext(); ) { -- cgit v1.2.3