Fix toBuilder to carry forward the sourceLocation
Most existing toBuilders do this, but these ones were missing that logic.
This commit is contained in:
parent
9b4de14a5c
commit
32fbace531
|
@ -101,7 +101,7 @@ public final class AuthorizersTrait extends AbstractTrait implements ToSmithyBui
|
|||
|
||||
@Override
|
||||
public Builder toBuilder() {
|
||||
return builder().authorizers(authorizers);
|
||||
return builder().sourceLocation(getSourceLocation()).authorizers(authorizers);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -342,6 +342,7 @@ public final class IntegrationTrait extends AbstractTrait implements ToSmithyBui
|
|||
@Override
|
||||
public Builder toBuilder() {
|
||||
return builder()
|
||||
.sourceLocation(getSourceLocation())
|
||||
.type(type)
|
||||
.uri(uri)
|
||||
.credentials(credentials)
|
||||
|
|
|
@ -163,6 +163,7 @@ public final class MockIntegrationTrait extends AbstractTrait implements ToSmith
|
|||
@Override
|
||||
public Builder toBuilder() {
|
||||
return builder()
|
||||
.sourceLocation(getSourceLocation())
|
||||
.passThroughBehavior(passThroughBehavior)
|
||||
.contentHandling(contentHandling)
|
||||
.requestParameters(requestParameters)
|
||||
|
|
|
@ -76,7 +76,7 @@ public final class CfnResourceTrait extends AbstractTrait
|
|||
|
||||
@Override
|
||||
public SmithyBuilder<CfnResourceTrait> toBuilder() {
|
||||
return builder().name(name).additionalSchemas(additionalSchemas);
|
||||
return builder().sourceLocation(getSourceLocation()).name(name).additionalSchemas(additionalSchemas);
|
||||
}
|
||||
|
||||
public static final class Provider extends AbstractTrait.Provider {
|
||||
|
|
|
@ -76,7 +76,7 @@ public final class CognitoUserPoolsTrait extends AbstractTrait implements ToSmit
|
|||
|
||||
@Override
|
||||
public Builder toBuilder() {
|
||||
return builder().providerArns(providerArns);
|
||||
return builder().sourceLocation(getSourceLocation()).providerArns(providerArns);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -61,7 +61,7 @@ public final class ClientDiscoveredEndpointTrait extends AbstractTrait
|
|||
|
||||
@Override
|
||||
public SmithyBuilder<ClientDiscoveredEndpointTrait> toBuilder() {
|
||||
return builder().required(required);
|
||||
return builder().sourceLocation(getSourceLocation()).required(required);
|
||||
}
|
||||
|
||||
/** Builder for {@link ClientDiscoveredEndpointTrait}. */
|
||||
|
|
|
@ -91,7 +91,8 @@ public final class ClientEndpointDiscoveryTrait extends AbstractTrait
|
|||
@Override
|
||||
public Builder toBuilder() {
|
||||
return new Builder()
|
||||
.operation(getOperation())
|
||||
.sourceLocation(getSourceLocation())
|
||||
.operation(operation)
|
||||
.error(error);
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ public final class EndpointTrait extends AbstractTrait implements ToSmithyBuilde
|
|||
|
||||
@Override
|
||||
public Builder toBuilder() {
|
||||
return new Builder().hostPrefix(hostPrefix.toString());
|
||||
return new Builder().sourceLocation(getSourceLocation()).hostPrefix(hostPrefix.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -89,7 +89,7 @@ public final class HttpTrait extends AbstractTrait implements ToSmithyBuilder<Ht
|
|||
|
||||
@Override
|
||||
public HttpTrait.Builder toBuilder() {
|
||||
return new Builder().method(method).uri(uri).code(code);
|
||||
return new Builder().sourceLocation(getSourceLocation()).method(method).uri(uri).code(code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,7 +72,10 @@ public final class TraitDefinition extends AbstractTrait implements ToSmithyBuil
|
|||
|
||||
@Override
|
||||
public Builder toBuilder() {
|
||||
Builder builder = builder().selector(selector).structurallyExclusive(structurallyExclusive);
|
||||
Builder builder = builder()
|
||||
.sourceLocation(getSourceLocation())
|
||||
.selector(selector)
|
||||
.structurallyExclusive(structurallyExclusive);
|
||||
conflicts.forEach(builder::addConflict);
|
||||
return builder;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue