Skip to content

Commit

Permalink
Fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaTP committed Sep 12, 2023
1 parent 8bb1ae6 commit 49033d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public override void WriteCodeElement(CodeMethod codeElement, LanguageWriter wri
ArgumentNullException.ThrowIfNull(writer);
if (codeElement.Parent is not CodeClass parentClass) throw new InvalidOperationException("the parent of a method should be a class");

var returnType = conventions.GetTypeString(codeElement.ReturnType, codeElement);
if (codeElement.ReturnType is CodeType { TypeDefinition: CodeEnum { Flags: true }, IsCollection: false })
returnType = $"EnumSet<{returnType}>";
var baseReturnType = conventions.GetTypeString(codeElement.ReturnType, codeElement);
var finalReturnType = GetFinalReturnType(codeElement, baseReturnType);
WriteMethodDocumentation(codeElement, writer, baseReturnType, finalReturnType);
Expand Down Expand Up @@ -681,6 +678,8 @@ private void WriteSerializationMethodCall(CodeProperty otherProp, CodeMethod met
private string GetFinalReturnType(CodeMethod code, string returnType)
{
var voidType = code.IsAsync ? "Void" : "void";
if (code.ReturnType is CodeType { TypeDefinition: CodeEnum { Flags: true }, IsCollection: false })
returnType = $"EnumSet<{returnType}>";
var returnTypeAsyncPrefix = code.IsAsync ? "java.util.concurrent.CompletableFuture<" : string.Empty;
var returnTypeAsyncSuffix = code.IsAsync ? ">" : string.Empty;
var reType = returnType.Equals("void", StringComparison.OrdinalIgnoreCase) ? voidType : returnType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ public void WritesMessageOverrideOnPrimary()
Kind = CodeMethodKind.ErrorMessageOverride,
ReturnType = new CodeType
{
Name = "string",
Name = "String",
IsNullable = false,
},
IsAsync = false,
Expand Down

0 comments on commit 49033d3

Please sign in to comment.