summaryrefslogtreecommitdiffstats
path: root/weaver/src/org
diff options
context:
space:
mode:
authoraclement <aclement>2006-02-13 15:19:36 +0000
committeraclement <aclement>2006-02-13 15:19:36 +0000
commitb94253a3336b01c2fa17627168ae6701bafa47da (patch)
treeae92dd965ff2821645a85d87dc7e293ffe5e112b /weaver/src/org
parent648abc59cc5b4e4d1d475cfc6dfe421e88a5cd3a (diff)
downloadaspectj-b94253a3336b01c2fa17627168ae6701bafa47da.tar.gz
aspectj-b94253a3336b01c2fa17627168ae6701bafa47da.zip
optimization: dont unnecessarily build signatures and faster signature processing.
Diffstat (limited to 'weaver/src/org')
-rw-r--r--weaver/src/org/aspectj/weaver/MemberImpl.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/weaver/src/org/aspectj/weaver/MemberImpl.java b/weaver/src/org/aspectj/weaver/MemberImpl.java
index 0c22ff264..5f0c6ff55 100644
--- a/weaver/src/org/aspectj/weaver/MemberImpl.java
+++ b/weaver/src/org/aspectj/weaver/MemberImpl.java
@@ -60,7 +60,9 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member {
Object[] returnAndParams = signatureToTypes(signature,false);
this.returnType = (UnresolvedType) returnAndParams[0];
this.parameterTypes = (UnresolvedType[]) returnAndParams[1];
- signature = typesToSignature(returnType,parameterTypes,true);
+// always safe not to do this ?!?
+// String oldsig=new String(signature);
+// signature = typesToSignature(returnType,parameterTypes,true);
}
}
@@ -158,6 +160,7 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member {
private static Object[] signatureToTypes(String sig,boolean keepParameterizationInfo) {
List l = new ArrayList();
int i = 1;
+ boolean hasAnyAnglies = sig.indexOf('<')!=-1;
while (true) {
char c = sig.charAt(i);
if (c == ')') break; // break out when the hit the ')'
@@ -165,8 +168,8 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member {
while (c == '[') c = sig.charAt(++i);
if (c == 'L' || c == 'P') {
int nextSemicolon = sig.indexOf(';',start);
- int firstAngly = sig.indexOf('<',start);
- if (firstAngly == -1 || firstAngly>nextSemicolon) {
+ int firstAngly = (hasAnyAnglies?sig.indexOf('<',start):-1);
+ if (!hasAnyAnglies || firstAngly == -1 || firstAngly>nextSemicolon) {
i = nextSemicolon + 1;
l.add(UnresolvedType.forSignature(sig.substring(start, i)));
} else {
@@ -186,10 +189,7 @@ public class MemberImpl implements Comparable, AnnotatedElement,Member {
}
// posn now points to the correct nextSemicolon :)
i=posn;
- String toProcess = null;
- toProcess = sig.substring(start,i);
- UnresolvedType tx = UnresolvedType.forSignature(toProcess);
- l.add(tx);
+ l.add(UnresolvedType.forSignature(sig.substring(start,i)));
}
} else if (c=='T') { // assumed 'reference' to a type variable, so just "Tname;"
int nextSemicolon = sig.indexOf(';',start);