Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary warnings in administration client #37915

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugs Fixed

- Removes extraneous log messages when deserializing topics or subscriptions. ([32325](https://github.com/Azure/azure-sdk-for-java/issues/32325))

### Other Changes

## 7.15.0-beta.5 (2023-11-22)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,8 @@ private <T> T deserialize(Object object, Class<T> clazz) {
Response<QueueProperties> deserializeQueue(Response<Object> response) {
final QueueDescriptionEntryImpl entry = deserialize(response.getValue(), QueueDescriptionEntryImpl.class);

// This was an empty response (ie. 204).
if (entry == null) {
return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null);
} else if (entry.getContent() == null) {
logger.info("entry.getContent() is null. The entity may not exist. {}", entry);
// This was an empty response (ie. 204) or the entity does not exist.
if (entry == null || entry.getContent() == null) {
return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null);
} else if (entry.getContent().getQueueDescription() == null) {
final TopicDescriptionEntryImpl entryTopic = deserialize(response.getValue(), TopicDescriptionEntryImpl.class);
Expand All @@ -455,11 +452,8 @@ Response<QueueProperties> deserializeQueue(Response<Object> response) {
Response<TopicProperties> deserializeTopic(Response<Object> response) {
final TopicDescriptionEntryImpl entry = deserialize(response.getValue(), TopicDescriptionEntryImpl.class);

// This was an empty response (ie. 204).
if (entry == null) {
return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null);
} else if (entry.getContent() == null) {
logger.warning("entry.getContent() is null. There should have been content returned. Entry: {}", entry);
// This was an empty response (i.e. 204) or the entity does not exist.
if (entry == null || entry.getContent() == null) {
return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null);
} else if (entry.getContent().getTopicDescription() == null) {
final QueueDescriptionEntryImpl entryQueue = deserialize(response.getValue(), QueueDescriptionEntryImpl.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,21 @@ public String serialize(Object object, SerializerEncoding encoding) throws IOExc

// This hack is here because value of custom property within RuleFilter should have a namespace like
// xmlns:d6p1="http://www.w3.org/2001/XMLSchema" ns0:type="d6p1:string".
// It is possible that there is no "Value" to set in the rule.
if (CreateRuleBodyImpl.class.equals(clazz)) {
final Matcher filterValue = FILTER_VALUE_PATTERN.matcher(replaced);
if (filterValue.find()) {
replaced = filterValue.replaceAll(RULE_VALUE_ATTRIBUTE_XML);
} else {
LOGGER.warning("Could not find filter name pattern '{}' in {}.", FILTER_VALUE_PATTERN.pattern(),
contents);
}
}

// This hack is here because RuleFilter and RuleAction type="Foo" should have a namespace like n0:type="Foo".
// It is possible that there is no RuleFilter or RuleAction type. (i.e. creating a subscription with its
// default rule.)
final Matcher filterType = FILTER_ACTION_PATTERN.matcher(replaced);
if (filterType.find()) {
return filterType.replaceAll("<$1 xmlns:ns0=\"http://www.w3.org/2001/XMLSchema-instance\" ns0:type=");
} else {
LOGGER.warning("Could not find filter name pattern '{}' in {}.", FILTER_ACTION_PATTERN.pattern(),
contents);
return replaced;
}
}
Expand Down