Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Swapped Jenkins.getInstanceOrNull with JenkinsJVM.isJenkinsJVM#1

Open
tranceporter wants to merge 5 commits into
salemove:fix-global-config-in-agentfrom
tranceporter:patch-1
Open

Swapped Jenkins.getInstanceOrNull with JenkinsJVM.isJenkinsJVM#1
tranceporter wants to merge 5 commits into
salemove:fix-global-config-in-agentfrom
tranceporter:patch-1

Conversation

@tranceporter

Copy link
Copy Markdown

No description provided.

@jakub-bochenski

Copy link
Copy Markdown

If I understand correctly we should only have the JenkinsJVM.isJenkinsJVM() check
We should not import the Jenkins class in this file at all, as this is enough to cause loading of the class and linkage problems AFAIK

@tranceporter

Copy link
Copy Markdown
Author

Fixed.

@jakub-bochenski

Copy link
Copy Markdown

OK, but the condition is now logically inverted
getInstanceOrNull() == null should be changed to !JenkinsJVM.isJenkinsJVM()

@tranceporter

Copy link
Copy Markdown
Author

Thanks for your guidance. I am not familiar with the inner workings, so this is helpful. I have fixed the condition.

@tranceporter tranceporter changed the title Additional check for JenkinsJVM for runtime controller or agent check Swapped Jenkins.getInstanceOrNull with JenkinsJVM.isJenkinsJVM() Aug 28, 2024
@tranceporter tranceporter changed the title Swapped Jenkins.getInstanceOrNull with JenkinsJVM.isJenkinsJVM() Swapped Jenkins.getInstanceOrNull with JenkinsJVM.isJenkinsJVM Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants