@@ -1504,7 +1504,7 @@ public List<TypeParameter> getTypeParameters() {
1504
1504
return typeParameters == null ? null : typeParameters .getElements ();
1505
1505
}
1506
1506
1507
- J .VariableDeclarations variableDeclarations ;
1507
+ JRightPadded < J .VariableDeclarations > paddedVariableDeclarations ;
1508
1508
1509
1509
@ Nullable
1510
1510
TypeConstraints typeConstraints ;
@@ -1523,7 +1523,8 @@ public Property(UUID id,
1523
1523
Space prefix ,
1524
1524
Markers markers ,
1525
1525
JContainer <TypeParameter > typeParameters ,
1526
- VariableDeclarations variableDeclarations ,
1526
+ @ Nullable JRightPadded <J .VariableDeclarations > paddedVariableDeclarations ,
1527
+ @ Nullable VariableDeclarations variableDeclarations ,
1527
1528
@ Nullable K .TypeConstraints typeConstraints ,
1528
1529
@ Nullable @ JsonProperty ("getter" ) J .MethodDeclaration getter ,
1529
1530
@ Nullable @ JsonProperty ("setter" ) J .MethodDeclaration setter ,
@@ -1535,7 +1536,14 @@ public Property(UUID id,
1535
1536
this .prefix = prefix ;
1536
1537
this .markers = markers ;
1537
1538
this .typeParameters = typeParameters ;
1538
- this .variableDeclarations = variableDeclarations ;
1539
+
1540
+ if (variableDeclarations != null ) {
1541
+ // from old LST
1542
+ this .paddedVariableDeclarations = new JRightPadded <>(variableDeclarations , Space .EMPTY , Markers .EMPTY );
1543
+ } else {
1544
+ this .paddedVariableDeclarations = requireNonNull (paddedVariableDeclarations );
1545
+ }
1546
+
1539
1547
this .typeConstraints = typeConstraints ;
1540
1548
1541
1549
if (getter != null || setter != null || isSetterFirst != null ) {
@@ -1561,6 +1569,10 @@ public Property(UUID id,
1561
1569
this .receiver = receiver ;
1562
1570
}
1563
1571
1572
+ public J .VariableDeclarations getVariableDeclarations () {
1573
+ return paddedVariableDeclarations .getElement ();
1574
+ }
1575
+
1564
1576
@ Nullable
1565
1577
public Expression getReceiver () {
1566
1578
return receiver == null ? null : receiver .getElement ();
@@ -1602,14 +1614,23 @@ public String toString() {
1602
1614
public static class Padding {
1603
1615
private final Property t ;
1604
1616
1617
+ public JRightPadded <J .VariableDeclarations > getVariableDeclarations () {
1618
+ return t .paddedVariableDeclarations ;
1619
+ }
1620
+
1621
+ public Property withVariableDeclarations (JRightPadded <J .VariableDeclarations > variableDeclarations ) {
1622
+ return t .paddedVariableDeclarations == variableDeclarations ? t : new Property (t .id , t .prefix , t .markers , t .typeParameters ,
1623
+ variableDeclarations , t .typeConstraints , t .accessors , t .receiver );
1624
+ }
1625
+
1605
1626
@ Nullable
1606
1627
public JContainer <TypeParameter > getTypeParameters () {
1607
1628
return t .typeParameters ;
1608
1629
}
1609
1630
1610
1631
public Property withTypeParameters (@ Nullable JContainer <TypeParameter > typeParameters ) {
1611
1632
return t .typeParameters == typeParameters ? t : new Property (t .id , t .prefix , t .markers , typeParameters ,
1612
- t .variableDeclarations , t .typeConstraints , t .accessors , t .receiver );
1633
+ t .paddedVariableDeclarations , t .typeConstraints , t .accessors , t .receiver );
1613
1634
}
1614
1635
1615
1636
@ Nullable
@@ -1620,7 +1641,7 @@ public JRightPadded<Expression> getReceiver() {
1620
1641
@ Nullable
1621
1642
public Property withReceiver (@ Nullable JRightPadded <Expression > receiver ) {
1622
1643
return t .receiver == receiver ? t : new Property (t .id , t .prefix , t .markers , t .typeParameters ,
1623
- t .variableDeclarations , t .typeConstraints , t .accessors , receiver );
1644
+ t .paddedVariableDeclarations , t .typeConstraints , t .accessors , receiver );
1624
1645
}
1625
1646
}
1626
1647
}
0 commit comments