Skip to content

Commit 2c59358

Browse files
author
Brian Melton
committed
Small cleanup - still suffering x-template duplication
1 parent e9a43c6 commit 2c59358

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

Templates/Android/generated/BaseEntityCollectionRequestBuilder.java.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
return new <#=TypeRequestBuilder(c)#>(getRequestUrlWithAdditionalSegment(id), getClient(), getOptions());
3232
}
3333
<#
34-
var aa = c.AsOdcmProperty().Projection.Type.AsOdcmClass();
35-
if (aa != null) {
36-
foreach (var method in aa.MethodsAndOverloads()) {
34+
var currentTypeProjection = c.AsOdcmProperty().Projection.Type.AsOdcmClass();
35+
if (currentTypeProjection != null) {
36+
foreach (var method in currentTypeProjection.MethodsAndOverloads()) {
3737

3838
if (!method.IsBoundToCollection) {
3939
continue;

Templates/Android/generated/BaseEntityRequestBuilder.java.tt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,13 @@ if (c.AsOdcmClass() != null)
107107
}
108108

109109
var parameterList = MethodParametersSignature(method);
110-
if (parameterList != "") { parameterList = parameterList.Remove(0, 2); }
110+
111+
if (parameterList != "") {
112+
parameterList = parameterList.Remove(0, 2);
113+
}
114+
115+
if (method.IsCollection) {
111116
#>
112-
<# if (method.IsCollection) { #>
113117

114118
public <#=ITypeCollectionRequestBuilder(method)#> get<#=MethodName(method)#>(<#=parameterList#>) {
115119
return new <#=TypeCollectionRequestBuilder(method)#>(getRequestUrlWithAdditionalSegment("<#=MethodFullName(method)#>"), getClient(), null<#=MethodParametersValues(method)#>);

Templates/Android/generated/IBaseEntityCollectionRequestBuilder.java.tt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@
1818
<#=ITypeRequestBuilder(c)#> byId(final String id);
1919

2020
<#
21-
var aa = c.AsOdcmProperty().Projection.Type.AsOdcmClass();
22-
if (aa != null)
21+
var currentTypeProjection = c.AsOdcmProperty().Projection.Type.AsOdcmClass();
22+
if (currentTypeProjection != null)
2323
{
24-
foreach (var method in aa.AsOdcmClass().MethodsAndOverloads()) {
24+
foreach (var method in currentTypeProjection.AsOdcmClass().MethodsAndOverloads()) {
2525

2626
if (!method.IsBoundToCollection) {
2727
continue;
2828
}
2929

3030
var parameterList = MethodParametersSignature(method);
31-
if (parameterList != "") { parameterList = parameterList.Remove(0, 2); }
31+
if (parameterList != "") {
32+
parameterList = parameterList.Remove(0, 2);
33+
}
34+
35+
if (method.IsCollection) {
3236
#>
33-
<# if (method.IsCollection) { #>
3437

3538
<#=ITypeCollectionRequestBuilder(method)#> get<#=MethodName(method)#>(<#=parameterList#>);
3639
<# } else { #>

Templates/Android/generated/IBaseEntityRequestBuilder.java.tt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ if (c.AsOdcmClass() != null)
7979
}
8080

8181
var parameterList = MethodParametersSignature(method);
82-
if (parameterList != "") { parameterList = parameterList.Remove(0, 2); }
82+
83+
if (parameterList != "") {
84+
parameterList = parameterList.Remove(0, 2);
85+
}
86+
87+
if (method.IsCollection) {
8388
#>
84-
<# if (method.IsCollection) { #>
8589

8690
<#=ITypeCollectionRequestBuilder(method)#> get<#=MethodName(method)#>(<#=parameterList#>);
8791
<# } else { #>

0 commit comments

Comments
 (0)