Skip to content

Commit

Permalink
- fixes void return in request executors
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Nov 13, 2023
1 parent 4a94cce commit ba7bb13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ private void WriteRequestExecutorBody(CodeMethod codeElement, RequestParams requ
}
}
var factoryParameter = codeElement.ReturnType is CodeType returnCodeType && returnCodeType.TypeDefinition is CodeClass ? $"{returnType}::{FactoryMethodName}" : $"{returnType}.class";
writer.WriteLine($"return this.requestAdapter.{sendMethodName}({RequestInfoVarName}, {factoryParameter}, {errorMappingVarName});");
var returnPrefix = codeElement.ReturnType.Name.Equals("void", StringComparison.OrdinalIgnoreCase) ? string.Empty : "return ";
writer.WriteLine($"{returnPrefix}this.requestAdapter.{sendMethodName}({RequestInfoVarName}, {factoryParameter}, {errorMappingVarName});");
}
private string GetSendRequestMethodName(bool isCollection, string returnType, bool isEnum)
{
Expand Down

0 comments on commit ba7bb13

Please sign in to comment.