Fix bugs (string comparison) in csharp generators (#15663)

* fix bugs in csharp generators

* undo change
This commit is contained in:
William Cheng 2023-05-29 15:17:54 +08:00 committed by GitHub
parent 784c700d37
commit 431cc2ec8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 46 deletions

View File

@ -1399,35 +1399,35 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
properties.put(frameworkStrategy.name, strategies.stream().anyMatch(s -> s.name.equals(frameworkStrategy.name))); properties.put(frameworkStrategy.name, strategies.stream().anyMatch(s -> s.name.equals(frameworkStrategy.name)));
} }
if (strategies.stream().anyMatch(p -> Boolean.FALSE.equals(p.name == "netstandard1.3"))) { if (strategies.stream().anyMatch(p -> !"netstandard1.3".equals(p.name))) {
if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "netstandard1.4"))) { if (strategies.stream().anyMatch(p -> "netstandard1.4".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "netstandard1.5"))) { } else if (strategies.stream().anyMatch(p -> "netstandard1.5".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "netstandard1.6"))) { } else if (strategies.stream().anyMatch(p -> "netstandard1.6".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "netstandard2.0"))) { } else if (strategies.stream().anyMatch(p -> "netstandard2.0".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);
properties.put(NET_STANDARD_20_OR_LATER, true); properties.put(NET_STANDARD_20_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "netstandard2.1"))) { } else if (strategies.stream().anyMatch(p -> "netstandard2.1".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);
properties.put(NET_STANDARD_20_OR_LATER, true); properties.put(NET_STANDARD_20_OR_LATER, true);
properties.put(NET_STANDARD_21_OR_LATER, true); properties.put(NET_STANDARD_21_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "net47"))) { } else if (strategies.stream().anyMatch(p -> "net47".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);
properties.put(NET_STANDARD_20_OR_LATER, true); properties.put(NET_STANDARD_20_OR_LATER, true);
properties.put(NET_STANDARD_21_OR_LATER, true); properties.put(NET_STANDARD_21_OR_LATER, true);
properties.put(NET_47_OR_LATER, true); properties.put(NET_47_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "net48"))) { } else if (strategies.stream().anyMatch(p -> "net48".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);
@ -1435,7 +1435,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
properties.put(NET_STANDARD_21_OR_LATER, true); properties.put(NET_STANDARD_21_OR_LATER, true);
properties.put(NET_47_OR_LATER, true); properties.put(NET_47_OR_LATER, true);
properties.put(NET_48_OR_LATER, true); properties.put(NET_48_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "net6.0"))) { } else if (strategies.stream().anyMatch(p -> "net6.0".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);
@ -1444,7 +1444,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
properties.put(NET_47_OR_LATER, true); properties.put(NET_47_OR_LATER, true);
properties.put(NET_48_OR_LATER, true); properties.put(NET_48_OR_LATER, true);
properties.put(NET_60_OR_LATER, true); properties.put(NET_60_OR_LATER, true);
} else if (strategies.stream().anyMatch(p -> Boolean.TRUE.equals(p.name == "net7.0"))){ } else if (strategies.stream().anyMatch(p -> "net7.0".equals(p.name))) {
properties.put(NET_STANDARD_14_OR_LATER, true); properties.put(NET_STANDARD_14_OR_LATER, true);
properties.put(NET_STANDARD_15_OR_LATER, true); properties.put(NET_STANDARD_15_OR_LATER, true);
properties.put(NET_STANDARD_16_OR_LATER, true); properties.put(NET_STANDARD_16_OR_LATER, true);