-
Type:
Sub-task
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: tools
-
generic
-
generic
The boiler-plate code, repeated at least 7 times --
- TranslationContext<?> localContext = context();
- while (localContext != null) {
- if (localContext.tree.hasTag(LAMBDA)) {
- /** do something with **/ (LambdaTranslationContext)localContext
- }
- localContext = localContext.prev;
- }
+ for (LambdaTranslationContext ctx = lambdaContext; ctx != null; ctx = ctx.enclosingLambda()) {
+ /** do something with **/ ctx
+ }
or possibly take it higher level.
- TranslationContext<?> localContext = context();
- while (localContext != null) {
- if (localContext.tree.hasTag(LAMBDA)) {
- /** do something with **/ (LambdaTranslationContext)localContext
- }
- localContext = localContext.prev;
- }
+ for (LambdaTranslationContext ctx = lambdaContext; ctx != null; ctx = ctx.enclosingLambda()) {
+ /** do something with **/ ctx
+ }
or possibly take it higher level.