id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
125,400 | jenkinsci/jenkins | core/src/main/java/hudson/model/LoadStatistics.java | LoadStatistics.computeSnapshot | public LoadStatisticsSnapshot computeSnapshot() {
if (modern) {
return computeSnapshot(Jenkins.getInstance().getQueue().getBuildableItems());
} else {
int t = computeTotalExecutors();
int i = computeIdleExecutors();
return new LoadStatisticsSnapshot(t, t, ... | java | public LoadStatisticsSnapshot computeSnapshot() {
if (modern) {
return computeSnapshot(Jenkins.getInstance().getQueue().getBuildableItems());
} else {
int t = computeTotalExecutors();
int i = computeIdleExecutors();
return new LoadStatisticsSnapshot(t, t, ... | [
"public",
"LoadStatisticsSnapshot",
"computeSnapshot",
"(",
")",
"{",
"if",
"(",
"modern",
")",
"{",
"return",
"computeSnapshot",
"(",
"Jenkins",
".",
"getInstance",
"(",
")",
".",
"getQueue",
"(",
")",
".",
"getBuildableItems",
"(",
")",
")",
";",
"}",
"e... | Computes a self-consistent snapshot of the load statistics.
Note: The original method of computing load statistics would compute the total and idle counts independently
which could lead to counting errors while jobs started in between the different state counting operations.
By returning a {@link LoadStatisticsSnapsho... | [
"Computes",
"a",
"self",
"-",
"consistent",
"snapshot",
"of",
"the",
"load",
"statistics",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/LoadStatistics.java#L333-L341 |
125,401 | jenkinsci/jenkins | core/src/main/java/hudson/model/LoadStatistics.java | LoadStatistics.computeSnapshot | protected LoadStatisticsSnapshot computeSnapshot(Iterable<Queue.BuildableItem> queue) {
final LoadStatisticsSnapshot.Builder builder = LoadStatisticsSnapshot.builder();
final Iterable<Node> nodes = getNodes();
if (nodes != null) {
for (Node node : nodes) {
builder.wit... | java | protected LoadStatisticsSnapshot computeSnapshot(Iterable<Queue.BuildableItem> queue) {
final LoadStatisticsSnapshot.Builder builder = LoadStatisticsSnapshot.builder();
final Iterable<Node> nodes = getNodes();
if (nodes != null) {
for (Node node : nodes) {
builder.wit... | [
"protected",
"LoadStatisticsSnapshot",
"computeSnapshot",
"(",
"Iterable",
"<",
"Queue",
".",
"BuildableItem",
">",
"queue",
")",
"{",
"final",
"LoadStatisticsSnapshot",
".",
"Builder",
"builder",
"=",
"LoadStatisticsSnapshot",
".",
"builder",
"(",
")",
";",
"final"... | Computes the self-consistent snapshot with the specified queue items.
@param queue the queue items.
@return a self-consistent snapshot of the load statistics.
@since 1.607 | [
"Computes",
"the",
"self",
"-",
"consistent",
"snapshot",
"with",
"the",
"specified",
"queue",
"items",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/LoadStatistics.java#L350-L369 |
125,402 | jenkinsci/jenkins | core/src/main/java/hudson/console/PlainTextConsoleOutputStream.java | PlainTextConsoleOutputStream.eol | protected void eol(byte[] in, int sz) throws IOException {
int next = ConsoleNote.findPreamble(in,0,sz);
// perform byte[]->char[] while figuring out the char positions of the BLOBs
int written = 0;
while (next>=0) {
if (next>written) {
out.write(in,written,... | java | protected void eol(byte[] in, int sz) throws IOException {
int next = ConsoleNote.findPreamble(in,0,sz);
// perform byte[]->char[] while figuring out the char positions of the BLOBs
int written = 0;
while (next>=0) {
if (next>written) {
out.write(in,written,... | [
"protected",
"void",
"eol",
"(",
"byte",
"[",
"]",
"in",
",",
"int",
"sz",
")",
"throws",
"IOException",
"{",
"int",
"next",
"=",
"ConsoleNote",
".",
"findPreamble",
"(",
"in",
",",
"0",
",",
"sz",
")",
";",
"// perform byte[]->char[] while figuring out the ... | Called after we read the whole line of plain text. | [
"Called",
"after",
"we",
"read",
"the",
"whole",
"line",
"of",
"plain",
"text",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/console/PlainTextConsoleOutputStream.java#L49-L76 |
125,403 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormFieldValidator.java | FormFieldValidator.process | public final void process() throws IOException, ServletException {
if(permission!=null)
try {
if(subject==null)
throw new AccessDeniedException("No subject");
subject.checkPermission(permission);
} catch (AccessDeniedException e) {
... | java | public final void process() throws IOException, ServletException {
if(permission!=null)
try {
if(subject==null)
throw new AccessDeniedException("No subject");
subject.checkPermission(permission);
} catch (AccessDeniedException e) {
... | [
"public",
"final",
"void",
"process",
"(",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"permission",
"!=",
"null",
")",
"try",
"{",
"if",
"(",
"subject",
"==",
"null",
")",
"throw",
"new",
"AccessDeniedException",
"(",
"\"No subjec... | Runs the validation code. | [
"Runs",
"the",
"validation",
"code",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormFieldValidator.java#L129-L143 |
125,404 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormFieldValidator.java | FormFieldValidator.getFileParameter | protected final File getFileParameter(String paramName) {
return new File(Util.fixNull(request.getParameter(paramName)));
} | java | protected final File getFileParameter(String paramName) {
return new File(Util.fixNull(request.getParameter(paramName)));
} | [
"protected",
"final",
"File",
"getFileParameter",
"(",
"String",
"paramName",
")",
"{",
"return",
"new",
"File",
"(",
"Util",
".",
"fixNull",
"(",
"request",
".",
"getParameter",
"(",
"paramName",
")",
")",
")",
";",
"}"
] | Gets the parameter as a file. | [
"Gets",
"the",
"parameter",
"as",
"a",
"file",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormFieldValidator.java#L150-L152 |
125,405 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormFieldValidator.java | FormFieldValidator.respond | public void respond(String html) throws IOException, ServletException {
response.setContentType("text/html");
response.getWriter().print(html);
} | java | public void respond(String html) throws IOException, ServletException {
response.setContentType("text/html");
response.getWriter().print(html);
} | [
"public",
"void",
"respond",
"(",
"String",
"html",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"response",
".",
"setContentType",
"(",
"\"text/html\"",
")",
";",
"response",
".",
"getWriter",
"(",
")",
".",
"print",
"(",
"html",
")",
";",
... | Sends out an arbitrary HTML fragment. | [
"Sends",
"out",
"an",
"arbitrary",
"HTML",
"fragment",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormFieldValidator.java#L164-L167 |
125,406 | jenkinsci/jenkins | core/src/main/java/hudson/util/Graph.java | Graph.doPng | public void doPng(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (req.checkIfModified(timestamp, rsp)) return;
try {
BufferedImage image = render(req,null);
rsp.setContentType("image/png");
ServletOutputStream os = rsp.getOutputStream();
... | java | public void doPng(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (req.checkIfModified(timestamp, rsp)) return;
try {
BufferedImage image = render(req,null);
rsp.setContentType("image/png");
ServletOutputStream os = rsp.getOutputStream();
... | [
"public",
"void",
"doPng",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
"{",
"if",
"(",
"req",
".",
"checkIfModified",
"(",
"timestamp",
",",
"rsp",
")",
")",
"return",
";",
"try",
"{",
"BufferedImage",
"image",
... | Renders a graph. | [
"Renders",
"a",
"graph",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/Graph.java#L116-L165 |
125,407 | jenkinsci/jenkins | core/src/main/java/hudson/util/Graph.java | Graph.doMap | public void doMap(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (req.checkIfModified(timestamp, rsp)) return;
ChartRenderingInfo info = new ChartRenderingInfo();
render(req,info);
rsp.setContentType("text/plain;charset=UTF-8");
rsp.getWriter().println(ChartUt... | java | public void doMap(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (req.checkIfModified(timestamp, rsp)) return;
ChartRenderingInfo info = new ChartRenderingInfo();
render(req,info);
rsp.setContentType("text/plain;charset=UTF-8");
rsp.getWriter().println(ChartUt... | [
"public",
"void",
"doMap",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
"{",
"if",
"(",
"req",
".",
"checkIfModified",
"(",
"timestamp",
",",
"rsp",
")",
")",
"return",
";",
"ChartRenderingInfo",
"info",
"=",
"ne... | Renders a clickable map. | [
"Renders",
"a",
"clickable",
"map",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/Graph.java#L170-L178 |
125,408 | jenkinsci/jenkins | core/src/main/java/hudson/model/PeriodicWork.java | PeriodicWork.getInitialDelay | public long getInitialDelay() {
long l = RANDOM.nextLong();
// Math.abs(Long.MIN_VALUE)==Long.MIN_VALUE!
if (l==Long.MIN_VALUE)
l++;
return Math.abs(l)%getRecurrencePeriod();
} | java | public long getInitialDelay() {
long l = RANDOM.nextLong();
// Math.abs(Long.MIN_VALUE)==Long.MIN_VALUE!
if (l==Long.MIN_VALUE)
l++;
return Math.abs(l)%getRecurrencePeriod();
} | [
"public",
"long",
"getInitialDelay",
"(",
")",
"{",
"long",
"l",
"=",
"RANDOM",
".",
"nextLong",
"(",
")",
";",
"// Math.abs(Long.MIN_VALUE)==Long.MIN_VALUE!",
"if",
"(",
"l",
"==",
"Long",
".",
"MIN_VALUE",
")",
"l",
"++",
";",
"return",
"Math",
".",
"abs... | Gets the number of milliseconds til the first execution.
<p>
By default it chooses the value randomly between 0 and {@link #getRecurrencePeriod()} | [
"Gets",
"the",
"number",
"of",
"milliseconds",
"til",
"the",
"first",
"execution",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/PeriodicWork.java#L87-L93 |
125,409 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.recordCauseOfInterruption | public void recordCauseOfInterruption(Run<?,?> build, TaskListener listener) {
List<CauseOfInterruption> r;
// atomically get&clear causes.
lock.writeLock().lock();
try {
if (causes.isEmpty()) return;
r = new ArrayList<>(causes);
causes.clear();
... | java | public void recordCauseOfInterruption(Run<?,?> build, TaskListener listener) {
List<CauseOfInterruption> r;
// atomically get&clear causes.
lock.writeLock().lock();
try {
if (causes.isEmpty()) return;
r = new ArrayList<>(causes);
causes.clear();
... | [
"public",
"void",
"recordCauseOfInterruption",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"List",
"<",
"CauseOfInterruption",
">",
"r",
";",
"// atomically get&clear causes.",
"lock",
".",
"writeLock",
"(",
")",
".... | report cause of interruption and record it to the build, if available.
@since 1.425 | [
"report",
"cause",
"of",
"interruption",
"and",
"record",
"it",
"to",
"the",
"build",
"if",
"available",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L267-L283 |
125,410 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.getCurrentExecutable | public @CheckForNull Queue.Executable getCurrentExecutable() {
lock.readLock().lock();
try {
return executable;
} finally {
lock.readLock().unlock();
}
} | java | public @CheckForNull Queue.Executable getCurrentExecutable() {
lock.readLock().lock();
try {
return executable;
} finally {
lock.readLock().unlock();
}
} | [
"public",
"@",
"CheckForNull",
"Queue",
".",
"Executable",
"getCurrentExecutable",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"executable",
";",
"}",
"finally",
"{",
"lock",
".",
"readLock",
"(",
... | Returns the current build this executor is running.
@return
null if the executor is idle. | [
"Returns",
"the",
"current",
"build",
"this",
"executor",
"is",
"running",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L513-L520 |
125,411 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.getAsynchronousExecution | public @CheckForNull AsynchronousExecution getAsynchronousExecution() {
lock.readLock().lock();
try {
return asynchronousExecution;
} finally {
lock.readLock().unlock();
}
} | java | public @CheckForNull AsynchronousExecution getAsynchronousExecution() {
lock.readLock().lock();
try {
return asynchronousExecution;
} finally {
lock.readLock().unlock();
}
} | [
"public",
"@",
"CheckForNull",
"AsynchronousExecution",
"getAsynchronousExecution",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"asynchronousExecution",
";",
"}",
"finally",
"{",
"lock",
".",
"readLock",
... | If currently running in asynchronous mode, returns that handle.
@since 1.607 | [
"If",
"currently",
"running",
"in",
"asynchronous",
"mode",
"returns",
"that",
"handle",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L646-L653 |
125,412 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.getProgress | @Exported
public int getProgress() {
long d = executableEstimatedDuration;
if (d <= 0) {
return DEFAULT_ESTIMATED_DURATION;
}
int num = (int) (getElapsedTime() * 100 / d);
if (num >= 100) {
num = 99;
}
return num;
} | java | @Exported
public int getProgress() {
long d = executableEstimatedDuration;
if (d <= 0) {
return DEFAULT_ESTIMATED_DURATION;
}
int num = (int) (getElapsedTime() * 100 / d);
if (num >= 100) {
num = 99;
}
return num;
} | [
"@",
"Exported",
"public",
"int",
"getProgress",
"(",
")",
"{",
"long",
"d",
"=",
"executableEstimatedDuration",
";",
"if",
"(",
"d",
"<=",
"0",
")",
"{",
"return",
"DEFAULT_ESTIMATED_DURATION",
";",
"}",
"int",
"num",
"=",
"(",
"int",
")",
"(",
"getElap... | Returns the progress of the current build in the number between 0-100.
@return -1
if it's impossible to estimate the progress. | [
"Returns",
"the",
"progress",
"of",
"the",
"current",
"build",
"in",
"the",
"number",
"between",
"0",
"-",
"100",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L697-L709 |
125,413 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.isLikelyStuck | @Exported
public boolean isLikelyStuck() {
lock.readLock().lock();
try {
if (executable == null) {
return false;
}
} finally {
lock.readLock().unlock();
}
long elapsed = getElapsedTime();
long d = executableEstimate... | java | @Exported
public boolean isLikelyStuck() {
lock.readLock().lock();
try {
if (executable == null) {
return false;
}
} finally {
lock.readLock().unlock();
}
long elapsed = getElapsedTime();
long d = executableEstimate... | [
"@",
"Exported",
"public",
"boolean",
"isLikelyStuck",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"executable",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"}",
"finally",
"{",
"loc... | Returns true if the current build is likely stuck.
<p>
This is a heuristics based approach, but if the build is suspiciously taking for a long time,
this method returns true. | [
"Returns",
"true",
"if",
"the",
"current",
"build",
"is",
"likely",
"stuck",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L718-L738 |
125,414 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.getTimeSpentInQueue | public long getTimeSpentInQueue() {
lock.readLock().lock();
try {
return startTime - workUnit.context.item.buildableStartMilliseconds;
} finally {
lock.readLock().unlock();
}
} | java | public long getTimeSpentInQueue() {
lock.readLock().lock();
try {
return startTime - workUnit.context.item.buildableStartMilliseconds;
} finally {
lock.readLock().unlock();
}
} | [
"public",
"long",
"getTimeSpentInQueue",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"startTime",
"-",
"workUnit",
".",
"context",
".",
"item",
".",
"buildableStartMilliseconds",
";",
"}",
"finally",
... | Returns the number of milli-seconds the currently executing job spent in the queue
waiting for an available executor. This excludes the quiet period time of the job.
@since 1.440 | [
"Returns",
"the",
"number",
"of",
"milli",
"-",
"seconds",
"the",
"currently",
"executing",
"job",
"spent",
"in",
"the",
"queue",
"waiting",
"for",
"an",
"available",
"executor",
".",
"This",
"excludes",
"the",
"quiet",
"period",
"time",
"of",
"the",
"job",
... | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L754-L761 |
125,415 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.getEstimatedRemainingTime | public String getEstimatedRemainingTime() {
long d = executableEstimatedDuration;
if (d < 0) {
return Messages.Executor_NotAvailable();
}
long eta = d - getElapsedTime();
if (eta <= 0) {
return Messages.Executor_NotAvailable();
}
return U... | java | public String getEstimatedRemainingTime() {
long d = executableEstimatedDuration;
if (d < 0) {
return Messages.Executor_NotAvailable();
}
long eta = d - getElapsedTime();
if (eta <= 0) {
return Messages.Executor_NotAvailable();
}
return U... | [
"public",
"String",
"getEstimatedRemainingTime",
"(",
")",
"{",
"long",
"d",
"=",
"executableEstimatedDuration",
";",
"if",
"(",
"d",
"<",
"0",
")",
"{",
"return",
"Messages",
".",
"Executor_NotAvailable",
"(",
")",
";",
"}",
"long",
"eta",
"=",
"d",
"-",
... | Computes a human-readable text that shows the expected remaining time
until the build completes. | [
"Computes",
"a",
"human",
"-",
"readable",
"text",
"that",
"shows",
"the",
"expected",
"remaining",
"time",
"until",
"the",
"build",
"completes",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L777-L789 |
125,416 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.doStop | @RequirePOST
public HttpResponse doStop() {
lock.writeLock().lock(); // need write lock as interrupt will change the field
try {
if (executable != null) {
getParentOf(executable).getOwnerTask().checkAbortPermission();
interrupt();
}
} f... | java | @RequirePOST
public HttpResponse doStop() {
lock.writeLock().lock(); // need write lock as interrupt will change the field
try {
if (executable != null) {
getParentOf(executable).getOwnerTask().checkAbortPermission();
interrupt();
}
} f... | [
"@",
"RequirePOST",
"public",
"HttpResponse",
"doStop",
"(",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"// need write lock as interrupt will change the field",
"try",
"{",
"if",
"(",
"executable",
"!=",
"null",
")",
"{",
"getPar... | Stops the current build.
@since 1.489 | [
"Stops",
"the",
"current",
"build",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L846-L858 |
125,417 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.hasStopPermission | public boolean hasStopPermission() {
lock.readLock().lock();
try {
return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission();
} finally {
lock.readLock().unlock();
}
} | java | public boolean hasStopPermission() {
lock.readLock().lock();
try {
return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission();
} finally {
lock.readLock().unlock();
}
} | [
"public",
"boolean",
"hasStopPermission",
"(",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"executable",
"!=",
"null",
"&&",
"getParentOf",
"(",
"executable",
")",
".",
"getOwnerTask",
"(",
")",
".",
"... | Checks if the current user has a permission to stop this build. | [
"Checks",
"if",
"the",
"current",
"user",
"has",
"a",
"permission",
"to",
"stop",
"this",
"build",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L871-L878 |
125,418 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.getIdleStartMilliseconds | public long getIdleStartMilliseconds() {
if (isIdle())
return Math.max(creationTime, owner.getConnectTime());
else {
return Math.max(startTime + Math.max(0, executableEstimatedDuration), System.currentTimeMillis() + 15000);
}
} | java | public long getIdleStartMilliseconds() {
if (isIdle())
return Math.max(creationTime, owner.getConnectTime());
else {
return Math.max(startTime + Math.max(0, executableEstimatedDuration), System.currentTimeMillis() + 15000);
}
} | [
"public",
"long",
"getIdleStartMilliseconds",
"(",
")",
"{",
"if",
"(",
"isIdle",
"(",
")",
")",
"return",
"Math",
".",
"max",
"(",
"creationTime",
",",
"owner",
".",
"getConnectTime",
"(",
")",
")",
";",
"else",
"{",
"return",
"Math",
".",
"max",
"(",... | Returns when this executor started or should start being idle. | [
"Returns",
"when",
"this",
"executor",
"started",
"or",
"should",
"start",
"being",
"idle",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L887-L893 |
125,419 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.newImpersonatingProxy | public <T> T newImpersonatingProxy(Class<T> type, T core) {
return new InterceptingProxy() {
protected Object call(Object o, Method m, Object[] args) throws Throwable {
final Executor old = IMPERSONATION.get();
IMPERSONATION.set(Executor.this);
try {
... | java | public <T> T newImpersonatingProxy(Class<T> type, T core) {
return new InterceptingProxy() {
protected Object call(Object o, Method m, Object[] args) throws Throwable {
final Executor old = IMPERSONATION.get();
IMPERSONATION.set(Executor.this);
try {
... | [
"public",
"<",
"T",
">",
"T",
"newImpersonatingProxy",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"core",
")",
"{",
"return",
"new",
"InterceptingProxy",
"(",
")",
"{",
"protected",
"Object",
"call",
"(",
"Object",
"o",
",",
"Method",
"m",
",",
"... | Creates a proxy object that executes the callee in the context that impersonates
this executor. Useful to export an object to a remote channel. | [
"Creates",
"a",
"proxy",
"object",
"that",
"executes",
"the",
"callee",
"in",
"the",
"context",
"that",
"impersonates",
"this",
"executor",
".",
"Useful",
"to",
"export",
"an",
"object",
"to",
"a",
"remote",
"channel",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L906-L918 |
125,420 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.currentExecutor | public static @CheckForNull Executor currentExecutor() {
Thread t = Thread.currentThread();
if (t instanceof Executor) return (Executor) t;
return IMPERSONATION.get();
} | java | public static @CheckForNull Executor currentExecutor() {
Thread t = Thread.currentThread();
if (t instanceof Executor) return (Executor) t;
return IMPERSONATION.get();
} | [
"public",
"static",
"@",
"CheckForNull",
"Executor",
"currentExecutor",
"(",
")",
"{",
"Thread",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"if",
"(",
"t",
"instanceof",
"Executor",
")",
"return",
"(",
"Executor",
")",
"t",
";",
"return",
"... | Returns the executor of the current thread or null if current thread is not an executor. | [
"Returns",
"the",
"executor",
"of",
"the",
"current",
"thread",
"or",
"null",
"if",
"current",
"thread",
"is",
"not",
"an",
"executor",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L923-L927 |
125,421 | jenkinsci/jenkins | core/src/main/java/hudson/model/Executor.java | Executor.of | @CheckForNull
public static Executor of(Executable executable) {
Jenkins jenkins = Jenkins.getInstanceOrNull(); // TODO confirm safe to assume non-null and use getInstance()
if (jenkins == null) {
return null;
}
for (Computer computer : jenkins.getComputers()) {
... | java | @CheckForNull
public static Executor of(Executable executable) {
Jenkins jenkins = Jenkins.getInstanceOrNull(); // TODO confirm safe to assume non-null and use getInstance()
if (jenkins == null) {
return null;
}
for (Computer computer : jenkins.getComputers()) {
... | [
"@",
"CheckForNull",
"public",
"static",
"Executor",
"of",
"(",
"Executable",
"executable",
")",
"{",
"Jenkins",
"jenkins",
"=",
"Jenkins",
".",
"getInstanceOrNull",
"(",
")",
";",
"// TODO confirm safe to assume non-null and use getInstance()",
"if",
"(",
"jenkins",
... | Finds the executor currently running a given process.
@param executable a possibly running executable
@return the executor (possibly a {@link OneOffExecutor}) whose {@link Executor#getCurrentExecutable} matches that,
or null if it could not be found (for example because the execution has already completed)
@since 1.607 | [
"Finds",
"the",
"executor",
"currently",
"running",
"a",
"given",
"process",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Executor.java#L936-L950 |
125,422 | jenkinsci/jenkins | core/src/main/java/hudson/search/Search.java | Search.getSuggestions | public SearchResult getSuggestions(StaplerRequest req, String query) {
Set<String> paths = new HashSet<>(); // paths already added, to control duplicates
SearchResultImpl r = new SearchResultImpl();
int max = req.hasParameter("max") ? Integer.parseInt(req.getParameter("max")) : 100;
Sea... | java | public SearchResult getSuggestions(StaplerRequest req, String query) {
Set<String> paths = new HashSet<>(); // paths already added, to control duplicates
SearchResultImpl r = new SearchResultImpl();
int max = req.hasParameter("max") ? Integer.parseInt(req.getParameter("max")) : 100;
Sea... | [
"public",
"SearchResult",
"getSuggestions",
"(",
"StaplerRequest",
"req",
",",
"String",
"query",
")",
"{",
"Set",
"<",
"String",
">",
"paths",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"// paths already added, to control duplicates",
"SearchResultImpl",
"r",
"=... | Gets the list of suggestions that match the given query.
@return
can be empty but never null. The size of the list is always smaller than
a certain threshold to avoid showing too many options. | [
"Gets",
"the",
"list",
"of",
"suggestions",
"that",
"match",
"the",
"given",
"query",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L144-L158 |
125,423 | jenkinsci/jenkins | core/src/main/java/hudson/search/Search.java | Search.makeSuggestIndex | private SearchIndex makeSuggestIndex(StaplerRequest req) {
SearchIndexBuilder builder = new SearchIndexBuilder();
for (Ancestor a : req.getAncestors()) {
if (a.getObject() instanceof SearchableModelObject) {
SearchableModelObject smo = (SearchableModelObject) a.getObject();
... | java | private SearchIndex makeSuggestIndex(StaplerRequest req) {
SearchIndexBuilder builder = new SearchIndexBuilder();
for (Ancestor a : req.getAncestors()) {
if (a.getObject() instanceof SearchableModelObject) {
SearchableModelObject smo = (SearchableModelObject) a.getObject();
... | [
"private",
"SearchIndex",
"makeSuggestIndex",
"(",
"StaplerRequest",
"req",
")",
"{",
"SearchIndexBuilder",
"builder",
"=",
"new",
"SearchIndexBuilder",
"(",
")",
";",
"for",
"(",
"Ancestor",
"a",
":",
"req",
".",
"getAncestors",
"(",
")",
")",
"{",
"if",
"(... | Creates merged search index for suggestion. | [
"Creates",
"merged",
"search",
"index",
"for",
"suggestion",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L174-L183 |
125,424 | jenkinsci/jenkins | core/src/main/java/hudson/search/Search.java | Search.findClosestSuggestedItem | static SuggestedItem findClosestSuggestedItem(List<SuggestedItem> r, String query) {
for(SuggestedItem curItem : r) {
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(String.format("item's searchUrl:%s;query=%s", curItem.item.getSearchUrl(), query));
}
if(curIt... | java | static SuggestedItem findClosestSuggestedItem(List<SuggestedItem> r, String query) {
for(SuggestedItem curItem : r) {
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(String.format("item's searchUrl:%s;query=%s", curItem.item.getSearchUrl(), query));
}
if(curIt... | [
"static",
"SuggestedItem",
"findClosestSuggestedItem",
"(",
"List",
"<",
"SuggestedItem",
">",
"r",
",",
"String",
"query",
")",
"{",
"for",
"(",
"SuggestedItem",
"curItem",
":",
"r",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isLoggable",
"(",
"Level",
".",
"FI... | When there are multiple suggested items, this method can narrow down the resultset
to the SuggestedItem that has a url that contains the query. This is useful is one
job has a display name that matches another job's project name.
@param r A list of Suggested items. It is assumed that there is at least one
SuggestedItem... | [
"When",
"there",
"are",
"multiple",
"suggested",
"items",
"this",
"method",
"can",
"narrow",
"down",
"the",
"resultset",
"to",
"the",
"SuggestedItem",
"that",
"has",
"a",
"url",
"that",
"contains",
"the",
"query",
".",
"This",
"is",
"useful",
"is",
"one",
... | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L237-L250 |
125,425 | jenkinsci/jenkins | core/src/main/java/hudson/search/Search.java | Search.find | public static SuggestedItem find(SearchIndex index, String query, SearchableModelObject searchContext) {
List<SuggestedItem> r = find(Mode.FIND, index, query, searchContext);
if(r.isEmpty()){
return null;
}
else if(1==r.size()){
return r.get(0);
}
... | java | public static SuggestedItem find(SearchIndex index, String query, SearchableModelObject searchContext) {
List<SuggestedItem> r = find(Mode.FIND, index, query, searchContext);
if(r.isEmpty()){
return null;
}
else if(1==r.size()){
return r.get(0);
}
... | [
"public",
"static",
"SuggestedItem",
"find",
"(",
"SearchIndex",
"index",
",",
"String",
"query",
",",
"SearchableModelObject",
"searchContext",
")",
"{",
"List",
"<",
"SuggestedItem",
">",
"r",
"=",
"find",
"(",
"Mode",
".",
"FIND",
",",
"index",
",",
"quer... | Performs a search and returns the match, or null if no match was found
or more than one match was found.
@since 1.527 | [
"Performs",
"a",
"search",
"and",
"returns",
"the",
"match",
"or",
"null",
"if",
"no",
"match",
"was",
"found",
"or",
"more",
"than",
"one",
"match",
"was",
"found",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L265-L279 |
125,426 | jenkinsci/jenkins | core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java | AdminWhitelistRule.transformForWindows | private InputStream transformForWindows(InputStream src) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(src));
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (PrintStream p = new PrintStream(out)) {
String line;
while ((line... | java | private InputStream transformForWindows(InputStream src) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(src));
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (PrintStream p = new PrintStream(out)) {
String line;
while ((line... | [
"private",
"InputStream",
"transformForWindows",
"(",
"InputStream",
"src",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"r",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"src",
")",
")",
";",
"ByteArrayOutputStream",
"out",
"=",
"ne... | Transform path for Windows. | [
"Transform",
"path",
"for",
"Windows",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java#L114-L126 |
125,427 | jenkinsci/jenkins | core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java | AdminWhitelistRule.doApproveAll | @RequirePOST
public HttpResponse doApproveAll() throws IOException {
StringBuilder buf = new StringBuilder();
for (Class c : rejected.get()) {
buf.append(c.getName()).append('\n');
}
whitelisted.append(buf.toString());
return HttpResponses.ok();
} | java | @RequirePOST
public HttpResponse doApproveAll() throws IOException {
StringBuilder buf = new StringBuilder();
for (Class c : rejected.get()) {
buf.append(c.getName()).append('\n');
}
whitelisted.append(buf.toString());
return HttpResponses.ok();
} | [
"@",
"RequirePOST",
"public",
"HttpResponse",
"doApproveAll",
"(",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Class",
"c",
":",
"rejected",
".",
"get",
"(",
")",
")",
"{",
"buf",
".... | Approves all the currently rejected subjects | [
"Approves",
"all",
"the",
"currently",
"rejected",
"subjects"
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/s2m/AdminWhitelistRule.java#L187-L196 |
125,428 | jenkinsci/jenkins | core/src/main/java/hudson/security/csrf/CrumbIssuerDescriptor.java | CrumbIssuerDescriptor.setCrumbSalt | public void setCrumbSalt(String salt) {
if (Util.fixEmptyAndTrim(salt) == null) {
crumbSalt = "hudson.crumb";
} else {
crumbSalt = salt;
}
} | java | public void setCrumbSalt(String salt) {
if (Util.fixEmptyAndTrim(salt) == null) {
crumbSalt = "hudson.crumb";
} else {
crumbSalt = salt;
}
} | [
"public",
"void",
"setCrumbSalt",
"(",
"String",
"salt",
")",
"{",
"if",
"(",
"Util",
".",
"fixEmptyAndTrim",
"(",
"salt",
")",
"==",
"null",
")",
"{",
"crumbSalt",
"=",
"\"hudson.crumb\"",
";",
"}",
"else",
"{",
"crumbSalt",
"=",
"salt",
";",
"}",
"}"... | Set the salt value. Must not be null.
@param salt | [
"Set",
"the",
"salt",
"value",
".",
"Must",
"not",
"be",
"null",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/csrf/CrumbIssuerDescriptor.java#L44-L50 |
125,429 | jenkinsci/jenkins | core/src/main/java/hudson/security/csrf/CrumbIssuerDescriptor.java | CrumbIssuerDescriptor.setCrumbRequestField | public void setCrumbRequestField(String requestField) {
if (Util.fixEmptyAndTrim(requestField) == null) {
crumbRequestField = CrumbIssuer.DEFAULT_CRUMB_NAME;
} else {
crumbRequestField = requestField;
}
} | java | public void setCrumbRequestField(String requestField) {
if (Util.fixEmptyAndTrim(requestField) == null) {
crumbRequestField = CrumbIssuer.DEFAULT_CRUMB_NAME;
} else {
crumbRequestField = requestField;
}
} | [
"public",
"void",
"setCrumbRequestField",
"(",
"String",
"requestField",
")",
"{",
"if",
"(",
"Util",
".",
"fixEmptyAndTrim",
"(",
"requestField",
")",
"==",
"null",
")",
"{",
"crumbRequestField",
"=",
"CrumbIssuer",
".",
"DEFAULT_CRUMB_NAME",
";",
"}",
"else",
... | Set the request parameter name. Must not be null.
@param requestField | [
"Set",
"the",
"request",
"parameter",
"name",
".",
"Must",
"not",
"be",
"null",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/csrf/CrumbIssuerDescriptor.java#L65-L71 |
125,430 | jenkinsci/jenkins | core/src/main/java/jenkins/security/RSADigitalSignatureConfidentialKey.java | RSADigitalSignatureConfidentialKey.sign | public String sign(String msg) {
try {
RSAPrivateKey key = getPrivateKey();
Signature sig = Signature.getInstance(SIGNING_ALGORITHM + "with" + key.getAlgorithm());
sig.initSign(key);
sig.update(msg.getBytes(StandardCharsets.UTF_8));
return hudson.remot... | java | public String sign(String msg) {
try {
RSAPrivateKey key = getPrivateKey();
Signature sig = Signature.getInstance(SIGNING_ALGORITHM + "with" + key.getAlgorithm());
sig.initSign(key);
sig.update(msg.getBytes(StandardCharsets.UTF_8));
return hudson.remot... | [
"public",
"String",
"sign",
"(",
"String",
"msg",
")",
"{",
"try",
"{",
"RSAPrivateKey",
"key",
"=",
"getPrivateKey",
"(",
")",
";",
"Signature",
"sig",
"=",
"Signature",
".",
"getInstance",
"(",
"SIGNING_ALGORITHM",
"+",
"\"with\"",
"+",
"key",
".",
"getA... | Sign a message and base64 encode the signature. | [
"Sign",
"a",
"message",
"and",
"base64",
"encode",
"the",
"signature",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/RSADigitalSignatureConfidentialKey.java#L49-L59 |
125,431 | jenkinsci/jenkins | core/src/main/java/hudson/util/IOUtils.java | IOUtils.drain | public static void drain(InputStream in) throws IOException {
org.apache.commons.io.IOUtils.copy(in, new NullStream());
in.close();
} | java | public static void drain(InputStream in) throws IOException {
org.apache.commons.io.IOUtils.copy(in, new NullStream());
in.close();
} | [
"public",
"static",
"void",
"drain",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"org",
".",
"apache",
".",
"commons",
".",
"io",
".",
"IOUtils",
".",
"copy",
"(",
"in",
",",
"new",
"NullStream",
"(",
")",
")",
";",
"in",
".",
"close... | Drains the input stream and closes it. | [
"Drains",
"the",
"input",
"stream",
"and",
"closes",
"it",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/IOUtils.java#L28-L31 |
125,432 | jenkinsci/jenkins | core/src/main/java/hudson/util/IOUtils.java | IOUtils.skip | public static InputStream skip(InputStream in, long size) throws IOException {
DataInputStream di = new DataInputStream(in);
while (size>0) {
int chunk = (int)Math.min(SKIP_BUFFER.length,size);
di.readFully(SKIP_BUFFER,0,chunk);
size -= chunk;
}
retu... | java | public static InputStream skip(InputStream in, long size) throws IOException {
DataInputStream di = new DataInputStream(in);
while (size>0) {
int chunk = (int)Math.min(SKIP_BUFFER.length,size);
di.readFully(SKIP_BUFFER,0,chunk);
size -= chunk;
}
retu... | [
"public",
"static",
"InputStream",
"skip",
"(",
"InputStream",
"in",
",",
"long",
"size",
")",
"throws",
"IOException",
"{",
"DataInputStream",
"di",
"=",
"new",
"DataInputStream",
"(",
"in",
")",
";",
"while",
"(",
"size",
">",
"0",
")",
"{",
"int",
"ch... | Fully skips the specified size from the given input stream.
<p>
{@link InputStream#skip(long)} has two problems. One is that
it doesn't let us reliably differentiate "hit EOF" case vs "inputstream just returning 0 since there's no data
currently available at hand", and some subtypes (such as {@link FileInputStream#ski... | [
"Fully",
"skips",
"the",
"specified",
"size",
"from",
"the",
"given",
"input",
"stream",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/IOUtils.java#L76-L86 |
125,433 | jenkinsci/jenkins | core/src/main/java/hudson/util/IOUtils.java | IOUtils.readFirstLine | public static String readFirstLine(InputStream is, String encoding) throws IOException {
try (BufferedReader reader = new BufferedReader(
encoding == null ? new InputStreamReader(is) : new InputStreamReader(is, encoding))) {
return reader.readLine();
}
} | java | public static String readFirstLine(InputStream is, String encoding) throws IOException {
try (BufferedReader reader = new BufferedReader(
encoding == null ? new InputStreamReader(is) : new InputStreamReader(is, encoding))) {
return reader.readLine();
}
} | [
"public",
"static",
"String",
"readFirstLine",
"(",
"InputStream",
"is",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"encoding",
"==",
"null",
"?",
"new",
"InputStreamRe... | Read the first line of the given stream, close it, and return that line.
@param encoding
If null, use the platform default encoding.
@since 1.422 | [
"Read",
"the",
"first",
"line",
"of",
"the",
"given",
"stream",
"close",
"it",
"and",
"return",
"that",
"line",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/IOUtils.java#L146-L151 |
125,434 | jenkinsci/jenkins | core/src/main/java/jenkins/util/xml/XMLUtils.java | XMLUtils._transform | private static void _transform(Source source, Result out) throws TransformerException {
TransformerFactory factory = TransformerFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
// this allows us to use UTF-8 for storing data,
// plus it checks any... | java | private static void _transform(Source source, Result out) throws TransformerException {
TransformerFactory factory = TransformerFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
// this allows us to use UTF-8 for storing data,
// plus it checks any... | [
"private",
"static",
"void",
"_transform",
"(",
"Source",
"source",
",",
"Result",
"out",
")",
"throws",
"TransformerException",
"{",
"TransformerFactory",
"factory",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setFeature",
"(",
... | potentially unsafe XML transformation.
@param source The XML input to transform.
@param out The Result of transforming the <code>source</code>. | [
"potentially",
"unsafe",
"XML",
"transformation",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/xml/XMLUtils.java#L203-L211 |
125,435 | jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.calcFillSettings | public void calcFillSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doFill" + capitalizedFieldName + "Items";
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(method=... | java | public void calcFillSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doFill" + capitalizedFieldName + "Items";
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(method=... | [
"public",
"void",
"calcFillSettings",
"(",
"String",
"field",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"String",
"capitalizedFieldName",
"=",
"StringUtils",
".",
"capitalize",
"(",
"field",
")",
";",
"String",
"methodName",
"=",
... | Computes the list of other form fields that the given field depends on, via the doFillXyzItems method,
and sets that as the 'fillDependsOn' attribute. Also computes the URL of the doFillXyzItems and
sets that as the 'fillUrl' attribute. | [
"Computes",
"the",
"list",
"of",
"other",
"form",
"fields",
"that",
"the",
"given",
"field",
"depends",
"on",
"via",
"the",
"doFillXyzItems",
"method",
"and",
"sets",
"that",
"as",
"the",
"fillDependsOn",
"attribute",
".",
"Also",
"computes",
"the",
"URL",
"... | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L411-L424 |
125,436 | jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.calcAutoCompleteSettings | public void calcAutoCompleteSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doAutoComplete" + capitalizedFieldName;
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(m... | java | public void calcAutoCompleteSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doAutoComplete" + capitalizedFieldName;
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(m... | [
"public",
"void",
"calcAutoCompleteSettings",
"(",
"String",
"field",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"String",
"capitalizedFieldName",
"=",
"StringUtils",
".",
"capitalize",
"(",
"field",
")",
";",
"String",
"methodName",
... | Computes the auto-completion setting | [
"Computes",
"the",
"auto",
"-",
"completion",
"setting"
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L453-L461 |
125,437 | jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.getGlobalPropertyType | public PropertyType getGlobalPropertyType(String field) {
if(globalPropertyTypes==null)
globalPropertyTypes = buildPropertyTypes(getClass());
return globalPropertyTypes.get(field);
} | java | public PropertyType getGlobalPropertyType(String field) {
if(globalPropertyTypes==null)
globalPropertyTypes = buildPropertyTypes(getClass());
return globalPropertyTypes.get(field);
} | [
"public",
"PropertyType",
"getGlobalPropertyType",
"(",
"String",
"field",
")",
"{",
"if",
"(",
"globalPropertyTypes",
"==",
"null",
")",
"globalPropertyTypes",
"=",
"buildPropertyTypes",
"(",
"getClass",
"(",
")",
")",
";",
"return",
"globalPropertyTypes",
".",
"... | Obtains the property type of the given field of this descriptor. | [
"Obtains",
"the",
"property",
"type",
"of",
"the",
"given",
"field",
"of",
"this",
"descriptor",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L499-L503 |
125,438 | jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.addHelpFileRedirect | protected void addHelpFileRedirect(String fieldName, Class<? extends Describable> owner, String fieldNameToRedirectTo) {
helpRedirect.put(fieldName, new HelpRedirect(owner,fieldNameToRedirectTo));
} | java | protected void addHelpFileRedirect(String fieldName, Class<? extends Describable> owner, String fieldNameToRedirectTo) {
helpRedirect.put(fieldName, new HelpRedirect(owner,fieldNameToRedirectTo));
} | [
"protected",
"void",
"addHelpFileRedirect",
"(",
"String",
"fieldName",
",",
"Class",
"<",
"?",
"extends",
"Describable",
">",
"owner",
",",
"String",
"fieldNameToRedirectTo",
")",
"{",
"helpRedirect",
".",
"put",
"(",
"fieldName",
",",
"new",
"HelpRedirect",
"(... | Tells Jenkins that the help file for the field 'fieldName' is defined in the help file for
the 'fieldNameToRedirectTo' in the 'owner' class.
@since 1.425 | [
"Tells",
"Jenkins",
"that",
"the",
"help",
"file",
"for",
"the",
"field",
"fieldName",
"is",
"defined",
"in",
"the",
"help",
"file",
"for",
"the",
"fieldNameToRedirectTo",
"in",
"the",
"owner",
"class",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L770-L772 |
125,439 | jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.findById | public static @CheckForNull <T extends Descriptor> T findById(Collection<? extends T> list, String id) {
for (T d : list) {
if(d.getId().equals(id))
return d;
}
return null;
} | java | public static @CheckForNull <T extends Descriptor> T findById(Collection<? extends T> list, String id) {
for (T d : list) {
if(d.getId().equals(id))
return d;
}
return null;
} | [
"public",
"static",
"@",
"CheckForNull",
"<",
"T",
"extends",
"Descriptor",
">",
"T",
"findById",
"(",
"Collection",
"<",
"?",
"extends",
"T",
">",
"list",
",",
"String",
"id",
")",
"{",
"for",
"(",
"T",
"d",
":",
"list",
")",
"{",
"if",
"(",
"d",
... | Finds a descriptor from a collection by its ID.
@param id should match {@link #getId}
@since 1.610 | [
"Finds",
"a",
"descriptor",
"from",
"a",
"collection",
"by",
"its",
"ID",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L1074-L1080 |
125,440 | jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.find | public static @CheckForNull <T extends Descriptor> T find(Collection<? extends T> list, String string) {
T d = findByClassName(list, string);
if (d != null) {
return d;
}
return findById(list, string);
} | java | public static @CheckForNull <T extends Descriptor> T find(Collection<? extends T> list, String string) {
T d = findByClassName(list, string);
if (d != null) {
return d;
}
return findById(list, string);
} | [
"public",
"static",
"@",
"CheckForNull",
"<",
"T",
"extends",
"Descriptor",
">",
"T",
"find",
"(",
"Collection",
"<",
"?",
"extends",
"T",
">",
"list",
",",
"String",
"string",
")",
"{",
"T",
"d",
"=",
"findByClassName",
"(",
"list",
",",
"string",
")"... | Finds a descriptor from a collection by its class name or ID.
@deprecated choose between {@link #findById} or {@link #findByDescribableClassName} | [
"Finds",
"a",
"descriptor",
"from",
"a",
"collection",
"by",
"its",
"class",
"name",
"or",
"ID",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L1111-L1117 |
125,441 | jenkinsci/jenkins | cli/src/main/java/hudson/cli/FullDuplexHttpStream.java | FullDuplexHttpStream.tryToResolveRedirects | private URL tryToResolveRedirects(URL base, String authorization) {
try {
HttpURLConnection con = (HttpURLConnection) base.openConnection();
if (authorization != null) {
con.addRequestProperty("Authorization", authorization);
}
con.getInputStream()... | java | private URL tryToResolveRedirects(URL base, String authorization) {
try {
HttpURLConnection con = (HttpURLConnection) base.openConnection();
if (authorization != null) {
con.addRequestProperty("Authorization", authorization);
}
con.getInputStream()... | [
"private",
"URL",
"tryToResolveRedirects",
"(",
"URL",
"base",
",",
"String",
"authorization",
")",
"{",
"try",
"{",
"HttpURLConnection",
"con",
"=",
"(",
"HttpURLConnection",
")",
"base",
".",
"openConnection",
"(",
")",
";",
"if",
"(",
"authorization",
"!=",... | As this transport mode is using POST, it is necessary to resolve possible redirections using GET first. | [
"As",
"this",
"transport",
"mode",
"is",
"using",
"POST",
"it",
"is",
"necessary",
"to",
"resolve",
"possible",
"redirections",
"using",
"GET",
"first",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/FullDuplexHttpStream.java#L96-L111 |
125,442 | jenkinsci/jenkins | core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java | AbstractAsyncNodeMonitorDescriptor.monitorDetailed | protected final @Nonnull Result<T> monitorDetailed() throws InterruptedException {
Map<Computer,Future<T>> futures = new HashMap<>();
Set<Computer> skipped = new HashSet<>();
for (Computer c : Jenkins.getInstance().getComputers()) {
try {
VirtualChannel ch = c.getCha... | java | protected final @Nonnull Result<T> monitorDetailed() throws InterruptedException {
Map<Computer,Future<T>> futures = new HashMap<>();
Set<Computer> skipped = new HashSet<>();
for (Computer c : Jenkins.getInstance().getComputers()) {
try {
VirtualChannel ch = c.getCha... | [
"protected",
"final",
"@",
"Nonnull",
"Result",
"<",
"T",
">",
"monitorDetailed",
"(",
")",
"throws",
"InterruptedException",
"{",
"Map",
"<",
"Computer",
",",
"Future",
"<",
"T",
">",
">",
"futures",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Set",
... | Perform monitoring with detailed reporting. | [
"Perform",
"monitoring",
"with",
"detailed",
"reporting",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/node_monitors/AbstractAsyncNodeMonitorDescriptor.java#L82-L122 |
125,443 | jenkinsci/jenkins | core/src/main/java/hudson/Main.java | Main.open | private static HttpURLConnection open(URL url) throws IOException {
HttpURLConnection c = (HttpURLConnection)url.openConnection();
c.setReadTimeout(TIMEOUT);
c.setConnectTimeout(TIMEOUT);
return c;
} | java | private static HttpURLConnection open(URL url) throws IOException {
HttpURLConnection c = (HttpURLConnection)url.openConnection();
c.setReadTimeout(TIMEOUT);
c.setConnectTimeout(TIMEOUT);
return c;
} | [
"private",
"static",
"HttpURLConnection",
"open",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"HttpURLConnection",
"c",
"=",
"(",
"HttpURLConnection",
")",
"url",
".",
"openConnection",
"(",
")",
";",
"c",
".",
"setReadTimeout",
"(",
"TIMEOUT",
")",
... | Connects to the given HTTP URL and configure time out, to avoid infinite hang. | [
"Connects",
"to",
"the",
"given",
"HTTP",
"URL",
"and",
"configure",
"time",
"out",
"to",
"avoid",
"infinite",
"hang",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Main.java#L211-L216 |
125,444 | jenkinsci/jenkins | core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java | AdministrativeMonitorsDecorator.shouldDisplay | public boolean shouldDisplay() throws IOException, ServletException {
if (!Functions.hasPermission(Jenkins.ADMINISTER)) {
return false;
}
StaplerRequest req = Stapler.getCurrentRequest();
if (req == null) {
return false;
}
List<Ancestor> ancestor... | java | public boolean shouldDisplay() throws IOException, ServletException {
if (!Functions.hasPermission(Jenkins.ADMINISTER)) {
return false;
}
StaplerRequest req = Stapler.getCurrentRequest();
if (req == null) {
return false;
}
List<Ancestor> ancestor... | [
"public",
"boolean",
"shouldDisplay",
"(",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"!",
"Functions",
".",
"hasPermission",
"(",
"Jenkins",
".",
"ADMINISTER",
")",
")",
"{",
"return",
"false",
";",
"}",
"StaplerRequest",
"req",
... | Whether the administrative monitors notifier should be shown.
@return true iff the administrative monitors notifier should be shown.
@throws IOException
@throws ServletException | [
"Whether",
"the",
"administrative",
"monitors",
"notifier",
"should",
"be",
"shown",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/management/AdministrativeMonitorsDecorator.java#L97-L140 |
125,445 | jenkinsci/jenkins | core/src/main/java/jenkins/util/Timer.java | Timer.get | @Nonnull
public static synchronized ScheduledExecutorService get() {
if (executorService == null) {
// corePoolSize is set to 10, but will only be created if needed.
// ScheduledThreadPoolExecutor "acts as a fixed-sized pool using corePoolSize threads"
// TODO consider al... | java | @Nonnull
public static synchronized ScheduledExecutorService get() {
if (executorService == null) {
// corePoolSize is set to 10, but will only be created if needed.
// ScheduledThreadPoolExecutor "acts as a fixed-sized pool using corePoolSize threads"
// TODO consider al... | [
"@",
"Nonnull",
"public",
"static",
"synchronized",
"ScheduledExecutorService",
"get",
"(",
")",
"{",
"if",
"(",
"executorService",
"==",
"null",
")",
"{",
"// corePoolSize is set to 10, but will only be created if needed.",
"// ScheduledThreadPoolExecutor \"acts as a fixed-sized... | Returns the scheduled executor service used by all timed tasks in Jenkins.
@return the single {@link ScheduledExecutorService}. | [
"Returns",
"the",
"scheduled",
"executor",
"service",
"used",
"by",
"all",
"timed",
"tasks",
"in",
"Jenkins",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/Timer.java#L41-L50 |
125,446 | jenkinsci/jenkins | core/src/main/java/hudson/security/AuthenticationProcessingFilter2.java | AuthenticationProcessingFilter2.onUnsuccessfulAuthentication | @Override
protected void onUnsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException {
super.onUnsuccessfulAuthentication(request, response, failed);
LOGGER.log(Level.FINE, "Login attempt failed", failed);
Authenti... | java | @Override
protected void onUnsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException {
super.onUnsuccessfulAuthentication(request, response, failed);
LOGGER.log(Level.FINE, "Login attempt failed", failed);
Authenti... | [
"@",
"Override",
"protected",
"void",
"onUnsuccessfulAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"AuthenticationException",
"failed",
")",
"throws",
"IOException",
"{",
"super",
".",
"onUnsuccessfulAuthentication",
"("... | Leave the information about login failure.
<p>
Otherwise it seems like Acegi doesn't really leave the detail of the failure anywhere. | [
"Leave",
"the",
"information",
"about",
"login",
"failure",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/AuthenticationProcessingFilter2.java#L115-L123 |
125,447 | jenkinsci/jenkins | core/src/main/java/hudson/util/PluginServletFilter.java | PluginServletFilter.hasFilter | public static boolean hasFilter(Filter filter) {
Jenkins j = Jenkins.getInstanceOrNull();
PluginServletFilter container = null;
if(j != null) {
container = getInstance(j.servletContext);
}
if (j == null || container == null) {
return LEGACY.contains(filter... | java | public static boolean hasFilter(Filter filter) {
Jenkins j = Jenkins.getInstanceOrNull();
PluginServletFilter container = null;
if(j != null) {
container = getInstance(j.servletContext);
}
if (j == null || container == null) {
return LEGACY.contains(filter... | [
"public",
"static",
"boolean",
"hasFilter",
"(",
"Filter",
"filter",
")",
"{",
"Jenkins",
"j",
"=",
"Jenkins",
".",
"getInstanceOrNull",
"(",
")",
";",
"PluginServletFilter",
"container",
"=",
"null",
";",
"if",
"(",
"j",
"!=",
"null",
")",
"{",
"container... | Checks whether the given filter is already registered in the chain.
@param filter the filter to check.
@return true if the filter is already registered in the chain.
@since 2.94 | [
"Checks",
"whether",
"the",
"given",
"filter",
"is",
"already",
"registered",
"in",
"the",
"chain",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/PluginServletFilter.java#L122-L133 |
125,448 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractCIBase.java | AbstractCIBase.updateComputerList | protected void updateComputerList(final boolean automaticSlaveLaunch) {
final Map<Node,Computer> computers = getComputerMap();
final Set<Computer> old = new HashSet<Computer>(computers.size());
Queue.withLock(new Runnable() {
@Override
public void run() {
... | java | protected void updateComputerList(final boolean automaticSlaveLaunch) {
final Map<Node,Computer> computers = getComputerMap();
final Set<Computer> old = new HashSet<Computer>(computers.size());
Queue.withLock(new Runnable() {
@Override
public void run() {
... | [
"protected",
"void",
"updateComputerList",
"(",
"final",
"boolean",
"automaticSlaveLaunch",
")",
"{",
"final",
"Map",
"<",
"Node",
",",
"Computer",
">",
"computers",
"=",
"getComputerMap",
"(",
")",
";",
"final",
"Set",
"<",
"Computer",
">",
"old",
"=",
"new... | Updates Computers.
<p>
This method tries to reuse existing {@link Computer} objects
so that we won't upset {@link Executor}s running in it. | [
"Updates",
"Computers",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractCIBase.java#L193-L243 |
125,449 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.error | public static FormValidation error(Throwable e, String message) {
return _error(Kind.ERROR, e, message);
} | java | public static FormValidation error(Throwable e, String message) {
return _error(Kind.ERROR, e, message);
} | [
"public",
"static",
"FormValidation",
"error",
"(",
"Throwable",
"e",
",",
"String",
"message",
")",
"{",
"return",
"_error",
"(",
"Kind",
".",
"ERROR",
",",
"e",
",",
"message",
")",
";",
"}"
] | Sends out a string error message, with optional "show details" link that expands to the full stack trace.
<p>
Use this with caution, so that anonymous users do not gain too much insights into the state of the system,
as error stack trace often reveals a lot of information. Consider if a check operation needs to be exp... | [
"Sends",
"out",
"a",
"string",
"error",
"message",
"with",
"optional",
"show",
"details",
"link",
"that",
"expands",
"to",
"the",
"full",
"stack",
"trace",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L189-L191 |
125,450 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.validateExecutable | public static FormValidation validateExecutable(String exe, FileValidator exeValidator) {
// insufficient permission to perform validation?
if(!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) return ok();
exe = fixEmpty(exe);
if(exe==null)
return ok();
if(e... | java | public static FormValidation validateExecutable(String exe, FileValidator exeValidator) {
// insufficient permission to perform validation?
if(!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) return ok();
exe = fixEmpty(exe);
if(exe==null)
return ok();
if(e... | [
"public",
"static",
"FormValidation",
"validateExecutable",
"(",
"String",
"exe",
",",
"FileValidator",
"exeValidator",
")",
"{",
"// insufficient permission to perform validation?",
"if",
"(",
"!",
"Jenkins",
".",
"getInstance",
"(",
")",
".",
"hasPermission",
"(",
"... | Makes sure that the given string points to an executable file.
@param exeValidator
If the validation process discovers a valid executable program on the given path,
the specified {@link FileValidator} can perform additional checks (such as making sure
that it has the right version, etc.) | [
"Makes",
"sure",
"that",
"the",
"given",
"string",
"points",
"to",
"an",
"executable",
"file",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L333-L383 |
125,451 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.validateNonNegativeInteger | public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.M... | java | public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.M... | [
"public",
"static",
"FormValidation",
"validateNonNegativeInteger",
"(",
"String",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"Integer",
".",
"parseInt",
"(",
"value",
")",
"<",
"0",
")",
"return",
"error",
"(",
"hudson",
".",
"model",
".",
"Messages",
".",... | Makes sure that the given string is a non-negative integer. | [
"Makes",
"sure",
"that",
"the",
"given",
"string",
"is",
"a",
"non",
"-",
"negative",
"integer",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L388-L396 |
125,452 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.validatePositiveInteger | public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messag... | java | public static FormValidation validatePositiveInteger(String value) {
try {
if(Integer.parseInt(value)<=0)
return error(hudson.model.Messages.Hudson_NotAPositiveNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.Messag... | [
"public",
"static",
"FormValidation",
"validatePositiveInteger",
"(",
"String",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"Integer",
".",
"parseInt",
"(",
"value",
")",
"<=",
"0",
")",
"return",
"error",
"(",
"hudson",
".",
"model",
".",
"Messages",
".",
... | Makes sure that the given string is a positive integer. | [
"Makes",
"sure",
"that",
"the",
"given",
"string",
"is",
"a",
"positive",
"integer",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L425-L433 |
125,453 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.validateRequired | public static FormValidation validateRequired(String value) {
if (Util.fixEmptyAndTrim(value) == null)
return error(Messages.FormValidation_ValidateRequired());
return ok();
} | java | public static FormValidation validateRequired(String value) {
if (Util.fixEmptyAndTrim(value) == null)
return error(Messages.FormValidation_ValidateRequired());
return ok();
} | [
"public",
"static",
"FormValidation",
"validateRequired",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"Util",
".",
"fixEmptyAndTrim",
"(",
"value",
")",
"==",
"null",
")",
"return",
"error",
"(",
"Messages",
".",
"FormValidation_ValidateRequired",
"(",
")",
"... | Makes sure that the given string is not null or empty. | [
"Makes",
"sure",
"that",
"the",
"given",
"string",
"is",
"not",
"null",
"or",
"empty",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L438-L442 |
125,454 | jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.validateBase64 | public static FormValidation validateBase64(String value, boolean allowWhitespace, boolean allowEmpty, String errorMessage) {
try {
String v = value;
if(!allowWhitespace) {
if(v.indexOf(' ')>=0 || v.indexOf('\n')>=0)
return error(errorMessage);
... | java | public static FormValidation validateBase64(String value, boolean allowWhitespace, boolean allowEmpty, String errorMessage) {
try {
String v = value;
if(!allowWhitespace) {
if(v.indexOf(' ')>=0 || v.indexOf('\n')>=0)
return error(errorMessage);
... | [
"public",
"static",
"FormValidation",
"validateBase64",
"(",
"String",
"value",
",",
"boolean",
"allowWhitespace",
",",
"boolean",
"allowEmpty",
",",
"String",
"errorMessage",
")",
"{",
"try",
"{",
"String",
"v",
"=",
"value",
";",
"if",
"(",
"!",
"allowWhites... | Makes sure that the given string is a base64 encoded text.
@param allowWhitespace
if you allow whitespace (CR,LF,etc) in base64 encoding
@param allowEmpty
Is empty string allowed?
@param errorMessage
Error message.
@since 1.305 | [
"Makes",
"sure",
"that",
"the",
"given",
"string",
"is",
"a",
"base64",
"encoded",
"text",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L455-L471 |
125,455 | jenkinsci/jenkins | core/src/main/java/jenkins/security/HMACConfidentialKey.java | HMACConfidentialKey.mac | public synchronized byte[] mac(byte[] message) {
ConfidentialStore cs = ConfidentialStore.get();
if (mac == null || cs != lastCS) {
lastCS = cs;
mac = createMac();
}
return chop(mac.doFinal(message));
} | java | public synchronized byte[] mac(byte[] message) {
ConfidentialStore cs = ConfidentialStore.get();
if (mac == null || cs != lastCS) {
lastCS = cs;
mac = createMac();
}
return chop(mac.doFinal(message));
} | [
"public",
"synchronized",
"byte",
"[",
"]",
"mac",
"(",
"byte",
"[",
"]",
"message",
")",
"{",
"ConfidentialStore",
"cs",
"=",
"ConfidentialStore",
".",
"get",
"(",
")",
";",
"if",
"(",
"mac",
"==",
"null",
"||",
"cs",
"!=",
"lastCS",
")",
"{",
"last... | Computes the message authentication code for the specified byte sequence. | [
"Computes",
"the",
"message",
"authentication",
"code",
"for",
"the",
"specified",
"byte",
"sequence",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/HMACConfidentialKey.java#L70-L77 |
125,456 | jenkinsci/jenkins | core/src/main/java/jenkins/security/HMACConfidentialKey.java | HMACConfidentialKey.mac | public String mac(String message) {
return Util.toHexString(mac(message.getBytes(StandardCharsets.UTF_8)));
} | java | public String mac(String message) {
return Util.toHexString(mac(message.getBytes(StandardCharsets.UTF_8)));
} | [
"public",
"String",
"mac",
"(",
"String",
"message",
")",
"{",
"return",
"Util",
".",
"toHexString",
"(",
"mac",
"(",
"message",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
")",
")",
";",
"}"
] | Computes the message authentication code and return it as a string.
While redundant, often convenient. | [
"Computes",
"the",
"message",
"authentication",
"code",
"and",
"return",
"it",
"as",
"a",
"string",
".",
"While",
"redundant",
"often",
"convenient",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/HMACConfidentialKey.java#L90-L92 |
125,457 | jenkinsci/jenkins | core/src/main/java/hudson/util/PersistedList.java | PersistedList.getAll | public <U extends T> List<U> getAll(Class<U> type) {
List<U> r = new ArrayList<>();
for (T t : data)
if(type.isInstance(t))
r.add(type.cast(t));
return r;
} | java | public <U extends T> List<U> getAll(Class<U> type) {
List<U> r = new ArrayList<>();
for (T t : data)
if(type.isInstance(t))
r.add(type.cast(t));
return r;
} | [
"public",
"<",
"U",
"extends",
"T",
">",
"List",
"<",
"U",
">",
"getAll",
"(",
"Class",
"<",
"U",
">",
"type",
")",
"{",
"List",
"<",
"U",
">",
"r",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"T",
"t",
":",
"data",
")",
"if",... | Gets all instances that matches the given type. | [
"Gets",
"all",
"instances",
"that",
"matches",
"the",
"given",
"type",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/PersistedList.java#L102-L108 |
125,458 | jenkinsci/jenkins | core/src/main/java/hudson/util/PersistedList.java | PersistedList.remove | public void remove(Class<? extends T> type) throws IOException {
for (T t : data) {
if(t.getClass()==type) {
data.remove(t);
onModified();
return;
}
}
} | java | public void remove(Class<? extends T> type) throws IOException {
for (T t : data) {
if(t.getClass()==type) {
data.remove(t);
onModified();
return;
}
}
} | [
"public",
"void",
"remove",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"throws",
"IOException",
"{",
"for",
"(",
"T",
"t",
":",
"data",
")",
"{",
"if",
"(",
"t",
".",
"getClass",
"(",
")",
"==",
"type",
")",
"{",
"data",
".",
"re... | Removes an instance by its type. | [
"Removes",
"an",
"instance",
"by",
"its",
"type",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/PersistedList.java#L117-L125 |
125,459 | jenkinsci/jenkins | core/src/main/java/hudson/util/PersistedList.java | PersistedList.replace | public void replace(T from, T to) throws IOException {
List<T> copy = new ArrayList<>(data.getView());
for (int i=0; i<copy.size(); i++) {
if (copy.get(i).equals(from))
copy.set(i,to);
}
data.replaceBy(copy);
} | java | public void replace(T from, T to) throws IOException {
List<T> copy = new ArrayList<>(data.getView());
for (int i=0; i<copy.size(); i++) {
if (copy.get(i).equals(from))
copy.set(i,to);
}
data.replaceBy(copy);
} | [
"public",
"void",
"replace",
"(",
"T",
"from",
",",
"T",
"to",
")",
"throws",
"IOException",
"{",
"List",
"<",
"T",
">",
"copy",
"=",
"new",
"ArrayList",
"<>",
"(",
"data",
".",
"getView",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
"... | A convenience method to replace a single item.
This method shouldn't be used when you are replacing a lot of stuff
as copy-on-write semantics make this rather slow. | [
"A",
"convenience",
"method",
"to",
"replace",
"a",
"single",
"item",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/PersistedList.java#L133-L140 |
125,460 | jenkinsci/jenkins | core/src/main/java/hudson/util/RunList.java | RunList.limit | private RunList<R> limit(final CountingPredicate<R> predicate) {
size = null;
first = null;
final Iterable<R> nested = base;
base = new Iterable<R>() {
public Iterator<R> iterator() {
return hudson.util.Iterators.limit(nested.iterator(),predicate);
... | java | private RunList<R> limit(final CountingPredicate<R> predicate) {
size = null;
first = null;
final Iterable<R> nested = base;
base = new Iterable<R>() {
public Iterator<R> iterator() {
return hudson.util.Iterators.limit(nested.iterator(),predicate);
... | [
"private",
"RunList",
"<",
"R",
">",
"limit",
"(",
"final",
"CountingPredicate",
"<",
"R",
">",
"predicate",
")",
"{",
"size",
"=",
"null",
";",
"first",
"=",
"null",
";",
"final",
"Iterable",
"<",
"R",
">",
"nested",
"=",
"base",
";",
"base",
"=",
... | Returns the first streak of the elements that satisfy the given predicate.
For example, {@code filter([1,2,3,4],odd)==[1,3]} but {@code limit([1,2,3,4],odd)==[1]}. | [
"Returns",
"the",
"first",
"streak",
"of",
"the",
"elements",
"that",
"satisfy",
"the",
"given",
"predicate",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/RunList.java#L222-L237 |
125,461 | jenkinsci/jenkins | core/src/main/java/hudson/util/RunList.java | RunList.byTimestamp | public RunList<R> byTimestamp(final long start, final long end) {
return
limit(new CountingPredicate<R>() {
public boolean apply(int index, R r) {
return start<=r.getTimeInMillis();
}
}).filter(new Predicate<R>() {
public boolean apply(R r) {
... | java | public RunList<R> byTimestamp(final long start, final long end) {
return
limit(new CountingPredicate<R>() {
public boolean apply(int index, R r) {
return start<=r.getTimeInMillis();
}
}).filter(new Predicate<R>() {
public boolean apply(R r) {
... | [
"public",
"RunList",
"<",
"R",
">",
"byTimestamp",
"(",
"final",
"long",
"start",
",",
"final",
"long",
"end",
")",
"{",
"return",
"limit",
"(",
"new",
"CountingPredicate",
"<",
"R",
">",
"(",
")",
"{",
"public",
"boolean",
"apply",
"(",
"int",
"index"... | Filter the list by timestamp.
{@code s<=;e}.
<em>Warning:</em> this method mutates the original list and then returns it. | [
"Filter",
"the",
"list",
"by",
"timestamp",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/RunList.java#L322-L333 |
125,462 | jenkinsci/jenkins | core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java | WindowsServiceLifecycle.rewriteHudsonWar | @Override
public void rewriteHudsonWar(File by) throws IOException {
File dest = getHudsonWar();
// this should be impossible given the canRewriteHudsonWar method,
// but let's be defensive
if(dest==null) throw new IOException("jenkins.war location is not known.");
// backi... | java | @Override
public void rewriteHudsonWar(File by) throws IOException {
File dest = getHudsonWar();
// this should be impossible given the canRewriteHudsonWar method,
// but let's be defensive
if(dest==null) throw new IOException("jenkins.war location is not known.");
// backi... | [
"@",
"Override",
"public",
"void",
"rewriteHudsonWar",
"(",
"File",
"by",
")",
"throws",
"IOException",
"{",
"File",
"dest",
"=",
"getHudsonWar",
"(",
")",
";",
"// this should be impossible given the canRewriteHudsonWar method,",
"// but let's be defensive",
"if",
"(",
... | On Windows, jenkins.war is locked, so we place a new version under a special name,
which is picked up by the service wrapper upon restart. | [
"On",
"Windows",
"jenkins",
".",
"war",
"is",
"locked",
"so",
"we",
"place",
"a",
"new",
"version",
"under",
"a",
"special",
"name",
"which",
"is",
"picked",
"up",
"by",
"the",
"service",
"wrapper",
"upon",
"restart",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java#L94-L116 |
125,463 | jenkinsci/jenkins | core/src/main/java/hudson/model/RestartListener.java | RestartListener.isAllReady | public static boolean isAllReady() throws IOException, InterruptedException {
for (RestartListener listener : all()) {
if (!listener.isReadyToRestart())
return false;
}
return true;
} | java | public static boolean isAllReady() throws IOException, InterruptedException {
for (RestartListener listener : all()) {
if (!listener.isReadyToRestart())
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isAllReady",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"for",
"(",
"RestartListener",
"listener",
":",
"all",
"(",
")",
")",
"{",
"if",
"(",
"!",
"listener",
".",
"isReadyToRestart",
"(",
")",
")",
... | Returns true iff all the listeners OKed the restart. | [
"Returns",
"true",
"iff",
"all",
"the",
"listeners",
"OKed",
"the",
"restart",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/RestartListener.java#L40-L46 |
125,464 | jenkinsci/jenkins | core/src/main/java/hudson/util/SecretRewriter.java | SecretRewriter.isIgnoredDir | protected boolean isIgnoredDir(File dir) {
// ignoring the workspace and the artifacts directories. Both of them
// are potentially large and they do not store any secrets.
String n = dir.getName();
return n.equals("workspace") || n.equals("artifacts")
|| n.equals("plugins") ... | java | protected boolean isIgnoredDir(File dir) {
// ignoring the workspace and the artifacts directories. Both of them
// are potentially large and they do not store any secrets.
String n = dir.getName();
return n.equals("workspace") || n.equals("artifacts")
|| n.equals("plugins") ... | [
"protected",
"boolean",
"isIgnoredDir",
"(",
"File",
"dir",
")",
"{",
"// ignoring the workspace and the artifacts directories. Both of them",
"// are potentially large and they do not store any secrets.",
"String",
"n",
"=",
"dir",
".",
"getName",
"(",
")",
";",
"return",
"n... | Decides if this directory is worth visiting or not. | [
"Decides",
"if",
"this",
"directory",
"is",
"worth",
"visiting",
"or",
"not",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/SecretRewriter.java#L190-L197 |
125,465 | jenkinsci/jenkins | cli/src/main/java/hudson/cli/FlightRecorderInputStream.java | FlightRecorderInputStream.skip | @Override
public long skip(long n) throws IOException {
byte[] buf = new byte[(int)Math.min(n,64*1024)];
return read(buf,0,buf.length);
} | java | @Override
public long skip(long n) throws IOException {
byte[] buf = new byte[(int)Math.min(n,64*1024)];
return read(buf,0,buf.length);
} | [
"@",
"Override",
"public",
"long",
"skip",
"(",
"long",
"n",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"(",
"int",
")",
"Math",
".",
"min",
"(",
"n",
",",
"64",
"*",
"1024",
")",
"]",
";",
"return",
"r... | To record the bytes we've skipped, convert the call to read. | [
"To",
"record",
"the",
"bytes",
"we",
"ve",
"skipped",
"convert",
"the",
"call",
"to",
"read",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/FlightRecorderInputStream.java#L105-L109 |
125,466 | jenkinsci/jenkins | core/src/main/java/hudson/model/ComputerPanelBox.java | ComputerPanelBox.all | public static List<ComputerPanelBox> all(Computer computer) {
List<ComputerPanelBox> boxs = new ArrayList<>();
for(ComputerPanelBox box: ExtensionList.lookup(ComputerPanelBox.class)){
box.setComputer(computer);
boxs.add(box);
}
return boxs;
} | java | public static List<ComputerPanelBox> all(Computer computer) {
List<ComputerPanelBox> boxs = new ArrayList<>();
for(ComputerPanelBox box: ExtensionList.lookup(ComputerPanelBox.class)){
box.setComputer(computer);
boxs.add(box);
}
return boxs;
} | [
"public",
"static",
"List",
"<",
"ComputerPanelBox",
">",
"all",
"(",
"Computer",
"computer",
")",
"{",
"List",
"<",
"ComputerPanelBox",
">",
"boxs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"ComputerPanelBox",
"box",
":",
"ExtensionList",
... | Create boxes for the given computer in its page.
@param computer
The computer for which displays the boxes. Never null.
@return
List of all the registered {@link ComputerPanelBox}s. | [
"Create",
"boxes",
"for",
"the",
"given",
"computer",
"in",
"its",
"page",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ComputerPanelBox.java#L39-L46 |
125,467 | jenkinsci/jenkins | core/src/main/java/jenkins/util/MemoryReductionUtil.java | MemoryReductionUtil.internInPlace | public static String[] internInPlace(String[] input) {
if (input == null) {
return null;
} else if (input.length == 0) {
return EMPTY_STRING_ARRAY;
}
for (int i=0; i<input.length; i++) {
input[i] = Util.intern(input[i]);
}
return input;... | java | public static String[] internInPlace(String[] input) {
if (input == null) {
return null;
} else if (input.length == 0) {
return EMPTY_STRING_ARRAY;
}
for (int i=0; i<input.length; i++) {
input[i] = Util.intern(input[i]);
}
return input;... | [
"public",
"static",
"String",
"[",
"]",
"internInPlace",
"(",
"String",
"[",
"]",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"input",
".",
"length",
"==",
"0",
")",
"{",
"return",
... | Returns the input strings, but with all values interned. | [
"Returns",
"the",
"input",
"strings",
"but",
"with",
"all",
"values",
"interned",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/MemoryReductionUtil.java#L55-L65 |
125,468 | jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM.pollChanges | @Deprecated
public boolean pollChanges(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener) throws IOException, InterruptedException {
// up until 1.336, this method was abstract, so everyone should have overridden this method
// without calling super.pollChang... | java | @Deprecated
public boolean pollChanges(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener) throws IOException, InterruptedException {
// up until 1.336, this method was abstract, so everyone should have overridden this method
// without calling super.pollChang... | [
"@",
"Deprecated",
"public",
"boolean",
"pollChanges",
"(",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"project",
",",
"Launcher",
"launcher",
",",
"FilePath",
"workspace",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException"... | Checks if there has been any changes to this module in the repository.
TODO: we need to figure out a better way to communicate an error back,
so that we won't keep retrying the same node (for example an agent might be down.)
<p>
If the SCM doesn't implement polling, have the {@link #supportsPolling()} method
return f... | [
"Checks",
"if",
"there",
"has",
"been",
"any",
"changes",
"to",
"this",
"module",
"in",
"the",
"repository",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L290-L296 |
125,469 | jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM.poll | public final PollingResult poll(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
if (is1_346OrLater()) {
// This is to work around HUDSON-5827 in a general way.
// don't let t... | java | public final PollingResult poll(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
if (is1_346OrLater()) {
// This is to work around HUDSON-5827 in a general way.
// don't let t... | [
"public",
"final",
"PollingResult",
"poll",
"(",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"project",
",",
"Launcher",
"launcher",
",",
"FilePath",
"workspace",
",",
"TaskListener",
"listener",
",",
"SCMRevisionState",
"baseline",
")",
"throws",
"IOException",
... | Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs. | [
"Convenience",
"method",
"for",
"the",
"caller",
"to",
"handle",
"the",
"backward",
"compatibility",
"between",
"pre",
"1",
".",
"345",
"SCMs",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L406-L421 |
125,470 | jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM.getModuleRoots | public FilePath[] getModuleRoots(FilePath workspace, AbstractBuild build) {
if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class))
// if the subtype derives legacy getModuleRoots(FilePath), delegate to it
return getModuleRoots(workspace);
// otherwise the ... | java | public FilePath[] getModuleRoots(FilePath workspace, AbstractBuild build) {
if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class))
// if the subtype derives legacy getModuleRoots(FilePath), delegate to it
return getModuleRoots(workspace);
// otherwise the ... | [
"public",
"FilePath",
"[",
"]",
"getModuleRoots",
"(",
"FilePath",
"workspace",
",",
"AbstractBuild",
"build",
")",
"{",
"if",
"(",
"Util",
".",
"isOverridden",
"(",
"SCM",
".",
"class",
",",
"getClass",
"(",
")",
",",
"\"getModuleRoots\"",
",",
"FilePath",
... | Gets the top directories of all the checked out modules.
<p>
Some SCMs support checking out multiple modules inside a workspace, which
creates directory layout like this:
<pre>{@code
workspace <- workspace root
+- xyz <- directory checked out by SCM
+- .svn
+- build.xml <- user file
+- abc <- second module fr... | [
"Gets",
"the",
"top",
"directories",
"of",
"all",
"the",
"checked",
"out",
"modules",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L657-L664 |
125,471 | jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM._for | public static List<SCMDescriptor<?>> _for(@CheckForNull final Job project) {
if(project==null) return all();
final Descriptor pd = Jenkins.getInstance().getDescriptor((Class) project.getClass());
List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>();
for (SCMDescriptor<... | java | public static List<SCMDescriptor<?>> _for(@CheckForNull final Job project) {
if(project==null) return all();
final Descriptor pd = Jenkins.getInstance().getDescriptor((Class) project.getClass());
List<SCMDescriptor<?>> r = new ArrayList<SCMDescriptor<?>>();
for (SCMDescriptor<... | [
"public",
"static",
"List",
"<",
"SCMDescriptor",
"<",
"?",
">",
">",
"_for",
"(",
"@",
"CheckForNull",
"final",
"Job",
"project",
")",
"{",
"if",
"(",
"project",
"==",
"null",
")",
"return",
"all",
"(",
")",
";",
"final",
"Descriptor",
"pd",
"=",
"J... | Determines which kinds of SCMs are applicable to a given project.
@param project a project on which we might be configuring SCM, or null if unknown
@return all descriptors which {@link SCMDescriptor#isApplicable(Job)} to it, also filtered by {@link TopLevelItemDescriptor#isApplicable};
or simply {@link #all} if there i... | [
"Determines",
"which",
"kinds",
"of",
"SCMs",
"are",
"applicable",
"to",
"a",
"given",
"project",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L740-L757 |
125,472 | jenkinsci/jenkins | core/src/main/java/jenkins/security/ApiTokenProperty.java | ApiTokenProperty.hasPermissionToSeeToken | private boolean hasPermissionToSeeToken() {
// Administrators can do whatever they want
if (SHOW_LEGACY_TOKEN_TO_ADMINS && Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
return true;
}
User current = User.current();
if (current == null) { // Anonymous
... | java | private boolean hasPermissionToSeeToken() {
// Administrators can do whatever they want
if (SHOW_LEGACY_TOKEN_TO_ADMINS && Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
return true;
}
User current = User.current();
if (current == null) { // Anonymous
... | [
"private",
"boolean",
"hasPermissionToSeeToken",
"(",
")",
"{",
"// Administrators can do whatever they want",
"if",
"(",
"SHOW_LEGACY_TOKEN_TO_ADMINS",
"&&",
"Jenkins",
".",
"get",
"(",
")",
".",
"hasPermission",
"(",
"Jenkins",
".",
"ADMINISTER",
")",
")",
"{",
"r... | Only for legacy token | [
"Only",
"for",
"legacy",
"token"
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/ApiTokenProperty.java#L210-L227 |
125,473 | jenkinsci/jenkins | core/src/main/java/jenkins/security/ApiTokenProperty.java | ApiTokenProperty.getTokenList | @Restricted(NoExternalUse.class)
public Collection<TokenInfoAndStats> getTokenList() {
return tokenStore.getTokenListSortedByName()
.stream()
.map(token -> {
ApiTokenStats.SingleTokenStats stats = tokenStats.findTokenStatsById(token.getUuid());
... | java | @Restricted(NoExternalUse.class)
public Collection<TokenInfoAndStats> getTokenList() {
return tokenStore.getTokenListSortedByName()
.stream()
.map(token -> {
ApiTokenStats.SingleTokenStats stats = tokenStats.findTokenStatsById(token.getUuid());
... | [
"@",
"Restricted",
"(",
"NoExternalUse",
".",
"class",
")",
"public",
"Collection",
"<",
"TokenInfoAndStats",
">",
"getTokenList",
"(",
")",
"{",
"return",
"tokenStore",
".",
"getTokenListSortedByName",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"to... | only for Jelly | [
"only",
"for",
"Jelly"
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/ApiTokenProperty.java#L230-L239 |
125,474 | jenkinsci/jenkins | core/src/main/java/jenkins/security/ApiTokenProperty.java | ApiTokenProperty.changeApiToken | @Deprecated
public void changeApiToken() throws IOException {
// just to keep the same level of security
user.checkPermission(Jenkins.ADMINISTER);
LOGGER.log(Level.FINE, "Deprecated usage of changeApiToken");
ApiTokenStore.HashedToken existingLegacyToken = tokenStore.getLegacyToken... | java | @Deprecated
public void changeApiToken() throws IOException {
// just to keep the same level of security
user.checkPermission(Jenkins.ADMINISTER);
LOGGER.log(Level.FINE, "Deprecated usage of changeApiToken");
ApiTokenStore.HashedToken existingLegacyToken = tokenStore.getLegacyToken... | [
"@",
"Deprecated",
"public",
"void",
"changeApiToken",
"(",
")",
"throws",
"IOException",
"{",
"// just to keep the same level of security",
"user",
".",
"checkPermission",
"(",
"Jenkins",
".",
"ADMINISTER",
")",
";",
"LOGGER",
".",
"log",
"(",
"Level",
".",
"FINE... | Only usable if the user still has the legacy API token.
@deprecated Each token can be revoked now and new tokens can be requested without altering existing ones. | [
"Only",
"usable",
"if",
"the",
"user",
"still",
"has",
"the",
"legacy",
"API",
"token",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/ApiTokenProperty.java#L316-L331 |
125,475 | jenkinsci/jenkins | core/src/main/java/hudson/triggers/SCMTrigger.java | SCMTrigger.run | public void run(Action[] additionalActions) {
if (job == null) {
return;
}
DescriptorImpl d = getDescriptor();
LOGGER.fine("Scheduling a polling for "+job);
if (d.synchronousPolling) {
LOGGER.fine("Running the trigger directly without threading, " +
... | java | public void run(Action[] additionalActions) {
if (job == null) {
return;
}
DescriptorImpl d = getDescriptor();
LOGGER.fine("Scheduling a polling for "+job);
if (d.synchronousPolling) {
LOGGER.fine("Running the trigger directly without threading, " +
... | [
"public",
"void",
"run",
"(",
"Action",
"[",
"]",
"additionalActions",
")",
"{",
"if",
"(",
"job",
"==",
"null",
")",
"{",
"return",
";",
"}",
"DescriptorImpl",
"d",
"=",
"getDescriptor",
"(",
")",
";",
"LOGGER",
".",
"fine",
"(",
"\"Scheduling a polling... | Run the SCM trigger with additional build actions. Used by SubversionRepositoryStatus
to trigger a build at a specific revision number.
@param additionalActions
@since 1.375 | [
"Run",
"the",
"SCM",
"trigger",
"with",
"additional",
"build",
"actions",
".",
"Used",
"by",
"SubversionRepositoryStatus",
"to",
"trigger",
"a",
"build",
"at",
"a",
"specific",
"revision",
"number",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/triggers/SCMTrigger.java#L173-L193 |
125,476 | jenkinsci/jenkins | core/src/main/java/hudson/tasks/BuildTrigger.java | BuildTrigger.execute | public static boolean execute(AbstractBuild build, BuildListener listener) {
PrintStream logger = listener.getLogger();
// Check all downstream Project of the project, not just those defined by BuildTrigger
// TODO this may not yet be up to date if rebuildDependencyGraphAsync has been used; need... | java | public static boolean execute(AbstractBuild build, BuildListener listener) {
PrintStream logger = listener.getLogger();
// Check all downstream Project of the project, not just those defined by BuildTrigger
// TODO this may not yet be up to date if rebuildDependencyGraphAsync has been used; need... | [
"public",
"static",
"boolean",
"execute",
"(",
"AbstractBuild",
"build",
",",
"BuildListener",
"listener",
")",
"{",
"PrintStream",
"logger",
"=",
"listener",
".",
"getLogger",
"(",
")",
";",
"// Check all downstream Project of the project, not just those defined by BuildTr... | Convenience method to trigger downstream builds.
@param build
The current build. Its downstreams will be triggered.
@param listener
Receives the progress report. | [
"Convenience",
"method",
"to",
"trigger",
"downstream",
"builds",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildTrigger.java#L254-L291 |
125,477 | jenkinsci/jenkins | core/src/main/java/hudson/model/ResourceController.java | ResourceController.canRun | public boolean canRun(final ResourceList resources) {
try {
return _withLock(new Callable<Boolean>() {
@Override
public Boolean call() {
return !inUse.isCollidingWith(resources);
}
});
} catch (Exception e) {
... | java | public boolean canRun(final ResourceList resources) {
try {
return _withLock(new Callable<Boolean>() {
@Override
public Boolean call() {
return !inUse.isCollidingWith(resources);
}
});
} catch (Exception e) {
... | [
"public",
"boolean",
"canRun",
"(",
"final",
"ResourceList",
"resources",
")",
"{",
"try",
"{",
"return",
"_withLock",
"(",
"new",
"Callable",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"call",
"(",
")",
"{",
"return",
"!",... | Checks if an activity that requires the given resource list
can run immediately.
<p>
This method is really only useful as a hint, since
another activity might acquire resources before the caller
gets to call {@link #execute(Runnable, ResourceActivity)}. | [
"Checks",
"if",
"an",
"activity",
"that",
"requires",
"the",
"given",
"resource",
"list",
"can",
"run",
"immediately",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ResourceController.java#L120-L131 |
125,478 | jenkinsci/jenkins | core/src/main/java/hudson/model/ResourceController.java | ResourceController.getMissingResource | public Resource getMissingResource(final ResourceList resources) {
try {
return _withLock(new Callable<Resource>() {
@Override
public Resource call() {
return resources.getConflict(inUse);
}
});
} catch (Exceptio... | java | public Resource getMissingResource(final ResourceList resources) {
try {
return _withLock(new Callable<Resource>() {
@Override
public Resource call() {
return resources.getConflict(inUse);
}
});
} catch (Exceptio... | [
"public",
"Resource",
"getMissingResource",
"(",
"final",
"ResourceList",
"resources",
")",
"{",
"try",
"{",
"return",
"_withLock",
"(",
"new",
"Callable",
"<",
"Resource",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Resource",
"call",
"(",
")",
"{",
"... | Of the resource in the given resource list, return the one that's
currently in use.
<p>
If more than one such resource exists, one is chosen and returned.
This method is used for reporting what's causing the blockage. | [
"Of",
"the",
"resource",
"in",
"the",
"given",
"resource",
"list",
"return",
"the",
"one",
"that",
"s",
"currently",
"in",
"use",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ResourceController.java#L141-L152 |
125,479 | jenkinsci/jenkins | core/src/main/java/hudson/model/ListView.java | ListView.add | @Override
public void add(TopLevelItem item) throws IOException {
synchronized (this) {
jobNames.add(item.getRelativeNameFrom(getOwner().getItemGroup()));
}
save();
} | java | @Override
public void add(TopLevelItem item) throws IOException {
synchronized (this) {
jobNames.add(item.getRelativeNameFrom(getOwner().getItemGroup()));
}
save();
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"TopLevelItem",
"item",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"jobNames",
".",
"add",
"(",
"item",
".",
"getRelativeNameFrom",
"(",
"getOwner",
"(",
")",
".",
"getItemGroup",
... | Adds the given item to this view.
@since 1.389 | [
"Adds",
"the",
"given",
"item",
"to",
"this",
"view",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ListView.java#L297-L303 |
125,480 | jenkinsci/jenkins | core/src/main/java/hudson/model/ListView.java | ListView.remove | @Override
public boolean remove(TopLevelItem item) throws IOException {
synchronized (this) {
String name = item.getRelativeNameFrom(getOwner().getItemGroup());
if (!jobNames.remove(name)) return false;
}
save();
return true;
} | java | @Override
public boolean remove(TopLevelItem item) throws IOException {
synchronized (this) {
String name = item.getRelativeNameFrom(getOwner().getItemGroup());
if (!jobNames.remove(name)) return false;
}
save();
return true;
} | [
"@",
"Override",
"public",
"boolean",
"remove",
"(",
"TopLevelItem",
"item",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"String",
"name",
"=",
"item",
".",
"getRelativeNameFrom",
"(",
"getOwner",
"(",
")",
".",
"getItemGroup",
... | Removes given item from this view.
@since 1.566 | [
"Removes",
"given",
"item",
"from",
"this",
"view",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ListView.java#L310-L318 |
125,481 | jenkinsci/jenkins | core/src/main/java/hudson/model/ListView.java | ListView.isAddToCurrentView | @Restricted(NoExternalUse.class) // called from newJob_button-bar view
@SuppressWarnings("unused") // called from newJob_button-bar view
public boolean isAddToCurrentView() {
synchronized(this) {
return !jobNames.isEmpty() || // There are already items in this view specified by name
... | java | @Restricted(NoExternalUse.class) // called from newJob_button-bar view
@SuppressWarnings("unused") // called from newJob_button-bar view
public boolean isAddToCurrentView() {
synchronized(this) {
return !jobNames.isEmpty() || // There are already items in this view specified by name
... | [
"@",
"Restricted",
"(",
"NoExternalUse",
".",
"class",
")",
"// called from newJob_button-bar view",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called from newJob_button-bar view",
"public",
"boolean",
"isAddToCurrentView",
"(",
")",
"{",
"synchronized",
"(",
"t... | Determines the initial state of the checkbox.
@return true when the view is empty or already contains jobs specified by name. | [
"Determines",
"the",
"initial",
"state",
"of",
"the",
"checkbox",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ListView.java#L348-L356 |
125,482 | jenkinsci/jenkins | core/src/main/java/hudson/node_monitors/NodeMonitorUpdater.java | NodeMonitorUpdater.onOnline | @Override
public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException {
synchronized(this) {
future.cancel(false);
future = Timer.get().schedule(MONITOR_UPDATER, 5, TimeUnit.SECONDS);
}
} | java | @Override
public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException {
synchronized(this) {
future.cancel(false);
future = Timer.get().schedule(MONITOR_UPDATER, 5, TimeUnit.SECONDS);
}
} | [
"@",
"Override",
"public",
"void",
"onOnline",
"(",
"Computer",
"c",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"future",
".",
"cancel",
"(",
"false",
")",
";",
"fut... | Triggers the update with 5 seconds quiet period, to avoid triggering data check too often
when multiple agents become online at about the same time. | [
"Triggers",
"the",
"update",
"with",
"5",
"seconds",
"quiet",
"period",
"to",
"avoid",
"triggering",
"data",
"check",
"too",
"often",
"when",
"multiple",
"agents",
"become",
"online",
"at",
"about",
"the",
"same",
"time",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/node_monitors/NodeMonitorUpdater.java#L39-L45 |
125,483 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getAssignedLabelString | @Exported(name="labelExpression")
public String getAssignedLabelString() {
if (canRoam || assignedNode==null) return null;
try {
LabelExpression.parseExpression(assignedNode);
return assignedNode;
} catch (ANTLRException e) {
// must be old label or hos... | java | @Exported(name="labelExpression")
public String getAssignedLabelString() {
if (canRoam || assignedNode==null) return null;
try {
LabelExpression.parseExpression(assignedNode);
return assignedNode;
} catch (ANTLRException e) {
// must be old label or hos... | [
"@",
"Exported",
"(",
"name",
"=",
"\"labelExpression\"",
")",
"public",
"String",
"getAssignedLabelString",
"(",
")",
"{",
"if",
"(",
"canRoam",
"||",
"assignedNode",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"LabelExpression",
".",
"parseExpressi... | Gets the textual representation of the assigned label as it was entered by the user. | [
"Gets",
"the",
"textual",
"representation",
"of",
"the",
"assigned",
"label",
"as",
"it",
"was",
"entered",
"by",
"the",
"user",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L410-L420 |
125,484 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.setAssignedLabel | public void setAssignedLabel(Label l) throws IOException {
if(l==null) {
canRoam = true;
assignedNode = null;
} else {
canRoam = false;
if(l== Jenkins.getInstance().getSelfLabel()) assignedNode = null;
else ... | java | public void setAssignedLabel(Label l) throws IOException {
if(l==null) {
canRoam = true;
assignedNode = null;
} else {
canRoam = false;
if(l== Jenkins.getInstance().getSelfLabel()) assignedNode = null;
else ... | [
"public",
"void",
"setAssignedLabel",
"(",
"Label",
"l",
")",
"throws",
"IOException",
"{",
"if",
"(",
"l",
"==",
"null",
")",
"{",
"canRoam",
"=",
"true",
";",
"assignedNode",
"=",
"null",
";",
"}",
"else",
"{",
"canRoam",
"=",
"false",
";",
"if",
"... | Sets the assigned label. | [
"Sets",
"the",
"assigned",
"label",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L425-L435 |
125,485 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getWorkspace | @Deprecated
public final FilePath getWorkspace() {
AbstractBuild b = getBuildForDeprecatedMethods();
return b != null ? b.getWorkspace() : null;
} | java | @Deprecated
public final FilePath getWorkspace() {
AbstractBuild b = getBuildForDeprecatedMethods();
return b != null ? b.getWorkspace() : null;
} | [
"@",
"Deprecated",
"public",
"final",
"FilePath",
"getWorkspace",
"(",
")",
"{",
"AbstractBuild",
"b",
"=",
"getBuildForDeprecatedMethods",
"(",
")",
";",
"return",
"b",
"!=",
"null",
"?",
"b",
".",
"getWorkspace",
"(",
")",
":",
"null",
";",
"}"
] | Gets the directory where the module is checked out.
@return
null if the workspace is on an agent that's not connected.
@deprecated as of 1.319
To support concurrent builds of the same project, this method is moved to {@link AbstractBuild}.
For backward compatibility, this method returns the right {@link AbstractBuild#... | [
"Gets",
"the",
"directory",
"where",
"the",
"module",
"is",
"checked",
"out",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L500-L505 |
125,486 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getBuildForDeprecatedMethods | private AbstractBuild getBuildForDeprecatedMethods() {
Executor e = Executor.currentExecutor();
if(e!=null) {
Executable exe = e.getCurrentExecutable();
if (exe instanceof AbstractBuild) {
AbstractBuild b = (AbstractBuild) exe;
if(b.getProject()==t... | java | private AbstractBuild getBuildForDeprecatedMethods() {
Executor e = Executor.currentExecutor();
if(e!=null) {
Executable exe = e.getCurrentExecutable();
if (exe instanceof AbstractBuild) {
AbstractBuild b = (AbstractBuild) exe;
if(b.getProject()==t... | [
"private",
"AbstractBuild",
"getBuildForDeprecatedMethods",
"(",
")",
"{",
"Executor",
"e",
"=",
"Executor",
".",
"currentExecutor",
"(",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"{",
"Executable",
"exe",
"=",
"e",
".",
"getCurrentExecutable",
"(",
")",
... | Various deprecated methods in this class all need the 'current' build. This method returns
the build suitable for that purpose.
@return An AbstractBuild for deprecated methods to use. | [
"Various",
"deprecated",
"methods",
"in",
"this",
"class",
"all",
"need",
"the",
"current",
"build",
".",
"This",
"method",
"returns",
"the",
"build",
"suitable",
"for",
"that",
"purpose",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L513-L526 |
125,487 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getSomeWorkspace | public final @CheckForNull FilePath getSomeWorkspace() {
R b = getSomeBuildWithWorkspace();
if (b!=null) return b.getWorkspace();
for (WorkspaceBrowser browser : ExtensionList.lookup(WorkspaceBrowser.class)) {
FilePath f = browser.getWorkspace(this);
if (f != null) return... | java | public final @CheckForNull FilePath getSomeWorkspace() {
R b = getSomeBuildWithWorkspace();
if (b!=null) return b.getWorkspace();
for (WorkspaceBrowser browser : ExtensionList.lookup(WorkspaceBrowser.class)) {
FilePath f = browser.getWorkspace(this);
if (f != null) return... | [
"public",
"final",
"@",
"CheckForNull",
"FilePath",
"getSomeWorkspace",
"(",
")",
"{",
"R",
"b",
"=",
"getSomeBuildWithWorkspace",
"(",
")",
";",
"if",
"(",
"b",
"!=",
"null",
")",
"return",
"b",
".",
"getWorkspace",
"(",
")",
";",
"for",
"(",
"Workspace... | Gets a workspace for some build of this project.
<p>
This is useful for obtaining a workspace for the purpose of form field validation, where exactly
which build the workspace belonged is less important. The implementation makes a cursory effort
to find some workspace.
@return
null if there's no available workspace.
... | [
"Gets",
"a",
"workspace",
"for",
"some",
"build",
"of",
"this",
"project",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L540-L548 |
125,488 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getSomeBuildWithWorkspace | public final R getSomeBuildWithWorkspace() {
int cnt=0;
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace();
if (ws!=null) return b;
}
return null;
} | java | public final R getSomeBuildWithWorkspace() {
int cnt=0;
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
FilePath ws = b.getWorkspace();
if (ws!=null) return b;
}
return null;
} | [
"public",
"final",
"R",
"getSomeBuildWithWorkspace",
"(",
")",
"{",
"int",
"cnt",
"=",
"0",
";",
"for",
"(",
"R",
"b",
"=",
"getLastBuild",
"(",
")",
";",
"cnt",
"<",
"5",
"&&",
"b",
"!=",
"null",
";",
"b",
"=",
"b",
".",
"getPreviousBuild",
"(",
... | Gets some build that has a live workspace.
@return null if no such build exists. | [
"Gets",
"some",
"build",
"that",
"has",
"a",
"live",
"workspace",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L555-L562 |
125,489 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.scheduleBuild | public boolean scheduleBuild(int quietPeriod, Cause c, Action... actions) {
return scheduleBuild2(quietPeriod,c,actions)!=null;
} | java | public boolean scheduleBuild(int quietPeriod, Cause c, Action... actions) {
return scheduleBuild2(quietPeriod,c,actions)!=null;
} | [
"public",
"boolean",
"scheduleBuild",
"(",
"int",
"quietPeriod",
",",
"Cause",
"c",
",",
"Action",
"...",
"actions",
")",
"{",
"return",
"scheduleBuild2",
"(",
"quietPeriod",
",",
"c",
",",
"actions",
")",
"!=",
"null",
";",
"}"
] | Schedules a build.
Important: the actions should be persistable without outside references (e.g. don't store
references to this project). To provide parameters for a parameterized project, add a ParametersAction. If
no ParametersAction is provided for such a project, one will be created with the default parameter valu... | [
"Schedules",
"a",
"build",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L795-L797 |
125,490 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.schedulePolling | public boolean schedulePolling() {
if(isDisabled()) return false;
SCMTrigger scmt = getTrigger(SCMTrigger.class);
if(scmt==null) return false;
scmt.run();
return true;
} | java | public boolean schedulePolling() {
if(isDisabled()) return false;
SCMTrigger scmt = getTrigger(SCMTrigger.class);
if(scmt==null) return false;
scmt.run();
return true;
} | [
"public",
"boolean",
"schedulePolling",
"(",
")",
"{",
"if",
"(",
"isDisabled",
"(",
")",
")",
"return",
"false",
";",
"SCMTrigger",
"scmt",
"=",
"getTrigger",
"(",
"SCMTrigger",
".",
"class",
")",
";",
"if",
"(",
"scmt",
"==",
"null",
")",
"return",
"... | Schedules a polling of this project.
@see SCMTriggerItem#schedulePolling | [
"Schedules",
"a",
"polling",
"of",
"this",
"project",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L860-L866 |
125,491 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getResourceList | public ResourceList getResourceList() {
final Set<ResourceActivity> resourceActivities = getResourceActivities();
final List<ResourceList> resourceLists = new ArrayList<ResourceList>(1 + resourceActivities.size());
for (ResourceActivity activity : resourceActivities) {
if (activity !... | java | public ResourceList getResourceList() {
final Set<ResourceActivity> resourceActivities = getResourceActivities();
final List<ResourceList> resourceLists = new ArrayList<ResourceList>(1 + resourceActivities.size());
for (ResourceActivity activity : resourceActivities) {
if (activity !... | [
"public",
"ResourceList",
"getResourceList",
"(",
")",
"{",
"final",
"Set",
"<",
"ResourceActivity",
">",
"resourceActivities",
"=",
"getResourceActivities",
"(",
")",
";",
"final",
"List",
"<",
"ResourceList",
">",
"resourceLists",
"=",
"new",
"ArrayList",
"<",
... | List of necessary resources to perform the build of this project. | [
"List",
"of",
"necessary",
"resources",
"to",
"perform",
"the",
"build",
"of",
"this",
"project",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1175-L1185 |
125,492 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.calcPollingBaseline | private void calcPollingBaseline(AbstractBuild build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
SCMRevisionState baseline = build.getAction(SCMRevisionState.class);
if (baseline==null) {
try {
baseline = getScm().calcRevisionsFromBui... | java | private void calcPollingBaseline(AbstractBuild build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
SCMRevisionState baseline = build.getAction(SCMRevisionState.class);
if (baseline==null) {
try {
baseline = getScm().calcRevisionsFromBui... | [
"private",
"void",
"calcPollingBaseline",
"(",
"AbstractBuild",
"build",
",",
"Launcher",
"launcher",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"SCMRevisionState",
"baseline",
"=",
"build",
".",
"getAction",
"(",
... | Pushes the baseline up to the newly checked out revision. | [
"Pushes",
"the",
"baseline",
"up",
"to",
"the",
"newly",
"checked",
"out",
"revision",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1220-L1232 |
125,493 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.poll | public PollingResult poll( TaskListener listener ) {
SCM scm = getScm();
if (scm==null) {
listener.getLogger().println(Messages.AbstractProject_NoSCM());
return NO_CHANGES;
}
if (!isBuildable()) {
listener.getLogger().println(Messages.AbstractProject_D... | java | public PollingResult poll( TaskListener listener ) {
SCM scm = getScm();
if (scm==null) {
listener.getLogger().println(Messages.AbstractProject_NoSCM());
return NO_CHANGES;
}
if (!isBuildable()) {
listener.getLogger().println(Messages.AbstractProject_D... | [
"public",
"PollingResult",
"poll",
"(",
"TaskListener",
"listener",
")",
"{",
"SCM",
"scm",
"=",
"getScm",
"(",
")",
";",
"if",
"(",
"scm",
"==",
"null",
")",
"{",
"listener",
".",
"getLogger",
"(",
")",
".",
"println",
"(",
"Messages",
".",
"AbstractP... | Checks if there's any update in SCM, and returns true if any is found.
<p>
The implementation is responsible for ensuring mutual exclusion between polling and builds
if necessary.
@since 1.345 | [
"Checks",
"if",
"there",
"s",
"any",
"update",
"in",
"SCM",
"and",
"returns",
"true",
"if",
"any",
"is",
"found",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1254-L1317 |
125,494 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.isAllSuitableNodesOffline | private boolean isAllSuitableNodesOffline(R build) {
Label label = getAssignedLabel();
List<Node> allNodes = Jenkins.getInstance().getNodes();
if (label != null) {
//Invalid label. Put in queue to make administrator fix
if(label.getNodes().isEmpty()) {
re... | java | private boolean isAllSuitableNodesOffline(R build) {
Label label = getAssignedLabel();
List<Node> allNodes = Jenkins.getInstance().getNodes();
if (label != null) {
//Invalid label. Put in queue to make administrator fix
if(label.getNodes().isEmpty()) {
re... | [
"private",
"boolean",
"isAllSuitableNodesOffline",
"(",
"R",
"build",
")",
"{",
"Label",
"label",
"=",
"getAssignedLabel",
"(",
")",
";",
"List",
"<",
"Node",
">",
"allNodes",
"=",
"Jenkins",
".",
"getInstance",
"(",
")",
".",
"getNodes",
"(",
")",
";",
... | Returns true if all suitable nodes for the job are offline. | [
"Returns",
"true",
"if",
"all",
"suitable",
"nodes",
"for",
"the",
"job",
"are",
"offline",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1432-L1457 |
125,495 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.hasParticipant | public boolean hasParticipant(User user) {
for( R build = getLastBuild(); build!=null; build=build.getPreviousBuild())
if(build.hasParticipant(user))
return true;
return false;
} | java | public boolean hasParticipant(User user) {
for( R build = getLastBuild(); build!=null; build=build.getPreviousBuild())
if(build.hasParticipant(user))
return true;
return false;
} | [
"public",
"boolean",
"hasParticipant",
"(",
"User",
"user",
")",
"{",
"for",
"(",
"R",
"build",
"=",
"getLastBuild",
"(",
")",
";",
"build",
"!=",
"null",
";",
"build",
"=",
"build",
".",
"getPreviousBuild",
"(",
")",
")",
"if",
"(",
"build",
".",
"h... | Returns true if this user has made a commit to this project.
@since 1.191 | [
"Returns",
"true",
"if",
"this",
"user",
"has",
"made",
"a",
"commit",
"to",
"this",
"project",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1489-L1494 |
125,496 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getTrigger | public <T extends Trigger> T getTrigger(Class<T> clazz) {
for (Trigger p : triggers()) {
if(clazz.isInstance(p))
return clazz.cast(p);
}
return null;
} | java | public <T extends Trigger> T getTrigger(Class<T> clazz) {
for (Trigger p : triggers()) {
if(clazz.isInstance(p))
return clazz.cast(p);
}
return null;
} | [
"public",
"<",
"T",
"extends",
"Trigger",
">",
"T",
"getTrigger",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"for",
"(",
"Trigger",
"p",
":",
"triggers",
"(",
")",
")",
"{",
"if",
"(",
"clazz",
".",
"isInstance",
"(",
"p",
")",
")",
"return"... | Gets the specific trigger, or null if the property is not configured for this job. | [
"Gets",
"the",
"specific",
"trigger",
"or",
"null",
"if",
"the",
"property",
"is",
"not",
"configured",
"for",
"this",
"job",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1549-L1555 |
125,497 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.checkAndRecord | private void checkAndRecord(AbstractProject that, TreeMap<Integer, RangeSet> r, Collection<R> builds) {
for (R build : builds) {
RangeSet rs = build.getDownstreamRelationship(that);
if(rs==null || rs.isEmpty())
continue;
int n = build.getNumber();
... | java | private void checkAndRecord(AbstractProject that, TreeMap<Integer, RangeSet> r, Collection<R> builds) {
for (R build : builds) {
RangeSet rs = build.getDownstreamRelationship(that);
if(rs==null || rs.isEmpty())
continue;
int n = build.getNumber();
... | [
"private",
"void",
"checkAndRecord",
"(",
"AbstractProject",
"that",
",",
"TreeMap",
"<",
"Integer",
",",
"RangeSet",
">",
"r",
",",
"Collection",
"<",
"R",
">",
"builds",
")",
"{",
"for",
"(",
"R",
"build",
":",
"builds",
")",
"{",
"RangeSet",
"rs",
"... | Helper method for getDownstreamRelationship.
For each given build, find the build number range of the given project and put that into the map. | [
"Helper",
"method",
"for",
"getDownstreamRelationship",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1660-L1674 |
125,498 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.getDelay | @Deprecated
public int getDelay(StaplerRequest req) throws ServletException {
String delay = req.getParameter("delay");
if (delay==null) return getQuietPeriod();
try {
// TODO: more unit handling
if(delay.endsWith("sec")) delay=delay.substring(0,delay.length()-3... | java | @Deprecated
public int getDelay(StaplerRequest req) throws ServletException {
String delay = req.getParameter("delay");
if (delay==null) return getQuietPeriod();
try {
// TODO: more unit handling
if(delay.endsWith("sec")) delay=delay.substring(0,delay.length()-3... | [
"@",
"Deprecated",
"public",
"int",
"getDelay",
"(",
"StaplerRequest",
"req",
")",
"throws",
"ServletException",
"{",
"String",
"delay",
"=",
"req",
".",
"getParameter",
"(",
"\"delay\"",
")",
";",
"if",
"(",
"delay",
"==",
"null",
")",
"return",
"getQuietPe... | Computes the delay by taking the default value and the override in the request parameter into the account.
@deprecated as of 1.489
Inject {@link TimeDuration}. | [
"Computes",
"the",
"delay",
"by",
"taking",
"the",
"default",
"value",
"and",
"the",
"override",
"in",
"the",
"request",
"parameter",
"into",
"the",
"account",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1712-L1725 |
125,499 | jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.doWs | public DirectoryBrowserSupport doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
checkPermission(Item.WORKSPACE);
FilePath ws = getSomeWorkspace();
if ((ws == null) || (!ws.exists())) {
// if there's no workspace, report a ni... | java | public DirectoryBrowserSupport doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
checkPermission(Item.WORKSPACE);
FilePath ws = getSomeWorkspace();
if ((ws == null) || (!ws.exists())) {
// if there's no workspace, report a ni... | [
"public",
"DirectoryBrowserSupport",
"doWs",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
",",
"InterruptedException",
"{",
"checkPermission",
"(",
"Item",
".",
"WORKSPACE",
")",
";",
"FilePath",
... | Serves the workspace files. | [
"Serves",
"the",
"workspace",
"files",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L1834-L1855 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.