Skip to content

Commit d0f6f0b

Browse files
authored
Fix static checker warnings in AggregatesSpecification.groovy (#1564)
1 parent 60c2a60 commit d0f6f0b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Diff for: config/codenarc/codenarc.xml

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<rule-config name='HashtableIsObsolete'>
4242
<property name='doNotApplyToFileNames' value='MongoClientFactorySpecification.groovy'/>
4343
</rule-config>
44+
<rule-config name='VectorIsObsolete'>
45+
<property name='doNotApplyToFileNames' value='AggregatesSpecification.groovy'/>
46+
</rule-config>
4447
<exclude name="TrailingComma"/>
4548
<exclude name="CouldBeSwitchStatement"/>
4649
<exclude name="NoDef"/>

Diff for: driver-core/src/test/unit/com/mongodb/client/model/AggregatesSpecification.groovy

+5-5
Original file line numberDiff line numberDiff line change
@@ -879,9 +879,9 @@ class AggregatesSpecification extends Specification {
879879

880880
where:
881881
vector | queryVector
882-
Vector.int8Vector(new byte[]{127, 7}) | '{"$binary": {"base64": "AwB/Bw==", "subType": "09"}}'
883-
Vector.floatVector(new float[]{127.0f, 7.0f}) | '{"$binary": {"base64": "JwAAAP5CAADgQA==", "subType": "09"}}'
884-
Vector.packedBitVector(new byte[]{127, 7}, (byte) 0) | '{"$binary": {"base64": "EAB/Bw==", "subType": "09"}}'
882+
Vector.int8Vector([127, 7] as byte[]) | '{"$binary": {"base64": "AwB/Bw==", "subType": "09"}}'
883+
Vector.floatVector([127.0f, 7.0f] as float[]) | '{"$binary": {"base64": "JwAAAP5CAADgQA==", "subType": "09"}}'
884+
Vector.packedBitVector([127, 7] as byte[], (byte) 0) | '{"$binary": {"base64": "EAB/Bw==", "subType": "09"}}'
885885
[1.0d, 2.0d] | "[1.0, 2.0]"
886886
}
887887

@@ -913,8 +913,8 @@ class AggregatesSpecification extends Specification {
913913

914914
where:
915915
vector | queryVector
916-
Vector.int8Vector(new byte[]{127, 7}) | '{"$binary": {"base64": "AwB/Bw==", "subType": "09"}}'
917-
Vector.floatVector(new float[]{127.0f, 7.0f}) | '{"$binary": {"base64": "JwAAAP5CAADgQA==", "subType": "09"}}'
916+
Vector.int8Vector([127, 7] as byte[]) | '{"$binary": {"base64": "AwB/Bw==", "subType": "09"}}'
917+
Vector.floatVector([127.0f, 7.0f] as float[]) | '{"$binary": {"base64": "JwAAAP5CAADgQA==", "subType": "09"}}'
918918
[1.0d, 2.0d] | "[1.0, 2.0]"
919919
}
920920

0 commit comments

Comments
 (0)