Lines 57-62
Link Here
|
57 |
private Set /* resolvedMembers */superMethodsCalled = Collections.EMPTY_SET; |
57 |
private Set /* resolvedMembers */superMethodsCalled = Collections.EMPTY_SET; |
58 |
|
58 |
|
59 |
private ISourceLocation location; // Lost during serialize/deserialize ! |
59 |
private ISourceLocation location; // Lost during serialize/deserialize ! |
|
|
60 |
private MatchHolder avoider; |
60 |
|
61 |
|
61 |
public ResolvedTypeMunger(Kind kind, ResolvedMember signature) { |
62 |
public ResolvedTypeMunger(Kind kind, ResolvedMember signature) { |
62 |
this.kind = kind; |
63 |
this.kind = kind; |
Lines 99-132
Link Here
|
99 |
// ConcreteTypeMunger munger = world.concreteTypeMunger(this, aspectType); |
100 |
// ConcreteTypeMunger munger = world.concreteTypeMunger(this, aspectType); |
100 |
// return munger; |
101 |
// return munger; |
101 |
// } |
102 |
// } |
102 |
|
103 |
|
|
|
104 |
|
103 |
public boolean matches(ResolvedType matchType, ResolvedType aspectType) { |
105 |
public boolean matches(ResolvedType matchType, ResolvedType aspectType) { |
104 |
ResolvedType onType = matchType.getWorld().resolve(signature.getDeclaringType()); |
106 |
Boolean b = (avoider==null?null:avoider.matches(matchType)); |
105 |
if (onType.isRawType()) |
107 |
if (b==null) { |
106 |
onType = onType.getGenericType(); |
108 |
ResolvedType onType = matchType.getWorld().resolve(signature.getDeclaringType()); |
107 |
// System.err.println("matching: " + this + " to " + matchType + " onType = " + onType); |
109 |
// System.out.println("Matches check for "+this+" on "+matchType+" decltype="+onType); |
108 |
if (matchType.equals(onType)) { |
110 |
if (onType.isRawType()) { |
109 |
if (!onType.isExposedToWeaver()) { |
111 |
onType = onType.getGenericType(); |
110 |
// if the onType is an interface, and it already has the member we are about |
112 |
} |
111 |
// to munge, then this is ok... |
113 |
// System.err.println("matching: " + this + " to " + matchType + " onType = " + onType); |
112 |
boolean ok = (onType.isInterface() && (onType.lookupMemberWithSupersAndITDs(getSignature()) != null)); |
114 |
if (matchType.equals(onType)) { |
113 |
|
115 |
if (!onType.isExposedToWeaver()) { |
114 |
if (!ok && onType.getWeaverState() == null) { |
116 |
// if the onType is an interface, and it already has the member we are about |
115 |
if (matchType.getWorld().getLint().typeNotExposedToWeaver.isEnabled()) { |
117 |
// to munge, then this is ok... |
116 |
matchType.getWorld().getLint().typeNotExposedToWeaver.signal(matchType.getName(), signature |
118 |
boolean ok = (onType.isInterface() && (onType.lookupMemberWithSupersAndITDs(getSignature()) != null)); |
117 |
.getSourceLocation()); |
119 |
|
|
|
120 |
if (!ok && onType.getWeaverState() == null) { |
121 |
if (matchType.getWorld().getLint().typeNotExposedToWeaver.isEnabled()) { |
122 |
matchType.getWorld().getLint().typeNotExposedToWeaver.signal(matchType.getName(), signature |
123 |
.getSourceLocation()); |
124 |
} |
118 |
} |
125 |
} |
119 |
} |
126 |
} |
|
|
127 |
b = Boolean.TRUE; |
128 |
} else { |
129 |
|
130 |
if (onType.isInterface()) { |
131 |
b = Boolean.valueOf(matchType.isTopmostImplementor(onType)); |
132 |
} else { |
133 |
b = Boolean.FALSE; |
134 |
} |
135 |
} |
136 |
if (avoider!=null) { |
137 |
avoider.record(matchType,b); |
120 |
} |
138 |
} |
121 |
return true; |
|
|
122 |
} |
123 |
// System.err.println("NO MATCH DIRECT"); |
124 |
|
125 |
if (onType.isInterface()) { |
126 |
return matchType.isTopmostImplementor(onType); |
127 |
} else { |
128 |
return false; |
129 |
} |
139 |
} |
|
|
140 |
return b.booleanValue(); |
130 |
} |
141 |
} |
131 |
|
142 |
|
132 |
// ---- |
143 |
// ---- |
Lines 449-452
Link Here
|
449 |
throw new BCException("Dont call parameterizeWith() on a type munger of this kind: " + this.getClass()); |
460 |
throw new BCException("Dont call parameterizeWith() on a type munger of this kind: " + this.getClass()); |
450 |
} |
461 |
} |
451 |
|
462 |
|
|
|
463 |
public void setAvoider(MatchHolder holder) { |
464 |
this.avoider = holder; |
465 |
} |
466 |
|
452 |
} |
467 |
} |