mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-21 15:55:40 +00:00
Fix OBL_UNSATISFIED_OBLIGATION SpotBugs violations
This commit is contained in:
1 parent
6c45a12cd7
commit
f7bc2b5da6
3 files changed
+11
-13
No files matched your search
@@ -65,12 +65,16 @@ public class AdminWhitelistRule implements StaplerProxy {
|
||||
// overwrite 30-default.conf with what we think is the best from the core.
|
||||
// this file shouldn't be touched by anyone. For local customization, use other files in the conf dir.
|
||||
// 0-byte file is used as a signal from the admin to prevent this overwriting
|
||||
placeDefaultRule(
|
||||
new File(jenkins.getRootDir(), "secrets/whitelisted-callables.d/default.conf"),
|
||||
getClass().getResourceAsStream("callable.conf"));
|
||||
placeDefaultRule(
|
||||
new File(jenkins.getRootDir(), "secrets/filepath-filters.d/30-default.conf"),
|
||||
transformForWindows(getClass().getResourceAsStream("filepath-filter.conf")));
|
||||
try (InputStream callable = getClass().getResourceAsStream("callable.conf")) {
|
||||
placeDefaultRule(
|
||||
new File(jenkins.getRootDir(), "secrets/whitelisted-callables.d/default.conf"),
|
||||
callable);
|
||||
}
|
||||
try (InputStream filepathFilter = getClass().getResourceAsStream("filepath-filter.conf")) {
|
||||
placeDefaultRule(
|
||||
new File(jenkins.getRootDir(), "secrets/filepath-filters.d/30-default.conf"),
|
||||
transformForWindows(filepathFilter));
|
||||
}
|
||||
|
||||
this.whitelisted = new CallableWhitelistConfig(
|
||||
new File(jenkins.getRootDir(),"secrets/whitelisted-callables.d/gui.conf"));
|
||||
|
||||
@@ -66,6 +66,7 @@ public class StandardOutputSwapper extends ComputerListener {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressFBWarnings(value = "OBL_UNSATISFIED_OBLIGATION", justification = "the obligation is satisfied with libc(7)")
|
||||
private void swap(StandardOutputStream stdout) throws IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, UnsatisfiedLinkError {
|
||||
// duplicate the OS file descriptor and create FileOutputStream around it
|
||||
int out = GNUCLibrary.LIBC.dup(1);
|
||||
|
||||
Reference in new issue
Block a user