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

Refactor network detectors to kotlin #752

Merged
merged 11 commits into from
Jan 22, 2025

Conversation

breedx-splk
Copy link
Contributor

Follow up from #736, this refactors the two network detectors to be in kotlin, and simplifies a few things.

@breedx-splk breedx-splk requested a review from a team as a code owner January 16, 2025 05:24
@@ -116,6 +116,9 @@ public Builder carrier(@Nullable Carrier carrier) {
}

public Builder subType(@Nullable String subType) {
if ((subType != null) && subType.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ((subType != null) && subType.isEmpty()) {
if ((subType.isNullOrEmpty()) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will NPE right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@breedx-splk breedx-splk Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is indeed super nice! And does this also monkey patch the java classes? Because this is still java.....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't work from Java, though maybe we can take the opportunity to switch it to Kotlin? It doesn't seem like it'll be a complicated class to change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could subType?.isNullOrEmpty() ?: true or similar with Java interop.

@breedx-splk breedx-splk merged commit b554ad3 into open-telemetry:main Jan 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants