mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-21 15:55:40 +00:00
Consistent indentation with spaces rather than tabs (#6147)
This commit is contained in:
1 parent
0303e31890
commit
02eecd8a49
26 files changed
+420
-417
No files matched your search
@@ -2364,9 +2364,9 @@ public final class FilePath implements SerializableOnlyOverRemoting {
|
||||
* be on the some host
|
||||
*/
|
||||
public void renameTo(final FilePath target) throws IOException, InterruptedException {
|
||||
if(this.channel != target.channel) {
|
||||
throw new IOException("renameTo target must be on the same host");
|
||||
}
|
||||
if(this.channel != target.channel) {
|
||||
throw new IOException("renameTo target must be on the same host");
|
||||
}
|
||||
act(new RenameTo(target));
|
||||
}
|
||||
private static class RenameTo extends MasterToSlaveFileCallable<Void> {
|
||||
@@ -2695,14 +2695,14 @@ public final class FilePath implements SerializableOnlyOverRemoting {
|
||||
}
|
||||
}
|
||||
private boolean tryCopyWithAttributes(File f, Path targetPath) {
|
||||
try {
|
||||
try {
|
||||
Files.copy(fileToPath(f), targetPath,
|
||||
StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING);
|
||||
} catch (IOException e) {
|
||||
LOGGER.log(Level.FINE, "Unable to copy: {0}", e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean understandsSymlink() {
|
||||
|
||||
@@ -987,7 +987,7 @@ public abstract class Launcher {
|
||||
// replace variables in command line
|
||||
String[] jobCmd = new String[ps.commands.size()];
|
||||
for ( int idx = 0 ; idx < jobCmd.length; idx++ )
|
||||
jobCmd[idx] = jobEnv.expand(ps.commands.get(idx));
|
||||
jobCmd[idx] = jobEnv.expand(ps.commands.get(idx));
|
||||
|
||||
return new LocalProc(jobCmd, Util.mapToEnv(jobEnv),
|
||||
ps.reverseStdin ?LocalProc.SELFPUMP_INPUT:ps.stdin,
|
||||
|
||||
@@ -1183,31 +1183,31 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
* Creates a hudson.PluginStrategy, looking at the corresponding system property.
|
||||
*/
|
||||
protected PluginStrategy createPluginStrategy() {
|
||||
String strategyName = SystemProperties.getString(PluginStrategy.class.getName());
|
||||
if (strategyName != null) {
|
||||
try {
|
||||
Class<?> klazz = getClass().getClassLoader().loadClass(strategyName);
|
||||
Object strategy = klazz.getConstructor(PluginManager.class)
|
||||
.newInstance(this);
|
||||
if (strategy instanceof PluginStrategy) {
|
||||
LOGGER.info("Plugin strategy: " + strategyName);
|
||||
return (PluginStrategy) strategy;
|
||||
} else {
|
||||
LOGGER.warning("Plugin strategy (" + strategyName +
|
||||
") is not an instance of hudson.PluginStrategy");
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOGGER.warning("Plugin strategy class not found: "
|
||||
+ strategyName);
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(WARNING, "Could not instantiate plugin strategy: "
|
||||
+ strategyName + ". Falling back to ClassicPluginStrategy", e);
|
||||
}
|
||||
LOGGER.info("Falling back to ClassicPluginStrategy");
|
||||
}
|
||||
String strategyName = SystemProperties.getString(PluginStrategy.class.getName());
|
||||
if (strategyName != null) {
|
||||
try {
|
||||
Class<?> klazz = getClass().getClassLoader().loadClass(strategyName);
|
||||
Object strategy = klazz.getConstructor(PluginManager.class)
|
||||
.newInstance(this);
|
||||
if (strategy instanceof PluginStrategy) {
|
||||
LOGGER.info("Plugin strategy: " + strategyName);
|
||||
return (PluginStrategy) strategy;
|
||||
} else {
|
||||
LOGGER.warning("Plugin strategy (" + strategyName +
|
||||
") is not an instance of hudson.PluginStrategy");
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOGGER.warning("Plugin strategy class not found: "
|
||||
+ strategyName);
|
||||
} catch (Exception e) {
|
||||
LOGGER.log(WARNING, "Could not instantiate plugin strategy: "
|
||||
+ strategyName + ". Falling back to ClassicPluginStrategy", e);
|
||||
}
|
||||
LOGGER.info("Falling back to ClassicPluginStrategy");
|
||||
}
|
||||
|
||||
// default and fallback
|
||||
return new ClassicPluginStrategy(this);
|
||||
// default and fallback
|
||||
return new ClassicPluginStrategy(this);
|
||||
}
|
||||
|
||||
public PluginStrategy getPluginStrategy() {
|
||||
@@ -1498,8 +1498,8 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
for (UpdateSite.Plugin plugin: site.getAvailables()) {
|
||||
JSONObject pluginInfo = allPlugins.get(plugin.name);
|
||||
if(pluginInfo == null) {
|
||||
pluginInfo = new JSONObject();
|
||||
pluginInfo.put("installed", false);
|
||||
pluginInfo = new JSONObject();
|
||||
pluginInfo.put("installed", false);
|
||||
}
|
||||
pluginInfo.put("name", plugin.name);
|
||||
pluginInfo.put("title", plugin.getDisplayName());
|
||||
|
||||
@@ -485,17 +485,17 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
* @param optionalDependencies a list of optional dependencies
|
||||
*/
|
||||
public PluginWrapper(PluginManager parent, File archive, Manifest manifest, URL baseResourceURL,
|
||||
ClassLoader classLoader, File disableFile,
|
||||
List<Dependency> dependencies, List<Dependency> optionalDependencies) {
|
||||
ClassLoader classLoader, File disableFile,
|
||||
List<Dependency> dependencies, List<Dependency> optionalDependencies) {
|
||||
this.parent = parent;
|
||||
this.manifest = manifest;
|
||||
this.shortName = Util.intern(computeShortName(manifest, archive.getName()));
|
||||
this.baseResourceURL = baseResourceURL;
|
||||
this.classLoader = classLoader;
|
||||
this.disableFile = disableFile;
|
||||
this.active = !disableFile.exists();
|
||||
this.dependencies = dependencies;
|
||||
this.optionalDependencies = optionalDependencies;
|
||||
this.manifest = manifest;
|
||||
this.shortName = Util.intern(computeShortName(manifest, archive.getName()));
|
||||
this.baseResourceURL = baseResourceURL;
|
||||
this.classLoader = classLoader;
|
||||
this.disableFile = disableFile;
|
||||
this.active = !disableFile.exists();
|
||||
this.dependencies = dependencies;
|
||||
this.optionalDependencies = optionalDependencies;
|
||||
for (Dependency d : optionalDependencies) {
|
||||
assert d.optional : d + " included among optionalDependencies of " + shortName + " but was not marked optional";
|
||||
}
|
||||
@@ -608,7 +608,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
List<UpdateSite.Plugin> siteMetadataList = getInfoFromAllSites();
|
||||
String firstSiteUrl = null;
|
||||
if (!siteMetadataList.isEmpty()) {
|
||||
firstSiteUrl = siteMetadataList.get(0).wiki;
|
||||
firstSiteUrl = siteMetadataList.get(0).wiki;
|
||||
if (allUrlsMatch(firstSiteUrl, siteMetadataList)) {
|
||||
return firstSiteUrl;
|
||||
}
|
||||
@@ -618,7 +618,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
// use manifest (since maven-hpi-plugin 1.30)
|
||||
String url = manifest.getMainAttributes().getValue("Url");
|
||||
if (url != null) {
|
||||
return url;
|
||||
return url;
|
||||
}
|
||||
return firstSiteUrl;
|
||||
}
|
||||
@@ -627,7 +627,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
return uiList.stream().allMatch(k -> k.wiki != null && k.wiki.equals(url));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Plugin:" + getShortName();
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ public class WebAppMain implements ServletContextListener {
|
||||
JellyFacet.setExpressionFactory(event, new ExpressionFactory2());
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Installs log handler to monitor all Hudson logs.
|
||||
*/
|
||||
private void installLogger() {
|
||||
|
||||
@@ -883,7 +883,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* No need to lock the entire AbstractBuild on change set calculation
|
||||
*/
|
||||
private transient Object changeSetLock = new Object();
|
||||
|
||||
@@ -1105,7 +1105,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
|
||||
Set<Task> unblockedTasks = Jenkins.get().getQueue().getUnblockedTasks();
|
||||
|
||||
for (AbstractProject tup : getTransitiveDownstreamProjects()) {
|
||||
if (tup!=this && (tup.isBuilding() || unblockedTasks.contains(tup)))
|
||||
if (tup!=this && (tup.isBuilding() || unblockedTasks.contains(tup)))
|
||||
return tup;
|
||||
}
|
||||
return null;
|
||||
@@ -1122,7 +1122,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
|
||||
Set<Task> unblockedTasks = Jenkins.get().getQueue().getUnblockedTasks();
|
||||
|
||||
for (AbstractProject tup : getTransitiveUpstreamProjects()) {
|
||||
if (tup!=this && (tup.isBuilding() || unblockedTasks.contains(tup)))
|
||||
if (tup!=this && (tup.isBuilding() || unblockedTasks.contains(tup)))
|
||||
return tup;
|
||||
}
|
||||
return null;
|
||||
@@ -1932,10 +1932,10 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
|
||||
}
|
||||
|
||||
public FormValidation doCheckCustomWorkspace(@QueryParameter String customWorkspace){
|
||||
if(Util.fixEmptyAndTrim(customWorkspace)==null)
|
||||
return FormValidation.error(Messages.AbstractProject_CustomWorkspaceEmpty());
|
||||
else
|
||||
return FormValidation.ok();
|
||||
if(Util.fixEmptyAndTrim(customWorkspace)==null)
|
||||
return FormValidation.error(Messages.AbstractProject_CustomWorkspaceEmpty());
|
||||
else
|
||||
return FormValidation.ok();
|
||||
}
|
||||
|
||||
public AutoCompletionCandidates doAutoCompleteUpstreamProjects(@QueryParameter String value) {
|
||||
|
||||
@@ -52,7 +52,7 @@ import jenkins.util.Timer;
|
||||
@SuppressFBWarnings(value="PREDICTABLE_RANDOM", justification = "The random is just used for an initial delay.")
|
||||
public abstract class AperiodicWork extends SafeTimerTask implements ExtensionPoint {
|
||||
|
||||
protected final Logger logger = Logger.getLogger(getClass().getName());
|
||||
protected final Logger logger = Logger.getLogger(getClass().getName());
|
||||
|
||||
/**
|
||||
* Gets the number of milliseconds between successive executions.
|
||||
@@ -88,7 +88,7 @@ public abstract class AperiodicWork extends SafeTimerTask implements ExtensionPo
|
||||
|
||||
@Override
|
||||
public final void doRun() throws Exception{
|
||||
doAperiodicRun();
|
||||
doAperiodicRun();
|
||||
Timer.get().schedule(getNewInstance(), getRecurrencePeriod(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,83 +11,83 @@ import org.kohsuke.stapler.Stapler;
|
||||
|
||||
public class PaneStatusProperties extends UserProperty implements Saveable {
|
||||
|
||||
private final PersistedList<String> collapsed = new PersistedList<>(this);
|
||||
private final PersistedList<String> collapsed = new PersistedList<>(this);
|
||||
|
||||
private static final PaneStatusProperties FALLBACK = new PaneStatusPropertiesSessionFallback();
|
||||
private static final PaneStatusProperties FALLBACK = new PaneStatusPropertiesSessionFallback();
|
||||
|
||||
public boolean isCollapsed(String paneId) {
|
||||
return collapsed.contains(paneId);
|
||||
}
|
||||
public boolean isCollapsed(String paneId) {
|
||||
return collapsed.contains(paneId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param paneId panel name
|
||||
* @return the actual state of panel
|
||||
*/
|
||||
public boolean toggleCollapsed(String paneId) {
|
||||
if (collapsed.contains(paneId)) {
|
||||
collapsed.remove(paneId);
|
||||
return false;
|
||||
} else {
|
||||
collapsed.add(paneId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param paneId panel name
|
||||
* @return the actual state of panel
|
||||
*/
|
||||
public boolean toggleCollapsed(String paneId) {
|
||||
if (collapsed.contains(paneId)) {
|
||||
collapsed.remove(paneId);
|
||||
return false;
|
||||
} else {
|
||||
collapsed.add(paneId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() throws IOException {
|
||||
@Override
|
||||
public void save() throws IOException {
|
||||
user.save();
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
collapsed.setOwner(this);
|
||||
return this;
|
||||
}
|
||||
private Object readResolve() {
|
||||
collapsed.setOwner(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Extension @Symbol("paneStatus")
|
||||
public static class DescriptorImpl extends UserPropertyDescriptor {
|
||||
@Extension @Symbol("paneStatus")
|
||||
public static class DescriptorImpl extends UserPropertyDescriptor {
|
||||
|
||||
@Override
|
||||
public UserProperty newInstance(User user) {
|
||||
return new PaneStatusProperties();
|
||||
}
|
||||
@Override
|
||||
public UserProperty newInstance(User user) {
|
||||
return new PaneStatusProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static class PaneStatusPropertiesSessionFallback extends PaneStatusProperties {
|
||||
private static class PaneStatusPropertiesSessionFallback extends PaneStatusProperties {
|
||||
|
||||
private static final String attribute = "jenkins_pane_%s_collapsed";
|
||||
private static final String attribute = "jenkins_pane_%s_collapsed";
|
||||
|
||||
@Override
|
||||
public boolean isCollapsed(String paneId) {
|
||||
final HttpSession session = Stapler.getCurrentRequest().getSession();
|
||||
return session.getAttribute(format(attribute, paneId)) != null;
|
||||
}
|
||||
@Override
|
||||
public boolean isCollapsed(String paneId) {
|
||||
final HttpSession session = Stapler.getCurrentRequest().getSession();
|
||||
return session.getAttribute(format(attribute, paneId)) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean toggleCollapsed(String paneId) {
|
||||
final HttpSession session = Stapler.getCurrentRequest().getSession();
|
||||
final String property = format(attribute, paneId);
|
||||
final Object collapsed = session.getAttribute(property);
|
||||
if (collapsed == null) {
|
||||
session.setAttribute(property, true);
|
||||
return true;
|
||||
}
|
||||
session.removeAttribute(property);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean toggleCollapsed(String paneId) {
|
||||
final HttpSession session = Stapler.getCurrentRequest().getSession();
|
||||
final String property = format(attribute, paneId);
|
||||
final Object collapsed = session.getAttribute(property);
|
||||
if (collapsed == null) {
|
||||
session.setAttribute(property, true);
|
||||
return true;
|
||||
}
|
||||
session.removeAttribute(property);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static PaneStatusProperties forCurrentUser() {
|
||||
final User current = User.current();
|
||||
if (current == null) {
|
||||
return FALLBACK;
|
||||
}
|
||||
return current.getProperty(PaneStatusProperties.class);
|
||||
}
|
||||
public static PaneStatusProperties forCurrentUser() {
|
||||
final User current = User.current();
|
||||
if (current == null) {
|
||||
return FALLBACK;
|
||||
}
|
||||
return current.getProperty(PaneStatusProperties.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public class ParametersDefinitionProperty extends OptionalJobProperty<Job<?, ?>>
|
||||
}
|
||||
}
|
||||
|
||||
WaitingItem item = Jenkins.get().getQueue().schedule(
|
||||
WaitingItem item = Jenkins.get().getQueue().schedule(
|
||||
getJob(), delay.getTimeInSeconds(), new ParametersAction(values), new CauseAction(new Cause.UserIdCause()));
|
||||
if (item!=null) {
|
||||
String url = formData.optString("redirectTo");
|
||||
@@ -182,10 +182,10 @@ public class ParametersDefinitionProperty extends OptionalJobProperty<Job<?, ?>>
|
||||
public void buildWithParameters(StaplerRequest req, StaplerResponse rsp, @CheckForNull TimeDuration delay) throws IOException, ServletException {
|
||||
List<ParameterValue> values = new ArrayList<>();
|
||||
for (ParameterDefinition d: parameterDefinitions) {
|
||||
ParameterValue value = d.createValue(req);
|
||||
if (value != null) {
|
||||
values.add(value);
|
||||
}
|
||||
ParameterValue value = d.createValue(req);
|
||||
if (value != null) {
|
||||
values.add(value);
|
||||
}
|
||||
}
|
||||
if (delay==null)
|
||||
delay=new TimeDuration(TimeUnit.MILLISECONDS.convert(getJob().getQuietPeriod(), TimeUnit.SECONDS));
|
||||
|
||||
@@ -1355,7 +1355,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
/**
|
||||
* Relative path name from artifacts root.
|
||||
*/
|
||||
@Exported(visibility=3)
|
||||
@Exported(visibility=3)
|
||||
public final String relativePath;
|
||||
|
||||
/**
|
||||
@@ -1410,12 +1410,12 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
/**
|
||||
* Returns just the file name portion, without the path.
|
||||
*/
|
||||
@Exported(visibility=3)
|
||||
@Exported(visibility=3)
|
||||
public String getFileName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Exported(visibility=3)
|
||||
@Exported(visibility=3)
|
||||
public String getDisplayPath() {
|
||||
return displayPath;
|
||||
}
|
||||
@@ -1492,10 +1492,10 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
* @since 1.349
|
||||
*/
|
||||
public @NonNull InputStream getLogInputStream() throws IOException {
|
||||
File logFile = getLogFile();
|
||||
File logFile = getLogFile();
|
||||
|
||||
if (logFile.exists() ) {
|
||||
// Checking if a ".gz" file was return
|
||||
if (logFile.exists() ) {
|
||||
// Checking if a ".gz" file was return
|
||||
try {
|
||||
InputStream fis = Files.newInputStream(logFile.toPath());
|
||||
if (logFile.getName().endsWith(".gz")) {
|
||||
@@ -1506,10 +1506,10 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
} catch (InvalidPathException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String message = "No such file: " + logFile;
|
||||
return new ByteArrayInputStream(charset != null ? message.getBytes(charset) : message.getBytes(Charset.defaultCharset()));
|
||||
return new ByteArrayInputStream(charset != null ? message.getBytes(charset) : message.getBytes(Charset.defaultCharset()));
|
||||
}
|
||||
|
||||
public @NonNull Reader getLogReader() throws IOException {
|
||||
|
||||
@@ -695,9 +695,9 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
|
||||
private boolean checkMinVersion(@CheckForNull Plugin p, @CheckForNull VersionNumber minVersion) {
|
||||
return p != null
|
||||
&& (minVersion == null || !minVersion.isNewerThan(new VersionNumber(p.version)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Schedules a Jenkins upgrade.
|
||||
*/
|
||||
@RequirePOST
|
||||
|
||||
@@ -179,14 +179,14 @@ public class SCMTrigger extends Trigger<Item> {
|
||||
|
||||
LOGGER.fine("Scheduling a polling for "+job);
|
||||
if (d.synchronousPolling) {
|
||||
LOGGER.fine("Running the trigger directly without threading, " +
|
||||
"as it's already taken care of by Trigger.Cron");
|
||||
LOGGER.fine("Running the trigger directly without threading, " +
|
||||
"as it's already taken care of by Trigger.Cron");
|
||||
new Runner(additionalActions).run();
|
||||
} else {
|
||||
// schedule the polling.
|
||||
// even if we end up submitting this too many times, that's OK.
|
||||
// the real exclusion control happens inside Runner.
|
||||
LOGGER.fine("scheduling the trigger to (asynchronously) run");
|
||||
LOGGER.fine("scheduling the trigger to (asynchronously) run");
|
||||
d.queue.execute(new Runner(additionalActions));
|
||||
d.clogCheck();
|
||||
}
|
||||
|
||||
@@ -1121,44 +1121,44 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
|
||||
super(pid);
|
||||
|
||||
try (RandomAccessFile pstatus = new RandomAccessFile(getFile("status"), "r")) {
|
||||
// typedef struct pstatus {
|
||||
// uint32_t pr_flag; /* process flags from proc struct p_flag */
|
||||
// uint32_t pr_flag2; /* process flags from proc struct p_flag2 */
|
||||
// uint32_t pr_flags; /* /proc flags */
|
||||
// uint32_t pr_nlwp; /* number of threads in the process */
|
||||
// char pr_stat; /* process state from proc p_stat */
|
||||
// char pr_dmodel; /* data model for the process */
|
||||
// char pr__pad1[6]; /* reserved for future use */
|
||||
// pr_sigset_t pr_sigpend; /* set of process pending signals */
|
||||
// prptr64_t pr_brkbase; /* address of the process heap */
|
||||
// uint64_t pr_brksize; /* size of the process heap, in bytes */
|
||||
// prptr64_t pr_stkbase; /* address of the process stack */
|
||||
// uint64_t pr_stksize; /* size of the process stack, in bytes */
|
||||
// uint64_t pr_pid; /* process id */
|
||||
// uint64_t pr_ppid; /* parent process id */
|
||||
// uint64_t pr_pgid; /* process group id */
|
||||
// uint64_t pr_sid; /* session id */
|
||||
// pr_timestruc64_t pr_utime; /* process user cpu time */
|
||||
// pr_timestruc64_t pr_stime; /* process system cpu time */
|
||||
// pr_timestruc64_t pr_cutime; /* sum of children's user times */
|
||||
// pr_timestruc64_t pr_cstime; /* sum of children's system times */
|
||||
// pr_sigset_t pr_sigtrace; /* mask of traced signals */
|
||||
// fltset_t pr_flttrace; /* mask of traced hardware faults */
|
||||
// uint32_t pr_sysentry_offset; /* offset into pstatus file of sysset_t
|
||||
// * identifying system calls traced on
|
||||
// * entry. If 0, then no entry syscalls
|
||||
// * are being traced. */
|
||||
// uint32_t pr_sysexit_offset; /* offset into pstatus file of sysset_t
|
||||
// * identifying system calls traced on
|
||||
// * exit. If 0, then no exit syscalls
|
||||
// * are being traced. */
|
||||
// uint64_t pr__pad[8]; /* reserved for future use */
|
||||
// lwpstatus_t pr_lwp; /* "representative" thread status */
|
||||
// } pstatus_t;
|
||||
// typedef struct pstatus {
|
||||
// uint32_t pr_flag; /* process flags from proc struct p_flag */
|
||||
// uint32_t pr_flag2; /* process flags from proc struct p_flag2 */
|
||||
// uint32_t pr_flags; /* /proc flags */
|
||||
// uint32_t pr_nlwp; /* number of threads in the process */
|
||||
// char pr_stat; /* process state from proc p_stat */
|
||||
// char pr_dmodel; /* data model for the process */
|
||||
// char pr__pad1[6]; /* reserved for future use */
|
||||
// pr_sigset_t pr_sigpend; /* set of process pending signals */
|
||||
// prptr64_t pr_brkbase; /* address of the process heap */
|
||||
// uint64_t pr_brksize; /* size of the process heap, in bytes */
|
||||
// prptr64_t pr_stkbase; /* address of the process stack */
|
||||
// uint64_t pr_stksize; /* size of the process stack, in bytes */
|
||||
// uint64_t pr_pid; /* process id */
|
||||
// uint64_t pr_ppid; /* parent process id */
|
||||
// uint64_t pr_pgid; /* process group id */
|
||||
// uint64_t pr_sid; /* session id */
|
||||
// pr_timestruc64_t pr_utime; /* process user cpu time */
|
||||
// pr_timestruc64_t pr_stime; /* process system cpu time */
|
||||
// pr_timestruc64_t pr_cutime; /* sum of children's user times */
|
||||
// pr_timestruc64_t pr_cstime; /* sum of children's system times */
|
||||
// pr_sigset_t pr_sigtrace; /* mask of traced signals */
|
||||
// fltset_t pr_flttrace; /* mask of traced hardware faults */
|
||||
// uint32_t pr_sysentry_offset; /* offset into pstatus file of sysset_t
|
||||
// * identifying system calls traced on
|
||||
// * entry. If 0, then no entry syscalls
|
||||
// * are being traced. */
|
||||
// uint32_t pr_sysexit_offset; /* offset into pstatus file of sysset_t
|
||||
// * identifying system calls traced on
|
||||
// * exit. If 0, then no exit syscalls
|
||||
// * are being traced. */
|
||||
// uint64_t pr__pad[8]; /* reserved for future use */
|
||||
// lwpstatus_t pr_lwp; /* "representative" thread status */
|
||||
// } pstatus_t;
|
||||
|
||||
pstatus.seek(17); // offset of pr_dmodel
|
||||
|
||||
byte pr_dmodel = pstatus.readByte();
|
||||
byte pr_dmodel = pstatus.readByte();
|
||||
|
||||
if (pr_dmodel == PR_MODEL_ILP32) {
|
||||
b64 = false;
|
||||
@@ -1535,9 +1535,9 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
|
||||
return arguments;
|
||||
|
||||
arguments = new ArrayList<>(argc);
|
||||
if (argc == 0) {
|
||||
return arguments;
|
||||
}
|
||||
if (argc == 0) {
|
||||
return arguments;
|
||||
}
|
||||
|
||||
int psize = b64 ? 8 : 4;
|
||||
Memory m = new Memory(psize);
|
||||
@@ -1572,9 +1572,9 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
|
||||
return envVars;
|
||||
envVars = new EnvVars();
|
||||
|
||||
if (envp == 0) {
|
||||
return envVars;
|
||||
}
|
||||
if (envp == 0) {
|
||||
return envVars;
|
||||
}
|
||||
|
||||
int psize = b64 ? 8 : 4;
|
||||
Memory m = new Memory(psize);
|
||||
|
||||
@@ -280,10 +280,10 @@ public class InstallUtil {
|
||||
* Returns a list of any plugins that are persisted in the installing list
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static synchronized @CheckForNull Map<String,String> getPersistedInstallStatus() {
|
||||
public static synchronized @CheckForNull Map<String,String> getPersistedInstallStatus() {
|
||||
File installingPluginsFile = getInstallingPluginsFile();
|
||||
if(installingPluginsFile == null || !installingPluginsFile.exists()) {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
return (Map<String,String>)new XStream().fromXML(installingPluginsFile);
|
||||
}
|
||||
@@ -293,29 +293,29 @@ public class InstallUtil {
|
||||
*/
|
||||
public static synchronized void persistInstallStatus(List<UpdateCenterJob> installingPlugins) {
|
||||
File installingPluginsFile = getInstallingPluginsFile();
|
||||
if(installingPlugins == null || installingPlugins.isEmpty()) {
|
||||
try {
|
||||
Files.deleteIfExists(installingPluginsFile.toPath());
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
LOGGER.fine("Writing install state to: " + installingPluginsFile.getAbsolutePath());
|
||||
Map<String,String> statuses = new HashMap<>();
|
||||
for(UpdateCenterJob j : installingPlugins) {
|
||||
if(j instanceof InstallationJob && j.getCorrelationId() != null) { // only include install jobs with a correlation id (directly selected)
|
||||
InstallationJob ij = (InstallationJob)j;
|
||||
InstallationStatus status = ij.status;
|
||||
String statusText = status.getType();
|
||||
if(status instanceof Installing) { // flag currently installing plugins as pending
|
||||
statusText = "Pending";
|
||||
}
|
||||
statuses.put(ij.plugin.name, statusText);
|
||||
}
|
||||
}
|
||||
if(installingPlugins == null || installingPlugins.isEmpty()) {
|
||||
try {
|
||||
Files.deleteIfExists(installingPluginsFile.toPath());
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
LOGGER.fine("Writing install state to: " + installingPluginsFile.getAbsolutePath());
|
||||
Map<String,String> statuses = new HashMap<>();
|
||||
for(UpdateCenterJob j : installingPlugins) {
|
||||
if(j instanceof InstallationJob && j.getCorrelationId() != null) { // only include install jobs with a correlation id (directly selected)
|
||||
InstallationJob ij = (InstallationJob)j;
|
||||
InstallationStatus status = ij.status;
|
||||
String statusText = status.getType();
|
||||
if(status instanceof Installing) { // flag currently installing plugins as pending
|
||||
statusText = "Pending";
|
||||
}
|
||||
statuses.put(ij.plugin.name, statusText);
|
||||
}
|
||||
}
|
||||
try {
|
||||
String installingPluginXml = new XStream().toXML(statuses);
|
||||
String installingPluginXml = new XStream().toXML(statuses);
|
||||
FileUtils.write(installingPluginsFile, installingPluginXml);
|
||||
} catch (IOException e) {
|
||||
LOGGER.log(SEVERE, "Failed to save " + installingPluginsFile.getAbsolutePath(), e);
|
||||
@@ -325,7 +325,7 @@ public class InstallUtil {
|
||||
/**
|
||||
* Call to remove any active install status
|
||||
*/
|
||||
public static void clearInstallStatus() {
|
||||
persistInstallStatus(null);
|
||||
}
|
||||
public static void clearInstallStatus() {
|
||||
persistInstallStatus(null);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user