diff --git a/sdk/storage/azure-storage-blob-changefeed/pom.xml b/sdk/storage/azure-storage-blob-changefeed/pom.xml
index 416f6eb58f272..294dd75438c89 100644
--- a/sdk/storage/azure-storage-blob-changefeed/pom.xml
+++ b/sdk/storage/azure-storage-blob-changefeed/pom.xml
@@ -62,7 +62,7 @@
com.azureazure-json
- 1.1.0
+ 1.2.0com.azure
diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml
index 0380bcb1b12bb..0ba5b2899468c 100644
--- a/sdk/storage/azure-storage-blob-cryptography/pom.xml
+++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml
@@ -56,7 +56,7 @@
com.azureazure-json
- 1.1.0
+ 1.2.0com.azure
diff --git a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java
index d6e1c82244e32..ef7b7c16ee1de 100644
--- a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java
+++ b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/StorageCommonTestUtils.java
@@ -72,7 +72,7 @@ public final class StorageCommonTestUtils {
@SuppressWarnings("deprecation")
private static HttpClient createJdkHttpClient() throws ReflectiveOperationException {
Class> clazz = Class.forName("com.azure.core.http.jdk.httpclient.JdkHttpClientProvider");
- return (HttpClient) clazz.getDeclaredMethod("createInstance").invoke(clazz.newInstance());
+ return (HttpClient) clazz.getDeclaredMethod("createInstance").invoke(clazz.newInstance());
}
/**
@@ -198,8 +198,8 @@ public static boolean compareFiles(File file1, File file2, long offset, long cou
* @return The instrumented builder.
*/
@SuppressWarnings("unchecked")
- public static , E extends Enum> T instrument(T builder,
- HttpLogOptions logOptions, InterceptorManager interceptorManager) {
+ public static , E extends Enum> T instrument(T builder, HttpLogOptions logOptions,
+ InterceptorManager interceptorManager) {
// Groovy style reflection. All our builders follow this pattern.
builder.httpClient(getHttpClient(interceptorManager));
@@ -210,12 +210,11 @@ public static , E extends Enum> T instrument(T builder
if (ENVIRONMENT.getServiceVersion() != null) {
try {
Method serviceVersionMethod = Arrays.stream(builder.getClass().getDeclaredMethods())
- .filter(method -> "serviceVersion".equals(method.getName())
- && method.getParameterCount() == 1
+ .filter(method -> "serviceVersion".equals(method.getName()) && method.getParameterCount() == 1
&& ServiceVersion.class.isAssignableFrom(method.getParameterTypes()[0]))
.findFirst()
- .orElseThrow(() -> new RuntimeException("Unable to find serviceVersion method for builder: "
- + builder.getClass()));
+ .orElseThrow(() -> new RuntimeException(
+ "Unable to find serviceVersion method for builder: " + builder.getClass()));
Class serviceVersionClass = (Class) serviceVersionMethod.getParameterTypes()[0];
ServiceVersion serviceVersion = (ServiceVersion) Enum.valueOf(serviceVersionClass,
ENVIRONMENT.getServiceVersion());
@@ -315,8 +314,8 @@ public static TokenCredential getTokenCredential(InterceptorManager interceptorM
} else { //live
Configuration config = Configuration.getGlobalConfiguration();
- ChainedTokenCredentialBuilder builder = new ChainedTokenCredentialBuilder()
- .addLast(new EnvironmentCredentialBuilder().build())
+ ChainedTokenCredentialBuilder builder = new ChainedTokenCredentialBuilder().addLast(
+ new EnvironmentCredentialBuilder().build())
.addLast(new AzureCliCredentialBuilder().build())
.addLast(new AzureDeveloperCliCredentialBuilder().build());
@@ -325,19 +324,18 @@ public static TokenCredential getTokenCredential(InterceptorManager interceptorM
String tenantId = config.get("AZURESUBSCRIPTION_TENANT_ID");
String systemAccessToken = config.get("SYSTEM_ACCESSTOKEN");
- if (!CoreUtils.isNullOrEmpty(serviceConnectionId)
- && !CoreUtils.isNullOrEmpty(clientId)
- && !CoreUtils.isNullOrEmpty(tenantId)
- && !CoreUtils.isNullOrEmpty(systemAccessToken)) {
+ if (!CoreUtils.isNullOrEmpty(serviceConnectionId) && !CoreUtils.isNullOrEmpty(clientId)
+ && !CoreUtils.isNullOrEmpty(tenantId) && !CoreUtils.isNullOrEmpty(systemAccessToken)) {
- AzurePipelinesCredential pipelinesCredential = new AzurePipelinesCredentialBuilder()
- .systemAccessToken(systemAccessToken)
+ AzurePipelinesCredential pipelinesCredential = new AzurePipelinesCredentialBuilder().systemAccessToken(
+ systemAccessToken)
.clientId(clientId)
.tenantId(tenantId)
.serviceConnectionId(serviceConnectionId)
.build();
- builder.addLast(request -> pipelinesCredential.getToken(request).subscribeOn(Schedulers.boundedElastic()));
+ builder.addLast(
+ request -> pipelinesCredential.getToken(request).subscribeOn(Schedulers.boundedElastic()));
}
builder.addLast(new AzurePowerShellCredentialBuilder().build());
diff --git a/sdk/storage/azure-storage-internal-avro/checkstyle-suppressions.xml b/sdk/storage/azure-storage-internal-avro/checkstyle-suppressions.xml
index 4c376ddf2ce15..322f1bdcfae2f 100644
--- a/sdk/storage/azure-storage-internal-avro/checkstyle-suppressions.xml
+++ b/sdk/storage/azure-storage-internal-avro/checkstyle-suppressions.xml
@@ -3,19 +3,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sdk/storage/azure-storage-internal-avro/pom.xml b/sdk/storage/azure-storage-internal-avro/pom.xml
index 25f929e211375..a41a75c5ccc94 100644
--- a/sdk/storage/azure-storage-internal-avro/pom.xml
+++ b/sdk/storage/azure-storage-internal-avro/pom.xml
@@ -61,12 +61,6 @@
12.26.0
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-xml
- 2.13.5
-
-
org.junit.jupiterjunit-jupiter-api
@@ -179,21 +173,6 @@
-
-
- org.apache.maven.plugins
- maven-enforcer-plugin
- 3.4.1
-
-
-
-
- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:[2.13.5]
-
-
-
-
-
diff --git a/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroParser.java b/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroParser.java
index 79d9e0530df09..0783a5c05500f 100644
--- a/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroParser.java
+++ b/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroParser.java
@@ -20,12 +20,12 @@
/**
* A class that represents a push based AvroParser that can parse avro data from a reactive stream.
- *
+ *
* The parser stores the {@link AvroParserState current state}, the sync marker (parsed from the header),
* the file type (parsed from the header metadata), and the list of records collected so far.
- *
+ *
* The {@link AvroParser#parse(ByteBuffer)} method accepts ByteBuffers as they are emitted from the stream.
- *
+ *
* Header Block Block Block ....
*/
public class AvroParser {
@@ -47,7 +47,7 @@ public class AvroParser {
/* Holds objects collected so far. */
private List objects;
- private boolean partialRead; /* Whether the Avro Parser will read the Header and Block off different
+ private final boolean partialRead; /* Whether the Avro Parser will read the Header and Block off different
streams. This is custom functionality for Changefeed. */
/**
@@ -59,21 +59,18 @@ public class AvroParser {
this.partialRead = partialRead;
/* Start off by adding the header schema to the stack so we can parse it. */
- AvroHeaderSchema headerSchema = new AvroHeaderSchema(
- this.state,
- this::onFilteredHeader
- );
+ AvroHeaderSchema headerSchema = new AvroHeaderSchema(this.state, this::onFilteredHeader);
headerSchema.pushToStack();
}
Mono prepareParserToReadBody(long sourceOffset, long thresholdIndex) {
if (!this.partialRead) {
- return Mono.error(new IllegalStateException("This method should only be called when parsing header "
- + "and body separately."));
+ return Mono.error(new IllegalStateException(
+ "This method should only be called when parsing header and body separately."));
}
if (this.objectType == null || this.syncMarker == null) {
- return Mono.error(new IllegalStateException("Expected to read entire header before preparing "
- + "parser to read body."));
+ return Mono.error(
+ new IllegalStateException("Expected to read entire header before preparing parser to read body."));
}
this.state = new AvroParserState(sourceOffset);
this.objects = new ArrayList<>();
@@ -111,23 +108,17 @@ private void onFilteredHeader(Object header) {
* Block handler.
*
* @param beginObjectIndex The object index after which to start aggregating events in the block.
- * By default, this is 0 to collect all objects in the block.
+ * By default, this is 0 to collect all objects in the block.
*/
private void onBlock(Object beginObjectIndex) {
/* On reading the block, read another block. */
AvroSchema.checkType("beginObjectIndex", beginObjectIndex, Long.class);
- final AvroBlockSchema blockSchema = new AvroBlockSchema(
- this.objectType,
- (Long) beginObjectIndex,
- o -> {
- AvroSchema.checkType("object", o, AvroObject.class);
- this.objects.add((AvroObject) o);
- }, /* Object result handler. */
- this.syncMarker,
- this.state,
- this::onBlock
- );
+ final AvroBlockSchema blockSchema = new AvroBlockSchema(this.objectType, (Long) beginObjectIndex, o -> {
+ AvroSchema.checkType("object", o, AvroObject.class);
+ this.objects.add((AvroObject) o);
+ }, /* Object result handler. */
+ this.syncMarker, this.state, this::onBlock);
blockSchema.pushToStack();
}
@@ -158,8 +149,8 @@ public Flux parse(ByteBuffer buffer) {
return Flux.empty();
}
AvroSchema schema = this.state.peekFromStack();
- while ((schema instanceof AvroCompositeSchema)
- || ((schema instanceof AvroSimpleSchema) && ((AvroSimpleSchema) schema).canProgress())) {
+ while ((schema instanceof AvroCompositeSchema) || ((schema instanceof AvroSimpleSchema)
+ && ((AvroSimpleSchema) schema).canProgress())) {
if (schema instanceof AvroSimpleSchema) {
((AvroSimpleSchema) schema).progress();
}
diff --git a/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroReader.java b/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroReader.java
index adf93ab3bc7c4..8b1122e36671f 100644
--- a/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroReader.java
+++ b/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/AvroReader.java
@@ -9,5 +9,10 @@
* An interface that represents an AvroReader.
*/
public interface AvroReader {
+ /**
+ * Read a stream of {@link AvroObject}.
+ *
+ * @return A stream of {@link AvroObject}.
+ */
Flux read();
}
diff --git a/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/schema/AvroCompositeSchema.java b/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/schema/AvroCompositeSchema.java
index 40790a5351b9d..948f2da9ec2c7 100644
--- a/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/schema/AvroCompositeSchema.java
+++ b/sdk/storage/azure-storage-internal-avro/src/main/java/com/azure/storage/internal/avro/implementation/schema/AvroCompositeSchema.java
@@ -9,7 +9,7 @@
/**
* An abstract class that represents a composite Avro schema that can return an Object result.
- *
+ *
* Composite avro schemas depend on other avro schemas to populate the result.
*
* @see AvroSchema
@@ -18,7 +18,7 @@ public abstract class AvroCompositeSchema extends AvroSchema {
/**
* Constructs a new Schema.
*
- * @param state The state of the parser.
+ * @param state The state of the parser.
* @param onResult The result handler.
*/
public AvroCompositeSchema(AvroParserState state, Consumer