File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/main/java/gr/uom/java/xmi/decomposition Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .util .List ;
4
4
5
+ import gr .uom .java .xmi .VariableDeclarationContainer ;
6
+
5
7
public abstract class AbstractStatement extends AbstractCodeFragment {
6
8
private CompositeStatementObject parent ;
7
9
protected String actualSignature ;
@@ -30,6 +32,18 @@ public VariableDeclaration searchVariableDeclaration(String variableName) {
30
32
else if (parent != null ) {
31
33
return parent .searchVariableDeclaration (variableName );
32
34
}
35
+ else if (this instanceof CompositeStatementObject ) {
36
+ CompositeStatementObject comp = (CompositeStatementObject )this ;
37
+ if (comp .getOwner ().isPresent ()) {
38
+ VariableDeclarationContainer container = comp .getOwner ().get ();
39
+ if (container instanceof LambdaExpressionObject ) {
40
+ VariableDeclaration declaration = container .getVariableDeclaration (variableName );
41
+ if (declaration != null ) {
42
+ return declaration ;
43
+ }
44
+ }
45
+ }
46
+ }
33
47
return null ;
34
48
}
35
49
You can’t perform that action at this time.
0 commit comments