Skip to content

Commit df8a2ef

Browse files
committed
Apply Spotless formatting
1 parent 97a136e commit df8a2ef

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

coral-schema/src/main/java/com/linkedin/coral/schema/avro/SchemaUtilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019-2023 LinkedIn Corporation. All rights reserved.
2+
* Copyright 2019-2025 LinkedIn Corporation. All rights reserved.
33
* Licensed under the BSD-2 Clause license.
44
* See LICENSE in the project root for license information.
55
*/

coral-schema/src/test/java/com/linkedin/coral/schema/avro/SchemaUtilitiesTests.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2019-2023 LinkedIn Corporation. All rights reserved.
2+
* Copyright 2019-2025 LinkedIn Corporation. All rights reserved.
33
* Licensed under the BSD-2 Clause license.
44
* See LICENSE in the project root for license information.
55
*/
@@ -98,12 +98,12 @@ public void testToNullableSchema() {
9898
@Test
9999
public void testSetupNameAndNamespacePreservesOriginalNamespace() {
100100
// Create first nested record with namespace "com.foo.bar"
101-
Schema nestedRecord1 = SchemaBuilder.record("FooRecord").namespace("com.foo.bar").fields().name("field1")
102-
.type().intType().noDefault().endRecord();
101+
Schema nestedRecord1 = SchemaBuilder.record("FooRecord").namespace("com.foo.bar").fields().name("field1").type()
102+
.intType().noDefault().endRecord();
103103

104104
// Create second nested record with the same name but different namespace "com.baz.qux"
105-
Schema nestedRecord2 = SchemaBuilder.record("FooRecord").namespace("com.baz.qux").fields().name("field2")
106-
.type().stringType().noDefault().endRecord();
105+
Schema nestedRecord2 = SchemaBuilder.record("FooRecord").namespace("com.baz.qux").fields().name("field2").type()
106+
.stringType().noDefault().endRecord();
107107

108108
// Create nullable unions for both nested records
109109
Schema nullableRecord1 = Schema.createUnion(Schema.create(Schema.Type.NULL), nestedRecord1);
@@ -134,9 +134,8 @@ public void testSetupNameAndNamespacePreservesOriginalNamespace() {
134134
Assert.assertEquals(resultRecord2.getName(), "FooRecord");
135135

136136
// But they should have different namespaces with numeric suffixes to avoid conflicts
137-
Assert.assertNotEquals(namespace1, namespace2,
138-
"Namespaces should be different to avoid conflicts. Got namespace1: " + namespace1 + ", namespace2: "
139-
+ namespace2);
137+
Assert.assertNotEquals(namespace1, namespace2, "Namespaces should be different to avoid conflicts. Got namespace1: "
138+
+ namespace1 + ", namespace2: " + namespace2);
140139

141140
// Verify that numeric suffixes are appended to distinguish the colliding records
142141
Assert.assertTrue(namespace1.endsWith("-0") || namespace1.endsWith("-1"),
@@ -165,8 +164,7 @@ public void testSetupNameAndNamespaceDetectsDirectRecordCollisions() {
165164
.type(nestedRecord1).noDefault().name("serviceConfig2").type(nestedRecord2).noDefault().endRecord();
166165

167166
// Apply setupNameAndNamespace
168-
Schema resultSchema =
169-
SchemaUtilities.setupNameAndNamespace(parentSchema, "ApplicationConfig", "com.app.config");
167+
Schema resultSchema = SchemaUtilities.setupNameAndNamespace(parentSchema, "ApplicationConfig", "com.app.config");
170168

171169
// Extract the nested record schemas from the result
172170
Schema.Field config1Field = resultSchema.getField("serviceConfig1");
@@ -218,13 +216,13 @@ public void testSetupNameAndNamespaceDetectsDeeplyNestedCollisions() {
218216

219217
// Create an intermediate record that contains both colliding records
220218
// This represents the middle layer in the nesting hierarchy
221-
Schema intermediateRecord = SchemaBuilder.record("IntermediateRecord").namespace("com.intermediate").fields()
222-
.name("collidingField1").type(collidingRecord1).noDefault().name("collidingField2").type(collidingRecord2)
223-
.noDefault().endRecord();
219+
Schema intermediateRecord =
220+
SchemaBuilder.record("IntermediateRecord").namespace("com.intermediate").fields().name("collidingField1")
221+
.type(collidingRecord1).noDefault().name("collidingField2").type(collidingRecord2).noDefault().endRecord();
224222

225223
// Create top-level parent schema that contains the intermediate record
226-
Schema parentSchema = SchemaBuilder.record("ParentRecord").namespace("com.parent").fields().name("intermediateField")
227-
.type(intermediateRecord).noDefault().endRecord();
224+
Schema parentSchema = SchemaBuilder.record("ParentRecord").namespace("com.parent").fields()
225+
.name("intermediateField").type(intermediateRecord).noDefault().endRecord();
228226

229227
// Apply setupNameAndNamespace
230228
Schema resultSchema = SchemaUtilities.setupNameAndNamespace(parentSchema, "ParentRecord", "com.result");

0 commit comments

Comments
 (0)