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

VendorId should be a String #2343

Merged
merged 6 commits into from
Nov 9, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Fix `Gpu.vendorId` should be a String ([#2343](https://github.com/getsentry/sentry-java/pull/2343))

## 6.7.0

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ public final class io/sentry/protocol/Gpu : io/sentry/JsonSerializable, io/sentr
public fun getName ()Ljava/lang/String;
public fun getNpotSupport ()Ljava/lang/String;
public fun getUnknown ()Ljava/util/Map;
public fun getVendorId ()Ljava/lang/Integer;
public fun getVendorId ()Ljava/lang/String;
public fun getVendorName ()Ljava/lang/String;
public fun getVersion ()Ljava/lang/String;
public fun isMultiThreadedRendering ()Ljava/lang/Boolean;
Expand All @@ -2523,7 +2523,7 @@ public final class io/sentry/protocol/Gpu : io/sentry/JsonSerializable, io/sentr
public fun setName (Ljava/lang/String;)V
public fun setNpotSupport (Ljava/lang/String;)V
public fun setUnknown (Ljava/util/Map;)V
public fun setVendorId (Ljava/lang/Integer;)V
public fun setVendorId (Ljava/lang/String;)V
public fun setVendorName (Ljava/lang/String;)V
public fun setVersion (Ljava/lang/String;)V
}
Expand Down
8 changes: 4 additions & 4 deletions sentry/src/main/java/io/sentry/protocol/Gpu.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class Gpu implements JsonUnknown, JsonSerializable {
/** The PCI identifier of the graphics device. */
private @Nullable Integer id;
/** The PCI vendor identifier of the graphics device. */
private @Nullable Integer vendorId;
private @Nullable String vendorId;
/** The vendor name as reported by the graphics device. */
private @Nullable String vendorName;
/** The total GPU memory available in Megabytes. */
Expand Down Expand Up @@ -74,11 +74,11 @@ public void setId(Integer id) {
this.id = id;
}

public @Nullable Integer getVendorId() {
public @Nullable String getVendorId() {
return vendorId;
}

public void setVendorId(Integer vendorId) {
public void setVendorId(@Nullable String vendorId) {
this.vendorId = vendorId;
}

Expand Down Expand Up @@ -213,7 +213,7 @@ public static final class Deserializer implements JsonDeserializer<Gpu> {
gpu.id = reader.nextIntegerOrNull();
break;
case JsonKeys.VENDOR_ID:
gpu.vendorId = reader.nextIntegerOrNull();
gpu.vendorId = reader.nextStringOrNull();
break;
case JsonKeys.VENDOR_NAME:
gpu.vendorName = reader.nextStringOrNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GpuSerializationTest {
fun getSut() = Gpu().apply {
name = "d623a6b5-e1ab-4402-931b-c06f5a43a5ae"
id = -596576280
vendorId = 1874778041
vendorId = "1874778041"
vendorName = "d732cf76-07dc-48e2-8920-96d6bfc2439d"
memorySize = -1484004451
apiType = "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f"
Expand Down
4 changes: 2 additions & 2 deletions sentry/src/test/java/io/sentry/protocol/GpuTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GpuTest {
val gpu = Gpu()
gpu.name = "name"
gpu.id = 10
gpu.vendorId = 20
gpu.vendorId = "20"
gpu.vendorName = "vendor name"
gpu.memorySize = 1024
gpu.apiType = "api type"
Expand All @@ -40,7 +40,7 @@ class GpuTest {

assertEquals("name", clone.name)
assertEquals(10, clone.id)
assertEquals(20, clone.vendorId)
assertEquals("20", clone.vendorId)
assertEquals("vendor name", clone.vendorName)
assertEquals(1024, clone.memorySize)
assertEquals("api type", clone.apiType)
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/contexts.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/gpu.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/sentry_base_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/sentry_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/resources/json/sentry_transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
{
"name": "d623a6b5-e1ab-4402-931b-c06f5a43a5ae",
"id": -596576280,
"vendor_id": 1874778041,
"vendor_id": "1874778041",
"vendor_name": "d732cf76-07dc-48e2-8920-96d6bfc2439d",
"memory_size": -1484004451,
"api_type": "95dfc8bc-88ae-4d66-b85f-6c88ad45b80f",
Expand Down