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,800
jenkinsci/jenkins
core/src/main/java/hudson/XmlFile.java
XmlFile.read
public Object read() throws IOException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Reading "+file); } try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) { return xs.fromXML(in); } catch (RuntimeException | Error e) { ...
java
public Object read() throws IOException { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Reading "+file); } try (InputStream in = new BufferedInputStream(Files.newInputStream(file.toPath()))) { return xs.fromXML(in); } catch (RuntimeException | Error e) { ...
[ "public", "Object", "read", "(", ")", "throws", "IOException", "{", "if", "(", "LOGGER", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "LOGGER", ".", "fine", "(", "\"Reading \"", "+", "file", ")", ";", "}", "try", "(", "InputStream", "...
Loads the contents of this file into a new object.
[ "Loads", "the", "contents", "of", "this", "file", "into", "a", "new", "object", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/XmlFile.java#L142-L151
125,801
jenkinsci/jenkins
core/src/main/java/hudson/XmlFile.java
XmlFile.asString
public String asString() throws IOException { StringWriter w = new StringWriter(); writeRawTo(w); return w.toString(); }
java
public String asString() throws IOException { StringWriter w = new StringWriter(); writeRawTo(w); return w.toString(); }
[ "public", "String", "asString", "(", ")", "throws", "IOException", "{", "StringWriter", "w", "=", "new", "StringWriter", "(", ")", ";", "writeRawTo", "(", "w", ")", ";", "return", "w", ".", "toString", "(", ")", ";", "}" ]
Returns the XML file read as a string.
[ "Returns", "the", "XML", "file", "read", "as", "a", "string", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/XmlFile.java#L270-L274
125,802
jenkinsci/jenkins
core/src/main/java/hudson/XmlFile.java
XmlFile.sniffEncoding
public String sniffEncoding() throws IOException { class Eureka extends SAXException { final String encoding; public Eureka(String encoding) { this.encoding = encoding; } } try (InputStream in = Files.newInputStream(file.toPath())) { ...
java
public String sniffEncoding() throws IOException { class Eureka extends SAXException { final String encoding; public Eureka(String encoding) { this.encoding = encoding; } } try (InputStream in = Files.newInputStream(file.toPath())) { ...
[ "public", "String", "sniffEncoding", "(", ")", "throws", "IOException", "{", "class", "Eureka", "extends", "SAXException", "{", "final", "String", "encoding", ";", "public", "Eureka", "(", "String", "encoding", ")", "{", "this", ".", "encoding", "=", "encoding...
Parses the beginning of the file and determines the encoding. @throws IOException if failed to detect encoding. @return always non-null.
[ "Parses", "the", "beginning", "of", "the", "file", "and", "determines", "the", "encoding", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/XmlFile.java#L294-L349
125,803
jenkinsci/jenkins
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
TokenBasedRememberMeServices2.findRememberMeCookieValue
private String findRememberMeCookieValue(HttpServletRequest request, HttpServletResponse response) { Cookie[] cookies = request.getCookies(); if ((cookies == null) || (cookies.length == 0)) { return null; } for (Cookie cookie : cookies) { if (ACEGI_SECURITY_HASH...
java
private String findRememberMeCookieValue(HttpServletRequest request, HttpServletResponse response) { Cookie[] cookies = request.getCookies(); if ((cookies == null) || (cookies.length == 0)) { return null; } for (Cookie cookie : cookies) { if (ACEGI_SECURITY_HASH...
[ "private", "String", "findRememberMeCookieValue", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "Cookie", "[", "]", "cookies", "=", "request", ".", "getCookies", "(", ")", ";", "if", "(", "(", "cookies", "==", "null", ...
Patched version of the super.autoLogin with a time-independent equality check for the token validation
[ "Patched", "version", "of", "the", "super", ".", "autoLogin", "with", "a", "time", "-", "independent", "equality", "check", "for", "the", "token", "validation" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java#L185-L199
125,804
jenkinsci/jenkins
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
TokenBasedRememberMeServices2.retrieveAuthFromCookie
private @CheckForNull Authentication retrieveAuthFromCookie(HttpServletRequest request, HttpServletResponse response, String cookieValueBase64){ String cookieValue = decodeCookieBase64(cookieValueBase64); if (cookieValue == null) { String reason = "Cookie token was not Base64 encoded; value ...
java
private @CheckForNull Authentication retrieveAuthFromCookie(HttpServletRequest request, HttpServletResponse response, String cookieValueBase64){ String cookieValue = decodeCookieBase64(cookieValueBase64); if (cookieValue == null) { String reason = "Cookie token was not Base64 encoded; value ...
[ "private", "@", "CheckForNull", "Authentication", "retrieveAuthFromCookie", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "String", "cookieValueBase64", ")", "{", "String", "cookieValue", "=", "decodeCookieBase64", "(", "cookieValueBase6...
and reducing drastically the information provided in the log to avoid potential disclosure
[ "and", "reducing", "drastically", "the", "information", "provided", "in", "the", "log", "to", "avoid", "potential", "disclosure" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java#L204-L273
125,805
jenkinsci/jenkins
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
TokenBasedRememberMeServices2.secureCookie
private void secureCookie(Cookie cookie, HttpServletRequest request){ // if we can mark the cookie HTTP only, do so to protect this cookie even in case of XSS vulnerability. if (SET_HTTP_ONLY!=null) { try { SET_HTTP_ONLY.invoke(cookie,true); } catch (IllegalAccess...
java
private void secureCookie(Cookie cookie, HttpServletRequest request){ // if we can mark the cookie HTTP only, do so to protect this cookie even in case of XSS vulnerability. if (SET_HTTP_ONLY!=null) { try { SET_HTTP_ONLY.invoke(cookie,true); } catch (IllegalAccess...
[ "private", "void", "secureCookie", "(", "Cookie", "cookie", ",", "HttpServletRequest", "request", ")", "{", "// if we can mark the cookie HTTP only, do so to protect this cookie even in case of XSS vulnerability.", "if", "(", "SET_HTTP_ONLY", "!=", "null", ")", "{", "try", "{...
Force always the http-only flag and depending on the request, put also the secure flag.
[ "Force", "always", "the", "http", "-", "only", "flag", "and", "depending", "on", "the", "request", "put", "also", "the", "secure", "flag", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java#L309-L323
125,806
jenkinsci/jenkins
core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java
TokenBasedRememberMeServices2.isTokenExpired
@Override protected boolean isTokenExpired(long tokenExpiryTimeMs) { long nowMs = System.currentTimeMillis(); long maxExpirationMs = TimeUnit.SECONDS.toMillis(tokenValiditySeconds) + nowMs; if(!SKIP_TOO_FAR_EXPIRATION_DATE_CHECK && tokenExpiryTimeMs > maxExpirationMs){ // attempt...
java
@Override protected boolean isTokenExpired(long tokenExpiryTimeMs) { long nowMs = System.currentTimeMillis(); long maxExpirationMs = TimeUnit.SECONDS.toMillis(tokenValiditySeconds) + nowMs; if(!SKIP_TOO_FAR_EXPIRATION_DATE_CHECK && tokenExpiryTimeMs > maxExpirationMs){ // attempt...
[ "@", "Override", "protected", "boolean", "isTokenExpired", "(", "long", "tokenExpiryTimeMs", ")", "{", "long", "nowMs", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "maxExpirationMs", "=", "TimeUnit", ".", "SECONDS", ".", "toMillis", "(", "t...
In addition to the expiration requested by the super class, we also check the expiration is not too far in the future. Especially to detect maliciously crafted cookie.
[ "In", "addition", "to", "the", "expiration", "requested", "by", "the", "super", "class", "we", "also", "check", "the", "expiration", "is", "not", "too", "far", "in", "the", "future", ".", "Especially", "to", "detect", "maliciously", "crafted", "cookie", "." ...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/TokenBasedRememberMeServices2.java#L329-L345
125,807
jenkinsci/jenkins
core/src/main/java/hudson/util/ProcessTree.java
OSProcess.getChildren
public final List<OSProcess> getChildren() { List<OSProcess> r = new ArrayList<OSProcess>(); for (OSProcess p : ProcessTree.this) if(p.getParent()==this) r.add(p); return r; }
java
public final List<OSProcess> getChildren() { List<OSProcess> r = new ArrayList<OSProcess>(); for (OSProcess p : ProcessTree.this) if(p.getParent()==this) r.add(p); return r; }
[ "public", "final", "List", "<", "OSProcess", ">", "getChildren", "(", ")", "{", "List", "<", "OSProcess", ">", "r", "=", "new", "ArrayList", "<", "OSProcess", ">", "(", ")", ";", "for", "(", "OSProcess", "p", ":", "ProcessTree", ".", "this", ")", "if...
Immediate child processes.
[ "Immediate", "child", "processes", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ProcessTree.java#L232-L238
125,808
jenkinsci/jenkins
core/src/main/java/hudson/util/ProcessTree.java
OSProcess.act
public <T> T act(ProcessCallable<T> callable) throws IOException, InterruptedException { return callable.invoke(this, FilePath.localChannel); }
java
public <T> T act(ProcessCallable<T> callable) throws IOException, InterruptedException { return callable.invoke(this, FilePath.localChannel); }
[ "public", "<", "T", ">", "T", "act", "(", "ProcessCallable", "<", "T", ">", "callable", ")", "throws", "IOException", ",", "InterruptedException", "{", "return", "callable", ".", "invoke", "(", "this", ",", "FilePath", ".", "localChannel", ")", ";", "}" ]
Executes a chunk of code at the same machine where this process resides.
[ "Executes", "a", "chunk", "of", "code", "at", "the", "same", "machine", "where", "this", "process", "resides", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ProcessTree.java#L335-L337
125,809
jenkinsci/jenkins
core/src/main/java/hudson/util/ProcessTree.java
UnixProcess.kill
public void kill() throws InterruptedException { // after sending SIGTERM, wait for the process to cease to exist long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(softKillWaitSeconds); kill(deadline); }
java
public void kill() throws InterruptedException { // after sending SIGTERM, wait for the process to cease to exist long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(softKillWaitSeconds); kill(deadline); }
[ "public", "void", "kill", "(", ")", "throws", "InterruptedException", "{", "// after sending SIGTERM, wait for the process to cease to exist", "long", "deadline", "=", "System", ".", "nanoTime", "(", ")", "+", "TimeUnit", ".", "SECONDS", ".", "toNanos", "(", "softKill...
Tries to kill this process.
[ "Tries", "to", "kill", "this", "process", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ProcessTree.java#L763-L767
125,810
jenkinsci/jenkins
core/src/main/java/hudson/scheduler/CronTab.java
CronTab.hashify
public static @CheckForNull String hashify(String spec) { if (spec.contains("H")) { // if someone is already using H, presumably he knows what it is, so a warning is likely false positive return null; } else if (spec.startsWith("*/")) {// "*/15 ...." (every N minutes) to hash ...
java
public static @CheckForNull String hashify(String spec) { if (spec.contains("H")) { // if someone is already using H, presumably he knows what it is, so a warning is likely false positive return null; } else if (spec.startsWith("*/")) {// "*/15 ...." (every N minutes) to hash ...
[ "public", "static", "@", "CheckForNull", "String", "hashify", "(", "String", "spec", ")", "{", "if", "(", "spec", ".", "contains", "(", "\"H\"", ")", ")", "{", "// if someone is already using H, presumably he knows what it is, so a warning is likely false positive", "retu...
Checks a prospective crontab specification to see if it could benefit from balanced hashes. @param spec a (legal) spec @return a similar spec that uses a hash, if such a transformation is necessary; null if it is OK as is @since 1.510
[ "Checks", "a", "prospective", "crontab", "specification", "to", "see", "if", "it", "could", "benefit", "from", "balanced", "hashes", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scheduler/CronTab.java#L518-L542
125,811
jenkinsci/jenkins
core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java
SwapSpaceMonitor.toHtml
public String toHtml(MemoryUsage usage) { if(usage.availableSwapSpace==-1) return "N/A"; String humanReadableSpace = Functions.humanReadableByteSize(usage.availableSwapSpace); long free = usage.availableSwapSpace; free/=1024L; // convert to KB free/=1024L; ...
java
public String toHtml(MemoryUsage usage) { if(usage.availableSwapSpace==-1) return "N/A"; String humanReadableSpace = Functions.humanReadableByteSize(usage.availableSwapSpace); long free = usage.availableSwapSpace; free/=1024L; // convert to KB free/=1024L; ...
[ "public", "String", "toHtml", "(", "MemoryUsage", "usage", ")", "{", "if", "(", "usage", ".", "availableSwapSpace", "==", "-", "1", ")", "return", "\"N/A\"", ";", "String", "humanReadableSpace", "=", "Functions", ".", "humanReadableByteSize", "(", "usage", "."...
Returns the HTML representation of the space.
[ "Returns", "the", "HTML", "representation", "of", "the", "space", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java#L52-L66
125,812
jenkinsci/jenkins
core/src/main/java/hudson/model/TimeSeries.java
TimeSeries.update
public void update(float newData) { float data = history[0]*decay + newData*(1-decay); float[] r = new float[Math.min(history.length+1,historySize)]; System.arraycopy(history,0,r,1,Math.min(history.length,r.length-1)); r[0] = data; history = r; }
java
public void update(float newData) { float data = history[0]*decay + newData*(1-decay); float[] r = new float[Math.min(history.length+1,historySize)]; System.arraycopy(history,0,r,1,Math.min(history.length,r.length-1)); r[0] = data; history = r; }
[ "public", "void", "update", "(", "float", "newData", ")", "{", "float", "data", "=", "history", "[", "0", "]", "*", "decay", "+", "newData", "*", "(", "1", "-", "decay", ")", ";", "float", "[", "]", "r", "=", "new", "float", "[", "Math", ".", "...
Pushes a new data point. <p> Exponential moving average is calculated, and the {@link #history} is updated. This method needs to be called periodically and regularly, and it represents the raw data stream.
[ "Pushes", "a", "new", "data", "point", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/TimeSeries.java#L73-L80
125,813
jenkinsci/jenkins
core/src/main/java/hudson/scm/ChangeLogAnnotator.java
ChangeLogAnnotator.annotate
public void annotate(Run<?,?> build, Entry change, MarkupText text) { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogAnnotator.class, getClass(), "annotate", AbstractBuild.class, Entry.class, MarkupText.class)) { annotate((AbstractBuild) build, change, text); } else { ...
java
public void annotate(Run<?,?> build, Entry change, MarkupText text) { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogAnnotator.class, getClass(), "annotate", AbstractBuild.class, Entry.class, MarkupText.class)) { annotate((AbstractBuild) build, change, text); } else { ...
[ "public", "void", "annotate", "(", "Run", "<", "?", ",", "?", ">", "build", ",", "Entry", "change", ",", "MarkupText", "text", ")", "{", "if", "(", "build", "instanceof", "AbstractBuild", "&&", "Util", ".", "isOverridden", "(", "ChangeLogAnnotator", ".", ...
Called by Hudson to allow markups to be added to the changelog text. <p> This method is invoked each time a page is rendered, so implementations of this method should not take too long to execute. Also note that this method may be invoked concurrently by multiple threads. <p> If there's any error during the processin...
[ "Called", "by", "Hudson", "to", "allow", "markups", "to", "be", "added", "to", "the", "changelog", "text", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/ChangeLogAnnotator.java#L81-L87
125,814
jenkinsci/jenkins
core/src/main/java/hudson/model/ResourceList.java
ResourceList.union
public static ResourceList union(Collection<ResourceList> lists) { switch(lists.size()) { case 0: return EMPTY; case 1: return lists.iterator().next(); default: ResourceList r = new ResourceList(); for (ResourceList l : lists) { ...
java
public static ResourceList union(Collection<ResourceList> lists) { switch(lists.size()) { case 0: return EMPTY; case 1: return lists.iterator().next(); default: ResourceList r = new ResourceList(); for (ResourceList l : lists) { ...
[ "public", "static", "ResourceList", "union", "(", "Collection", "<", "ResourceList", ">", "lists", ")", "{", "switch", "(", "lists", ".", "size", "(", ")", ")", "{", "case", "0", ":", "return", "EMPTY", ";", "case", "1", ":", "return", "lists", ".", ...
Creates union of all resources.
[ "Creates", "union", "of", "all", "resources", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ResourceList.java#L76-L91
125,815
jenkinsci/jenkins
core/src/main/java/hudson/model/ResourceList.java
ResourceList.w
public ResourceList w(Resource r) { all.add(r); write.put(r, unbox(write.get(r))+1); return this; }
java
public ResourceList w(Resource r) { all.add(r); write.put(r, unbox(write.get(r))+1); return this; }
[ "public", "ResourceList", "w", "(", "Resource", "r", ")", "{", "all", ".", "add", "(", "r", ")", ";", "write", ".", "put", "(", "r", ",", "unbox", "(", "write", ".", "get", "(", "r", ")", ")", "+", "1", ")", ";", "return", "this", ";", "}" ]
Adds a resource for write access.
[ "Adds", "a", "resource", "for", "write", "access", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ResourceList.java#L104-L108
125,816
jenkinsci/jenkins
core/src/main/java/hudson/model/ResourceList.java
ResourceList.getConflict
public Resource getConflict(ResourceList that) { Resource r = _getConflict(this,that); if(r!=null) return r; return _getConflict(that,this); }
java
public Resource getConflict(ResourceList that) { Resource r = _getConflict(this,that); if(r!=null) return r; return _getConflict(that,this); }
[ "public", "Resource", "getConflict", "(", "ResourceList", "that", ")", "{", "Resource", "r", "=", "_getConflict", "(", "this", ",", "that", ")", ";", "if", "(", "r", "!=", "null", ")", "return", "r", ";", "return", "_getConflict", "(", "that", ",", "th...
Returns the resource in this list that's colliding with the given resource list.
[ "Returns", "the", "resource", "in", "this", "list", "that", "s", "colliding", "with", "the", "given", "resource", "list", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ResourceList.java#L121-L125
125,817
jenkinsci/jenkins
core/src/main/java/jenkins/model/lazy/BuildReference.java
BuildReference.get
public @CheckForNull R get() { Holder<R> h = holder; // capture return h!=null ? h.get() : null; }
java
public @CheckForNull R get() { Holder<R> h = holder; // capture return h!=null ? h.get() : null; }
[ "public", "@", "CheckForNull", "R", "get", "(", ")", "{", "Holder", "<", "R", ">", "h", "=", "holder", ";", "// capture", "return", "h", "!=", "null", "?", "h", ".", "get", "(", ")", ":", "null", ";", "}" ]
Gets the build if still in memory. @return the actual build, or null if it has been collected @see Holder#get
[ "Gets", "the", "build", "if", "still", "in", "memory", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/lazy/BuildReference.java#L51-L54
125,818
jenkinsci/jenkins
core/src/main/java/hudson/console/ConsoleAnnotator.java
ConsoleAnnotator.cast
@SuppressWarnings("unchecked") public static <T> ConsoleAnnotator<T> cast(ConsoleAnnotator<? super T> a) { return (ConsoleAnnotator)a; }
java
@SuppressWarnings("unchecked") public static <T> ConsoleAnnotator<T> cast(ConsoleAnnotator<? super T> a) { return (ConsoleAnnotator)a; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "ConsoleAnnotator", "<", "T", ">", "cast", "(", "ConsoleAnnotator", "<", "?", "super", "T", ">", "a", ")", "{", "return", "(", "ConsoleAnnotator", ")", "a", ";", "}" ]
Cast operation that restricts T.
[ "Cast", "operation", "that", "restricts", "T", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/console/ConsoleAnnotator.java#L90-L93
125,819
jenkinsci/jenkins
core/src/main/java/hudson/console/ConsoleAnnotator.java
ConsoleAnnotator._for
@SuppressWarnings({"unchecked", "rawtypes"}) // reflective public static <T> List<ConsoleAnnotator<T>> _for(T context) { List<ConsoleAnnotator<T>> r = new ArrayList<>(); for (ConsoleAnnotatorFactory f : ConsoleAnnotatorFactory.all()) { if (f.type().isInstance(context)) { ...
java
@SuppressWarnings({"unchecked", "rawtypes"}) // reflective public static <T> List<ConsoleAnnotator<T>> _for(T context) { List<ConsoleAnnotator<T>> r = new ArrayList<>(); for (ConsoleAnnotatorFactory f : ConsoleAnnotatorFactory.all()) { if (f.type().isInstance(context)) { ...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "// reflective", "public", "static", "<", "T", ">", "List", "<", "ConsoleAnnotator", "<", "T", ">", ">", "_for", "(", "T", "context", ")", "{", "List", "<", "ConsoleAnnotato...
List all the console annotators that can work for the specified context type.
[ "List", "all", "the", "console", "annotators", "that", "can", "work", "for", "the", "specified", "context", "type", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/console/ConsoleAnnotator.java#L146-L157
125,820
jenkinsci/jenkins
core/src/main/java/hudson/model/DownloadService.java
DownloadService.generateFragment
public String generateFragment() { if (!DownloadSettings.usePostBack()) { return ""; } if (neverUpdate) return ""; if (doesNotSupportPostMessage()) return ""; StringBuilder buf = new StringBuilder(); if(Jenkins.getInstance().hasPermission(Jenkins.READ)) { ...
java
public String generateFragment() { if (!DownloadSettings.usePostBack()) { return ""; } if (neverUpdate) return ""; if (doesNotSupportPostMessage()) return ""; StringBuilder buf = new StringBuilder(); if(Jenkins.getInstance().hasPermission(Jenkins.READ)) { ...
[ "public", "String", "generateFragment", "(", ")", "{", "if", "(", "!", "DownloadSettings", ".", "usePostBack", "(", ")", ")", "{", "return", "\"\"", ";", "}", "if", "(", "neverUpdate", ")", "return", "\"\"", ";", "if", "(", "doesNotSupportPostMessage", "("...
Builds up an HTML fragment that starts all the download jobs.
[ "Builds", "up", "an", "HTML", "fragment", "that", "starts", "all", "the", "download", "jobs", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/DownloadService.java#L84-L115
125,821
jenkinsci/jenkins
core/src/main/java/jenkins/model/PeepholePermalink.java
PeepholePermalink.resolve
@Override public Run<?, ?> resolve(Job<?, ?> job) { File f = getPermalinkFile(job); Run<?,?> b=null; try { String target = readSymlink(f); if (target!=null) { int n = Integer.parseInt(Util.getFileName(target)); if (n==RESOLVES_TO_NONE)...
java
@Override public Run<?, ?> resolve(Job<?, ?> job) { File f = getPermalinkFile(job); Run<?,?> b=null; try { String target = readSymlink(f); if (target!=null) { int n = Integer.parseInt(Util.getFileName(target)); if (n==RESOLVES_TO_NONE)...
[ "@", "Override", "public", "Run", "<", "?", ",", "?", ">", "resolve", "(", "Job", "<", "?", ",", "?", ">", "job", ")", "{", "File", "f", "=", "getPermalinkFile", "(", "job", ")", ";", "Run", "<", "?", ",", "?", ">", "b", "=", "null", ";", "...
Resolves the permalink by using the cache if possible.
[ "Resolves", "the", "permalink", "by", "using", "the", "cache", "if", "possible", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/PeepholePermalink.java#L84-L124
125,822
jenkinsci/jenkins
core/src/main/java/jenkins/model/PeepholePermalink.java
PeepholePermalink.find
private Run<?,?> find(Run<?,?> b) { for ( ; b!=null && !apply(b); b=b.getPreviousBuild()) ; return b; }
java
private Run<?,?> find(Run<?,?> b) { for ( ; b!=null && !apply(b); b=b.getPreviousBuild()) ; return b; }
[ "private", "Run", "<", "?", ",", "?", ">", "find", "(", "Run", "<", "?", ",", "?", ">", "b", ")", "{", "for", "(", ";", "b", "!=", "null", "&&", "!", "apply", "(", "b", ")", ";", "b", "=", "b", ".", "getPreviousBuild", "(", ")", ")", ";",...
Start from the build 'b' and locate the build that matches the criteria going back in time
[ "Start", "from", "the", "build", "b", "and", "locate", "the", "build", "that", "matches", "the", "criteria", "going", "back", "in", "time" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/PeepholePermalink.java#L129-L133
125,823
jenkinsci/jenkins
core/src/main/java/jenkins/model/PeepholePermalink.java
PeepholePermalink.exists
private static boolean exists(File link) { File[] kids = link.getParentFile().listFiles(); return kids != null && Arrays.asList(kids).contains(link); }
java
private static boolean exists(File link) { File[] kids = link.getParentFile().listFiles(); return kids != null && Arrays.asList(kids).contains(link); }
[ "private", "static", "boolean", "exists", "(", "File", "link", ")", "{", "File", "[", "]", "kids", "=", "link", ".", "getParentFile", "(", ")", ".", "listFiles", "(", ")", ";", "return", "kids", "!=", "null", "&&", "Arrays", ".", "asList", "(", "kids...
File.exists returns false for a link with a missing target, so for Java 6 compatibility we have to use this circuitous method to see if it was created.
[ "File", ".", "exists", "returns", "false", "for", "a", "link", "with", "a", "missing", "target", "so", "for", "Java", "6", "compatibility", "we", "have", "to", "use", "this", "circuitous", "method", "to", "see", "if", "it", "was", "created", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/PeepholePermalink.java#L158-L161
125,824
jenkinsci/jenkins
core/src/main/java/hudson/cli/GroovyCommand.java
GroovyCommand.loadScript
private String loadScript() throws CmdLineException, IOException, InterruptedException { if(script==null) throw new CmdLineException(null, "No script is specified"); if (script.equals("=")) return IOUtils.toString(stdin); checkChannel(); return null; // never cal...
java
private String loadScript() throws CmdLineException, IOException, InterruptedException { if(script==null) throw new CmdLineException(null, "No script is specified"); if (script.equals("=")) return IOUtils.toString(stdin); checkChannel(); return null; // never cal...
[ "private", "String", "loadScript", "(", ")", "throws", "CmdLineException", ",", "IOException", ",", "InterruptedException", "{", "if", "(", "script", "==", "null", ")", "throw", "new", "CmdLineException", "(", "null", ",", "\"No script is specified\"", ")", ";", ...
Loads the script from the argument.
[ "Loads", "the", "script", "from", "the", "argument", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/cli/GroovyCommand.java#L78-L86
125,825
jenkinsci/jenkins
core/src/main/java/hudson/model/queue/AbstractQueueSorterImpl.java
AbstractQueueSorterImpl.compare
public int compare(BuildableItem lhs, BuildableItem rhs) { return compare(lhs.buildableStartMilliseconds,rhs.buildableStartMilliseconds); }
java
public int compare(BuildableItem lhs, BuildableItem rhs) { return compare(lhs.buildableStartMilliseconds,rhs.buildableStartMilliseconds); }
[ "public", "int", "compare", "(", "BuildableItem", "lhs", ",", "BuildableItem", "rhs", ")", "{", "return", "compare", "(", "lhs", ".", "buildableStartMilliseconds", ",", "rhs", ".", "buildableStartMilliseconds", ")", ";", "}" ]
Override this method to provide the ordering of the sort. <p> if lhs should be build before rhs, return a negative value. Or put another way, think of the comparison as a process of converting a {@link BuildableItem} into a number, then doing num(lhs)-num(rhs). <p> The default implementation does FIFO.
[ "Override", "this", "method", "to", "provide", "the", "ordering", "of", "the", "sort", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/queue/AbstractQueueSorterImpl.java#L31-L33
125,826
jenkinsci/jenkins
core/src/main/java/hudson/util/DescribableList.java
DescribableList.replace
public void replace(T item) throws IOException { removeAll((Class)item.getClass()); data.add(item); onModified(); }
java
public void replace(T item) throws IOException { removeAll((Class)item.getClass()); data.add(item); onModified(); }
[ "public", "void", "replace", "(", "T", "item", ")", "throws", "IOException", "{", "removeAll", "(", "(", "Class", ")", "item", ".", "getClass", "(", ")", ")", ";", "data", ".", "add", "(", "item", ")", ";", "onModified", "(", ")", ";", "}" ]
Removes all instances of the same type, then add the new one.
[ "Removes", "all", "instances", "of", "the", "same", "type", "then", "add", "the", "new", "one", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/DescribableList.java#L100-L104
125,827
jenkinsci/jenkins
core/src/main/java/hudson/util/DescribableList.java
DescribableList.getDynamic
public T getDynamic(String id) { // by ID for (T t : data) if(t.getDescriptor().getId().equals(id)) return t; // by position try { return data.get(Integer.parseInt(id)); } catch (NumberFormatException e) { // fall through ...
java
public T getDynamic(String id) { // by ID for (T t : data) if(t.getDescriptor().getId().equals(id)) return t; // by position try { return data.get(Integer.parseInt(id)); } catch (NumberFormatException e) { // fall through ...
[ "public", "T", "getDynamic", "(", "String", "id", ")", "{", "// by ID", "for", "(", "T", "t", ":", "data", ")", "if", "(", "t", ".", "getDescriptor", "(", ")", ".", "getId", "(", ")", ".", "equals", "(", "id", ")", ")", "return", "t", ";", "// ...
Binds items in the collection to URL.
[ "Binds", "items", "in", "the", "collection", "to", "URL", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/DescribableList.java#L109-L123
125,828
jenkinsci/jenkins
core/src/main/java/hudson/Plugin.java
Plugin.configure
public void configure(StaplerRequest req, JSONObject formData) throws IOException, ServletException, FormException { configure(formData); }
java
public void configure(StaplerRequest req, JSONObject formData) throws IOException, ServletException, FormException { configure(formData); }
[ "public", "void", "configure", "(", "StaplerRequest", "req", ",", "JSONObject", "formData", ")", "throws", "IOException", ",", "ServletException", ",", "FormException", "{", "configure", "(", "formData", ")", ";", "}" ]
Handles the submission for the system configuration. <p> If this class defines {@code config.jelly} view, be sure to override this method and persists the submitted values accordingly. <p> The following is a sample {@code config.jelly} that you can start yours with: <pre>{@code <xmp> <j:jelly xmlns:j="jelly:core" xml...
[ "Handles", "the", "submission", "for", "the", "system", "configuration", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Plugin.java#L220-L222
125,829
jenkinsci/jenkins
core/src/main/java/hudson/Plugin.java
Plugin.save
public void save() throws IOException { if(BulkChange.contains(this)) return; XmlFile config = getConfigXml(); config.write(this); SaveableListener.fireOnChange(this, config); }
java
public void save() throws IOException { if(BulkChange.contains(this)) return; XmlFile config = getConfigXml(); config.write(this); SaveableListener.fireOnChange(this, config); }
[ "public", "void", "save", "(", ")", "throws", "IOException", "{", "if", "(", "BulkChange", ".", "contains", "(", "this", ")", ")", "return", ";", "XmlFile", "config", "=", "getConfigXml", "(", ")", ";", "config", ".", "write", "(", "this", ")", ";", ...
Saves serializable fields of this instance to the persisted storage. @since 1.245
[ "Saves", "serializable", "fields", "of", "this", "instance", "to", "the", "persisted", "storage", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Plugin.java#L275-L280
125,830
jenkinsci/jenkins
core/src/main/java/hudson/slaves/AbstractCloudSlave.java
AbstractCloudSlave.terminate
public void terminate() throws InterruptedException, IOException { final Computer computer = toComputer(); if (computer != null) { computer.recordTermination(); } try { // TODO: send the output to somewhere real _terminate(new StreamTaskListener(System...
java
public void terminate() throws InterruptedException, IOException { final Computer computer = toComputer(); if (computer != null) { computer.recordTermination(); } try { // TODO: send the output to somewhere real _terminate(new StreamTaskListener(System...
[ "public", "void", "terminate", "(", ")", "throws", "InterruptedException", ",", "IOException", "{", "final", "Computer", "computer", "=", "toComputer", "(", ")", ";", "if", "(", "computer", "!=", "null", ")", "{", "computer", ".", "recordTermination", "(", "...
Releases and removes this agent.
[ "Releases", "and", "removes", "this", "agent", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/slaves/AbstractCloudSlave.java#L60-L75
125,831
jenkinsci/jenkins
cli/src/main/java/hudson/util/QuotedStringTokenizer.java
QuotedStringTokenizer.quote
public static String quote(String s) { if (s==null) return null; if (s.length()==0) return "\"\""; StringBuffer b=new StringBuffer(s.length()+8); quote(b,s); return b.toString(); }
java
public static String quote(String s) { if (s==null) return null; if (s.length()==0) return "\"\""; StringBuffer b=new StringBuffer(s.length()+8); quote(b,s); return b.toString(); }
[ "public", "static", "String", "quote", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "return", "null", ";", "if", "(", "s", ".", "length", "(", ")", "==", "0", ")", "return", "\"\\\"\\\"\"", ";", "StringBuffer", "b", "=", "new", ...
Quote a string. The string is quoted only if quoting is required due to embedded delimiters, quote characters or the empty string. @param s The string to quote. @return quoted string
[ "Quote", "a", "string", ".", "The", "string", "is", "quoted", "only", "if", "quoting", "is", "required", "due", "to", "embedded", "delimiters", "quote", "characters", "or", "the", "empty", "string", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/util/QuotedStringTokenizer.java#L366-L377
125,832
jenkinsci/jenkins
core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
AbstractLazyLoadRunMap.reset
public synchronized void reset(TreeMap<Integer,R> builds) { Index index = new Index(); for (R r : builds.values()) { BuildReference<R> ref = createReference(r); index.byNumber.put(getNumberOf(r),ref); } this.index = index; }
java
public synchronized void reset(TreeMap<Integer,R> builds) { Index index = new Index(); for (R r : builds.values()) { BuildReference<R> ref = createReference(r); index.byNumber.put(getNumberOf(r),ref); } this.index = index; }
[ "public", "synchronized", "void", "reset", "(", "TreeMap", "<", "Integer", ",", "R", ">", "builds", ")", "{", "Index", "index", "=", "new", "Index", "(", ")", ";", "for", "(", "R", "r", ":", "builds", ".", "values", "(", ")", ")", "{", "BuildRefere...
Replaces all the current loaded Rs with the given ones.
[ "Replaces", "all", "the", "current", "loaded", "Rs", "with", "the", "given", "ones", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java#L567-L575
125,833
jenkinsci/jenkins
core/src/main/java/hudson/model/AdministrativeMonitor.java
AdministrativeMonitor.disable
public void disable(boolean value) throws IOException { AbstractCIBase jenkins = Jenkins.get(); Set<String> set = jenkins.getDisabledAdministrativeMonitors(); if(value) set.add(id); else set.remove(id); jenkins.save(); }
java
public void disable(boolean value) throws IOException { AbstractCIBase jenkins = Jenkins.get(); Set<String> set = jenkins.getDisabledAdministrativeMonitors(); if(value) set.add(id); else set.remove(id); jenkins.save(); }
[ "public", "void", "disable", "(", "boolean", "value", ")", "throws", "IOException", "{", "AbstractCIBase", "jenkins", "=", "Jenkins", ".", "get", "(", ")", ";", "Set", "<", "String", ">", "set", "=", "jenkins", ".", "getDisabledAdministrativeMonitors", "(", ...
Mark this monitor as disabled, to prevent this from showing up in the UI.
[ "Mark", "this", "monitor", "as", "disabled", "to", "prevent", "this", "from", "showing", "up", "in", "the", "UI", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AdministrativeMonitor.java#L118-L124
125,834
jenkinsci/jenkins
core/src/main/java/hudson/model/AdministrativeMonitor.java
AdministrativeMonitor.doDisable
@RequirePOST public void doDisable(StaplerRequest req, StaplerResponse rsp) throws IOException { disable(true); rsp.sendRedirect2(req.getContextPath()+"/manage"); }
java
@RequirePOST public void doDisable(StaplerRequest req, StaplerResponse rsp) throws IOException { disable(true); rsp.sendRedirect2(req.getContextPath()+"/manage"); }
[ "@", "RequirePOST", "public", "void", "doDisable", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", "{", "disable", "(", "true", ")", ";", "rsp", ".", "sendRedirect2", "(", "req", ".", "getContextPath", "(", ")", "+"...
URL binding to disable this monitor.
[ "URL", "binding", "to", "disable", "this", "monitor", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AdministrativeMonitor.java#L150-L154
125,835
jenkinsci/jenkins
core/src/main/java/hudson/util/ArgumentListBuilder.java
ArgumentListBuilder.add
public ArgumentListBuilder add(String a, boolean mask) { if(a!=null) { if(mask) { this.mask.set(args.size()); } args.add(a); } return this; }
java
public ArgumentListBuilder add(String a, boolean mask) { if(a!=null) { if(mask) { this.mask.set(args.size()); } args.add(a); } return this; }
[ "public", "ArgumentListBuilder", "add", "(", "String", "a", ",", "boolean", "mask", ")", "{", "if", "(", "a", "!=", "null", ")", "{", "if", "(", "mask", ")", "{", "this", ".", "mask", ".", "set", "(", "args", ".", "size", "(", ")", ")", ";", "}...
Optionally hide this part of the command line from being printed to the log. @param a a command argument @param mask true to suppress in output, false to print normally @return this @see hudson.Launcher.ProcStarter#masks(boolean[]) @see Launcher#maskedPrintCommandLine(List, boolean[], FilePath) @since 1.378
[ "Optionally", "hide", "this", "part", "of", "the", "command", "line", "from", "being", "printed", "to", "the", "log", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ArgumentListBuilder.java#L90-L98
125,836
jenkinsci/jenkins
core/src/main/java/hudson/util/ArgumentListBuilder.java
ArgumentListBuilder.addTokenized
public ArgumentListBuilder addTokenized(String s) { if(s==null) return this; add(Util.tokenize(s)); return this; }
java
public ArgumentListBuilder addTokenized(String s) { if(s==null) return this; add(Util.tokenize(s)); return this; }
[ "public", "ArgumentListBuilder", "addTokenized", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "return", "this", ";", "add", "(", "Util", ".", "tokenize", "(", "s", ")", ")", ";", "return", "this", ";", "}" ]
Decomposes the given token into multiple arguments by splitting via whitespace.
[ "Decomposes", "the", "given", "token", "into", "multiple", "arguments", "by", "splitting", "via", "whitespace", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ArgumentListBuilder.java#L150-L154
125,837
jenkinsci/jenkins
core/src/main/java/hudson/util/ArgumentListBuilder.java
ArgumentListBuilder.addKeyValuePairs
public ArgumentListBuilder addKeyValuePairs(String prefix, Map<String,String> props) { for (Entry<String,String> e : props.entrySet()) addKeyValuePair(prefix, e.getKey(), e.getValue(), false); return this; }
java
public ArgumentListBuilder addKeyValuePairs(String prefix, Map<String,String> props) { for (Entry<String,String> e : props.entrySet()) addKeyValuePair(prefix, e.getKey(), e.getValue(), false); return this; }
[ "public", "ArgumentListBuilder", "addKeyValuePairs", "(", "String", "prefix", ",", "Map", "<", "String", ",", "String", ">", "props", ")", "{", "for", "(", "Entry", "<", "String", ",", "String", ">", "e", ":", "props", ".", "entrySet", "(", ")", ")", "...
Adds key value pairs as "-Dkey=value -Dkey=value ..." {@code -D} portion is configurable as the 'prefix' parameter. @since 1.114
[ "Adds", "key", "value", "pairs", "as", "-", "Dkey", "=", "value", "-", "Dkey", "=", "value", "..." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ArgumentListBuilder.java#L171-L175
125,838
jenkinsci/jenkins
core/src/main/java/hudson/util/ArgumentListBuilder.java
ArgumentListBuilder.addKeyValuePairs
public ArgumentListBuilder addKeyValuePairs(String prefix, Map<String,String> props, Set<String> propsToMask) { for (Entry<String,String> e : props.entrySet()) { addKeyValuePair(prefix, e.getKey(), e.getValue(), (propsToMask != null) && propsToMask.contains(e.getKey())); } return thi...
java
public ArgumentListBuilder addKeyValuePairs(String prefix, Map<String,String> props, Set<String> propsToMask) { for (Entry<String,String> e : props.entrySet()) { addKeyValuePair(prefix, e.getKey(), e.getValue(), (propsToMask != null) && propsToMask.contains(e.getKey())); } return thi...
[ "public", "ArgumentListBuilder", "addKeyValuePairs", "(", "String", "prefix", ",", "Map", "<", "String", ",", "String", ">", "props", ",", "Set", "<", "String", ">", "propsToMask", ")", "{", "for", "(", "Entry", "<", "String", ",", "String", ">", "e", ":...
Adds key value pairs as "-Dkey=value -Dkey=value ..." with masking. @param prefix Configures the -D portion of the example. Defaults to -D if null. @param props The map of key/value pairs to add @param propsToMask Set containing key names to mark as masked in the argument list. Key names that do not exist in the set w...
[ "Adds", "key", "value", "pairs", "as", "-", "Dkey", "=", "value", "-", "Dkey", "=", "value", "...", "with", "masking", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ArgumentListBuilder.java#L189-L194
125,839
jenkinsci/jenkins
core/src/main/java/hudson/util/ArgumentListBuilder.java
ArgumentListBuilder.propertiesGeneratingResolver
private static VariableResolver<String> propertiesGeneratingResolver(final VariableResolver<String> original) { return new VariableResolver<String>() { public String resolve(String name) { final String value = original.resolve(name); if (value == null) return null; ...
java
private static VariableResolver<String> propertiesGeneratingResolver(final VariableResolver<String> original) { return new VariableResolver<String>() { public String resolve(String name) { final String value = original.resolve(name); if (value == null) return null; ...
[ "private", "static", "VariableResolver", "<", "String", ">", "propertiesGeneratingResolver", "(", "final", "VariableResolver", "<", "String", ">", "original", ")", "{", "return", "new", "VariableResolver", "<", "String", ">", "(", ")", "{", "public", "String", "...
Creates a resolver generating values to be safely placed in properties string. {@link Properties#load} generally removes single backslashes from input and that is not desirable for outcomes of macro substitution as the values can contain them but user has no way to escape them. @param original Resolution will be dele...
[ "Creates", "a", "resolver", "generating", "values", "to", "be", "safely", "placed", "in", "properties", "string", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ArgumentListBuilder.java#L249-L260
125,840
jenkinsci/jenkins
core/src/main/java/hudson/model/Node.java
Node.getChannel
@CheckForNull public final VirtualChannel getChannel() { Computer c = toComputer(); return c==null ? null : c.getChannel(); }
java
@CheckForNull public final VirtualChannel getChannel() { Computer c = toComputer(); return c==null ? null : c.getChannel(); }
[ "@", "CheckForNull", "public", "final", "VirtualChannel", "getChannel", "(", ")", "{", "Computer", "c", "=", "toComputer", "(", ")", ";", "return", "c", "==", "null", "?", "null", ":", "c", ".", "getChannel", "(", ")", ";", "}" ]
Gets the current channel, if the node is connected and online, or null. This is just a convenience method for {@link Computer#getChannel()} with null check.
[ "Gets", "the", "current", "channel", "if", "the", "node", "is", "connected", "and", "online", "or", "null", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Node.java#L215-L219
125,841
jenkinsci/jenkins
core/src/main/java/hudson/model/Node.java
Node.getLabelCloud
public TagCloud<LabelAtom> getLabelCloud() { return new TagCloud<LabelAtom>(getAssignedLabels(),new WeightFunction<LabelAtom>() { public float weight(LabelAtom item) { return item.getTiedJobCount(); } }); }
java
public TagCloud<LabelAtom> getLabelCloud() { return new TagCloud<LabelAtom>(getAssignedLabels(),new WeightFunction<LabelAtom>() { public float weight(LabelAtom item) { return item.getTiedJobCount(); } }); }
[ "public", "TagCloud", "<", "LabelAtom", ">", "getLabelCloud", "(", ")", "{", "return", "new", "TagCloud", "<", "LabelAtom", ">", "(", "getAssignedLabels", "(", ")", ",", "new", "WeightFunction", "<", "LabelAtom", ">", "(", ")", "{", "public", "float", "wei...
Return the possibly empty tag cloud for the labels of this node.
[ "Return", "the", "possibly", "empty", "tag", "cloud", "for", "the", "labels", "of", "this", "node", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Node.java#L284-L290
125,842
jenkinsci/jenkins
core/src/main/java/hudson/model/Node.java
Node.getDynamicLabels
private HashSet<LabelAtom> getDynamicLabels() { HashSet<LabelAtom> result = new HashSet<LabelAtom>(); for (LabelFinder labeler : LabelFinder.all()) { // Filter out any bad(null) results from plugins // for compatibility reasons, findLabels may return LabelExpression and not atom....
java
private HashSet<LabelAtom> getDynamicLabels() { HashSet<LabelAtom> result = new HashSet<LabelAtom>(); for (LabelFinder labeler : LabelFinder.all()) { // Filter out any bad(null) results from plugins // for compatibility reasons, findLabels may return LabelExpression and not atom....
[ "private", "HashSet", "<", "LabelAtom", ">", "getDynamicLabels", "(", ")", "{", "HashSet", "<", "LabelAtom", ">", "result", "=", "new", "HashSet", "<", "LabelAtom", ">", "(", ")", ";", "for", "(", "LabelFinder", "labeler", ":", "LabelFinder", ".", "all", ...
Return all the labels assigned dynamically to this node. This calls all the LabelFinder implementations with the node converts the results into Labels. @return HashSet<Label>.
[ "Return", "all", "the", "labels", "assigned", "dynamically", "to", "this", "node", ".", "This", "calls", "all", "the", "LabelFinder", "implementations", "with", "the", "node", "converts", "the", "results", "into", "Labels", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Node.java#L315-L324
125,843
jenkinsci/jenkins
core/src/main/java/hudson/model/Node.java
Node.getNodeProperty
@CheckForNull public <T extends NodeProperty> T getNodeProperty(Class<T> clazz) { for (NodeProperty p: getNodeProperties()) { if (clazz.isInstance(p)) { return clazz.cast(p); } } return null; }
java
@CheckForNull public <T extends NodeProperty> T getNodeProperty(Class<T> clazz) { for (NodeProperty p: getNodeProperties()) { if (clazz.isInstance(p)) { return clazz.cast(p); } } return null; }
[ "@", "CheckForNull", "public", "<", "T", "extends", "NodeProperty", ">", "T", "getNodeProperty", "(", "Class", "<", "T", ">", "clazz", ")", "{", "for", "(", "NodeProperty", "p", ":", "getNodeProperties", "(", ")", ")", "{", "if", "(", "clazz", ".", "is...
Gets the specified property or null if the property is not configured for this Node. @param clazz the type of the property @return null if the property is not configured @since 2.37
[ "Gets", "the", "specified", "property", "or", "null", "if", "the", "property", "is", "not", "configured", "for", "this", "Node", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Node.java#L475-L484
125,844
jenkinsci/jenkins
core/src/main/java/hudson/model/Node.java
Node.getNodeProperty
@CheckForNull public NodeProperty getNodeProperty(String className) { for (NodeProperty p: getNodeProperties()) { if (p.getClass().getName().equals(className)) { return p; } } return null; }
java
@CheckForNull public NodeProperty getNodeProperty(String className) { for (NodeProperty p: getNodeProperties()) { if (p.getClass().getName().equals(className)) { return p; } } return null; }
[ "@", "CheckForNull", "public", "NodeProperty", "getNodeProperty", "(", "String", "className", ")", "{", "for", "(", "NodeProperty", "p", ":", "getNodeProperties", "(", ")", ")", "{", "if", "(", "p", ".", "getClass", "(", ")", ".", "getName", "(", ")", "....
Gets the property from the given classname or null if the property is not configured for this Node. @param className The classname of the property @return null if the property is not configured @since 2.37
[ "Gets", "the", "property", "from", "the", "given", "classname", "or", "null", "if", "the", "property", "is", "not", "configured", "for", "this", "Node", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Node.java#L496-L505
125,845
jenkinsci/jenkins
core/src/main/java/hudson/model/Node.java
Node.getClockDifference
public ClockDifference getClockDifference() throws IOException, InterruptedException { VirtualChannel channel = getChannel(); if(channel==null) throw new IOException(getNodeName()+" is offline"); return channel.call(getClockDifferenceCallable()); }
java
public ClockDifference getClockDifference() throws IOException, InterruptedException { VirtualChannel channel = getChannel(); if(channel==null) throw new IOException(getNodeName()+" is offline"); return channel.call(getClockDifferenceCallable()); }
[ "public", "ClockDifference", "getClockDifference", "(", ")", "throws", "IOException", ",", "InterruptedException", "{", "VirtualChannel", "channel", "=", "getChannel", "(", ")", ";", "if", "(", "channel", "==", "null", ")", "throw", "new", "IOException", "(", "g...
Estimates the clock difference with this agent. @return always non-null. @throws InterruptedException if the operation is aborted.
[ "Estimates", "the", "clock", "difference", "with", "this", "agent", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Node.java#L557-L563
125,846
jenkinsci/jenkins
core/src/main/java/hudson/ProxyConfiguration.java
ProxyConfiguration.getNoProxyHostPatterns
public static List<Pattern> getNoProxyHostPatterns(String noProxyHost) { if (noProxyHost==null) return Collections.emptyList(); List<Pattern> r = Lists.newArrayList(); for (String s : noProxyHost.split("[ \t\n,|]+")) { if (s.length()==0) continue; r.add(Pattern.compile...
java
public static List<Pattern> getNoProxyHostPatterns(String noProxyHost) { if (noProxyHost==null) return Collections.emptyList(); List<Pattern> r = Lists.newArrayList(); for (String s : noProxyHost.split("[ \t\n,|]+")) { if (s.length()==0) continue; r.add(Pattern.compile...
[ "public", "static", "List", "<", "Pattern", ">", "getNoProxyHostPatterns", "(", "String", "noProxyHost", ")", "{", "if", "(", "noProxyHost", "==", "null", ")", "return", "Collections", ".", "emptyList", "(", ")", ";", "List", "<", "Pattern", ">", "r", "=",...
Returns the list of properly formatted no proxy host names.
[ "Returns", "the", "list", "of", "properly", "formatted", "no", "proxy", "host", "names", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/ProxyConfiguration.java#L187-L196
125,847
jenkinsci/jenkins
core/src/main/java/hudson/ProxyConfiguration.java
ProxyConfiguration.jenkins48775workaround
private void jenkins48775workaround(Proxy proxy, URL url) { if ("https".equals(url.getProtocol()) && !authCacheSeeded && proxy != Proxy.NO_PROXY) { HttpURLConnection preAuth = null; try { // We do not care if there is anything at this URL, all we care is that it is using ...
java
private void jenkins48775workaround(Proxy proxy, URL url) { if ("https".equals(url.getProtocol()) && !authCacheSeeded && proxy != Proxy.NO_PROXY) { HttpURLConnection preAuth = null; try { // We do not care if there is anything at this URL, all we care is that it is using ...
[ "private", "void", "jenkins48775workaround", "(", "Proxy", "proxy", ",", "URL", "url", ")", "{", "if", "(", "\"https\"", ".", "equals", "(", "url", ".", "getProtocol", "(", ")", ")", "&&", "!", "authCacheSeeded", "&&", "proxy", "!=", "Proxy", ".", "NO_PR...
If the first URL we try to access with a HTTP proxy is HTTPS then the authentication cache will not have been pre-populated, so we try to access at least one HTTP URL before the very first HTTPS url. @param proxy @param url the actual URL being opened.
[ "If", "the", "first", "URL", "we", "try", "to", "access", "with", "a", "HTTP", "proxy", "is", "HTTPS", "then", "the", "authentication", "cache", "will", "not", "have", "been", "pre", "-", "populated", "so", "we", "try", "to", "access", "at", "least", "...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/ProxyConfiguration.java#L301-L321
125,848
jenkinsci/jenkins
core/src/main/java/hudson/model/Label.java
Label.isOffline
@Exported public boolean isOffline() { for (Node n : getNodes()) { Computer c = n.toComputer(); if(c != null && !c.isOffline()) return false; } return true; }
java
@Exported public boolean isOffline() { for (Node n : getNodes()) { Computer c = n.toComputer(); if(c != null && !c.isOffline()) return false; } return true; }
[ "@", "Exported", "public", "boolean", "isOffline", "(", ")", "{", "for", "(", "Node", "n", ":", "getNodes", "(", ")", ")", "{", "Computer", "c", "=", "n", ".", "toComputer", "(", ")", ";", "if", "(", "c", "!=", "null", "&&", "!", "c", ".", "isO...
Returns true if all the nodes of this label is offline.
[ "Returns", "true", "if", "all", "the", "nodes", "of", "this", "label", "is", "offline", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Label.java#L334-L342
125,849
jenkinsci/jenkins
core/src/main/java/hudson/model/Label.java
Label.getDescription
@Exported public String getDescription() { Set<Node> nodes = getNodes(); if(nodes.isEmpty()) { Set<Cloud> clouds = getClouds(); if(clouds.isEmpty()) return Messages.Label_InvalidLabel(); return Messages.Label_ProvisionedFrom(toString(clouds)); ...
java
@Exported public String getDescription() { Set<Node> nodes = getNodes(); if(nodes.isEmpty()) { Set<Cloud> clouds = getClouds(); if(clouds.isEmpty()) return Messages.Label_InvalidLabel(); return Messages.Label_ProvisionedFrom(toString(clouds)); ...
[ "@", "Exported", "public", "String", "getDescription", "(", ")", "{", "Set", "<", "Node", ">", "nodes", "=", "getNodes", "(", ")", ";", "if", "(", "nodes", ".", "isEmpty", "(", ")", ")", "{", "Set", "<", "Cloud", ">", "clouds", "=", "getClouds", "(...
Returns a human readable text that explains this label.
[ "Returns", "a", "human", "readable", "text", "that", "explains", "this", "label", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Label.java#L347-L362
125,850
jenkinsci/jenkins
core/src/main/java/hudson/model/Label.java
Label.getTiedJobCount
public int getTiedJobCount() { if (tiedJobsCount != -1) return tiedJobsCount; // denormalize for performance // we don't need to respect security as much when returning a simple count SecurityContext context = ACL.impersonate(ACL.SYSTEM); try { int result = 0; ...
java
public int getTiedJobCount() { if (tiedJobsCount != -1) return tiedJobsCount; // denormalize for performance // we don't need to respect security as much when returning a simple count SecurityContext context = ACL.impersonate(ACL.SYSTEM); try { int result = 0; ...
[ "public", "int", "getTiedJobCount", "(", ")", "{", "if", "(", "tiedJobsCount", "!=", "-", "1", ")", "return", "tiedJobsCount", ";", "// denormalize for performance", "// we don't need to respect security as much when returning a simple count", "SecurityContext", "context", "=...
Returns an approximate count of projects that are tied on this node. In a system without security this should be the same as {@code getTiedJobs().size()} but significantly faster as it involves fewer temporary objects and avoids sorting the intermediary list. In a system with security, this will likely return a higher...
[ "Returns", "an", "approximate", "count", "of", "projects", "that", "are", "tied", "on", "this", "node", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Label.java#L402-L445
125,851
jenkinsci/jenkins
core/src/main/java/hudson/model/Label.java
Label.listAtoms
public Set<LabelAtom> listAtoms() { Set<LabelAtom> r = new HashSet<>(); accept(ATOM_COLLECTOR,r); return r; }
java
public Set<LabelAtom> listAtoms() { Set<LabelAtom> r = new HashSet<>(); accept(ATOM_COLLECTOR,r); return r; }
[ "public", "Set", "<", "LabelAtom", ">", "listAtoms", "(", ")", "{", "Set", "<", "LabelAtom", ">", "r", "=", "new", "HashSet", "<>", "(", ")", ";", "accept", "(", "ATOM_COLLECTOR", ",", "r", ")", ";", "return", "r", ";", "}" ]
Lists up all the atoms contained in in this label. @since 1.420
[ "Lists", "up", "all", "the", "atoms", "contained", "in", "in", "this", "label", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Label.java#L482-L486
125,852
jenkinsci/jenkins
core/src/main/java/hudson/model/Label.java
Label.parseExpression
public static Label parseExpression(String labelExpression) throws ANTLRException { LabelExpressionLexer lexer = new LabelExpressionLexer(new StringReader(labelExpression)); return new LabelExpressionParser(lexer).expr(); }
java
public static Label parseExpression(String labelExpression) throws ANTLRException { LabelExpressionLexer lexer = new LabelExpressionLexer(new StringReader(labelExpression)); return new LabelExpressionParser(lexer).expr(); }
[ "public", "static", "Label", "parseExpression", "(", "String", "labelExpression", ")", "throws", "ANTLRException", "{", "LabelExpressionLexer", "lexer", "=", "new", "LabelExpressionLexer", "(", "new", "StringReader", "(", "labelExpression", ")", ")", ";", "return", ...
Parses the expression into a label expression tree. TODO: replace this with a real parser later
[ "Parses", "the", "expression", "into", "a", "label", "expression", "tree", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Label.java#L629-L632
125,853
jenkinsci/jenkins
core/src/main/java/jenkins/model/RunIdMigrator.java
RunIdMigrator.delete
public synchronized void delete(File dir, String id) { if (idToNumber.remove(id) != null) { save(dir); } }
java
public synchronized void delete(File dir, String id) { if (idToNumber.remove(id) != null) { save(dir); } }
[ "public", "synchronized", "void", "delete", "(", "File", "dir", ",", "String", "id", ")", "{", "if", "(", "idToNumber", ".", "remove", "(", "id", ")", "!=", "null", ")", "{", "save", "(", "dir", ")", ";", "}", "}" ]
Delete the record of a build. @param dir as in {@link Job#getBuildDir} @param id a {@link Run#getId}
[ "Delete", "the", "record", "of", "a", "build", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/RunIdMigrator.java#L303-L307
125,854
jenkinsci/jenkins
core/src/main/java/jenkins/model/RunIdMigrator.java
RunIdMigrator.main
public static void main(String... args) throws Exception { if (args.length != 1) { throw new Exception("pass one parameter, $JENKINS_HOME"); } File root = new File(args[0]); File jobs = new File(root, "jobs"); if (!jobs.isDirectory()) { throw new FileNotFo...
java
public static void main(String... args) throws Exception { if (args.length != 1) { throw new Exception("pass one parameter, $JENKINS_HOME"); } File root = new File(args[0]); File jobs = new File(root, "jobs"); if (!jobs.isDirectory()) { throw new FileNotFo...
[ "public", "static", "void", "main", "(", "String", "...", "args", ")", "throws", "Exception", "{", "if", "(", "args", ".", "length", "!=", "1", ")", "{", "throw", "new", "Exception", "(", "\"pass one parameter, $JENKINS_HOME\"", ")", ";", "}", "File", "roo...
Reverses the migration, in case you want to revert to the older format. @param args one parameter, {@code $JENKINS_HOME}
[ "Reverses", "the", "migration", "in", "case", "you", "want", "to", "revert", "to", "the", "older", "format", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/RunIdMigrator.java#L313-L323
125,855
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.doPostBack
@RequirePOST public FormValidation doPostBack(StaplerRequest req) throws IOException, GeneralSecurityException { DownloadSettings.checkPostBackAccess(); return updateData(IOUtils.toString(req.getInputStream(),"UTF-8"), true); }
java
@RequirePOST public FormValidation doPostBack(StaplerRequest req) throws IOException, GeneralSecurityException { DownloadSettings.checkPostBackAccess(); return updateData(IOUtils.toString(req.getInputStream(),"UTF-8"), true); }
[ "@", "RequirePOST", "public", "FormValidation", "doPostBack", "(", "StaplerRequest", "req", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "DownloadSettings", ".", "checkPostBackAccess", "(", ")", ";", "return", "updateData", "(", "IOUtils", ".", ...
This is the endpoint that receives the update center data file from the browser.
[ "This", "is", "the", "endpoint", "that", "receives", "the", "update", "center", "data", "file", "from", "the", "browser", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L194-L198
125,856
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.doInvalidateData
@RequirePOST public HttpResponse doInvalidateData() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); dataTimestamp = 0; data = null; return HttpResponses.ok(); }
java
@RequirePOST public HttpResponse doInvalidateData() { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); dataTimestamp = 0; data = null; return HttpResponses.ok(); }
[ "@", "RequirePOST", "public", "HttpResponse", "doInvalidateData", "(", ")", "{", "Jenkins", ".", "getInstance", "(", ")", ".", "checkPermission", "(", "Jenkins", ".", "ADMINISTER", ")", ";", "dataTimestamp", "=", "0", ";", "data", "=", "null", ";", "return",...
Invalidates the cached data and force retrieval. @since 1.432
[ "Invalidates", "the", "cached", "data", "and", "force", "retrieval", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L307-L313
125,857
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getData
public Data getData() { if (data == null) { JSONObject o = getJSONObject(); if (o != null) { data = new Data(o); } } return data; }
java
public Data getData() { if (data == null) { JSONObject o = getJSONObject(); if (o != null) { data = new Data(o); } } return data; }
[ "public", "Data", "getData", "(", ")", "{", "if", "(", "data", "==", "null", ")", "{", "JSONObject", "o", "=", "getJSONObject", "(", ")", ";", "if", "(", "o", "!=", "null", ")", "{", "data", "=", "new", "Data", "(", "o", ")", ";", "}", "}", "...
Loads the update center data, if any. @return null if no data is available.
[ "Loads", "the", "update", "center", "data", "if", "any", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L320-L328
125,858
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getJSONObject
public JSONObject getJSONObject() { TextFile df = getDataFile(); if(df.exists()) { try { return JSONObject.fromObject(df.read()); } catch (JSONException | IOException e) { LOGGER.log(Level.SEVERE,"Failed to parse "+df,e); df.delete(...
java
public JSONObject getJSONObject() { TextFile df = getDataFile(); if(df.exists()) { try { return JSONObject.fromObject(df.read()); } catch (JSONException | IOException e) { LOGGER.log(Level.SEVERE,"Failed to parse "+df,e); df.delete(...
[ "public", "JSONObject", "getJSONObject", "(", ")", "{", "TextFile", "df", "=", "getDataFile", "(", ")", ";", "if", "(", "df", ".", "exists", "(", ")", ")", "{", "try", "{", "return", "JSONObject", ".", "fromObject", "(", "df", ".", "read", "(", ")", ...
Gets the raw update center JSON data.
[ "Gets", "the", "raw", "update", "center", "JSON", "data", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L333-L346
125,859
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getAvailables
@Exported public List<Plugin> getAvailables() { List<Plugin> r = new ArrayList<>(); Data data = getData(); if(data==null) return Collections.emptyList(); for (Plugin p : data.plugins.values()) { if(p.getInstalled()==null) r.add(p); } re...
java
@Exported public List<Plugin> getAvailables() { List<Plugin> r = new ArrayList<>(); Data data = getData(); if(data==null) return Collections.emptyList(); for (Plugin p : data.plugins.values()) { if(p.getInstalled()==null) r.add(p); } re...
[ "@", "Exported", "public", "List", "<", "Plugin", ">", "getAvailables", "(", ")", "{", "List", "<", "Plugin", ">", "r", "=", "new", "ArrayList", "<>", "(", ")", ";", "Data", "data", "=", "getData", "(", ")", ";", "if", "(", "data", "==", "null", ...
Returns a list of plugins that should be shown in the "available" tab. These are "all plugins - installed plugins".
[ "Returns", "a", "list", "of", "plugins", "that", "should", "be", "shown", "in", "the", "available", "tab", ".", "These", "are", "all", "plugins", "-", "installed", "plugins", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L352-L362
125,860
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getPlugin
public Plugin getPlugin(String artifactId) { Data dt = getData(); if(dt==null) return null; return dt.plugins.get(artifactId); }
java
public Plugin getPlugin(String artifactId) { Data dt = getData(); if(dt==null) return null; return dt.plugins.get(artifactId); }
[ "public", "Plugin", "getPlugin", "(", "String", "artifactId", ")", "{", "Data", "dt", "=", "getData", "(", ")", ";", "if", "(", "dt", "==", "null", ")", "return", "null", ";", "return", "dt", ".", "plugins", ".", "get", "(", "artifactId", ")", ";", ...
Gets the information about a specific plugin. @param artifactId The short name of the plugin. Corresponds to {@link PluginWrapper#getShortName()}. @return null if no such information is found.
[ "Gets", "the", "information", "about", "a", "specific", "plugin", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L373-L377
125,861
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getConnectionCheckUrl
@Exported @CheckForNull public String getConnectionCheckUrl() { Data dt = getData(); if(dt==null) return "http://www.google.com/"; return dt.connectionCheckUrl; }
java
@Exported @CheckForNull public String getConnectionCheckUrl() { Data dt = getData(); if(dt==null) return "http://www.google.com/"; return dt.connectionCheckUrl; }
[ "@", "Exported", "@", "CheckForNull", "public", "String", "getConnectionCheckUrl", "(", ")", "{", "Data", "dt", "=", "getData", "(", ")", ";", "if", "(", "dt", "==", "null", ")", "return", "\"http://www.google.com/\"", ";", "return", "dt", ".", "connectionCh...
Gets a URL for the Internet connection check. @return an "always up" server for Internet connectivity testing, or {@code null} if we are going to skip the test.
[ "Gets", "a", "URL", "for", "the", "Internet", "connection", "check", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L387-L393
125,862
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getUpdates
@Exported public List<Plugin> getUpdates() { Data data = getData(); if(data==null) return Collections.emptyList(); // fail to determine List<Plugin> r = new ArrayList<>(); for (PluginWrapper pw : Jenkins.getInstance().getPluginManager().getPlugins()) { Plugi...
java
@Exported public List<Plugin> getUpdates() { Data data = getData(); if(data==null) return Collections.emptyList(); // fail to determine List<Plugin> r = new ArrayList<>(); for (PluginWrapper pw : Jenkins.getInstance().getPluginManager().getPlugins()) { Plugi...
[ "@", "Exported", "public", "List", "<", "Plugin", ">", "getUpdates", "(", ")", "{", "Data", "data", "=", "getData", "(", ")", ";", "if", "(", "data", "==", "null", ")", "return", "Collections", ".", "emptyList", "(", ")", ";", "// fail to determine", "...
Returns the list of plugins that are updates to currently installed ones. @return can be empty but never null.
[ "Returns", "the", "list", "of", "plugins", "that", "are", "updates", "to", "currently", "installed", "ones", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L409-L421
125,863
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.hasUpdates
@Exported public boolean hasUpdates() { Data data = getData(); if(data==null) return false; for (PluginWrapper pw : Jenkins.getInstance().getPluginManager().getPlugins()) { if(!pw.isBundled() && pw.getUpdateInfo()!=null) // do not advertize updates t...
java
@Exported public boolean hasUpdates() { Data data = getData(); if(data==null) return false; for (PluginWrapper pw : Jenkins.getInstance().getPluginManager().getPlugins()) { if(!pw.isBundled() && pw.getUpdateInfo()!=null) // do not advertize updates t...
[ "@", "Exported", "public", "boolean", "hasUpdates", "(", ")", "{", "Data", "data", "=", "getData", "(", ")", ";", "if", "(", "data", "==", "null", ")", "return", "false", ";", "for", "(", "PluginWrapper", "pw", ":", "Jenkins", ".", "getInstance", "(", ...
Does any of the plugin has updates?
[ "Does", "any", "of", "the", "plugin", "has", "updates?" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L426-L438
125,864
jenkinsci/jenkins
core/src/main/java/hudson/model/UpdateSite.java
UpdateSite.getMetadataUrlForDownloadable
@CheckForNull @Restricted(NoExternalUse.class) public String getMetadataUrlForDownloadable(String downloadable) { String siteUrl = getUrl(); String updateSiteMetadataUrl = null; int baseUrlEnd = siteUrl.indexOf("update-center.json"); if (baseUrlEnd != -1) { String sit...
java
@CheckForNull @Restricted(NoExternalUse.class) public String getMetadataUrlForDownloadable(String downloadable) { String siteUrl = getUrl(); String updateSiteMetadataUrl = null; int baseUrlEnd = siteUrl.indexOf("update-center.json"); if (baseUrlEnd != -1) { String sit...
[ "@", "CheckForNull", "@", "Restricted", "(", "NoExternalUse", ".", "class", ")", "public", "String", "getMetadataUrlForDownloadable", "(", "String", "downloadable", ")", "{", "String", "siteUrl", "=", "getUrl", "(", ")", ";", "String", "updateSiteMetadataUrl", "="...
URL which exposes the metadata location in a specific update site. @param downloadable, the downloadable id of a specific metatadata json (e.g. hudson.tasks.Maven.MavenInstaller.json) @return the location @since 2.20
[ "URL", "which", "exposes", "the", "metadata", "location", "in", "a", "specific", "update", "site", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/UpdateSite.java#L457-L470
125,865
jenkinsci/jenkins
core/src/main/java/jenkins/security/LastGrantedAuthoritiesProperty.java
LastGrantedAuthoritiesProperty.invalidate
public void invalidate() throws IOException { if (roles!=null) { roles = null; timestamp = System.currentTimeMillis(); user.save(); } }
java
public void invalidate() throws IOException { if (roles!=null) { roles = null; timestamp = System.currentTimeMillis(); user.save(); } }
[ "public", "void", "invalidate", "(", ")", "throws", "IOException", "{", "if", "(", "roles", "!=", "null", ")", "{", "roles", "=", "null", ";", "timestamp", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "user", ".", "save", "(", ")", ";", "}...
Removes the recorded information
[ "Removes", "the", "recorded", "information" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/LastGrantedAuthoritiesProperty.java#L88-L94
125,866
jenkinsci/jenkins
core/src/main/java/hudson/model/listeners/SCMListener.java
SCMListener.onChangeLogParsed
public void onChangeLogParsed(Run<?,?> build, SCM scm, TaskListener listener, ChangeLogSet<?> changelog) throws Exception { if (build instanceof AbstractBuild && listener instanceof BuildListener && Util.isOverridden(SCMListener.class, getClass(), "onChangeLogParsed", AbstractBuild.class, BuildListener.class, C...
java
public void onChangeLogParsed(Run<?,?> build, SCM scm, TaskListener listener, ChangeLogSet<?> changelog) throws Exception { if (build instanceof AbstractBuild && listener instanceof BuildListener && Util.isOverridden(SCMListener.class, getClass(), "onChangeLogParsed", AbstractBuild.class, BuildListener.class, C...
[ "public", "void", "onChangeLogParsed", "(", "Run", "<", "?", ",", "?", ">", "build", ",", "SCM", "scm", ",", "TaskListener", "listener", ",", "ChangeLogSet", "<", "?", ">", "changelog", ")", "throws", "Exception", "{", "if", "(", "build", "instanceof", "...
Called once the changelog is determined. <p> During a build, Jenkins fetches the update of the workspace from SCM, and determines the changelog (see {@link SCM#checkout}). Immediately after that, a build will invoke this method on all registered {@link SCMListener}s. <p> If a build failed before we successfully deter...
[ "Called", "once", "the", "changelog", "is", "determined", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/listeners/SCMListener.java#L111-L115
125,867
jenkinsci/jenkins
core/src/main/java/hudson/model/queue/QueueSorter.java
QueueSorter.installDefaultQueueSorter
@Initializer(after=JOB_LOADED) public static void installDefaultQueueSorter() { ExtensionList<QueueSorter> all = all(); if (all.isEmpty()) return; Queue q = Jenkins.getInstance().getQueue(); if (q.getSorter()!=null) return; // someone has already installed something. leave t...
java
@Initializer(after=JOB_LOADED) public static void installDefaultQueueSorter() { ExtensionList<QueueSorter> all = all(); if (all.isEmpty()) return; Queue q = Jenkins.getInstance().getQueue(); if (q.getSorter()!=null) return; // someone has already installed something. leave t...
[ "@", "Initializer", "(", "after", "=", "JOB_LOADED", ")", "public", "static", "void", "installDefaultQueueSorter", "(", ")", "{", "ExtensionList", "<", "QueueSorter", ">", "all", "=", "all", "(", ")", ";", "if", "(", "all", ".", "isEmpty", "(", ")", ")",...
Installs the default queue sorter. {@link Queue#Queue(LoadBalancer)} is too early to do this
[ "Installs", "the", "default", "queue", "sorter", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/queue/QueueSorter.java#L72-L83
125,868
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.getBeanDefinition
public BeanDefinition getBeanDefinition(String name) { if(!getSpringConfig().containsBean(name)) return null; return getSpringConfig().getBeanConfig(name).getBeanDefinition(); }
java
public BeanDefinition getBeanDefinition(String name) { if(!getSpringConfig().containsBean(name)) return null; return getSpringConfig().getBeanConfig(name).getBeanDefinition(); }
[ "public", "BeanDefinition", "getBeanDefinition", "(", "String", "name", ")", "{", "if", "(", "!", "getSpringConfig", "(", ")", ".", "containsBean", "(", "name", ")", ")", "return", "null", ";", "return", "getSpringConfig", "(", ")", ".", "getBeanConfig", "("...
Retrieves a BeanDefinition for the given name @param name The bean definition @return The BeanDefinition instance
[ "Retrieves", "a", "BeanDefinition", "for", "the", "given", "name" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L162-L166
125,869
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.getBeanDefinitions
public Map<String,BeanDefinition> getBeanDefinitions() { Map<String,BeanDefinition> beanDefinitions = new HashMap<>(); for (String beanName : getSpringConfig().getBeanNames()) { BeanDefinition bd = getSpringConfig() .getBeanConfig(beanName) .getBeanDe...
java
public Map<String,BeanDefinition> getBeanDefinitions() { Map<String,BeanDefinition> beanDefinitions = new HashMap<>(); for (String beanName : getSpringConfig().getBeanNames()) { BeanDefinition bd = getSpringConfig() .getBeanConfig(beanName) .getBeanDe...
[ "public", "Map", "<", "String", ",", "BeanDefinition", ">", "getBeanDefinitions", "(", ")", "{", "Map", "<", "String", ",", "BeanDefinition", ">", "beanDefinitions", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "String", "beanName", ":", "getSpr...
Retrieves all BeanDefinitions for this BeanBuilder @return A map of BeanDefinition instances with the bean id as the key
[ "Retrieves", "all", "BeanDefinitions", "for", "this", "BeanBuilder" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L173-L183
125,870
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.methodMissing
public Object methodMissing(String name, Object arg) { Object[] args = (Object[])arg; if(args.length == 0) throw new MissingMethodException(name,getClass(),args); if(args[0] instanceof Closure) { // abstract bean definition return invokeBeanDefiningMethod(name, args); } ...
java
public Object methodMissing(String name, Object arg) { Object[] args = (Object[])arg; if(args.length == 0) throw new MissingMethodException(name,getClass(),args); if(args[0] instanceof Closure) { // abstract bean definition return invokeBeanDefiningMethod(name, args); } ...
[ "public", "Object", "methodMissing", "(", "String", "name", ",", "Object", "arg", ")", "{", "Object", "[", "]", "args", "=", "(", "Object", "[", "]", ")", "arg", ";", "if", "(", "args", ".", "length", "==", "0", ")", "throw", "new", "MissingMethodExc...
This method is invoked by Groovy when a method that's not defined in Java is invoked. We use that as a syntax for bean definition.
[ "This", "method", "is", "invoked", "by", "Groovy", "when", "a", "method", "that", "s", "not", "defined", "in", "Java", "is", "invoked", ".", "We", "use", "that", "as", "a", "syntax", "for", "bean", "definition", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L365-L387
125,871
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.setProperty
@Override public void setProperty(String name, Object value) { if(currentBeanConfig != null) { if(value instanceof GString)value = value.toString(); if(addToDeferred(currentBeanConfig, name, value)) { return; } else if(value instanceof Closure) { BeanConfiguration current = currentBeanConfig; ...
java
@Override public void setProperty(String name, Object value) { if(currentBeanConfig != null) { if(value instanceof GString)value = value.toString(); if(addToDeferred(currentBeanConfig, name, value)) { return; } else if(value instanceof Closure) { BeanConfiguration current = currentBeanConfig; ...
[ "@", "Override", "public", "void", "setProperty", "(", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "currentBeanConfig", "!=", "null", ")", "{", "if", "(", "value", "instanceof", "GString", ")", "value", "=", "value", ".", "toString", "...
This method overrides property setting in the scope of the BeanBuilder to set properties on the current BeanConfiguration
[ "This", "method", "overrides", "property", "setting", "in", "the", "scope", "of", "the", "BeanBuilder", "to", "set", "properties", "on", "the", "current", "BeanConfiguration" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L523-L555
125,872
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.manageMapIfNecessary
private Object manageMapIfNecessary(Map<Object, Object> value) { boolean containsRuntimeRefs = false; for (Entry<Object, Object> e : value.entrySet()) { Object v = e.getValue(); if (v instanceof RuntimeBeanReference) { containsRuntimeRefs = true; } ...
java
private Object manageMapIfNecessary(Map<Object, Object> value) { boolean containsRuntimeRefs = false; for (Entry<Object, Object> e : value.entrySet()) { Object v = e.getValue(); if (v instanceof RuntimeBeanReference) { containsRuntimeRefs = true; } ...
[ "private", "Object", "manageMapIfNecessary", "(", "Map", "<", "Object", ",", "Object", ">", "value", ")", "{", "boolean", "containsRuntimeRefs", "=", "false", ";", "for", "(", "Entry", "<", "Object", ",", "Object", ">", "e", ":", "value", ".", "entrySet", ...
Checks whether there are any runtime refs inside a Map and converts it to a ManagedMap if necessary @param value The current map @return A ManagedMap or a normal map
[ "Checks", "whether", "there", "are", "any", "runtime", "refs", "inside", "a", "Map", "and", "converts", "it", "to", "a", "ManagedMap", "if", "necessary" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L564-L584
125,873
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.manageListIfNecessary
private Object manageListIfNecessary(List<Object> value) { boolean containsRuntimeRefs = false; for (ListIterator<Object> i = value.listIterator(); i.hasNext();) { Object e = i.next(); if(e instanceof RuntimeBeanReference) { containsRuntimeRefs = true; } if (e instanceof BeanConfiguration) ...
java
private Object manageListIfNecessary(List<Object> value) { boolean containsRuntimeRefs = false; for (ListIterator<Object> i = value.listIterator(); i.hasNext();) { Object e = i.next(); if(e instanceof RuntimeBeanReference) { containsRuntimeRefs = true; } if (e instanceof BeanConfiguration) ...
[ "private", "Object", "manageListIfNecessary", "(", "List", "<", "Object", ">", "value", ")", "{", "boolean", "containsRuntimeRefs", "=", "false", ";", "for", "(", "ListIterator", "<", "Object", ">", "i", "=", "value", ".", "listIterator", "(", ")", ";", "i...
Checks whether there are any runtime refs inside the list and converts it to a ManagedList if necessary @param value The object that represents the list @return Either a new list or a managed one
[ "Checks", "whether", "there", "are", "any", "runtime", "refs", "inside", "the", "list", "and", "converts", "it", "to", "a", "ManagedList", "if", "necessary" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L593-L612
125,874
jenkinsci/jenkins
core/src/main/java/hudson/MarkupText.java
MarkupText.subText
public SubText subText(int start, int end) { return new SubText(start, end<0 ? text.length()+1+end : end); }
java
public SubText subText(int start, int end) { return new SubText(start, end<0 ? text.length()+1+end : end); }
[ "public", "SubText", "subText", "(", "int", "start", ",", "int", "end", ")", "{", "return", "new", "SubText", "(", "start", ",", "end", "<", "0", "?", "text", ".", "length", "(", ")", "+", "1", "+", "end", ":", "end", ")", ";", "}" ]
Returns a subtext. @param end If negative, -N means "trim the last N-1 chars". That is, (s,-1) is the same as (s,length)
[ "Returns", "a", "subtext", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/MarkupText.java#L252-L254
125,875
jenkinsci/jenkins
cli/src/main/java/hudson/cli/PrivateKeyProvider.java
PrivateKeyProvider.readFromDefaultLocations
public boolean readFromDefaultLocations() { final File home = new File(System.getProperty("user.home")); boolean read = false; for (String path : new String[] {".ssh/id_rsa", ".ssh/id_dsa", ".ssh/identity"}) { final File key = new File(home, path); if (!key.exists()) con...
java
public boolean readFromDefaultLocations() { final File home = new File(System.getProperty("user.home")); boolean read = false; for (String path : new String[] {".ssh/id_rsa", ".ssh/id_dsa", ".ssh/identity"}) { final File key = new File(home, path); if (!key.exists()) con...
[ "public", "boolean", "readFromDefaultLocations", "(", ")", "{", "final", "File", "home", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.home\"", ")", ")", ";", "boolean", "read", "=", "false", ";", "for", "(", "String", "path", ":", ...
Read keys from default keyFiles {@code .ssh/id_rsa}, {@code .ssh/id_dsa} and {@code .ssh/identity}. @return true if some key was read successfully.
[ "Read", "keys", "from", "default", "keyFiles" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/PrivateKeyProvider.java#L77-L99
125,876
jenkinsci/jenkins
cli/src/main/java/hudson/cli/PrivateKeyProvider.java
PrivateKeyProvider.readFrom
public void readFrom(File keyFile) throws IOException, GeneralSecurityException { final String password = isPemEncrypted(keyFile) ? askForPasswd(keyFile.getCanonicalPath()) : null ; privateKeys.add(loadKey(keyFile, password)); }
java
public void readFrom(File keyFile) throws IOException, GeneralSecurityException { final String password = isPemEncrypted(keyFile) ? askForPasswd(keyFile.getCanonicalPath()) : null ; privateKeys.add(loadKey(keyFile, password)); }
[ "public", "void", "readFrom", "(", "File", "keyFile", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "final", "String", "password", "=", "isPemEncrypted", "(", "keyFile", ")", "?", "askForPasswd", "(", "keyFile", ".", "getCanonicalPath", "(", ...
Read key from keyFile.
[ "Read", "key", "from", "keyFile", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/cli/src/main/java/hudson/cli/PrivateKeyProvider.java#L104-L110
125,877
jenkinsci/jenkins
core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java
AbstractDiskSpaceMonitor.markNodeOfflineIfDiskspaceIsTooLow
@Restricted(NoExternalUse.class) public DiskSpace markNodeOfflineIfDiskspaceIsTooLow(Computer c) { DiskSpace size = (DiskSpace) super.data(c); if(size!=null && size.size < getThresholdBytes()) { size.setTriggered(this.getClass(), true); if(getDescriptor().markOffline(c,size)) { ...
java
@Restricted(NoExternalUse.class) public DiskSpace markNodeOfflineIfDiskspaceIsTooLow(Computer c) { DiskSpace size = (DiskSpace) super.data(c); if(size!=null && size.size < getThresholdBytes()) { size.setTriggered(this.getClass(), true); if(getDescriptor().markOffline(c,size)) { ...
[ "@", "Restricted", "(", "NoExternalUse", ".", "class", ")", "public", "DiskSpace", "markNodeOfflineIfDiskspaceIsTooLow", "(", "Computer", "c", ")", "{", "DiskSpace", "size", "=", "(", "DiskSpace", ")", "super", ".", "data", "(", "c", ")", ";", "if", "(", "...
Marks the given node as offline if free disk space is below the configured threshold. @param c the node @return the free space @since 1.521
[ "Marks", "the", "given", "node", "as", "offline", "if", "free", "disk", "space", "is", "below", "the", "configured", "threshold", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java#L61-L71
125,878
jenkinsci/jenkins
core/src/main/java/hudson/cli/ConsoleCommand.java
ConsoleCommand.seek
private long seek(Run<?, ?> run) throws IOException { class RingBuffer { long[] lastNlines = new long[n]; int ptr=0; RingBuffer() { for (int i=0; i<n; i++) lastNlines[i] = -1; } void add(long pos) { ...
java
private long seek(Run<?, ?> run) throws IOException { class RingBuffer { long[] lastNlines = new long[n]; int ptr=0; RingBuffer() { for (int i=0; i<n; i++) lastNlines[i] = -1; } void add(long pos) { ...
[ "private", "long", "seek", "(", "Run", "<", "?", ",", "?", ">", "run", ")", "throws", "IOException", "{", "class", "RingBuffer", "{", "long", "[", "]", "lastNlines", "=", "new", "long", "[", "n", "]", ";", "int", "ptr", "=", "0", ";", "RingBuffer",...
Find the byte offset in the log input stream that marks "last N lines".
[ "Find", "the", "byte", "offset", "in", "the", "log", "input", "stream", "that", "marks", "last", "N", "lines", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/cli/ConsoleCommand.java#L97-L140
125,879
jenkinsci/jenkins
core/src/main/java/hudson/util/ChunkedOutputStream.java
ChunkedOutputStream.write
public void write(int b) throws IOException { cache[cachePosition] = (byte) b; cachePosition++; if (cachePosition == cache.length) flushCache(); }
java
public void write(int b) throws IOException { cache[cachePosition] = (byte) b; cachePosition++; if (cachePosition == cache.length) flushCache(); }
[ "public", "void", "write", "(", "int", "b", ")", "throws", "IOException", "{", "cache", "[", "cachePosition", "]", "=", "(", "byte", ")", "b", ";", "cachePosition", "++", ";", "if", "(", "cachePosition", "==", "cache", ".", "length", ")", "flushCache", ...
Write the specified byte to our output stream. Note: Avoid this method as it will cause an inefficient single byte chunk. Use write (byte[], int, int) instead. @param b The byte to be written @throws IOException if an input/output error occurs
[ "Write", "the", "specified", "byte", "to", "our", "output", "stream", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/ChunkedOutputStream.java#L160-L164
125,880
jenkinsci/jenkins
core/src/main/java/hudson/scm/SCMDescriptor.java
SCMDescriptor.load
@SuppressWarnings({"ConstantConditions"}) @Override public void load() { Class<? extends RepositoryBrowser> rb = repositoryBrowser; super.load(); if (repositoryBrowser!=rb) { // XStream may overwrite even the final field. try { Field f = SCMDescriptor.class.ge...
java
@SuppressWarnings({"ConstantConditions"}) @Override public void load() { Class<? extends RepositoryBrowser> rb = repositoryBrowser; super.load(); if (repositoryBrowser!=rb) { // XStream may overwrite even the final field. try { Field f = SCMDescriptor.class.ge...
[ "@", "SuppressWarnings", "(", "{", "\"ConstantConditions\"", "}", ")", "@", "Override", "public", "void", "load", "(", ")", "{", "Class", "<", "?", "extends", "RepositoryBrowser", ">", "rb", "=", "repositoryBrowser", ";", "super", ".", "load", "(", ")", ";...
causing the field to be persisted and overwritten on the load method.
[ "causing", "the", "field", "to", "be", "persisted", "and", "overwritten", "on", "the", "load", "method", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCMDescriptor.java#L79-L93
125,881
jenkinsci/jenkins
core/src/main/java/jenkins/security/s2m/CallableRejectionConfig.java
CallableRejectionConfig.report
void report(Class c) { if (!get().contains(c)) { try { append(c.getName()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to persist " + file, e); } } }
java
void report(Class c) { if (!get().contains(c)) { try { append(c.getName()); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to persist " + file, e); } } }
[ "void", "report", "(", "Class", "c", ")", "{", "if", "(", "!", "get", "(", ")", ".", "contains", "(", "c", ")", ")", "{", "try", "{", "append", "(", "c", ".", "getName", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "...
This method gets called every time we see a new type of callable that we reject, so that we can persist the list.
[ "This", "method", "gets", "called", "every", "time", "we", "see", "a", "new", "type", "of", "callable", "that", "we", "reject", "so", "that", "we", "can", "persist", "the", "list", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/s2m/CallableRejectionConfig.java#L55-L63
125,882
jenkinsci/jenkins
core/src/main/java/jenkins/security/s2m/CallableRejectionConfig.java
CallableRejectionConfig.describe
public List<RejectedCallable> describe() { List<RejectedCallable> l = new ArrayList<>(); for (Class c : get()) { if (!whitelist.contains(c.getName())) l.add(new RejectedCallable(c)); } return l; }
java
public List<RejectedCallable> describe() { List<RejectedCallable> l = new ArrayList<>(); for (Class c : get()) { if (!whitelist.contains(c.getName())) l.add(new RejectedCallable(c)); } return l; }
[ "public", "List", "<", "RejectedCallable", ">", "describe", "(", ")", "{", "List", "<", "RejectedCallable", ">", "l", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Class", "c", ":", "get", "(", ")", ")", "{", "if", "(", "!", "whitelist...
Return the object that helps the UI rendering by providing the details.
[ "Return", "the", "object", "that", "helps", "the", "UI", "rendering", "by", "providing", "the", "details", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/s2m/CallableRejectionConfig.java#L68-L75
125,883
jenkinsci/jenkins
core/src/main/java/hudson/scm/ChangeLogSet.java
ChangeLogSet.getItems
@Exported public final Object[] getItems() { List<T> r = new ArrayList<>(); for (T t : this) r.add(t); return r.toArray(); }
java
@Exported public final Object[] getItems() { List<T> r = new ArrayList<>(); for (T t : this) r.add(t); return r.toArray(); }
[ "@", "Exported", "public", "final", "Object", "[", "]", "getItems", "(", ")", "{", "List", "<", "T", ">", "r", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "T", "t", ":", "this", ")", "r", ".", "(", "t", ")", ";", "return", "r", ...
method for the remote API.
[ "method", "for", "the", "remote", "API", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/ChangeLogSet.java#L108-L114
125,884
jenkinsci/jenkins
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
JenkinsLocationConfiguration.getAdminAddress
public @Nonnull String getAdminAddress() { String v = adminAddress; if(v==null) v = Messages.Mailer_Address_Not_Configured(); return v; }
java
public @Nonnull String getAdminAddress() { String v = adminAddress; if(v==null) v = Messages.Mailer_Address_Not_Configured(); return v; }
[ "public", "@", "Nonnull", "String", "getAdminAddress", "(", ")", "{", "String", "v", "=", "adminAddress", ";", "if", "(", "v", "==", "null", ")", "v", "=", "Messages", ".", "Mailer_Address_Not_Configured", "(", ")", ";", "return", "v", ";", "}" ]
Gets the service administrator e-mail address. @return Admin address or &quot;address not configured&quot; stub
[ "Gets", "the", "service", "administrator", "e", "-", "mail", "address", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java#L92-L96
125,885
jenkinsci/jenkins
core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java
JenkinsLocationConfiguration.updateSecureSessionFlag
private void updateSecureSessionFlag() { try { ServletContext context = Jenkins.get().servletContext; Method m; try { m = context.getClass().getMethod("getSessionCookieConfig"); } catch (NoSuchMethodException x) { // 3.0+ LOGGER.log...
java
private void updateSecureSessionFlag() { try { ServletContext context = Jenkins.get().servletContext; Method m; try { m = context.getClass().getMethod("getSessionCookieConfig"); } catch (NoSuchMethodException x) { // 3.0+ LOGGER.log...
[ "private", "void", "updateSecureSessionFlag", "(", ")", "{", "try", "{", "ServletContext", "context", "=", "Jenkins", ".", "get", "(", ")", ".", "servletContext", ";", "Method", "m", ";", "try", "{", "m", "=", "context", ".", "getClass", "(", ")", ".", ...
If the Jenkins URL starts from "https", force the secure session flag @see <a href="https://www.owasp.org/index.php/SecureFlag">discussion of this topic in OWASP</a>
[ "If", "the", "Jenkins", "URL", "starts", "from", "https", "force", "the", "secure", "session", "flag" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java#L131-L157
125,886
jenkinsci/jenkins
core/src/main/java/hudson/util/CompressedFile.java
CompressedFile.write
public OutputStream write() throws IOException { if(gz.exists()) gz.delete(); try { return Files.newOutputStream(file.toPath()); } catch (InvalidPathException e) { throw new IOException(e); } }
java
public OutputStream write() throws IOException { if(gz.exists()) gz.delete(); try { return Files.newOutputStream(file.toPath()); } catch (InvalidPathException e) { throw new IOException(e); } }
[ "public", "OutputStream", "write", "(", ")", "throws", "IOException", "{", "if", "(", "gz", ".", "exists", "(", ")", ")", "gz", ".", "delete", "(", ")", ";", "try", "{", "return", "Files", ".", "newOutputStream", "(", "file", ".", "toPath", "(", ")",...
Gets the OutputStream to write to the file.
[ "Gets", "the", "OutputStream", "to", "write", "to", "the", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/CompressedFile.java#L79-L87
125,887
jenkinsci/jenkins
core/src/main/java/hudson/util/CompressedFile.java
CompressedFile.read
public InputStream read() throws IOException { if(file.exists()) try { return Files.newInputStream(file.toPath()); } catch (InvalidPathException e) { throw new IOException(e); } // check if the compressed file exists if(gz.exis...
java
public InputStream read() throws IOException { if(file.exists()) try { return Files.newInputStream(file.toPath()); } catch (InvalidPathException e) { throw new IOException(e); } // check if the compressed file exists if(gz.exis...
[ "public", "InputStream", "read", "(", ")", "throws", "IOException", "{", "if", "(", "file", ".", "exists", "(", ")", ")", "try", "{", "return", "Files", ".", "newInputStream", "(", "file", ".", "toPath", "(", ")", ")", ";", "}", "catch", "(", "Invali...
Reads the contents of a file.
[ "Reads", "the", "contents", "of", "a", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/CompressedFile.java#L92-L110
125,888
jenkinsci/jenkins
core/src/main/java/hudson/util/CompressedFile.java
CompressedFile.loadAsString
public String loadAsString() throws IOException { long sizeGuess; if(file.exists()) sizeGuess = file.length(); else if(gz.exists()) sizeGuess = gz.length()*2; else return ""; StringBuilder str = new StringBuilder((int)sizeGuess); ...
java
public String loadAsString() throws IOException { long sizeGuess; if(file.exists()) sizeGuess = file.length(); else if(gz.exists()) sizeGuess = gz.length()*2; else return ""; StringBuilder str = new StringBuilder((int)sizeGuess); ...
[ "public", "String", "loadAsString", "(", ")", "throws", "IOException", "{", "long", "sizeGuess", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "sizeGuess", "=", "file", ".", "length", "(", ")", ";", "else", "if", "(", "gz", ".", "exists", "("...
Loads the file content as a string.
[ "Loads", "the", "file", "content", "as", "a", "string", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/CompressedFile.java#L115-L136
125,889
jenkinsci/jenkins
core/src/main/java/hudson/util/CompressedFile.java
CompressedFile.compress
public void compress() { compressionThread.submit(new Runnable() { public void run() { try { try (InputStream in = read(); OutputStream os = Files.newOutputStream(gz.toPath()); OutputStream out = new GZIPOutputStre...
java
public void compress() { compressionThread.submit(new Runnable() { public void run() { try { try (InputStream in = read(); OutputStream os = Files.newOutputStream(gz.toPath()); OutputStream out = new GZIPOutputStre...
[ "public", "void", "compress", "(", ")", "{", "compressionThread", ".", "submit", "(", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "try", "{", "try", "(", "InputStream", "in", "=", "read", "(", ")", ";", "OutputStream", "...
Asynchronously schedules the compression of this file. <p> Once the file is compressed, the original will be removed and the further reading will be done from the compressed stream.
[ "Asynchronously", "schedules", "the", "compression", "of", "this", "file", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/CompressedFile.java#L145-L162
125,890
jenkinsci/jenkins
core/src/main/java/jenkins/util/VirtualFile.java
VirtualFile.run
public <V> V run(Callable<V,IOException> callable) throws IOException { return callable.call(); }
java
public <V> V run(Callable<V,IOException> callable) throws IOException { return callable.call(); }
[ "public", "<", "V", ">", "V", "run", "(", "Callable", "<", "V", ",", "IOException", ">", "callable", ")", "throws", "IOException", "{", "return", "callable", ".", "call", "(", ")", ";", "}" ]
Does some calculations in batch. For a remote file, this can be much faster than doing the corresponding operations one by one as separate requests. The default implementation just calls the block directly. @param <V> a value type @param callable something to run all at once (only helpful if any mentioned files are on ...
[ "Does", "some", "calculations", "in", "batch", ".", "For", "a", "remote", "file", "this", "can", "be", "much", "faster", "than", "doing", "the", "corresponding", "operations", "one", "by", "one", "as", "separate", "requests", ".", "The", "default", "implemen...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/VirtualFile.java#L361-L363
125,891
jenkinsci/jenkins
core/src/main/java/hudson/TcpSlaveAgentListener.java
TcpSlaveAgentListener.getIdentityPublicKey
@Nullable public String getIdentityPublicKey() { RSAPublicKey key = InstanceIdentityProvider.RSA.getPublicKey(); return key == null ? null : new String(Base64.encodeBase64(key.getEncoded()), Charset.forName("UTF-8")); }
java
@Nullable public String getIdentityPublicKey() { RSAPublicKey key = InstanceIdentityProvider.RSA.getPublicKey(); return key == null ? null : new String(Base64.encodeBase64(key.getEncoded()), Charset.forName("UTF-8")); }
[ "@", "Nullable", "public", "String", "getIdentityPublicKey", "(", ")", "{", "RSAPublicKey", "key", "=", "InstanceIdentityProvider", ".", "RSA", ".", "getPublicKey", "(", ")", ";", "return", "key", "==", "null", "?", "null", ":", "new", "String", "(", "Base64...
Gets the Base64 encoded public key that forms part of this instance's identity keypair. @return the Base64 encoded public key @since 2.16
[ "Gets", "the", "Base64", "encoded", "public", "key", "that", "forms", "part", "of", "this", "instance", "s", "identity", "keypair", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/TcpSlaveAgentListener.java#L140-L144
125,892
jenkinsci/jenkins
core/src/main/java/hudson/TcpSlaveAgentListener.java
TcpSlaveAgentListener.shutdown
public void shutdown() { shuttingDown = true; try { SocketAddress localAddress = serverSocket.getLocalAddress(); if (localAddress instanceof InetSocketAddress) { InetSocketAddress address = (InetSocketAddress) localAddress; Socket client = new Sock...
java
public void shutdown() { shuttingDown = true; try { SocketAddress localAddress = serverSocket.getLocalAddress(); if (localAddress instanceof InetSocketAddress) { InetSocketAddress address = (InetSocketAddress) localAddress; Socket client = new Sock...
[ "public", "void", "shutdown", "(", ")", "{", "shuttingDown", "=", "true", ";", "try", "{", "SocketAddress", "localAddress", "=", "serverSocket", ".", "getLocalAddress", "(", ")", ";", "if", "(", "localAddress", "instanceof", "InetSocketAddress", ")", "{", "Ine...
Initiates the shuts down of the listener.
[ "Initiates", "the", "shuts", "down", "of", "the", "listener", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/TcpSlaveAgentListener.java#L198-L216
125,893
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.readResolve
@SuppressWarnings({"unused"}) private Object readResolve() { if (jdks == null) { jdks = new ArrayList<>(); } if (SLAVE_AGENT_PORT_ENFORCE) { slaveAgentPort = getSlaveAgentPortInitialValue(slaveAgentPort); } if (disabledAgentProtocols == null && _disabl...
java
@SuppressWarnings({"unused"}) private Object readResolve() { if (jdks == null) { jdks = new ArrayList<>(); } if (SLAVE_AGENT_PORT_ENFORCE) { slaveAgentPort = getSlaveAgentPortInitialValue(slaveAgentPort); } if (disabledAgentProtocols == null && _disabl...
[ "@", "SuppressWarnings", "(", "{", "\"unused\"", "}", ")", "private", "Object", "readResolve", "(", ")", "{", "if", "(", "jdks", "==", "null", ")", "{", "jdks", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "if", "(", "SLAVE_AGENT_PORT_ENFORCE", "...
Maintains backwards compatibility. Invoked by XStream when this object is de-serialized.
[ "Maintains", "backwards", "compatibility", ".", "Invoked", "by", "XStream", "when", "this", "object", "is", "de", "-", "serialized", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1022-L1041
125,894
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.executeReactor
private void executeReactor(final InitStrategy is, TaskBuilder... builders) throws IOException, InterruptedException, ReactorException { Reactor reactor = new Reactor(builders) { /** * Sets the thread name to the task for better diagnostics. */ @Override ...
java
private void executeReactor(final InitStrategy is, TaskBuilder... builders) throws IOException, InterruptedException, ReactorException { Reactor reactor = new Reactor(builders) { /** * Sets the thread name to the task for better diagnostics. */ @Override ...
[ "private", "void", "executeReactor", "(", "final", "InitStrategy", "is", ",", "TaskBuilder", "...", "builders", ")", "throws", "IOException", ",", "InterruptedException", ",", "ReactorException", "{", "Reactor", "reactor", "=", "new", "Reactor", "(", "builders", "...
Executes a reactor. @param is If non-null, this can be consulted for ignoring some tasks. Only used during the initialization of Jenkins.
[ "Executes", "a", "reactor", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1078-L1131
125,895
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getAgentProtocols
public Set<String> getAgentProtocols() { if (agentProtocols == null) { // idempotent, so don't care if we do this concurrently, should all get same result Set<String> result = new TreeSet<>(); Set<String> disabled = new TreeSet<>(); for (String p : Util.fixNull(di...
java
public Set<String> getAgentProtocols() { if (agentProtocols == null) { // idempotent, so don't care if we do this concurrently, should all get same result Set<String> result = new TreeSet<>(); Set<String> disabled = new TreeSet<>(); for (String p : Util.fixNull(di...
[ "public", "Set", "<", "String", ">", "getAgentProtocols", "(", ")", "{", "if", "(", "agentProtocols", "==", "null", ")", "{", "// idempotent, so don't care if we do this concurrently, should all get same result", "Set", "<", "String", ">", "result", "=", "new", "TreeS...
Returns the enabled agent protocols. @return the enabled agent protocols. @since 2.16
[ "Returns", "the", "enabled", "agent", "protocols", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1182-L1205
125,896
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.setAgentProtocols
public void setAgentProtocols(Set<String> protocols) { Set<String> disabled = new TreeSet<>(); Set<String> enabled = new TreeSet<>(); for (AgentProtocol p : AgentProtocol.all()) { String name = p.getName(); if (name != null && !p.isRequired()) { // we want...
java
public void setAgentProtocols(Set<String> protocols) { Set<String> disabled = new TreeSet<>(); Set<String> enabled = new TreeSet<>(); for (AgentProtocol p : AgentProtocol.all()) { String name = p.getName(); if (name != null && !p.isRequired()) { // we want...
[ "public", "void", "setAgentProtocols", "(", "Set", "<", "String", ">", "protocols", ")", "{", "Set", "<", "String", ">", "disabled", "=", "new", "TreeSet", "<>", "(", ")", ";", "Set", "<", "String", ">", "enabled", "=", "new", "TreeSet", "<>", "(", "...
Sets the enabled agent protocols. @param protocols the enabled agent protocols. @since 2.16
[ "Sets", "the", "enabled", "agent", "protocols", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1213-L1252
125,897
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.findDescriptor
private <T extends Describable<T>> Descriptor<T> findDescriptor(String shortClassName, Collection<? extends Descriptor<T>> descriptors) { String name = '.'+shortClassName; for (Descriptor<T> d : descriptors) { if(d.clazz.getName().endsWith(name)) return d; } ...
java
private <T extends Describable<T>> Descriptor<T> findDescriptor(String shortClassName, Collection<? extends Descriptor<T>> descriptors) { String name = '.'+shortClassName; for (Descriptor<T> d : descriptors) { if(d.clazz.getName().endsWith(name)) return d; } ...
[ "private", "<", "T", "extends", "Describable", "<", "T", ">", ">", "Descriptor", "<", "T", ">", "findDescriptor", "(", "String", "shortClassName", ",", "Collection", "<", "?", "extends", "Descriptor", "<", "T", ">", ">", "descriptors", ")", "{", "String", ...
Finds a descriptor that has the specified name.
[ "Finds", "a", "descriptor", "that", "has", "the", "specified", "name", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1570-L1578
125,898
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getPlugin
@SuppressWarnings("unchecked") @CheckForNull public <P extends Plugin> P getPlugin(Class<P> clazz) { PluginWrapper p = pluginManager.getPlugin(clazz); if(p==null) return null; return (P) p.getPlugin(); }
java
@SuppressWarnings("unchecked") @CheckForNull public <P extends Plugin> P getPlugin(Class<P> clazz) { PluginWrapper p = pluginManager.getPlugin(clazz); if(p==null) return null; return (P) p.getPlugin(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "CheckForNull", "public", "<", "P", "extends", "Plugin", ">", "P", "getPlugin", "(", "Class", "<", "P", ">", "clazz", ")", "{", "PluginWrapper", "p", "=", "pluginManager", ".", "getPlugin", "(", "cla...
Gets the plugin object from its class. <p> This allows easy storage of plugin information in the plugin singleton without every plugin reimplementing the singleton pattern. @param <P> Class of the plugin @param clazz The plugin class (beware class-loader fun, this will probably only work from within the jpi that defi...
[ "Gets", "the", "plugin", "object", "from", "its", "class", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1620-L1626
125,899
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getPlugins
public <P extends Plugin> List<P> getPlugins(Class<P> clazz) { List<P> result = new ArrayList<>(); for (PluginWrapper w: pluginManager.getPlugins(clazz)) { result.add((P)w.getPlugin()); } return Collections.unmodifiableList(result); }
java
public <P extends Plugin> List<P> getPlugins(Class<P> clazz) { List<P> result = new ArrayList<>(); for (PluginWrapper w: pluginManager.getPlugins(clazz)) { result.add((P)w.getPlugin()); } return Collections.unmodifiableList(result); }
[ "public", "<", "P", "extends", "Plugin", ">", "List", "<", "P", ">", "getPlugins", "(", "Class", "<", "P", ">", "clazz", ")", "{", "List", "<", "P", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "PluginWrapper", "w", ":...
Gets the plugin objects from their super-class. @param clazz The plugin class (beware class-loader fun) @return The plugin instances.
[ "Gets", "the", "plugin", "objects", "from", "their", "super", "-", "class", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1635-L1641