1488 TargetType type = TargetType.fromTargetTypeValue(tag); |
1488 TargetType type = TargetType.fromTargetTypeValue(tag); |
1489 |
1489 |
1490 position.type = type; |
1490 position.type = type; |
1491 |
1491 |
1492 switch (type) { |
1492 switch (type) { |
1493 // type cast |
|
1494 case CAST: |
|
1495 // instanceof |
1493 // instanceof |
1496 case INSTANCEOF: |
1494 case INSTANCEOF: |
1497 // new expression |
1495 // new expression |
1498 case NEW: |
1496 case NEW: |
|
1497 // constructor/method reference receiver |
|
1498 case CONSTRUCTOR_REFERENCE: |
|
1499 case METHOD_REFERENCE: |
1499 position.offset = nextChar(); |
1500 position.offset = nextChar(); |
1500 break; |
1501 break; |
1501 // local variable |
1502 // local variable |
1502 case LOCAL_VARIABLE: |
1503 case LOCAL_VARIABLE: |
1503 // resource variable |
1504 // resource variable |
1542 break; |
1543 break; |
1543 // method parameter |
1544 // method parameter |
1544 case METHOD_FORMAL_PARAMETER: |
1545 case METHOD_FORMAL_PARAMETER: |
1545 position.parameter_index = nextByte(); |
1546 position.parameter_index = nextByte(); |
1546 break; |
1547 break; |
|
1548 // type cast |
|
1549 case CAST: |
1547 // method/constructor/reference type argument |
1550 // method/constructor/reference type argument |
1548 case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT: |
1551 case CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT: |
1549 case METHOD_INVOCATION_TYPE_ARGUMENT: |
1552 case METHOD_INVOCATION_TYPE_ARGUMENT: |
|
1553 case CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT: |
1550 case METHOD_REFERENCE_TYPE_ARGUMENT: |
1554 case METHOD_REFERENCE_TYPE_ARGUMENT: |
1551 position.offset = nextChar(); |
1555 position.offset = nextChar(); |
1552 position.type_index = nextByte(); |
1556 position.type_index = nextByte(); |
1553 break; |
1557 break; |
1554 // We don't need to worry about these |
1558 // We don't need to worry about these |
1555 case METHOD_RETURN: |
1559 case METHOD_RETURN: |
1556 case FIELD: |
1560 case FIELD: |
1557 break; |
|
1558 // lambda formal parameter |
|
1559 case LAMBDA_FORMAL_PARAMETER: |
|
1560 position.parameter_index = nextByte(); |
|
1561 break; |
1561 break; |
1562 case UNKNOWN: |
1562 case UNKNOWN: |
1563 throw new AssertionError("jvm.ClassReader: UNKNOWN target type should never occur!"); |
1563 throw new AssertionError("jvm.ClassReader: UNKNOWN target type should never occur!"); |
1564 default: |
1564 default: |
1565 throw new AssertionError("jvm.ClassReader: Unknown target type for position: " + position); |
1565 throw new AssertionError("jvm.ClassReader: Unknown target type for position: " + position); |