@@ -1947,7 +1947,6 @@ public Node visitCompoundAssignment(CompoundAssignmentTree tree, Void p) {
1947
1947
} else if (kind == Tree .Kind .DIVIDE_ASSIGNMENT ) {
1948
1948
if (TypesUtils .isIntegralPrimitive (exprType )) {
1949
1949
operNode = new IntegerDivisionNode (operTree , targetRHS , value );
1950
-
1951
1950
extendWithNodeWithException (operNode , arithmeticExceptionType );
1952
1951
} else {
1953
1952
operNode = new FloatingDivisionNode (operTree , targetRHS , value );
@@ -1956,7 +1955,6 @@ public Node visitCompoundAssignment(CompoundAssignmentTree tree, Void p) {
1956
1955
assert kind == Tree .Kind .REMAINDER_ASSIGNMENT ;
1957
1956
if (TypesUtils .isIntegralPrimitive (exprType )) {
1958
1957
operNode = new IntegerRemainderNode (operTree , targetRHS , value );
1959
-
1960
1958
extendWithNodeWithException (operNode , arithmeticExceptionType );
1961
1959
} else {
1962
1960
operNode = new FloatingRemainderNode (operTree , targetRHS , value );
@@ -2133,7 +2131,7 @@ public Node visitBinary(BinaryTree tree, Void p) {
2133
2131
// Note that for binary operations it is important to perform any required promotion on the
2134
2132
// left operand before generating any Nodes for the right operand, because labels must be
2135
2133
// inserted AFTER ALL preceding Nodes and BEFORE ALL following Nodes.
2136
- Node r = null ;
2134
+ Node r ;
2137
2135
Tree leftTree = tree .getLeftOperand ();
2138
2136
Tree rightTree = tree .getRightOperand ();
2139
2137
@@ -2158,7 +2156,6 @@ public Node visitBinary(BinaryTree tree, Void p) {
2158
2156
} else if (kind == Tree .Kind .DIVIDE ) {
2159
2157
if (TypesUtils .isIntegralPrimitive (exprType )) {
2160
2158
r = new IntegerDivisionNode (tree , left , right );
2161
-
2162
2159
extendWithNodeWithException (r , arithmeticExceptionType );
2163
2160
} else {
2164
2161
r = new FloatingDivisionNode (tree , left , right );
@@ -2167,7 +2164,6 @@ public Node visitBinary(BinaryTree tree, Void p) {
2167
2164
assert kind == Tree .Kind .REMAINDER ;
2168
2165
if (TypesUtils .isIntegralPrimitive (exprType )) {
2169
2166
r = new IntegerRemainderNode (tree , left , right );
2170
-
2171
2167
extendWithNodeWithException (r , arithmeticExceptionType );
2172
2168
} else {
2173
2169
r = new FloatingRemainderNode (tree , left , right );
@@ -2247,21 +2243,17 @@ public Node visitBinary(BinaryTree tree, Void p) {
2247
2243
Node left = binaryNumericPromotion (scan (leftTree , p ), promotedType );
2248
2244
Node right = binaryNumericPromotion (scan (rightTree , p ), promotedType );
2249
2245
2250
- Node node ;
2251
2246
if (kind == Tree .Kind .GREATER_THAN ) {
2252
- node = new GreaterThanNode (tree , left , right );
2247
+ r = new GreaterThanNode (tree , left , right );
2253
2248
} else if (kind == Tree .Kind .GREATER_THAN_EQUAL ) {
2254
- node = new GreaterThanOrEqualNode (tree , left , right );
2249
+ r = new GreaterThanOrEqualNode (tree , left , right );
2255
2250
} else if (kind == Tree .Kind .LESS_THAN ) {
2256
- node = new LessThanNode (tree , left , right );
2251
+ r = new LessThanNode (tree , left , right );
2257
2252
} else {
2258
2253
assert kind == Tree .Kind .LESS_THAN_EQUAL ;
2259
- node = new LessThanOrEqualNode (tree , left , right );
2254
+ r = new LessThanOrEqualNode (tree , left , right );
2260
2255
}
2261
-
2262
- extendWithNode (node );
2263
-
2264
- return node ;
2256
+ break ;
2265
2257
}
2266
2258
2267
2259
case EQUAL_TO :
@@ -2289,16 +2281,13 @@ public Node visitBinary(BinaryTree tree, Void p) {
2289
2281
right = unboxAsNeeded (right , rightInfo .isBoxed ());
2290
2282
}
2291
2283
2292
- Node node ;
2293
2284
if (kind == Tree .Kind .EQUAL_TO ) {
2294
- node = new EqualToNode (tree , left , right );
2285
+ r = new EqualToNode (tree , left , right );
2295
2286
} else {
2296
2287
assert kind == Tree .Kind .NOT_EQUAL_TO ;
2297
- node = new NotEqualNode (tree , left , right );
2288
+ r = new NotEqualNode (tree , left , right );
2298
2289
}
2299
- extendWithNode (node );
2300
-
2301
- return node ;
2290
+ break ;
2302
2291
}
2303
2292
2304
2293
case AND :
@@ -2326,19 +2315,15 @@ public Node visitBinary(BinaryTree tree, Void p) {
2326
2315
right = unbox (scan (rightTree , p ));
2327
2316
}
2328
2317
2329
- Node node ;
2330
2318
if (kind == Tree .Kind .AND ) {
2331
- node = new BitwiseAndNode (tree , left , right );
2319
+ r = new BitwiseAndNode (tree , left , right );
2332
2320
} else if (kind == Tree .Kind .OR ) {
2333
- node = new BitwiseOrNode (tree , left , right );
2321
+ r = new BitwiseOrNode (tree , left , right );
2334
2322
} else {
2335
2323
assert kind == Tree .Kind .XOR ;
2336
- node = new BitwiseXorNode (tree , left , right );
2324
+ r = new BitwiseXorNode (tree , left , right );
2337
2325
}
2338
-
2339
- extendWithNode (node );
2340
-
2341
- return node ;
2326
+ break ;
2342
2327
}
2343
2328
2344
2329
case CONDITIONAL_AND :
@@ -2369,14 +2354,12 @@ public Node visitBinary(BinaryTree tree, Void p) {
2369
2354
2370
2355
// conditional expression itself
2371
2356
addLabelForNextNode (shortCircuitLabel );
2372
- Node node ;
2373
2357
if (kind == Tree .Kind .CONDITIONAL_AND ) {
2374
- node = new ConditionalAndNode (tree , left , right );
2358
+ r = new ConditionalAndNode (tree , left , right );
2375
2359
} else {
2376
- node = new ConditionalOrNode (tree , left , right );
2360
+ r = new ConditionalOrNode (tree , left , right );
2377
2361
}
2378
- extendWithNode (node );
2379
- return node ;
2362
+ break ;
2380
2363
}
2381
2364
default :
2382
2365
throw new BugInCF ("unexpected binary tree: " + kind );
@@ -2864,16 +2847,16 @@ private IPair<IdentifierTree, LocalVariableNode> buildVarUseNode(VariableTree va
2864
2847
@ Override
2865
2848
public Node visitContinue (ContinueTree tree , Void p ) {
2866
2849
Name label = tree .getLabel ();
2850
+ UnconditionalJump uj ;
2867
2851
if (label == null ) {
2868
2852
assert continueTargetLC != null : "no target for continue statement" ;
2869
-
2870
- extendWithExtendedNode (new UnconditionalJump (continueTargetLC .accessLabel ()));
2853
+ uj = new UnconditionalJump (continueTargetLC .accessLabel ());
2871
2854
} else {
2872
2855
assert continueLabels .containsKey (label );
2873
-
2874
- extendWithExtendedNode (new UnconditionalJump (continueLabels .get (label )));
2856
+ uj = new UnconditionalJump (continueLabels .get (label ));
2875
2857
}
2876
2858
2859
+ extendWithExtendedNode (uj );
2877
2860
return null ;
2878
2861
}
2879
2862
@@ -3421,7 +3404,7 @@ public Node visitLabeledStatement(LabeledStatementTree tree, Void p) {
3421
3404
3422
3405
@ Override
3423
3406
public Node visitLiteral (LiteralTree tree , Void p ) {
3424
- Node r = null ;
3407
+ Node r ;
3425
3408
switch (tree .getKind ()) {
3426
3409
case BOOLEAN_LITERAL :
3427
3410
r = new BooleanLiteralNode (tree );
@@ -3450,7 +3433,6 @@ public Node visitLiteral(LiteralTree tree, Void p) {
3450
3433
default :
3451
3434
throw new BugInCF ("unexpected literal tree: " + tree );
3452
3435
}
3453
- assert r != null : "unexpected literal tree" ;
3454
3436
extendWithNode (r );
3455
3437
return r ;
3456
3438
}
@@ -4169,7 +4151,7 @@ public Node visitInstanceOf(InstanceOfTree tree, Void p) {
4169
4151
4170
4152
@ Override
4171
4153
public Node visitUnary (UnaryTree tree , Void p ) {
4172
- Node result = null ;
4154
+ Node result ;
4173
4155
Tree .Kind kind = tree .getKind ();
4174
4156
switch (kind ) {
4175
4157
case BITWISE_COMPLEMENT :
@@ -4196,7 +4178,7 @@ public Node visitUnary(UnaryTree tree, Void p) {
4196
4178
throw new BugInCF ("Unexpected unary tree kind: " + kind );
4197
4179
}
4198
4180
extendWithNode (result );
4199
- break ;
4181
+ return result ;
4200
4182
}
4201
4183
4202
4184
case LOGICAL_COMPLEMENT :
@@ -4205,7 +4187,7 @@ public Node visitUnary(UnaryTree tree, Void p) {
4205
4187
Node expr = scan (tree .getExpression (), p );
4206
4188
result = new ConditionalNotNode (tree , unbox (expr ));
4207
4189
extendWithNode (result );
4208
- break ;
4190
+ return result ;
4209
4191
}
4210
4192
4211
4193
case POSTFIX_DECREMENT :
@@ -4249,13 +4231,12 @@ public Node visitUnary(UnaryTree tree, Void p) {
4249
4231
result = new LocalVariableNode (resultExpr );
4250
4232
result .setInSource (false );
4251
4233
extendWithNode (result );
4234
+ createIncrementOrDecrementAssign (tree , expr , isIncrement , isPostfix );
4235
+ } else {
4236
+ result = createIncrementOrDecrementAssign (tree , expr , isIncrement , isPostfix );
4237
+ extendWithNode (result );
4252
4238
}
4253
- AssignmentNode unaryAssign =
4254
- createIncrementOrDecrementAssign (tree , expr , isIncrement , isPostfix );
4255
- if (!isPostfix ) {
4256
- result = unaryAssign ;
4257
- }
4258
- break ;
4239
+ return result ;
4259
4240
}
4260
4241
4261
4242
case OTHER :
@@ -4265,13 +4246,11 @@ public Node visitUnary(UnaryTree tree, Void p) {
4265
4246
Node expr = scan (tree .getExpression (), p );
4266
4247
result = new NullChkNode (tree , expr );
4267
4248
extendWithNode (result );
4268
- break ;
4249
+ return result ;
4269
4250
}
4270
4251
4271
4252
throw new BugInCF ("Unknown kind (" + kind + ") of unary expression: " + tree );
4272
4253
}
4273
-
4274
- return result ;
4275
4254
}
4276
4255
4277
4256
/**
0 commit comments