issue_id
int64 2.04k
425k
| title
stringlengths 9
251
| body
stringlengths 4
32.8k
⌀ | status
stringclasses 6
values | after_fix_sha
stringlengths 7
7
| project_name
stringclasses 6
values | repo_url
stringclasses 6
values | repo_name
stringclasses 6
values | language
stringclasses 1
value | issue_url
null | before_fix_sha
null | pull_url
null | commit_datetime
timestamp[us, tz=UTC] | report_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 23
187
| chunk_content
stringlengths 1
22k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
@Override
public final int getModifiers() {
return 0;
}
@Override
public final boolean isAssignableFrom(ResolvedType other) {
return false;
}
@Override
public final boolean isAssignableFrom(ResolvedType other, boolean allowMissing) {
return false;
}
@Override
public final boolean isCoerceableFrom(ResolvedType other) {
return false;
}
@Override
public boolean needsNoConversionFrom(ResolvedType other) {
return false;
}
@Override
public ISourceContext getSourceContext() {
return null;
}
}
/**
* Look up a member, takes into account any ITDs on this type. return null if not found
*/
public ResolvedMember lookupMemberNoSupers(Member member) {
ResolvedMember ret = lookupDirectlyDeclaredMemberNoSupers(member);
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (ret == null && interTypeMungers != null) {
for (ConcreteTypeMunger tm : interTypeMungers) {
if (matches(tm.getSignature(), member)) {
return tm.getSignature();
}
}
}
return ret;
}
public ResolvedMember lookupMemberWithSupersAndITDs(Member member) {
ResolvedMember ret = lookupMemberNoSupers(member);
if (ret != null) {
return ret;
}
ResolvedType supert = getSuperclass();
while (ret == null && supert != null) {
ret = supert.lookupMemberNoSupers(member);
if (ret == null) {
supert = supert.getSuperclass();
}
}
return ret;
}
/**
* as lookupMemberNoSupers, but does not include ITDs
*
* @param member
* @return
*/
public ResolvedMember lookupDirectlyDeclaredMemberNoSupers(Member member) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
ResolvedMember ret;
if (member.getKind() == Member.FIELD) {
ret = lookupMember(member, getDeclaredFields());
} else {
ret = lookupMember(member, getDeclaredMethods());
}
return ret;
}
/**
* This lookup has specialized behaviour - a null result tells the EclipseTypeMunger that it should make a default
* implementation of a method on this type.
*
* @param member
* @return
*/
public ResolvedMember lookupMemberIncludingITDsOnInterfaces(Member member) {
return lookupMemberIncludingITDsOnInterfaces(member, this);
}
private ResolvedMember lookupMemberIncludingITDsOnInterfaces(Member member, ResolvedType onType) {
ResolvedMember ret = onType.lookupMemberNoSupers(member);
if (ret != null) {
return ret;
} else {
ResolvedType superType = onType.getSuperclass();
if (superType != null) {
ret = lookupMemberIncludingITDsOnInterfaces(member, superType);
}
if (ret == null) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
ResolvedType[] superInterfaces = onType.getDeclaredInterfaces();
for (int i = 0; i < superInterfaces.length; i++) {
ret = superInterfaces[i].lookupMethodInITDs(member);
if (ret != null) {
return ret;
}
}
}
}
return ret;
}
protected List<ConcreteTypeMunger> interTypeMungers = new ArrayList<ConcreteTypeMunger>();
public List<ConcreteTypeMunger> getInterTypeMungers() {
return interTypeMungers;
}
public List<ConcreteTypeMunger> getInterTypeParentMungers() {
List<ConcreteTypeMunger> l = new ArrayList<ConcreteTypeMunger>();
for (ConcreteTypeMunger element : interTypeMungers) {
if (element.getMunger() instanceof NewParentTypeMunger) {
l.add(element);
}
}
return l;
}
/**
* ??? This method is O(N*M) where N = number of methods and M is number of inter-type declarations in my super
*/
public List<ConcreteTypeMunger> getInterTypeMungersIncludingSupers() {
ArrayList<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
collectInterTypeMungers(ret);
return ret;
}
public List<ConcreteTypeMunger> getInterTypeParentMungersIncludingSupers() {
ArrayList<ConcreteTypeMunger> ret = new ArrayList<ConcreteTypeMunger>();
collectInterTypeParentMungers(ret);
return ret;
}
private void collectInterTypeParentMungers(List<ConcreteTypeMunger> collector) {
for (Iterator<ResolvedType> iter = getDirectSupertypes(); iter.hasNext();) {
ResolvedType superType = iter.next();
superType.collectInterTypeParentMungers(collector);
}
collector.addAll(getInterTypeParentMungers());
}
protected void collectInterTypeMungers(List<ConcreteTypeMunger> collector) {
for (Iterator<ResolvedType> iter = getDirectSupertypes(); iter.hasNext();) {
ResolvedType superType = iter.next();
if (superType == null) {
throw new BCException("UnexpectedProblem: a supertype in the hierarchy for " + this.getName() + " is null");
}
superType.collectInterTypeMungers(collector);
}
outer: for (Iterator<ConcreteTypeMunger> iter1 = collector.iterator(); iter1.hasNext();) {
ConcreteTypeMunger superMunger = iter1.next();
if (superMunger.getSignature() == null) {
continue;
}
if (!superMunger.getSignature().isAbstract()) {
continue;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
for (ConcreteTypeMunger myMunger : getInterTypeMungers()) {
if (conflictingSignature(myMunger.getSignature(), superMunger.getSignature())) {
iter1.remove();
continue outer;
}
}
if (!superMunger.getSignature().isPublic()) {
continue;
}
for (Iterator<ResolvedMember> iter = getMethods(true, true); iter.hasNext();) {
ResolvedMember method = iter.next();
if (conflictingSignature(method, superMunger.getSignature())) {
iter1.remove();
continue outer;
}
}
}
collector.addAll(getInterTypeMungers());
}
/**
* Check: 1) That we don't have any abstract type mungers unless this type is abstract. 2) That an abstract ITDM on an interface
* is declared public. (Compiler limitation) (PR70794)
*/
public void checkInterTypeMungers() {
if (isAbstract()) {
return;
}
boolean itdProblem = false;
for (ConcreteTypeMunger munger : getInterTypeMungersIncludingSupers()) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
itdProblem = checkAbstractDeclaration(munger) || itdProblem;
}
if (itdProblem) {
return;
}
for (ConcreteTypeMunger munger : getInterTypeMungersIncludingSupers()) {
if (munger.getSignature() != null && munger.getSignature().isAbstract()) {
if (munger.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
} else {
world.getMessageHandler()
.handleMessage(
new Message("must implement abstract inter-type declaration: " + munger.getSignature(), "",
IMessage.ERROR, getSourceLocation(), null,
new ISourceLocation[] { getMungerLocation(munger) }));
}
}
}
}
/**
* See PR70794. This method checks that if an abstract inter-type method declaration is made on an interface then it must also
* be public. This is a compiler limitation that could be made to work in the future (if someone provides a worthwhile usecase)
*
* @return indicates if the munger failed the check
*/
private boolean checkAbstractDeclaration(ConcreteTypeMunger munger) {
if (munger.getMunger() != null && (munger.getMunger() instanceof NewMethodTypeMunger)) {
ResolvedMember itdMember = munger.getSignature();
ResolvedType onType = itdMember.getDeclaringType().resolve(world);
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (onType.isInterface() && itdMember.isAbstract() && !itdMember.isPublic()) {
world.getMessageHandler().handleMessage(
new Message(WeaverMessages.format(WeaverMessages.ITD_ABSTRACT_MUST_BE_PUBLIC_ON_INTERFACE,
munger.getSignature(), onType), "", Message.ERROR, getSourceLocation(), null,
new ISourceLocation[] { getMungerLocation(munger) }));
return true;
}
}
return false;
}
/**
* Get a source location for the munger. Until intertype mungers remember where they came from, the source location for the
* munger itself is null. In these cases use the source location for the aspect containing the ITD.
*/
private ISourceLocation getMungerLocation(ConcreteTypeMunger munger) {
ISourceLocation sloc = munger.getSourceLocation();
if (sloc == null) {
sloc = munger.getAspectType().getSourceLocation();
}
return sloc;
}
/**
* Returns a ResolvedType object representing the declaring type of this type, or null if this type does not represent a
* non-package-level-type.
* <p/>
* <strong>Warning</strong>: This is guaranteed to work for all member types. For anonymous/local types, the only guarantee is
* given in JLS 13.1, where it guarantees that if you call getDeclaringType() repeatedly, you will eventually get the top-level
* class, but it does not say anything about classes in between.
*
* @return the declaring UnresolvedType object, or null.
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
*/
public ResolvedType getDeclaringType() {
if (isArray()) {
return null;
}
String name = getName();
int lastDollar = name.lastIndexOf('$');
while (lastDollar > 0) {
ResolvedType ret = world.resolve(UnresolvedType.forName(name.substring(0, lastDollar)), true);
if (!ResolvedType.isMissing(ret)) {
return ret;
}
lastDollar = name.lastIndexOf('$', lastDollar - 1);
}
return null;
}
public static boolean isVisible(int modifiers, ResolvedType targetType, ResolvedType fromType) {
if (Modifier.isPublic(modifiers)) {
return true;
} else if (Modifier.isPrivate(modifiers)) {
return targetType.getOutermostType().equals(fromType.getOutermostType());
} else if (Modifier.isProtected(modifiers)) {
return samePackage(targetType, fromType) || targetType.isAssignableFrom(fromType);
} else {
return samePackage(targetType, fromType);
}
}
private static boolean samePackage(ResolvedType targetType, ResolvedType fromType) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
String p1 = targetType.getPackageName();
String p2 = fromType.getPackageName();
if (p1 == null) {
return p2 == null;
}
if (p2 == null) {
return false;
}
return p1.equals(p2);
}
/**
* Checks if the generic type for 'this' and the generic type for 'other' are the same - it can be passed raw or parameterized
* versions and will just compare the underlying generic type.
*/
private boolean genericTypeEquals(ResolvedType other) {
ResolvedType rt = other;
if (rt.isParameterizedType() || rt.isRawType()) {
rt.getGenericType();
}
if (((isParameterizedType() || isRawType()) && getGenericType().equals(rt)) || (this.equals(other))) {
return true;
}
return false;
}
/**
* Look up the actual occurence of a particular type in the hierarchy for 'this' type. The input is going to be a generic type,
* and the caller wants to know if it was used in its RAW or a PARAMETERIZED form in this hierarchy.
*
* returns null if it can't be found.
*/
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
public ResolvedType discoverActualOccurrenceOfTypeInHierarchy(ResolvedType lookingFor) {
if (!lookingFor.isGenericType()) {
throw new BCException("assertion failed: method should only be called with generic type, but " + lookingFor + " is "
+ lookingFor.typeKind);
}
if (this.equals(ResolvedType.OBJECT)) {
return null;
}
if (genericTypeEquals(lookingFor)) {
return this;
}
ResolvedType superT = getSuperclass();
if (superT.genericTypeEquals(lookingFor)) {
return superT;
}
ResolvedType[] superIs = getDeclaredInterfaces();
for (int i = 0; i < superIs.length; i++) {
ResolvedType superI = superIs[i];
if (superI.genericTypeEquals(lookingFor)) {
return superI;
}
ResolvedType checkTheSuperI = superI.discoverActualOccurrenceOfTypeInHierarchy(lookingFor);
if (checkTheSuperI != null) {
return checkTheSuperI;
}
}
return superT.discoverActualOccurrenceOfTypeInHierarchy(lookingFor);
}
/**
* Called for all type mungers but only does something if they share type variables with a generic type which they target. When
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
* this happens this routine will check for the target type in the target hierarchy and 'bind' any type parameters as
* appropriate. For example, for the ITD "List<T> I<T>.x" against a type like this: "class A implements I<String>" this routine
* will return a parameterized form of the ITD "List<String> I.x"
*/
public ConcreteTypeMunger fillInAnyTypeParameters(ConcreteTypeMunger munger) {
boolean debug = false;
ResolvedMember member = munger.getSignature();
if (munger.isTargetTypeParameterized()) {
if (debug) {
System.err.println("Processing attempted parameterization of " + munger + " targetting type " + this);
}
if (debug) {
System.err.println(" This type is " + this + " (" + typeKind + ")");
}
if (debug) {
System.err.println(" Signature that needs parameterizing: " + member);
}
ResolvedType onTypeResolved = world.resolve(member.getDeclaringType());
ResolvedType onType = onTypeResolved.getGenericType();
if (onType == null) {
getWorld().getMessageHandler().handleMessage(
MessageUtil.error("The target type for the intertype declaration is not generic",
munger.getSourceLocation()));
return munger;
}
member.resolve(world);
if (debug) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
System.err.println(" Actual target ontype: " + onType + " (" + onType.typeKind + ")");
}
ResolvedType actualTarget = discoverActualOccurrenceOfTypeInHierarchy(onType);
if (actualTarget == null) {
throw new BCException("assertion failed: asked " + this + " for occurrence of " + onType + " in its hierarchy??");
}
if (!actualTarget.isGenericType()) {
if (debug) {
System.err.println("Occurrence in " + this + " is actually " + actualTarget + " (" + actualTarget.typeKind
+ ")");
}
}
munger = munger.parameterizedFor(actualTarget);
if (debug) {
System.err.println("New sig: " + munger.getSignature());
}
if (debug) {
System.err.println("=====================================");
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return munger;
}
/**
* Add an intertype munger to this type. isDuringCompilation tells us if we should be checking for an error scenario where two
* ITD fields are trying to use the same name. When this happens during compilation one of them is altered to get mangled name
* but when it happens during weaving it is too late and we need to put out an error asking them to recompile.
*/
public void addInterTypeMunger(ConcreteTypeMunger munger, boolean isDuringCompilation) {
ResolvedMember sig = munger.getSignature();
bits = (bits & ~MungersAnalyzed);
if (sig == null || munger.getMunger() == null || munger.getMunger().getKind() == ResolvedTypeMunger.PrivilegedAccess) {
interTypeMungers.add(munger);
return;
}
munger = fillInAnyTypeParameters(munger);
sig = munger.getSignature();
if (sig.getKind() == Member.METHOD) {
if (clashesWithExistingMember(munger, getMethods(true, false))) {
return;
}
if (this.isInterface()) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (clashesWithExistingMember(munger, Arrays.asList(world.getCoreType(OBJECT).getDeclaredMethods()).iterator())) {
return;
}
}
} else if (sig.getKind() == Member.FIELD) {
if (clashesWithExistingMember(munger, Arrays.asList(getDeclaredFields()).iterator())) {
return;
}
if (!isDuringCompilation) {
ResolvedTypeMunger thisRealMunger = munger.getMunger();
if (thisRealMunger instanceof NewFieldTypeMunger) {
NewFieldTypeMunger newFieldTypeMunger = (NewFieldTypeMunger) thisRealMunger;
if (newFieldTypeMunger.version == NewFieldTypeMunger.VersionTwo) {
String thisRealMungerSignatureName = newFieldTypeMunger.getSignature().getName();
for (ConcreteTypeMunger typeMunger : interTypeMungers) {
if (typeMunger.getMunger() instanceof NewFieldTypeMunger) {
if (typeMunger.getSignature().getKind() == Member.FIELD) {
NewFieldTypeMunger existing = (NewFieldTypeMunger) typeMunger.getMunger();
if (existing.getSignature().getName().equals(thisRealMungerSignatureName)
&& existing.version == NewFieldTypeMunger.VersionTwo
&& existing.getSignature().getDeclaringType()
.equals(newFieldTypeMunger.getSignature().getDeclaringType())) {
StringBuffer sb = new StringBuffer();
sb.append("Cannot handle two aspects both attempting to use new style ITDs for the same named field ");
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
sb.append("on the same target type. Please recompile at least one aspect with '-Xset:itdVersion=1'.");
sb.append(" Aspects involved: " + munger.getAspectType().getName() + " and "
+ typeMunger.getAspectType().getName() + ".");
sb.append(" Field is named '" + existing.getSignature().getName() + "'");
getWorld().getMessageHandler().handleMessage(
new Message(sb.toString(), getSourceLocation(), true));
return;
}
}
}
}
}
}
}
} else {
if (clashesWithExistingMember(munger, Arrays.asList(getDeclaredMethods()).iterator())) {
return;
}
}
for (Iterator<ConcreteTypeMunger> i = interTypeMungers.iterator(); i.hasNext();) {
ConcreteTypeMunger existingMunger = i.next();
if (conflictingSignature(existingMunger.getSignature(), munger.getSignature())) {
if (isVisible(munger.getSignature().getModifiers(), munger.getAspectType(), existingMunger.getAspectType())) {
int c = compareMemberPrecedence(sig, existingMunger.getSignature());
if (c == 0) {
c = getWorld().compareByPrecedenceAndHierarchy(munger.getAspectType(), existingMunger.getAspectType());
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
if (c < 0) {
checkLegalOverride(munger.getSignature(), existingMunger.getSignature(), 0x11, null);
return;
} else if (c > 0) {
checkLegalOverride(existingMunger.getSignature(), munger.getSignature(), 0x11, null);
i.remove();
break;
} else {
interTypeConflictError(munger, existingMunger);
interTypeConflictError(existingMunger, munger);
return;
}
}
}
}
interTypeMungers.add(munger);
}
/**
* Compare the type transformer with the existing members. A clash may not be an error (the ITD may be the 'default
* implementation') so returning false is not always a sign of an error.
*
* @return true if there is a clash
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
*/
private boolean clashesWithExistingMember(ConcreteTypeMunger typeTransformer, Iterator<ResolvedMember> existingMembers) {
ResolvedMember typeTransformerSignature = typeTransformer.getSignature();
while (existingMembers.hasNext()) {
ResolvedMember existingMember = existingMembers.next();
if (existingMember.isBridgeMethod()) {
continue;
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (conflictingSignature(existingMember, typeTransformerSignature)) {
if (isVisible(existingMember.getModifiers(), this, typeTransformer.getAspectType())) {
int c = compareMemberPrecedence(typeTransformerSignature, existingMember);
if (c < 0) {
checkLegalOverride(typeTransformerSignature, existingMember, 0x10, typeTransformer.getAspectType());
return true;
} else if (c > 0) {
checkLegalOverride(existingMember, typeTransformerSignature, 0x01, typeTransformer.getAspectType());
continue;
} else {
boolean sameReturnTypes = (existingMember.getReturnType().equals(typeTransformerSignature.getReturnType()));
if (sameReturnTypes) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
boolean isDuplicateOfPreviousITD = false;
ResolvedType declaringRt = existingMember.getDeclaringType().resolve(world);
WeaverStateInfo wsi = declaringRt.getWeaverState();
if (wsi != null) {
List<ConcreteTypeMunger> mungersAffectingThisType = wsi.getTypeMungers(declaringRt);
if (mungersAffectingThisType != null) {
for (Iterator<ConcreteTypeMunger> iterator = mungersAffectingThisType.iterator(); iterator
.hasNext() && !isDuplicateOfPreviousITD;) {
ConcreteTypeMunger ctMunger = iterator.next();
if (ctMunger.getSignature().equals(existingMember)
&& ctMunger.aspectType.equals(typeTransformer.getAspectType())) {
isDuplicateOfPreviousITD = true;
}
}
}
}
if (!isDuplicateOfPreviousITD) {
if (!(typeTransformerSignature.getName().equals("<init>") && existingMember.isDefaultConstructor())) {
String aspectName = typeTransformer.getAspectType().getName();
ISourceLocation typeTransformerLocation = typeTransformer.getSourceLocation();
ISourceLocation existingMemberLocation = existingMember.getSourceLocation();
String msg = WeaverMessages.format(WeaverMessages.ITD_MEMBER_CONFLICT, aspectName,
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
existingMember);
getWorld().getMessageHandler().handleMessage(new Message(msg, typeTransformerLocation, true));
if (existingMemberLocation != null) {
getWorld().getMessageHandler()
.handleMessage(new Message(msg, existingMemberLocation, true));
}
return true;
}
}
}
}
} else if (isDuplicateMemberWithinTargetType(existingMember, this, typeTransformerSignature)) {
getWorld().getMessageHandler().handleMessage(
MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_MEMBER_CONFLICT, typeTransformer
.getAspectType().getName(), existingMember), typeTransformer.getSourceLocation()));
return true;
}
}
}
return false;
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
private boolean isDuplicateMemberWithinTargetType(ResolvedMember existingMember, ResolvedType targetType,
ResolvedMember itdMember) {
if ((existingMember.isAbstract() || itdMember.isAbstract())) {
return false;
}
UnresolvedType declaringType = existingMember.getDeclaringType();
if (!targetType.equals(declaringType)) {
return false;
}
if (Modifier.isPrivate(itdMember.getModifiers())) {
return false;
}
if (itdMember.isPublic()) {
return true;
}
if (!targetType.getPackageName().equals(itdMember.getDeclaringType().getPackageName())) {
return false;
}
return true;
}
/**
* @param transformerPosition which parameter is the type transformer (0x10 for first, 0x01 for second, 0x11 for both, 0x00 for
* neither)
* @param aspectType the declaring type of aspect defining the *first* type transformer
* @return true if the override is legal note: calling showMessage with two locations issues TWO messages, not ONE message with
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
* an additional source location.
*/
public boolean checkLegalOverride(ResolvedMember parent, ResolvedMember child, int transformerPosition, ResolvedType aspectType) {
if (Modifier.isFinal(parent.getModifiers())) {
if (transformerPosition == 0x10 && aspectType != null) {
ResolvedType nonItdDeclaringType = child.getDeclaringType().resolve(world);
WeaverStateInfo wsi = nonItdDeclaringType.getWeaverState();
if (wsi != null) {
List<ConcreteTypeMunger> transformersOnThisType = wsi.getTypeMungers(nonItdDeclaringType);
if (transformersOnThisType != null) {
for (ConcreteTypeMunger transformer : transformersOnThisType) {
if (transformer.aspectType.equals(aspectType)) {
if (parent.equalsApartFromDeclaringType(transformer.getSignature())) {
return true;
}
}
}
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
world.showMessage(Message.ERROR, WeaverMessages.format(WeaverMessages.CANT_OVERRIDE_FINAL_MEMBER, parent),
child.getSourceLocation(), null);
return false;
}
boolean incompatibleReturnTypes = false;
if (world.isInJava5Mode() && parent.getKind() == Member.METHOD) {
ResolvedType rtParentReturnType = parent.resolve(world).getGenericReturnType().resolve(world);
ResolvedType rtChildReturnType = child.resolve(world).getGenericReturnType().resolve(world);
incompatibleReturnTypes = !rtParentReturnType.isAssignableFrom(rtChildReturnType);
} else {
incompatibleReturnTypes = !parent.getReturnType().equals(child.getReturnType());
}
if (incompatibleReturnTypes) {
world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_RETURN_TYPE_MISMATCH, parent, child),
child.getSourceLocation(), parent.getSourceLocation());
return false;
}
if (parent.getKind() == Member.POINTCUT) {
UnresolvedType[] pTypes = parent.getParameterTypes();
UnresolvedType[] cTypes = child.getParameterTypes();
if (!Arrays.equals(pTypes, cTypes)) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_PARAM_TYPE_MISMATCH, parent, child),
child.getSourceLocation(), parent.getSourceLocation());
return false;
}
}
if (isMoreVisible(parent.getModifiers(), child.getModifiers())) {
world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_VISIBILITY_REDUCTION, parent, child),
child.getSourceLocation(), parent.getSourceLocation());
return false;
}
ResolvedType[] childExceptions = world.resolve(child.getExceptions());
ResolvedType[] parentExceptions = world.resolve(parent.getExceptions());
ResolvedType runtimeException = world.resolve("java.lang.RuntimeException");
ResolvedType error = world.resolve("java.lang.Error");
outer: for (int i = 0, leni = childExceptions.length; i < leni; i++) {
if (runtimeException.isAssignableFrom(childExceptions[i])) {
continue;
}
if (error.isAssignableFrom(childExceptions[i])) {
continue;
}
for (int j = 0, lenj = parentExceptions.length; j < lenj; j++) {
if (parentExceptions[j].isAssignableFrom(childExceptions[i])) {
continue outer;
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return false;
}
boolean parentStatic = Modifier.isStatic(parent.getModifiers());
boolean childStatic = Modifier.isStatic(child.getModifiers());
if (parentStatic && !childStatic) {
world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERRIDDEN_STATIC, child, parent),
child.getSourceLocation(), null);
return false;
} else if (childStatic && !parentStatic) {
world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ITD_OVERIDDING_STATIC, child, parent),
child.getSourceLocation(), null);
return false;
}
return true;
}
private int compareMemberPrecedence(ResolvedMember m1, ResolvedMember m2) {
if (Modifier.isProtected(m2.getModifiers()) && m2.getName().charAt(0) == 'c') {
UnresolvedType declaring = m2.getDeclaringType();
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (declaring != null) {
if (declaring.getName().equals("java.lang.Object") && m2.getName().equals("clone")) {
return +1;
}
}
}
if (Modifier.isAbstract(m1.getModifiers())) {
return -1;
}
if (Modifier.isAbstract(m2.getModifiers())) {
return +1;
}
if (m1.getDeclaringType().equals(m2.getDeclaringType())) {
return 0;
}
ResolvedType t1 = m1.getDeclaringType().resolve(world);
ResolvedType t2 = m2.getDeclaringType().resolve(world);
if (t1.isAssignableFrom(t2)) {
return -1;
}
if (t2.isAssignableFrom(t1)) {
return +1;
}
return 0;
}
public static boolean isMoreVisible(int m1, int m2) {
if (Modifier.isPrivate(m1)) {
return false;
}
if (isPackage(m1)) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return Modifier.isPrivate(m2);
}
if (Modifier.isProtected(m1)) {
return (Modifier.isPrivate(m2) || isPackage(m2));
}
if (Modifier.isPublic(m1)) {
return !Modifier.isPublic(m2);
}
throw new RuntimeException("bad modifier: " + m1);
}
private static boolean isPackage(int i) {
return (0 == (i & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED)));
}
private void interTypeConflictError(ConcreteTypeMunger m1, ConcreteTypeMunger m2) {
/*
* if (m1.getMunger().getKind() == ResolvedTypeMunger.Field && m2.getMunger().getKind() == ResolvedTypeMunger.Field) { if
* *exactly* the same, it's ok return true; }
*/
getWorld().showMessage(
IMessage.ERROR,
WeaverMessages.format(WeaverMessages.ITD_CONFLICT, m1.getAspectType().getName(), m2.getSignature(), m2
.getAspectType().getName()), m2.getSourceLocation(), getSourceLocation());
}
public ResolvedMember lookupSyntheticMember(Member member) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
for (ConcreteTypeMunger m : interTypeMungers) {
ResolvedMember ret = m.getMatchingSyntheticMember(member);
if (ret != null) {
return ret;
}
}
if (world.isJoinpointArrayConstructionEnabled() && this.isArray()) {
if (member.getKind() == Member.CONSTRUCTOR) {
ResolvedMemberImpl ret = new ResolvedMemberImpl(Member.CONSTRUCTOR, this, Modifier.PUBLIC, UnresolvedType.VOID,
"<init>", world.resolve(member.getParameterTypes()));
int count = ret.getParameterTypes().length;
String[] paramNames = new String[count];
for (int i = 0; i < count; i++) {
paramNames[i] = new StringBuffer("dim").append(i).toString();
}
ret.setParameterNames(paramNames);
return ret;
}
}
return null;
}
static class SuperClassWalker implements Iterator<ResolvedType> {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
private ResolvedType curr;
private SuperInterfaceWalker iwalker;
private boolean wantGenerics;
public SuperClassWalker(ResolvedType type, SuperInterfaceWalker iwalker, boolean genericsAware) {
this.curr = type;
this.iwalker = iwalker;
this.wantGenerics = genericsAware;
}
public boolean hasNext() {
return curr != null;
}
public ResolvedType next() {
ResolvedType ret = curr;
if (!wantGenerics && ret.isParameterizedOrGenericType()) {
ret = ret.getRawType();
}
iwalker.push(ret);
curr = curr.getSuperclass();
return ret;
}
public void remove() {
throw new UnsupportedOperationException();
}
}
static class SuperInterfaceWalker implements Iterator<ResolvedType> {
private Getter<ResolvedType, ResolvedType> ifaceGetter;
Iterator<ResolvedType> delegate = null;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
public Queue<ResolvedType> toPersue = new LinkedList<ResolvedType>();
public Set<ResolvedType> visited = new HashSet<ResolvedType>();
SuperInterfaceWalker(Iterators.Getter<ResolvedType, ResolvedType> ifaceGetter) {
this.ifaceGetter = ifaceGetter;
}
SuperInterfaceWalker(Iterators.Getter<ResolvedType, ResolvedType> ifaceGetter, ResolvedType interfaceType) {
this.ifaceGetter = ifaceGetter;
this.delegate = Iterators.one(interfaceType);
}
public boolean hasNext() {
if (delegate == null || !delegate.hasNext()) {
if (toPersue.isEmpty()) {
return false;
}
do {
ResolvedType next = toPersue.remove();
visited.add(next);
delegate = ifaceGetter.get(next);
} while (!delegate.hasNext() && !toPersue.isEmpty());
}
return delegate.hasNext();
}
public void push(ResolvedType ret) {
toPersue.add(ret);
}
public ResolvedType next() {
ResolvedType next = delegate.next();
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (visited.add(next)) {
toPersue.add(next);
}
return next;
}
public void remove() {
throw new UnsupportedOperationException();
}
}
public void clearInterTypeMungers() {
if (isRawType()) {
ResolvedType genericType = getGenericType();
if (genericType.isRawType()) {
System.err.println("DebugFor341926: Type " + this.getName() + " has an incorrect generic form");
} else {
genericType.clearInterTypeMungers();
}
}
interTypeMungers = new ArrayList<ConcreteTypeMunger>();
}
public boolean isTopmostImplementor(ResolvedType interfaceType) {
boolean b = true;
if (isInterface()) {
b = false;
} else if (!interfaceType.isAssignableFrom(this, true)) {
b = false;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
} else {
ResolvedType superclass = this.getSuperclass();
if (superclass.isMissing()) {
b = true;
} else if (interfaceType.isAssignableFrom(superclass, true)) {
b = false;
}
}
return b;
}
public ResolvedType getTopmostImplementor(ResolvedType interfaceType) {
if (isInterface()) {
return null;
}
if (!interfaceType.isAssignableFrom(this)) {
return null;
}
ResolvedType higherType = this.getSuperclass().getTopmostImplementor(interfaceType);
if (higherType != null) {
return higherType;
}
return this;
}
public List<ResolvedMember> getExposedPointcuts() {
List<ResolvedMember> ret = new ArrayList<ResolvedMember>();
if (getSuperclass() != null) {
ret.addAll(getSuperclass().getExposedPointcuts());
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
for (ResolvedType type : getDeclaredInterfaces()) {
addPointcutsResolvingConflicts(ret, Arrays.asList(type.getDeclaredPointcuts()), false);
}
addPointcutsResolvingConflicts(ret, Arrays.asList(getDeclaredPointcuts()), true);
for (ResolvedMember member : ret) {
ResolvedPointcutDefinition inherited = (ResolvedPointcutDefinition) member;
if (inherited != null && inherited.isAbstract()) {
if (!this.isAbstract()) {
getWorld().showMessage(IMessage.ERROR,
WeaverMessages.format(WeaverMessages.POINCUT_NOT_CONCRETE, inherited, this.getName()),
inherited.getSourceLocation(), this.getSourceLocation());
}
}
}
return ret;
}
private void addPointcutsResolvingConflicts(List<ResolvedMember> acc, List<ResolvedMember> added, boolean isOverriding) {
for (Iterator<ResolvedMember> i = added.iterator(); i.hasNext();) {
ResolvedPointcutDefinition toAdd = (ResolvedPointcutDefinition) i.next();
for (Iterator<ResolvedMember> j = acc.iterator(); j.hasNext();) {
ResolvedPointcutDefinition existing = (ResolvedPointcutDefinition) j.next();
if (toAdd == null || existing == null || existing == toAdd) {
continue;
}
UnresolvedType pointcutDeclaringTypeUT = existing.getDeclaringType();
if (pointcutDeclaringTypeUT != null) {
ResolvedType pointcutDeclaringType = pointcutDeclaringTypeUT.resolve(getWorld());
if (!isVisible(existing.getModifiers(), pointcutDeclaringType, this)) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (existing.isAbstract() && conflictingSignature(existing, toAdd)) {
getWorld().showMessage(
IMessage.ERROR,
WeaverMessages.format(WeaverMessages.POINTCUT_NOT_VISIBLE, existing.getDeclaringType()
.getName() + "." + existing.getName() + "()", this.getName()),
toAdd.getSourceLocation(), null);
j.remove();
}
continue;
}
}
if (conflictingSignature(existing, toAdd)) {
if (isOverriding) {
checkLegalOverride(existing, toAdd, 0x00, null);
j.remove();
} else {
getWorld().showMessage(
IMessage.ERROR,
WeaverMessages.format(WeaverMessages.CONFLICTING_INHERITED_POINTCUTS,
this.getName() + toAdd.getSignature()), existing.getSourceLocation(),
toAdd.getSourceLocation());
j.remove();
}
}
}
acc.add(toAdd);
}
}
public ISourceLocation getSourceLocation() {
return null;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
public boolean isExposedToWeaver() {
return false;
}
public WeaverStateInfo getWeaverState() {
return null;
}
/**
* Overridden by ReferenceType to return a sensible answer for parameterized and raw types.
*
* @return
*/
public ResolvedType getGenericType() {
return null;
}
@Override
public ResolvedType getRawType() {
return super.getRawType().resolve(world);
}
public ResolvedType parameterizedWith(UnresolvedType[] typeParameters) {
if (!(isGenericType() || isParameterizedType())) {
return this;
}
return TypeFactory.createParameterizedType(this.getGenericType(), typeParameters, getWorld());
}
/**
* Iff I am a parameterized type, and any of my parameters are type variable references, return a version with those type
* parameters replaced in accordance with the passed bindings.
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
*/
@Override
public UnresolvedType parameterize(Map<String, UnresolvedType> typeBindings) {
if (!isParameterizedType()) {
return this;
}
boolean workToDo = false;
for (int i = 0; i < typeParameters.length; i++) {
if (typeParameters[i].isTypeVariableReference() || (typeParameters[i] instanceof BoundedReferenceType)) {
workToDo = true;
}
}
if (!workToDo) {
return this;
} else {
UnresolvedType[] newTypeParams = new UnresolvedType[typeParameters.length];
for (int i = 0; i < newTypeParams.length; i++) {
newTypeParams[i] = typeParameters[i];
if (newTypeParams[i].isTypeVariableReference()) {
TypeVariableReferenceType tvrt = (TypeVariableReferenceType) newTypeParams[i];
UnresolvedType binding = typeBindings.get(tvrt.getTypeVariable().getName());
if (binding != null) {
newTypeParams[i] = binding;
}
} else if (newTypeParams[i] instanceof BoundedReferenceType) {
BoundedReferenceType brType = (BoundedReferenceType) newTypeParams[i];
newTypeParams[i] = brType.parameterize(typeBindings);
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
}
return TypeFactory.createParameterizedType(getGenericType(), newTypeParams, getWorld());
}
}
/**
* Similar to the above method, but accumulates the super types
*
* @return
*/
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
/**
* @return true if assignable to java.lang.Exception
*/
public boolean isException() {
return (world.getCoreType(UnresolvedType.JL_EXCEPTION).isAssignableFrom(this));
}
/**
* @return true if it is an exception and it is a checked one, false otherwise.
*/
public boolean isCheckedException() {
if (!isException()) {
return false;
}
if (world.getCoreType(UnresolvedType.RUNTIME_EXCEPTION).isAssignableFrom(this)) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return false;
}
return true;
}
/**
* Determines if variables of this type could be assigned values of another with lots of help. java.lang.Object is convertable
* from all types. A primitive type is convertable from X iff it's assignable from X. A reference type is convertable from X iff
* it's coerceable from X. In other words, X isConvertableFrom Y iff the compiler thinks that _some_ value of Y could be
* assignable to a variable of type X without loss of precision.
*
* @param other the other type
* @param world the {@link World} in which the possible assignment should be checked.
* @return true iff variables of this type could be assigned values of other with possible conversion
*/
public final boolean isConvertableFrom(ResolvedType other) {
if (this.equals(OBJECT)) {
return true;
}
if (world.isInJava5Mode()) {
if (this.isPrimitiveType() ^ other.isPrimitiveType()) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
if (validBoxing.contains(this.getSignature() + other.getSignature())) {
return true;
}
}
}
if (this.isPrimitiveType() || other.isPrimitiveType()) {
return this.isAssignableFrom(other);
}
return this.isCoerceableFrom(other);
}
/**
* Determines if the variables of this type could be assigned values of another type without casting. This still allows for
* assignment conversion as per JLS 2ed 5.2. For object types, this means supertypeOrEqual(THIS, OTHER).
*
* @param other the other type
* @param world the {@link World} in which the possible assignment should be checked.
* @return true iff variables of this type could be assigned values of other without casting
* @throws NullPointerException if other is null
*/
public abstract boolean isAssignableFrom(ResolvedType other);
public abstract boolean isAssignableFrom(ResolvedType other, boolean allowMissing);
/**
* Determines if values of another type could possibly be cast to this type. The rules followed are from JLS 2ed 5.5,
* "Casting Conversion".
* <p/>
* <p>
* This method should be commutative, i.e., for all UnresolvedType a, b and all World w:
* <p/>
* <blockquote>
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
*
* <pre>
* a.isCoerceableFrom(b, w) == b.isCoerceableFrom(a, w)
* </pre>
*
* </blockquote>
*
* @param other the other type
* @param world the {@link World} in which the possible coersion should be checked.
* @return true iff values of other could possibly be cast to this type.
* @throws NullPointerException if other is null.
*/
public abstract boolean isCoerceableFrom(ResolvedType other);
public boolean needsNoConversionFrom(ResolvedType o) {
return isAssignableFrom(o);
}
public String getSignatureForAttribute() {
return signature;
}
private FuzzyBoolean parameterizedWithTypeVariable = FuzzyBoolean.MAYBE;
/**
* return true if the parameterization of this type includes a member type variable. Member type variables occur in generic
* methods/ctors.
*/
public boolean isParameterizedWithTypeVariable() {
if (parameterizedWithTypeVariable == FuzzyBoolean.MAYBE) {
if (typeParameters == null || typeParameters.length == 0) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
parameterizedWithTypeVariable = FuzzyBoolean.NO;
return false;
}
for (int i = 0; i < typeParameters.length; i++) {
ResolvedType aType = (ResolvedType) typeParameters[i];
if (aType.isTypeVariableReference()
) {
parameterizedWithTypeVariable = FuzzyBoolean.YES;
return true;
}
if (aType.isParameterizedType()) {
boolean b = aType.isParameterizedWithTypeVariable();
if (b) {
parameterizedWithTypeVariable = FuzzyBoolean.YES;
return true;
}
}
if (aType.isGenericWildcard()) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
BoundedReferenceType boundedRT = (BoundedReferenceType) aType;
if (boundedRT.isExtends()) {
boolean b = false;
UnresolvedType upperBound = boundedRT.getUpperBound();
if (upperBound.isParameterizedType()) {
b = ((ResolvedType) upperBound).isParameterizedWithTypeVariable();
} else if (upperBound.isTypeVariableReference()
&& ((TypeVariableReference) upperBound).getTypeVariable().getDeclaringElementKind() == TypeVariable.METHOD) {
b = true;
}
if (b) {
parameterizedWithTypeVariable = FuzzyBoolean.YES;
return true;
}
}
if (boundedRT.isSuper()) {
boolean b = false;
UnresolvedType lowerBound = boundedRT.getLowerBound();
if (lowerBound.isParameterizedType()) {
b = ((ResolvedType) lowerBound).isParameterizedWithTypeVariable();
} else if (lowerBound.isTypeVariableReference()
&& ((TypeVariableReference) lowerBound).getTypeVariable().getDeclaringElementKind() == TypeVariable.METHOD) {
b = true;
}
if (b) {
parameterizedWithTypeVariable = FuzzyBoolean.YES;
return true;
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
}
parameterizedWithTypeVariable = FuzzyBoolean.NO;
}
return parameterizedWithTypeVariable.alwaysTrue();
}
protected boolean ajMembersNeedParameterization() {
if (isParameterizedType()) {
return true;
}
ResolvedType superclass = getSuperclass();
if (superclass != null && !superclass.isMissing()) {
return superclass.ajMembersNeedParameterization();
}
return false;
}
protected Map<String, UnresolvedType> getAjMemberParameterizationMap() {
Map<String, UnresolvedType> myMap = getMemberParameterizationMap();
if (myMap.isEmpty()) {
if (getSuperclass() != null) {
return getSuperclass().getAjMemberParameterizationMap();
}
}
return myMap;
}
public void setBinaryPath(String binaryPath) {
this.binaryPath = binaryPath;
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
/**
* Returns the path to the jar or class file from which this binary aspect came or null if not a binary aspect
*/
public String getBinaryPath() {
return binaryPath;
}
/**
* Undo any temporary modifications to the type (for example it may be holding annotations temporarily whilst some matching is
* occurring - These annotations will be added properly during weaving but sometimes for type completion they need to be held
* here for a while).
*/
public void ensureConsistent() {
}
/**
* For an annotation type, this will return if it is marked with @Inherited
*/
public boolean isInheritedAnnotation() {
ensureAnnotationBitsInitialized();
return (bits & AnnotationMarkedInherited) != 0;
}
/*
* Setup the bitflags if they have not already been done.
*/
private void ensureAnnotationBitsInitialized() {
if ((bits & AnnotationBitsInitialized) == 0) {
bits |= AnnotationBitsInitialized;
if (hasAnnotation(UnresolvedType.AT_INHERITED)) {
bits |= AnnotationMarkedInherited;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
}
}
}
private boolean hasNewParentMungers() {
if ((bits & MungersAnalyzed) == 0) {
bits |= MungersAnalyzed;
for (ConcreteTypeMunger munger : interTypeMungers) {
ResolvedTypeMunger resolvedTypeMunger = munger.getMunger();
if (resolvedTypeMunger != null && resolvedTypeMunger.getKind() == ResolvedTypeMunger.Parent) {
bits |= HasParentMunger;
}
}
}
return (bits & HasParentMunger) != 0;
}
public void tagAsTypeHierarchyComplete() {
bits |= TypeHierarchyCompleteBit;
}
public boolean isTypeHierarchyComplete() {
return (bits & TypeHierarchyCompleteBit) != 0;
}
/**
* return the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.
*
* @return the (major) version, {@link WeaverVersionInfo}
*/
public int getCompilerVersion() {
return WeaverVersionInfo.getCurrentWeaverMajorVersion();
}
public boolean isPrimitiveArray() {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java
|
return false;
}
public boolean isGroovyObject() {
if ((bits & GroovyObjectInitialized) == 0) {
ResolvedType[] intfaces = getDeclaredInterfaces();
boolean done = false;
if (intfaces != null) {
for (ResolvedType intface : intfaces) {
if (intface.getName().equals("groovy.lang.GroovyObject")) {
bits |= IsGroovyObject;
done = true;
break;
}
}
}
if (!done) {
if (getSuperclass().getName().equals("groovy.lang.GroovyObjectSupport")) {
bits |= IsGroovyObject;
}
}
bits |= GroovyObjectInitialized;
}
return (bits & IsGroovyObject) != 0;
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
/* *******************************************************************
* Copyright (c) 2005-2010 Contributors.
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://eclipse.org/legal/epl-v10.html
* ******************************************************************/
package org.aspectj.weaver;
import java.util.ArrayList;
import java.util.List;
/**
* @author Adrian Colyer
* @author Andy Clement
*/
public class TypeFactory {
/**
* Create a parameterized version of a generic type.
*
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
* @param aGenericType
* @param someTypeParameters note, in the case of an inner type of a parameterized type, this parameter may legitimately be null
* @param inAWorld
* @return
*/
public static ReferenceType createParameterizedType(ResolvedType aBaseType, UnresolvedType[] someTypeParameters, World inAWorld) {
ResolvedType baseType = aBaseType;
if (!aBaseType.isGenericType()) {
if (someTypeParameters != null && someTypeParameters.length > 0) {
if (!aBaseType.isRawType()) {
throw new IllegalStateException("Expecting raw type, not: " + aBaseType);
}
baseType = baseType.getGenericType();
if (baseType == null) {
throw new IllegalStateException("Raw type does not have generic type set");
}
}
}
ResolvedType[] resolvedParameters = inAWorld.resolve(someTypeParameters);
ReferenceType pType = new ReferenceType(baseType, resolvedParameters, inAWorld);
return (ReferenceType) pType.resolve(inAWorld);
}
/**
* Create an *unresolved* parameterized version of a generic type.
*/
public static UnresolvedType createUnresolvedParameterizedType(String sig, String erasuresig, UnresolvedType[] arguments) {
return new UnresolvedType(sig, erasuresig, arguments);
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
/**
* Creates a sensible unresolvedtype from some signature, for example: signature = LIGuard<TT;>; bound = toString=IGuard<T>
* sig=PIGuard<TT;>; sigErasure=LIGuard; kind=parameterized
*/
static UnresolvedType convertSigToType(String aSignature) {
UnresolvedType bound = null;
int startOfParams = aSignature.indexOf('<');
if (startOfParams == -1) {
bound = UnresolvedType.forSignature(aSignature);
} else {
int endOfParams = aSignature.lastIndexOf('>');
String signatureErasure = "L" + aSignature.substring(1, startOfParams) + ";";
UnresolvedType[] typeParams = createTypeParams(aSignature.substring(startOfParams + 1, endOfParams));
bound = new UnresolvedType("P" + aSignature.substring(1), signatureErasure, typeParams);
}
return bound;
}
/**
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
* Used by UnresolvedType.read, creates a type from a full signature.
*/
public static UnresolvedType createTypeFromSignature(String signature) {
char firstChar = signature.charAt(0);
if (firstChar == 'P') {
int startOfParams = signature.indexOf('<');
if (startOfParams == -1) {
String signatureErasure = "L" + signature.substring(1);
return new UnresolvedType(signature, signatureErasure, UnresolvedType.NONE);
} else {
int endOfParams = locateMatchingEndAngleBracket(signature, startOfParams);
StringBuffer erasureSig = new StringBuffer(signature);
erasureSig.setCharAt(0, 'L');
while (startOfParams != -1) {
erasureSig.delete(startOfParams, endOfParams + 1);
startOfParams = locateFirstBracket(erasureSig);
if (startOfParams != -1) {
endOfParams = locateMatchingEndAngleBracket(erasureSig, startOfParams);
}
}
String signatureErasure = erasureSig.toString();
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
String lastType = null;
int nestedTypePosition = signature.indexOf("$", endOfParams);
if (nestedTypePosition != -1) {
lastType = signature.substring(nestedTypePosition + 1);
} else {
lastType = new String(signature);
}
startOfParams = lastType.indexOf("<");
UnresolvedType[] typeParams = UnresolvedType.NONE;
if (startOfParams != -1) {
endOfParams = locateMatchingEndAngleBracket(lastType, startOfParams);
typeParams = createTypeParams(lastType.substring(startOfParams + 1, endOfParams));
}
StringBuilder s = new StringBuilder();
int firstAngleBracket = signature.indexOf('<');
s.append("P").append(signature.substring(1, firstAngleBracket));
s.append('<');
for (UnresolvedType typeParameter : typeParams) {
s.append(typeParameter.getSignature());
}
s.append(">;");
signature = s.toString();
return new UnresolvedType(signature, signatureErasure, typeParams);
}
} else if ((firstChar == '?' || firstChar == '*') && signature.length()==1) {
return WildcardedUnresolvedType.QUESTIONMARK;
} else if (firstChar == '+') {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
UnresolvedType upperBound = convertSigToType(signature.substring(1));
WildcardedUnresolvedType wildcardedUT = new WildcardedUnresolvedType(signature, upperBound, null);
return wildcardedUT;
} else if (firstChar == '-') {
UnresolvedType lowerBound = convertSigToType(signature.substring(1));
WildcardedUnresolvedType wildcardedUT = new WildcardedUnresolvedType(signature, null, lowerBound);
return wildcardedUT;
} else if (firstChar == 'T') {
String typeVariableName = signature.substring(1);
if (typeVariableName.endsWith(";")) {
typeVariableName = typeVariableName.substring(0, typeVariableName.length() - 1);
}
return new UnresolvedTypeVariableReferenceType(new TypeVariable(typeVariableName));
} else if (firstChar == '[') {
int dims = 0;
while (signature.charAt(dims) == '[') {
dims++;
}
UnresolvedType componentType = createTypeFromSignature(signature.substring(dims));
return new UnresolvedType(signature, signature.substring(0, dims) + componentType.getErasureSignature());
} else if (signature.length() == 1) {
switch (firstChar) {
case 'V':
return UnresolvedType.VOID;
case 'Z':
return UnresolvedType.BOOLEAN;
case 'B':
return UnresolvedType.BYTE;
case 'C':
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
return UnresolvedType.CHAR;
case 'D':
return UnresolvedType.DOUBLE;
case 'F':
return UnresolvedType.FLOAT;
case 'I':
return UnresolvedType.INT;
case 'J':
return UnresolvedType.LONG;
case 'S':
return UnresolvedType.SHORT;
}
} else if (firstChar == '@') {
return ResolvedType.MISSING;
} else if (firstChar == 'L') {
int leftAngleBracket = signature.indexOf('<');
if (leftAngleBracket == -1) {
return new UnresolvedType(signature);
} else {
int endOfParams = locateMatchingEndAngleBracket(signature, leftAngleBracket);
StringBuffer erasureSig = new StringBuffer(signature);
erasureSig.setCharAt(0, 'L');
while (leftAngleBracket != -1) {
erasureSig.delete(leftAngleBracket, endOfParams + 1);
leftAngleBracket = locateFirstBracket(erasureSig);
if (leftAngleBracket != -1) {
endOfParams = locateMatchingEndAngleBracket(erasureSig, leftAngleBracket);
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
}
String signatureErasure = erasureSig.toString();
String lastType = null;
int nestedTypePosition = signature.indexOf("$", endOfParams);
if (nestedTypePosition != -1) {
lastType = signature.substring(nestedTypePosition + 1);
} else {
lastType = new String(signature);
}
leftAngleBracket = lastType.indexOf("<");
UnresolvedType[] typeParams = UnresolvedType.NONE;
if (leftAngleBracket != -1) {
endOfParams = locateMatchingEndAngleBracket(lastType, leftAngleBracket);
typeParams = createTypeParams(lastType.substring(leftAngleBracket + 1, endOfParams));
}
StringBuilder s = new StringBuilder();
int firstAngleBracket = signature.indexOf('<');
s.append("P").append(signature.substring(1, firstAngleBracket));
s.append('<');
for (UnresolvedType typeParameter : typeParams) {
s.append(typeParameter.getSignature());
}
s.append(">;");
signature = s.toString();
return new UnresolvedType(signature, signatureErasure, typeParams);
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
return new UnresolvedType(signature);
}
private static int locateMatchingEndAngleBracket(CharSequence signature, int startOfParams) {
if (startOfParams == -1) {
return -1;
}
int count = 1;
int idx = startOfParams;
int max = signature.length();
while (idx < max) {
char ch = signature.charAt(++idx);
if (ch == '<') {
count++;
} else if (ch == '>') {
if (count == 1) {
break;
}
count--;
}
}
return idx;
}
private static int locateFirstBracket(StringBuffer signature) {
int idx = 0;
int max = signature.length();
while (idx < max) {
if (signature.charAt(idx) == '<') {
return idx;
}
idx++;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
}
return -1;
}
private static UnresolvedType[] createTypeParams(String typeParameterSpecification) {
String remainingToProcess = typeParameterSpecification;
List<UnresolvedType> types = new ArrayList<UnresolvedType>();
while (remainingToProcess.length() != 0) {
int endOfSig = 0;
int anglies = 0;
boolean hadAnglies = false;
boolean sigFound = false;
for (endOfSig = 0; (endOfSig < remainingToProcess.length()) && !sigFound; endOfSig++) {
char thisChar = remainingToProcess.charAt(endOfSig);
switch (thisChar) {
case '<':
anglies++;
hadAnglies = true;
break;
case '>':
anglies--;
break;
case '*':
if (anglies==0) {
int nextCharPos = endOfSig+1;
if (nextCharPos>=remainingToProcess.length()) {
sigFound=true;
} else {
char nextChar = remainingToProcess.charAt(nextCharPos);
if (!(nextChar=='+' || nextChar=='-')) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
sigFound=true;
}
}
}
break;
case '[':
if (anglies == 0) {
int nextChar = endOfSig + 1;
while (remainingToProcess.charAt(nextChar) == '[') {
nextChar++;
}
if ("BCDFIJSZ".indexOf(remainingToProcess.charAt(nextChar)) != -1) {
sigFound = true;
endOfSig = nextChar;
break;
}
}
break;
case ';':
if (anglies == 0) {
sigFound = true;
break;
}
}
}
String forProcessing = remainingToProcess.substring(0, endOfSig);
if (hadAnglies && forProcessing.charAt(0) == 'L') {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeFactory.java
|
forProcessing = "P" + forProcessing.substring(1);
}
types.add(createTypeFromSignature(forProcessing));
remainingToProcess = remainingToProcess.substring(endOfSig);
}
UnresolvedType[] typeParams = new UnresolvedType[types.size()];
types.toArray(typeParams);
return typeParams;
}
/**
* Create a signature then delegate to the other factory method. Same input/output: baseTypeSignature="LSomeType;" arguments[0]=
* something with sig "Pcom/Foo<Ljava/lang/String;>;" signature created = "PSomeType<Pcom/Foo<Ljava/lang/String;>;>;"
*/
public static UnresolvedType createUnresolvedParameterizedType(String baseTypeSignature, UnresolvedType[] arguments) {
StringBuffer parameterizedSig = new StringBuffer();
parameterizedSig.append(ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER);
parameterizedSig.append(baseTypeSignature.substring(1, baseTypeSignature.length() - 1));
if (arguments.length > 0) {
parameterizedSig.append("<");
for (int i = 0; i < arguments.length; i++) {
parameterizedSig.append(arguments[i].getSignature());
}
parameterizedSig.append(">");
}
parameterizedSig.append(";");
return createUnresolvedParameterizedType(parameterizedSig.toString(), baseTypeSignature, arguments);
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableReferenceType.java
|
/* *******************************************************************
* Copyright (c) 2005-2010 Contributors.
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://eclipse.org/legal/epl-v10.html
* ******************************************************************/
package org.aspectj.weaver;
import java.util.Map;
/**
* ReferenceType representing a type variable. The delegate for this reference type is the upperbound on the type variable (so
* Object if not otherwise specified).
*
* @author Adrian Colyer
* @author Andy Clement
*/
public class TypeVariableReferenceType extends ReferenceType implements TypeVariableReference {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableReferenceType.java
|
private TypeVariable typeVariable;
boolean fixedUp = false;
public TypeVariableReferenceType(TypeVariable typeVariable, World world) {
super(typeVariable.getGenericSignature(), typeVariable.getErasureSignature(), world);
this.typeVariable = typeVariable;
}
/**
* For a TypeVariableReferenceType the delegate is the delegate for the first bound.
*/
@Override
public ReferenceTypeDelegate getDelegate() {
if (this.delegate == null) {
ResolvedType resolvedFirstBound = typeVariable.getFirstBound().resolve(world);
BoundedReferenceTypeDelegate brtd = null;
if (resolvedFirstBound.isMissing()) {
brtd = new BoundedReferenceTypeDelegate((ReferenceType) world.resolve(UnresolvedType.OBJECT));
setDelegate(brtd);
world.getLint().cantFindType.signal(
"Unable to find type for generic bound. Missing type is " + resolvedFirstBound.getName(),
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableReferenceType.java
|
getSourceLocation());
} else {
brtd = new BoundedReferenceTypeDelegate((ReferenceType) resolvedFirstBound);
setDelegate(brtd);
}
}
return this.delegate;
}
@Override
public UnresolvedType parameterize(Map<String, UnresolvedType> typeBindings) {
UnresolvedType ut = typeBindings.get(getName());
if (ut != null) {
return world.resolve(ut);
}
return this;
}
public TypeVariable getTypeVariable() {
return typeVariable;
}
@Override
public boolean isTypeVariableReference() {
return true;
}
@Override
public String toString() {
return typeVariable.getName();
}
@Override
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableReferenceType.java
|
public boolean isGenericWildcard() {
return false;
}
@Override
public boolean isAnnotation() {
ReferenceType upper = (ReferenceType) typeVariable.getUpperBound();
if (upper.isAnnotation()) {
return true;
}
World world = upper.getWorld();
typeVariable.resolve(world);
ResolvedType annotationType = ResolvedType.ANNOTATION.resolve(world);
UnresolvedType[] ifBounds = typeVariable.getSuperInterfaces();
for (int i = 0; i < ifBounds.length; i++) {
if (((ReferenceType) ifBounds[i]).isAnnotation()) {
return true;
}
if (ifBounds[i].equals(annotationType)) {
return true;
}
}
return false;
}
/**
* return the signature for a *REFERENCE* to a type variable, which is simply: Tname; there is no bounds info included, that is
* in the signature of the type variable itself
*/
@Override
public String getSignature() {
StringBuffer sb = new StringBuffer();
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableReferenceType.java
|
sb.append("T");
sb.append(typeVariable.getName());
sb.append(";");
return sb.toString();
}
/**
* @return the name of the type variable
*/
public String getTypeVariableName() {
return typeVariable.getName();
}
public ReferenceType getUpperBound() {
return (ReferenceType) typeVariable.resolve(world).getUpperBound();
}
/**
* resolve the type variable we are managing and then return this object. 'this' is already a ResolvedType but the type variable
* may transition from a not-resolved to a resolved state.
*/
public ResolvedType resolve(World world) {
typeVariable.resolve(world);
return this;
}
/**
* @return true if the type variable this reference is managing is resolved
*/
public boolean isTypeVariableResolved() {
return typeVariable.isResolved;
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
/* *******************************************************************
* Copyright (c) 2002,2005 Contributors
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* Andy Clement start of generics upgrade...
* Adrian Colyer - overhaul
* ******************************************************************/
package org.aspectj.weaver;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
import java.io.DataInputStream;
import java.io.IOException;
import java.util.Map;
import org.aspectj.util.GenericSignature;
import org.aspectj.util.GenericSignature.ClassSignature;
import org.aspectj.util.GenericSignatureParser;
import org.aspectj.weaver.tools.Traceable;
/**
* A UnresolvedType represents a type to the weaver. UnresolvedTypes are resolved in some World (a type repository). When a
* UnresolvedType is resolved it turns into a ResolvedType which may be a primitive type, or a ReferenceType. ReferenceTypes may
* refer to simple, generic, parameterized or type-variable based reference types. A ReferenceType is backed by a delegate that
* provides information about the type based on some repository (for example an Eclipse based delegate, a bytecode based delegate or
* a reflection based delegate).
* <p>
* Every UnresolvedType has a signature, the unique key for the type in the world.
*/
public class UnresolvedType implements Traceable, TypeVariableDeclaringElement {
public static final UnresolvedType[] NONE = new UnresolvedType[0];
public static final UnresolvedType OBJECT = forSignature("Ljava/lang/Object;");
public static final UnresolvedType OBJECTARRAY = forSignature("[Ljava/lang/Object;");
public static final UnresolvedType CLONEABLE = forSignature("Ljava/lang/Cloneable;");
public static final UnresolvedType SERIALIZABLE = forSignature("Ljava/io/Serializable;");
public static final UnresolvedType THROWABLE = forSignature("Ljava/lang/Throwable;");
public static final UnresolvedType RUNTIME_EXCEPTION = forSignature("Ljava/lang/RuntimeException;");
public static final UnresolvedType ERROR = forSignature("Ljava/lang/Error;");
public static final UnresolvedType AT_INHERITED = forSignature("Ljava/lang/annotation/Inherited;");
public static final UnresolvedType AT_RETENTION = forSignature("Ljava/lang/annotation/Retention;");
public static final UnresolvedType ENUM = forSignature("Ljava/lang/Enum;");
public static final UnresolvedType ANNOTATION = forSignature("Ljava/lang/annotation/Annotation;");
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
public static final UnresolvedType JL_CLASS = forSignature("Ljava/lang/Class;");
public static final UnresolvedType JAVA_LANG_CLASS_ARRAY = forSignature("[Ljava/lang/Class;");
public static final UnresolvedType JL_STRING = forSignature("Ljava/lang/String;");
public static final UnresolvedType JL_EXCEPTION = forSignature("Ljava/lang/Exception;");
public static final UnresolvedType JAVA_LANG_REFLECT_METHOD = forSignature("Ljava/lang/reflect/Method;");
public static final UnresolvedType JAVA_LANG_REFLECT_FIELD = forSignature("Ljava/lang/reflect/Field;");
public static final UnresolvedType JAVA_LANG_REFLECT_CONSTRUCTOR = forSignature("Ljava/lang/reflect/Constructor;");
public static final UnresolvedType JAVA_LANG_ANNOTATION = forSignature("Ljava/lang/annotation/Annotation;");
public static final UnresolvedType SUPPRESS_AJ_WARNINGS = forSignature("Lorg/aspectj/lang/annotation/SuppressAjWarnings;");
public static final UnresolvedType AT_TARGET = forSignature("Ljava/lang/annotation/Target;");
public static final UnresolvedType SOMETHING = new UnresolvedType("?");
public static final UnresolvedType[] ARRAY_WITH_JUST_OBJECT = new UnresolvedType[] { OBJECT };
public static final UnresolvedType JOINPOINT_STATICPART = forSignature("Lorg/aspectj/lang/JoinPoint$StaticPart;");
public static final UnresolvedType JOINPOINT_ENCLOSINGSTATICPART = forSignature("Lorg/aspectj/lang/JoinPoint$EnclosingStaticPart;");
public static final UnresolvedType BOOLEAN = forPrimitiveType("Z");
public static final UnresolvedType BYTE = forPrimitiveType("B");
public static final UnresolvedType CHAR = forPrimitiveType("C");
public static final UnresolvedType DOUBLE = forPrimitiveType("D");
public static final UnresolvedType FLOAT = forPrimitiveType("F");
public static final UnresolvedType INT = forPrimitiveType("I");
public static final UnresolvedType LONG = forPrimitiveType("J");
public static final UnresolvedType SHORT = forPrimitiveType("S");
public static final UnresolvedType VOID = forPrimitiveType("V");
public static final String MISSING_NAME = "@missing@";
protected TypeKind typeKind = TypeKind.SIMPLE;
protected String signature;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
/**
* The erasure of the signature. Contains only the Java signature of the type with all supertype, superinterface, type variable,
* and parameter information removed.
*/
protected String signatureErasure;
/**
* Calculated on first request - the package name (java.lang for type java.lang.String)
*/
private String packageName;
/**
* Calculated on first request - the class name (String for type java.lang.String)
*/
private String className;
/**
* Iff isParameterized(), then these are the type parameters
*/
protected UnresolvedType[] typeParameters;
/**
* Iff isGeneric(), then these are the type variables declared on the type Iff isParameterized(), then these are the type
* variables bound as parameters in the type
*/
protected TypeVariable[] typeVariables;
public boolean isPrimitiveType() {
return typeKind == TypeKind.PRIMITIVE;
}
public boolean isVoid() {
return signature.equals("V");
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
public boolean isSimpleType() {
return typeKind == TypeKind.SIMPLE;
}
public boolean isRawType() {
return typeKind == TypeKind.RAW;
}
public boolean isGenericType() {
return typeKind == TypeKind.GENERIC;
}
public boolean isParameterizedType() {
return typeKind == TypeKind.PARAMETERIZED;
}
public boolean isParameterizedOrGenericType() {
return typeKind == TypeKind.GENERIC || typeKind == TypeKind.PARAMETERIZED;
}
public boolean isParameterizedOrRawType() {
return typeKind == TypeKind.PARAMETERIZED || typeKind == TypeKind.RAW;
}
public boolean isTypeVariableReference() {
return typeKind == TypeKind.TYPE_VARIABLE;
}
public boolean isGenericWildcard() {
return typeKind == TypeKind.WILDCARD;
}
public TypeKind getTypekind() {
return typeKind;
}
public final boolean isArray() {
return signature.length() > 0 && signature.charAt(0) == '[';
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
}
/**
* Equality is checked based on the underlying signature.
*/
@Override
public boolean equals(Object other) {
if (!(other instanceof UnresolvedType)) {
return false;
}
return signature.equals(((UnresolvedType) other).signature);
}
/**
* Equality is checked based on the underlying signature, so the hash code of a particular type is the hash code of its
* signature string.
*/
@Override
public final int hashCode() {
return signature.hashCode();
}
protected UnresolvedType(String signature) {
this.signature = signature;
this.signatureErasure = signature;
}
protected UnresolvedType(String signature, String signatureErasure) {
this.signature = signature;
this.signatureErasure = signatureErasure;
}
public UnresolvedType(String signature, String signatureErasure, UnresolvedType[] typeParams) {
this.signature = signature;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
this.signatureErasure = signatureErasure;
this.typeParameters = typeParams;
if (typeParams != null) {
this.typeKind = TypeKind.PARAMETERIZED;
}
}
/**
* This is the size of this type as used in JVM.
*/
public int getSize() {
return size;
}
private int size = 1;
/**
* NOTE: Use forSignature() if you can, it'll be cheaper ! Constructs a UnresolvedType for a java language type name. For
* example:
*
* <blockquote>
*
* <pre>
* UnresolvedType.forName("java.lang.Thread[]")
* UnresolvedType.forName("int")
* </pre>
*
* </blockquote>
*
* Types may equivalently be produced by this or by {@link #forSignature(String)}.
*
* <blockquote>
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
*
* <pre>
* UnresolvedType.forName("java.lang.Thread[]").equals(Type.forSignature("[Ljava/lang/Thread;")
* UnresolvedType.forName("int").equals(Type.forSignature("I"))
* </pre>
*
* </blockquote>
*
* @param name the java language type name in question.
* @return a type object representing that java language type.
*/
public static UnresolvedType forName(String name) {
return forSignature(nameToSignature(name));
}
/**
* Constructs a UnresolvedType for each java language type name in an incoming array.
*
* @param names an array of java language type names.
* @return an array of UnresolvedType objects.
* @see #forName(String)
*/
public static UnresolvedType[] forNames(String[] names) {
UnresolvedType[] ret = new UnresolvedType[names.length];
for (int i = 0, len = names.length; i < len; i++) {
ret[i] = UnresolvedType.forName(names[i]);
}
return ret;
}
public static UnresolvedType forGenericType(String name, TypeVariable[] tvbs, String genericSig) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
String sig = nameToSignature(name);
UnresolvedType ret = UnresolvedType.forSignature(sig);
ret.typeKind = TypeKind.GENERIC;
ret.typeVariables = tvbs;
ret.signatureErasure = sig;
return ret;
}
public static UnresolvedType forGenericTypeSignature(String sig, String declaredGenericSig) {
UnresolvedType ret = UnresolvedType.forSignature(sig);
ret.typeKind = TypeKind.GENERIC;
ClassSignature csig = new GenericSignatureParser().parseAsClassSignature(declaredGenericSig);
GenericSignature.FormalTypeParameter[] ftps = csig.formalTypeParameters;
ret.typeVariables = new TypeVariable[ftps.length];
for (int i = 0; i < ftps.length; i++) {
GenericSignature.FormalTypeParameter parameter = ftps[i];
if (parameter.classBound instanceof GenericSignature.ClassTypeSignature) {
GenericSignature.ClassTypeSignature cts = (GenericSignature.ClassTypeSignature) parameter.classBound;
ret.typeVariables[i] = new TypeVariable(ftps[i].identifier, UnresolvedType.forSignature(cts.outerType.identifier
+ ";"));
} else if (parameter.classBound instanceof GenericSignature.TypeVariableSignature) {
GenericSignature.TypeVariableSignature tvs = (GenericSignature.TypeVariableSignature) parameter.classBound;
UnresolvedTypeVariableReferenceType utvrt = new UnresolvedTypeVariableReferenceType(new TypeVariable(
tvs.typeVariableName));
ret.typeVariables[i] = new TypeVariable(ftps[i].identifier, utvrt);
} else {
throw new BCException(
"UnresolvedType.forGenericTypeSignature(): Do not know how to process type variable bound of type '"
+ parameter.classBound.getClass() + "'. Full signature is '" + sig + "'");
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
}
ret.signatureErasure = sig;
ret.signature = ret.signatureErasure;
return ret;
}
public static UnresolvedType forGenericTypeVariables(String sig, TypeVariable[] tVars) {
UnresolvedType ret = UnresolvedType.forSignature(sig);
ret.typeKind = TypeKind.GENERIC;
ret.typeVariables = tVars;
ret.signatureErasure = sig;
ret.signature = ret.signatureErasure;
return ret;
}
public static UnresolvedType forRawTypeName(String name) {
UnresolvedType ret = UnresolvedType.forName(name);
ret.typeKind = TypeKind.RAW;
return ret;
}
public static UnresolvedType forPrimitiveType(String signature) {
UnresolvedType ret = new UnresolvedType(signature);
ret.typeKind = TypeKind.PRIMITIVE;
if (signature.equals("J") || signature.equals("D")) {
ret.size = 2;
} else if (signature.equals("V")) {
ret.size = 0;
}
return ret;
}
/**
* Creates a new type array with a fresh type appended to the end.
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
*
* @param types the left hand side of the new array
* @param end the right hand side of the new array
*/
public static UnresolvedType[] add(UnresolvedType[] types, UnresolvedType end) {
int len = types.length;
UnresolvedType[] ret = new UnresolvedType[len + 1];
System.arraycopy(types, 0, ret, 0, len);
ret[len] = end;
return ret;
}
/**
* Creates a new type array with a fresh type inserted at the beginning.
*
*
* @param start the left hand side of the new array
* @param types the right hand side of the new array
*/
public static UnresolvedType[] insert(UnresolvedType start, UnresolvedType[] types) {
int len = types.length;
UnresolvedType[] ret = new UnresolvedType[len + 1];
ret[0] = start;
System.arraycopy(types, 0, ret, 1, len);
return ret;
}
/**
* Constructs a Type for a JVM bytecode signature string. For example:
*
* <blockquote>
*
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
* <pre>
* UnresolvedType.forSignature("[Ljava/lang/Thread;")
* UnresolvedType.forSignature("I");
* </pre>
*
* </blockquote>
*
* Types may equivalently be produced by this or by {@link #forName(String)}. This method should not be passed P signatures.
*
* <blockquote>
*
* <pre>
* UnresolvedType.forName("java.lang.Thread[]").equals(Type.forSignature("[Ljava/lang/Thread;")
* UnresolvedType.forName("int").equals(Type.forSignature("I"))
* </pre>
*
* </blockquote>
*
* @param signature the JVM bytecode signature string for the desired type.
* @return a type object represnting that JVM bytecode signature.
*/
public static UnresolvedType forSignature(String signature) {
assert !(signature.startsWith("L") && signature.indexOf("<") != -1);
switch (signature.charAt(0)) {
case 'B':
return UnresolvedType.BYTE;
case 'C':
return UnresolvedType.CHAR;
case 'D':
return UnresolvedType.DOUBLE;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
case 'F':
return UnresolvedType.FLOAT;
case 'I':
return UnresolvedType.INT;
case 'J':
return UnresolvedType.LONG;
case 'L':
return TypeFactory.createTypeFromSignature(signature);
case 'P':
return TypeFactory.createTypeFromSignature(signature);
case 'S':
return UnresolvedType.SHORT;
case 'V':
return UnresolvedType.VOID;
case 'Z':
return UnresolvedType.BOOLEAN;
case '[':
return TypeFactory.createTypeFromSignature(signature);
case '+':
return TypeFactory.createTypeFromSignature(signature);
case '-':
return TypeFactory.createTypeFromSignature(signature);
case '?':
return TypeFactory.createTypeFromSignature(signature);
case 'T':
return TypeFactory.createTypeFromSignature(signature);
default:
throw new BCException("Bad type signature " + signature);
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
/**
* Constructs a UnresolvedType for each JVM bytecode type signature in an incoming array.
*
* @param names an array of JVM bytecode type signatures
* @return an array of UnresolvedType objects.
* @see #forSignature(String)
*/
public static UnresolvedType[] forSignatures(String[] sigs) {
UnresolvedType[] ret = new UnresolvedType[sigs.length];
for (int i = 0, len = sigs.length; i < len; i++) {
ret[i] = UnresolvedType.forSignature(sigs[i]);
}
return ret;
}
/**
* Returns the name of this type in java language form (e.g. java.lang.Thread or boolean[]). This produces a more aesthetically
* pleasing string than {@link java.lang.Class#getName()}.
*
* @return the java language name of this type.
*/
public String getName() {
return signatureToName(signature);
}
public String getSimpleName() {
String name = getRawName();
int lastDot = name.lastIndexOf('.');
if (lastDot != -1) {
name = name.substring(lastDot + 1);
}
if (isParameterizedType()) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
StringBuffer sb = new StringBuffer(name);
sb.append("<");
for (int i = 0; i < (typeParameters.length - 1); i++) {
sb.append(typeParameters[i].getSimpleName());
sb.append(",");
}
sb.append(typeParameters[typeParameters.length - 1].getSimpleName());
sb.append(">");
name = sb.toString();
}
return name;
}
public String getRawName() {
return signatureToName((signatureErasure == null ? signature : signatureErasure));
}
public String getBaseName() {
String name = getName();
if (isParameterizedType() || isGenericType()) {
if (typeParameters == null) {
return name;
} else {
return name.substring(0, name.indexOf("<"));
}
} else {
return name;
}
}
public String getSimpleBaseName() {
String name = getBaseName();
int lastDot = name.lastIndexOf('.');
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
if (lastDot != -1) {
name = name.substring(lastDot + 1);
}
return name;
}
/**
* Returns an array of strings representing the java langauge names of an array of types.
*
* @param types an array of UnresolvedType objects
* @return an array of Strings fo the java language names of types.
* @see #getName()
*/
public static String[] getNames(UnresolvedType[] types) {
String[] ret = new String[types.length];
for (int i = 0, len = types.length; i < len; i++) {
ret[i] = types[i].getName();
}
return ret;
}
/**
* Returns the name of this type in JVM signature form. For all UnresolvedType t:
*
* <blockquote>
*
* <pre>
* UnresolvedType.forSignature(t.getSignature()).equals(t)
* </pre>
*
* </blockquote>
*
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
* and for all String s where s is a lexically valid JVM type signature string:
*
* <blockquote>
*
* <pre>
* UnresolvedType.forSignature(s).getSignature().equals(s)
* </pre>
*
* </blockquote>
*
* @return the java JVM signature string for this type.
*/
public String getSignature() {
return signature;
}
/**
* For parameterized types, return the signature for the raw type
*/
public String getErasureSignature() {
if (signatureErasure == null) {
return signature;
}
return signatureErasure;
}
private boolean needsModifiableDelegate = false;
public boolean needsModifiableDelegate() {
return needsModifiableDelegate;
}
public void setNeedsModifiableDelegate(boolean b) {
this.needsModifiableDelegate = b;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
}
public UnresolvedType getRawType() {
return UnresolvedType.forSignature(getErasureSignature());
}
/**
* Returns a UnresolvedType object representing the effective outermost enclosing type for a name type. For all other types,
* this will return the type itself.
*
* The only guarantee is given in JLS 13.1 where code generated according to those rules will have type names that can be split
* apart in this way.
*
* @return the outermost enclosing UnresolvedType object or this.
*/
public UnresolvedType getOutermostType() {
if (isArray() || isPrimitiveType()) {
return this;
}
String sig = getErasureSignature();
int dollar = sig.indexOf('$');
if (dollar != -1) {
return UnresolvedType.forSignature(sig.substring(0, dollar) + ';');
} else {
return this;
}
}
/**
* Returns a UnresolvedType object representing the component type of this array, or null if this type does not represent an
* array type.
*
* @return the component UnresolvedType object, or null.
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
*/
public UnresolvedType getComponentType() {
if (isArray()) {
return forSignature(signature.substring(1));
} else {
return null;
}
}
/**
* Returns a java language string representation of this type.
*/
@Override
public String toString() {
return getName();
}
public String toDebugString() {
return getName();
}
/**
* Returns a resolved version of this type according to a particular world.
*
* @param world the {@link World} within which to resolve.
* @return a resolved type representing this type in the appropriate world.
*/
public ResolvedType resolve(World world) {
return world.resolve(this);
}
private static String signatureToName(String signature) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
switch (signature.charAt(0)) {
case 'B':
return "byte";
case 'C':
return "char";
case 'D':
return "double";
case 'F':
return "float";
case 'I':
return "int";
case 'J':
return "long";
case 'L':
String name = signature.substring(1, signature.length() - 1).replace('/', '.');
return name;
case 'T':
StringBuffer nameBuff2 = new StringBuffer();
int colon = signature.indexOf(";");
String tvarName = signature.substring(1, colon);
nameBuff2.append(tvarName);
return nameBuff2.toString();
case 'P':
StringBuffer nameBuff = new StringBuffer();
int paramNestLevel = 0;
for (int i = 1; i < signature.length(); i++) {
char c = signature.charAt(i);
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
switch (c) {
case '/':
nameBuff.append('.');
break;
case '<':
nameBuff.append("<");
paramNestLevel++;
StringBuffer innerBuff = new StringBuffer();
while (paramNestLevel > 0) {
c = signature.charAt(++i);
if (c == '<') {
paramNestLevel++;
}
if (c == '>') {
paramNestLevel--;
}
if (paramNestLevel > 0) {
innerBuff.append(c);
}
if (c == ';' && paramNestLevel == 1) {
nameBuff.append(signatureToName(innerBuff.toString()));
if (signature.charAt(i + 1) != '>') {
nameBuff.append(',');
}
innerBuff = new StringBuffer();
}
}
nameBuff.append(">");
break;
case ';':
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
break;
default:
nameBuff.append(c);
}
}
return nameBuff.toString();
case 'S':
return "short";
case 'V':
return "void";
case 'Z':
return "boolean";
case '[':
return signatureToName(signature.substring(1, signature.length())) + "[]";
case '+':
return "? extends " + signatureToName(signature.substring(1, signature.length()));
case '-':
return "? super " + signatureToName(signature.substring(1, signature.length()));
case '*':
return "?";
default:
throw new BCException("Bad type signature: " + signature);
}
}
private static String nameToSignature(String name) {
int len = name.length();
if (len < 8) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
if (name.equals("byte")) {
return "B";
}
if (name.equals("char")) {
return "C";
}
if (name.equals("double")) {
return "D";
}
if (name.equals("float")) {
return "F";
}
if (name.equals("int")) {
return "I";
}
if (name.equals("long")) {
return "J";
}
if (name.equals("short")) {
return "S";
}
if (name.equals("boolean")) {
return "Z";
}
if (name.equals("void")) {
return "V";
}
if (name.equals("?")) {
return name;
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
}
if (name.endsWith("[]")) {
return "[" + nameToSignature(name.substring(0, name.length() - 2));
}
if (len == 0) {
throw new BCException("Bad type name: " + name);
}
if (name.indexOf("<") == -1) {
return new StringBuilder("L").append(name.replace('.', '/')).append(';').toString();
} else {
StringBuffer nameBuff = new StringBuffer();
int nestLevel = 0;
nameBuff.append("P");
for (int i = 0; i < len; i++) {
char c = name.charAt(i);
switch (c) {
case '.':
nameBuff.append('/');
break;
case '<':
nameBuff.append("<");
nestLevel++;
StringBuffer innerBuff = new StringBuffer();
while (nestLevel > 0) {
c = name.charAt(++i);
if (c == '<') {
nestLevel++;
} else if (c == '>') {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
nestLevel--;
}
if (c == ',' && nestLevel == 1) {
nameBuff.append(nameToSignature(innerBuff.toString()));
innerBuff = new StringBuffer();
} else {
if (nestLevel > 0) {
innerBuff.append(c);
}
}
}
nameBuff.append(nameToSignature(innerBuff.toString()));
nameBuff.append('>');
break;
default:
nameBuff.append(c);
}
}
nameBuff.append(";");
return nameBuff.toString();
}
}
/**
* Write out an UnresolvedType - the signature should be enough.
*/
public final void write(CompressingDataOutputStream s) throws IOException {
s.writeUTF(getSignature());
}
/**
* Read in an UnresolvedType - just read the signature and rebuild the UnresolvedType.
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
*/
public static UnresolvedType read(DataInputStream s) throws IOException {
String sig = s.readUTF();
if (sig.equals(MISSING_NAME)) {
return ResolvedType.MISSING;
} else {
return UnresolvedType.forSignature(sig);
}
}
public String getNameAsIdentifier() {
return getName().replace('.', '_');
}
public String getPackageNameAsIdentifier() {
String name = getName();
int index = name.lastIndexOf('.');
if (index == -1) {
return "";
} else {
return name.substring(0, index).replace('.', '_');
}
}
public UnresolvedType[] getTypeParameters() {
return typeParameters == null ? UnresolvedType.NONE : typeParameters;
}
public TypeVariable[] getTypeVariables() {
return typeVariables;
}
public static class TypeKind {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
public final static TypeKind PRIMITIVE = new TypeKind("primitive");
public final static TypeKind SIMPLE = new TypeKind("simple");
public final static TypeKind RAW = new TypeKind("raw");
public final static TypeKind GENERIC = new TypeKind("generic");
public final static TypeKind PARAMETERIZED = new TypeKind("parameterized");
public final static TypeKind TYPE_VARIABLE = new TypeKind("type_variable");
public final static TypeKind WILDCARD = new TypeKind("wildcard");
@Override
public String toString() {
return type;
}
private TypeKind(String type) {
this.type = type;
}
private final String type;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
}
public TypeVariable getTypeVariableNamed(String name) {
TypeVariable[] vars = getTypeVariables();
if (vars == null || vars.length == 0) {
return null;
}
for (int i = 0; i < vars.length; i++) {
TypeVariable aVar = vars[i];
if (aVar.getName().equals(name)) {
return aVar;
}
}
return null;
}
public String toTraceString() {
return getClass().getName() + "[" + getName() + "]";
}
/**
* Return a version of this parameterized type in which any type parameters that are type variable references are replaced by
* their matching type variable binding.
*/
public UnresolvedType parameterize(Map<String, UnresolvedType> typeBindings) {
throw new UnsupportedOperationException("unable to parameterize unresolved type: " + signature);
}
/**
* @return the class name (does not include the package name)
*/
public String getClassName() {
if (className == null) {
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
String name = getName();
if (name.indexOf("<") != -1) {
name = name.substring(0, name.indexOf("<"));
}
int index = name.lastIndexOf('.');
if (index == -1) {
className = name;
} else {
className = name.substring(index + 1);
}
}
return className;
}
/**
* @return the package name (no class name included)
*/
public String getPackageName() {
if (packageName == null) {
String name = getName();
if (name.indexOf("<") != -1) {
name = name.substring(0, name.indexOf("<"));
}
int index = name.lastIndexOf('.');
if (index == -1) {
packageName = "";
} else {
packageName = name.substring(0, index);
}
}
return packageName;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java
|
}
public static void writeArray(UnresolvedType[] types, CompressingDataOutputStream stream) throws IOException {
int len = types.length;
stream.writeShort(len);
for (UnresolvedType type : types) {
type.write(stream);
}
}
public static UnresolvedType[] readArray(DataInputStream s) throws IOException {
int len = s.readShort();
if (len == 0) {
return UnresolvedType.NONE;
}
UnresolvedType[] types = new UnresolvedType[len];
for (int i = 0; i < len; i++) {
types[i] = UnresolvedType.read(s);
}
return types;
}
public static UnresolvedType makeArray(UnresolvedType base, int dims) {
StringBuffer sig = new StringBuffer();
for (int i = 0; i < dims; i++) {
sig.append("[");
}
sig.append(base.getSignature());
return UnresolvedType.forSignature(sig.toString());
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java
|
/* *******************************************************************
* Copyright (c) 2005-2010 Contributors
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://eclipse.org/legal/epl-v10.html
* ******************************************************************/
package org.aspectj.weaver;
/**
* @author Adrian Colyer
* @author Andy Clement
*/
public class UnresolvedTypeVariableReferenceType extends UnresolvedType implements TypeVariableReference {
private TypeVariable typeVariable;
public UnresolvedTypeVariableReferenceType() {
super("Ljava/lang/Object;");
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java
|
public UnresolvedTypeVariableReferenceType(TypeVariable aTypeVariable) {
super("T" + aTypeVariable.getName() + ";", aTypeVariable.getFirstBound().getErasureSignature());
this.typeVariable = aTypeVariable;
}
public void setTypeVariable(TypeVariable aTypeVariable) {
this.signature = "T" + aTypeVariable.getName() + ";";
this.signatureErasure = aTypeVariable.getFirstBound().getErasureSignature();
this.typeVariable = aTypeVariable;
this.typeKind = TypeKind.TYPE_VARIABLE;
}
@Override
public ResolvedType resolve(World world) {
TypeVariableDeclaringElement typeVariableScope = world.getTypeVariableLookupScope();
TypeVariable resolvedTypeVariable = null;
TypeVariableReferenceType tvrt = null;
if (typeVariableScope == null) {
resolvedTypeVariable = typeVariable.resolve(world);
tvrt = new TypeVariableReferenceType(resolvedTypeVariable, world);
} else {
boolean foundOK = false;
resolvedTypeVariable = typeVariableScope.getTypeVariableNamed(typeVariable.getName());
if (resolvedTypeVariable == null) {
resolvedTypeVariable = typeVariable.resolve(world);
} else {
foundOK = true;
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedTypeVariableReferenceType.java
|
tvrt = new TypeVariableReferenceType(resolvedTypeVariable, world);
tvrt.fixedUp = foundOK;
}
return tvrt;
}
@Override
public boolean isTypeVariableReference() {
return true;
}
public TypeVariable getTypeVariable() {
return typeVariable;
}
@Override
public String toString() {
if (typeVariable == null) {
return "<type variable not set!>";
} else {
return "T" + typeVariable.getName() + ";";
}
}
@Override
public String toDebugString() {
return typeVariable.getName();
}
@Override
public String getErasureSignature() {
return typeVariable.getFirstBound().getSignature();
}
}
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/World.java
|
/* *******************************************************************
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
* 2005 Contributors
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http:www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PARC initial implementation
* Adrian Colyer, Andy Clement, overhaul for generics, Abraham Nevado
* ******************************************************************/
package org.aspectj.weaver;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
|
374,745 |
Bug 374745 Performance regression in 1.6.12
| null |
resolved fixed
|
549d227
|
AspectJ
|
https://github.com/eclipse/org.aspectj
|
eclipse/org.aspectj
|
java
| null | null | null | 2012-03-23T23:57:10Z | 2012-03-20T10:40:00Z |
org.aspectj.matcher/src/org/aspectj/weaver/World.java
|
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.WeakHashMap;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessage.Kind;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.context.PinpointingMessageHandler;
import org.aspectj.util.IStructureModel;
import org.aspectj.weaver.ResolvedType.Primitive;
import org.aspectj.weaver.UnresolvedType.TypeKind;
import org.aspectj.weaver.patterns.Declare;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.DeclarePrecedence;
import org.aspectj.weaver.patterns.DeclareSoft;
import org.aspectj.weaver.patterns.DeclareTypeErrorOrWarning;
import org.aspectj.weaver.patterns.Pointcut;
import org.aspectj.weaver.patterns.TypePattern;
import org.aspectj.weaver.tools.PointcutDesignatorHandler;
import org.aspectj.weaver.tools.Trace;
import org.aspectj.weaver.tools.TraceFactory;
/**
* A World is a collection of known types and crosscutting members.
*/
public abstract class World implements Dump.INode {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.