Skip to content

Commit

Permalink
Fix: take in account wildcard imports when searching for aspects impo…
Browse files Browse the repository at this point in the history
…rted locally
  • Loading branch information
fcoulon committed Oct 7, 2015
1 parent 9f7def3 commit 5b114f9
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,30 @@ class LanguageExtensions
*/
def List<Aspect> getLocalSemantics(Language l){
val res = newArrayList

l.operators.filter(Weave).forEach[op |
val withAsp = l.semantics.findFirst[asp | asp.aspectTypeRef.simpleName == op.aspectTypeRef.simpleName]
if(withAsp !== null){

//Simple imports
l.operators.filter(Weave).filter[aspectWildcardImport === null].forEach [ op |
val withAsp = l.semantics.findFirst [ asp |
asp.aspectTypeRef.simpleName == op.aspectTypeRef.simpleName
]
if (withAsp !== null) {
res += withAsp
}
]


//Wildcard imports
l.operators.filter(Weave).filter[aspectWildcardImport !== null].forEach [ op |
val wildcardImportNS = op.aspectWildcardImport.substring(0,
op.aspectWildcardImport.length - 2)
val withAsps = l.semantics.filter [ asp |
asp.aspectTypeRef.simpleName.startsWith(wildcardImportNS)
]
res += withAsps
]

return res
}


// def List<Aspect> allSemantics(Language l) {
// val tmp = newArrayList
Expand Down

0 comments on commit 5b114f9

Please sign in to comment.