Skip to content

Commit

Permalink
graalvm, error model alone need reflect (#2811)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft authored Jun 13, 2024
1 parent 3b62cd6 commit d7b5ef3
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,21 @@ public GraalVmConfig map(ServiceAndModel data) {
List<String> proxies;
List<String> reflects;

final boolean streamStyle = JavaSettings.getInstance().isStreamStyleSerialization();

// Reflect
// Exception and error model is still created by reflection in azure-core
reflects = data.exceptions.stream()
.map(e -> e.getPackage() + "." + e.getName())
.collect(Collectors.toList());
if (!JavaSettings.getInstance().isStreamStyleSerialization()) {
reflects.addAll(data.models.stream()
.map(e -> e.getPackage() + "." + e.getName())
.collect(Collectors.toList()));
reflects.addAll(data.enums.stream()
.map(m -> m.getPackage() + "." + m.getName())
.collect(Collectors.toList()));
}
reflects.addAll(data.models.stream()
.filter(m -> !streamStyle || (m.getImplementationDetails() != null && m.getImplementationDetails().isException()))
.map(m -> m.getPackage() + "." + m.getName())
.collect(Collectors.toList()));
reflects.addAll(data.enums.stream()
.filter(m -> !streamStyle || (m.getImplementationDetails() != null && m.getImplementationDetails().isException()))
.map(m -> m.getPackage() + "." + m.getName())
.collect(Collectors.toList()));

// Proxy
proxies = data.serviceClients.stream()
Expand Down

0 comments on commit d7b5ef3

Please sign in to comment.