diff options
author | aclement <aclement> | 2006-03-28 09:34:35 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-03-28 09:34:35 +0000 |
commit | 4cbd5456f8d8886579970939d58992d32a1746bd (patch) | |
tree | 9cf7e35793a81cc6ffe2b66d95287d300d6ea9b7 /weaver | |
parent | 41f1f3a4174de86413942cd8f2c2e7c45d9824d7 (diff) | |
download | aspectj-4cbd5456f8d8886579970939d58992d32a1746bd.tar.gz aspectj-4cbd5456f8d8886579970939d58992d32a1746bd.zip |
test and fix for 126560 (@AJ types resolved in 'current package') and test for 132349
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java | 20 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/SimpleScope.java | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java index 2e00fcc39..d542571b6 100644 --- a/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java +++ b/weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java @@ -1587,6 +1587,26 @@ public class AtAjAttributes { public ISourceLocation makeSourceLocation(IHasPosition location) { return m_sourceContext.makeSourceLocation(location); } + + public UnresolvedType lookupType(String name, IHasPosition location) { + // bug 126560 + if (m_enclosingType != null) { + // add the package we're in to the list of imported + // prefixes so that we can find types in the same package + String pkgName = m_enclosingType.getPackageName(); + if (pkgName != null && !pkgName.equals("")) { + String[] currentImports = getImportedPrefixes(); + String[] newImports = new String[currentImports.length + 1]; + for (int i = 0; i < currentImports.length; i++) { + newImports[i] = currentImports[i]; + } + newImports[currentImports.length] = pkgName.concat("."); + setImportedPrefixes(newImports); + } + } + return super.lookupType(name,location); + } + } /** diff --git a/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java b/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java index 13475e6a0..c85b781ca 100644 --- a/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java +++ b/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java @@ -44,6 +44,9 @@ public class SimpleScope implements IScope { public UnresolvedType lookupType(String name, IHasPosition location) { for (int i=0; i<importedNames.length; i++) { String importedName = importedNames[i]; +// // make sure we're matching against the +// // type name rather than part of it +// if (importedName.endsWith("." + name)) { if (importedName.endsWith(name)) { return world.resolve(importedName); } |