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,900
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getMarkupFormatter
public @Nonnull MarkupFormatter getMarkupFormatter() { MarkupFormatter f = markupFormatter; return f != null ? f : new EscapedMarkupFormatter(); }
java
public @Nonnull MarkupFormatter getMarkupFormatter() { MarkupFormatter f = markupFormatter; return f != null ? f : new EscapedMarkupFormatter(); }
[ "public", "@", "Nonnull", "MarkupFormatter", "getMarkupFormatter", "(", ")", "{", "MarkupFormatter", "f", "=", "markupFormatter", ";", "return", "f", "!=", "null", "?", "f", ":", "new", "EscapedMarkupFormatter", "(", ")", ";", "}" ]
Gets the markup formatter used in the system. @return never null. @since 1.391
[ "Gets", "the", "markup", "formatter", "used", "in", "the", "system", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1657-L1660
125,901
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.setViews
public void setViews(Collection<View> views) throws IOException { BulkChange bc = new BulkChange(this); try { this.views.clear(); for (View v : views) { addView(v); } } finally { bc.commit(); } }
java
public void setViews(Collection<View> views) throws IOException { BulkChange bc = new BulkChange(this); try { this.views.clear(); for (View v : views) { addView(v); } } finally { bc.commit(); } }
[ "public", "void", "setViews", "(", "Collection", "<", "View", ">", "views", ")", "throws", "IOException", "{", "BulkChange", "bc", "=", "new", "BulkChange", "(", "this", ")", ";", "try", "{", "this", ".", "views", ".", "clear", "(", ")", ";", "for", ...
offers no such operation
[ "offers", "no", "such", "operation" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1836-L1846
125,902
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.isUpgradedFromBefore
public boolean isUpgradedFromBefore(VersionNumber v) { try { return new VersionNumber(version).isOlderThan(v); } catch (IllegalArgumentException e) { // fail to parse this version number return false; } }
java
public boolean isUpgradedFromBefore(VersionNumber v) { try { return new VersionNumber(version).isOlderThan(v); } catch (IllegalArgumentException e) { // fail to parse this version number return false; } }
[ "public", "boolean", "isUpgradedFromBefore", "(", "VersionNumber", "v", ")", "{", "try", "{", "return", "new", "VersionNumber", "(", "version", ")", ".", "isOlderThan", "(", "v", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "// fai...
Returns true if the current running Jenkins is upgraded from a version earlier than the specified version. <p> This method continues to return true until the system configuration is saved, at which point {@link #version} will be overwritten and Jenkins forgets the upgrade history. <p> To handle SNAPSHOTS correctly, p...
[ "Returns", "true", "if", "the", "current", "running", "Jenkins", "is", "upgraded", "from", "a", "version", "earlier", "than", "the", "specified", "version", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1906-L1913
125,903
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getLabel
public Label getLabel(String expr) { if(expr==null) return null; expr = hudson.util.QuotedStringTokenizer.unquote(expr); while(true) { Label l = labels.get(expr); if(l!=null) return l; // non-existent try { labels....
java
public Label getLabel(String expr) { if(expr==null) return null; expr = hudson.util.QuotedStringTokenizer.unquote(expr); while(true) { Label l = labels.get(expr); if(l!=null) return l; // non-existent try { labels....
[ "public", "Label", "getLabel", "(", "String", "expr", ")", "{", "if", "(", "expr", "==", "null", ")", "return", "null", ";", "expr", "=", "hudson", ".", "util", ".", "QuotedStringTokenizer", ".", "unquote", "(", "expr", ")", ";", "while", "(", "true", ...
Gets the label that exists on this system by the name. @return null if name is null. @see Label#parseExpression(String) (String)
[ "Gets", "the", "label", "that", "exists", "on", "this", "system", "by", "the", "name", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1948-L1964
125,904
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getLabels
public Set<Label> getLabels() { Set<Label> r = new TreeSet<>(); for (Label l : labels.values()) { if(!l.isEmpty()) r.add(l); } return r; }
java
public Set<Label> getLabels() { Set<Label> r = new TreeSet<>(); for (Label l : labels.values()) { if(!l.isEmpty()) r.add(l); } return r; }
[ "public", "Set", "<", "Label", ">", "getLabels", "(", ")", "{", "Set", "<", "Label", ">", "r", "=", "new", "TreeSet", "<>", "(", ")", ";", "for", "(", "Label", "l", ":", "labels", ".", "values", "(", ")", ")", "{", "if", "(", "!", "l", ".", ...
Gets all the active labels in the current system.
[ "Gets", "all", "the", "active", "labels", "in", "the", "current", "system", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L1988-L1995
125,905
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getJDK
public JDK getJDK(String name) { if(name==null) { // if only one JDK is configured, "default JDK" should mean that JDK. List<JDK> jdks = getJDKs(); if(jdks.size()==1) return jdks.get(0); return null; } for (JDK j : getJDKs()) { if(j.ge...
java
public JDK getJDK(String name) { if(name==null) { // if only one JDK is configured, "default JDK" should mean that JDK. List<JDK> jdks = getJDKs(); if(jdks.size()==1) return jdks.get(0); return null; } for (JDK j : getJDKs()) { if(j.ge...
[ "public", "JDK", "getJDK", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "// if only one JDK is configured, \"default JDK\" should mean that JDK.", "List", "<", "JDK", ">", "jdks", "=", "getJDKs", "(", ")", ";", "if", "(", "jdks",...
Gets the JDK installation of the given name, or returns null.
[ "Gets", "the", "JDK", "installation", "of", "the", "given", "name", "or", "returns", "null", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2033-L2045
125,906
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getActiveAdministrativeMonitors
public List<AdministrativeMonitor> getActiveAdministrativeMonitors() { return administrativeMonitors.stream().filter(m -> m.isEnabled() && m.isActivated()).collect(Collectors.toList()); }
java
public List<AdministrativeMonitor> getActiveAdministrativeMonitors() { return administrativeMonitors.stream().filter(m -> m.isEnabled() && m.isActivated()).collect(Collectors.toList()); }
[ "public", "List", "<", "AdministrativeMonitor", ">", "getActiveAdministrativeMonitors", "(", ")", "{", "return", "administrativeMonitors", ".", "stream", "(", ")", ".", "filter", "(", "m", "->", "m", ".", "isEnabled", "(", ")", "&&", "m", ".", "isActivated", ...
Returns the enabled and activated administrative monitors. @since 2.64
[ "Returns", "the", "enabled", "and", "activated", "administrative", "monitors", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2157-L2159
125,907
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getXForwardedHeader
private static String getXForwardedHeader(StaplerRequest req, String header, String defaultValue) { String value = req.getHeader(header); if (value != null) { int index = value.indexOf(','); return index == -1 ? value.trim() : value.substring(0,index).trim(); } re...
java
private static String getXForwardedHeader(StaplerRequest req, String header, String defaultValue) { String value = req.getHeader(header); if (value != null) { int index = value.indexOf(','); return index == -1 ? value.trim() : value.substring(0,index).trim(); } re...
[ "private", "static", "String", "getXForwardedHeader", "(", "StaplerRequest", "req", ",", "String", "header", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "req", ".", "getHeader", "(", "header", ")", ";", "if", "(", "value", "!=", "null", ...
Gets the originating "X-Forwarded-..." header from the request. If there are multiple headers the originating header is the first header. If the originating header contains a comma separated list, the originating entry is the first one. @param req the request @param header the header name @param defaultValue the value ...
[ "Gets", "the", "originating", "X", "-", "Forwarded", "-", "...", "header", "from", "the", "request", ".", "If", "there", "are", "multiple", "headers", "the", "originating", "header", "is", "the", "first", "header", ".", "If", "the", "originating", "header", ...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2367-L2374
125,908
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getSecurity
public SecurityMode getSecurity() { // fix the variable so that this code works under concurrent modification to securityRealm. SecurityRealm realm = securityRealm; if(realm==SecurityRealm.NO_AUTHENTICATION) return SecurityMode.UNSECURED; if(realm instanceof LegacySecurityRe...
java
public SecurityMode getSecurity() { // fix the variable so that this code works under concurrent modification to securityRealm. SecurityRealm realm = securityRealm; if(realm==SecurityRealm.NO_AUTHENTICATION) return SecurityMode.UNSECURED; if(realm instanceof LegacySecurityRe...
[ "public", "SecurityMode", "getSecurity", "(", ")", "{", "// fix the variable so that this code works under concurrent modification to securityRealm.", "SecurityRealm", "realm", "=", "securityRealm", ";", "if", "(", "realm", "==", "SecurityRealm", ".", "NO_AUTHENTICATION", ")", ...
Returns the constant that captures the three basic security modes in Jenkins.
[ "Returns", "the", "constant", "that", "captures", "the", "three", "basic", "security", "modes", "in", "Jenkins", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2495-L2504
125,909
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getItem
public Item getItem(String pathName, ItemGroup context) { if (context==null) context = this; if (pathName==null) return null; if (pathName.startsWith("/")) // absolute return getItemByFullName(pathName); Object/*Item|ItemGroup*/ ctx = context; StringTokenizer to...
java
public Item getItem(String pathName, ItemGroup context) { if (context==null) context = this; if (pathName==null) return null; if (pathName.startsWith("/")) // absolute return getItemByFullName(pathName); Object/*Item|ItemGroup*/ ctx = context; StringTokenizer to...
[ "public", "Item", "getItem", "(", "String", "pathName", ",", "ItemGroup", "context", ")", "{", "if", "(", "context", "==", "null", ")", "context", "=", "this", ";", "if", "(", "pathName", "==", "null", ")", "return", "null", ";", "if", "(", "pathName",...
Gets the item by its path name from the given context <h2>Path Names</h2> <p> If the name starts from '/', like "/foo/bar/zot", then it's interpreted as absolute. Otherwise, the name should be something like "foo/bar" and it's interpreted like relative path name in the file system is, against the given context. <p>For...
[ "Gets", "the", "item", "by", "its", "path", "name", "from", "the", "given", "context" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2775-L2818
125,910
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getUser
public @CheckForNull User getUser(String name) { return User.get(name, User.ALLOW_USER_CREATION_VIA_URL && hasPermission(ADMINISTER)); }
java
public @CheckForNull User getUser(String name) { return User.get(name, User.ALLOW_USER_CREATION_VIA_URL && hasPermission(ADMINISTER)); }
[ "public", "@", "CheckForNull", "User", "getUser", "(", "String", "name", ")", "{", "return", "User", ".", "get", "(", "name", ",", "User", ".", "ALLOW_USER_CREATION_VIA_URL", "&&", "hasPermission", "(", "ADMINISTER", ")", ")", ";", "}" ]
Gets the user of the given name. @return the user of the given name (which may or may not be an id), if that person exists; else null @see User#get(String,boolean) @see User#getById(String, boolean)
[ "Gets", "the", "user", "of", "the", "given", "name", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2889-L2891
125,911
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.putItem
public synchronized void putItem(TopLevelItem item) throws IOException, InterruptedException { String name = item.getName(); TopLevelItem old = items.get(name); if (old ==item) return; // noop checkPermission(Item.CREATE); if (old!=null) old.delete(); items....
java
public synchronized void putItem(TopLevelItem item) throws IOException, InterruptedException { String name = item.getName(); TopLevelItem old = items.get(name); if (old ==item) return; // noop checkPermission(Item.CREATE); if (old!=null) old.delete(); items....
[ "public", "synchronized", "void", "putItem", "(", "TopLevelItem", "item", ")", "throws", "IOException", ",", "InterruptedException", "{", "String", "name", "=", "item", ".", "getName", "(", ")", ";", "TopLevelItem", "old", "=", "items", ".", "get", "(", "nam...
Overwrites the existing item by new one. <p> This is a short cut for deleting an existing job and adding a new one.
[ "Overwrites", "the", "existing", "item", "by", "new", "one", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2907-L2917
125,912
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.createProject
public synchronized <T extends TopLevelItem> T createProject( Class<T> type, String name ) throws IOException { return type.cast(createProject((TopLevelItemDescriptor)getDescriptor(type),name)); }
java
public synchronized <T extends TopLevelItem> T createProject( Class<T> type, String name ) throws IOException { return type.cast(createProject((TopLevelItemDescriptor)getDescriptor(type),name)); }
[ "public", "synchronized", "<", "T", "extends", "TopLevelItem", ">", "T", "createProject", "(", "Class", "<", "T", ">", "type", ",", "String", "name", ")", "throws", "IOException", "{", "return", "type", ".", "cast", "(", "createProject", "(", "(", "TopLeve...
Creates a new job. <p> This version infers the descriptor from the type of the top-level item. @throws IllegalArgumentException if the project of the given name already exists.
[ "Creates", "a", "new", "job", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2928-L2930
125,913
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.getFingerprint
@StaplerDispatchable public Object getFingerprint( String md5sum ) throws IOException { Fingerprint r = fingerprintMap.get(md5sum); if(r==null) return new NoFingerprintMatch(md5sum); else return r; }
java
@StaplerDispatchable public Object getFingerprint( String md5sum ) throws IOException { Fingerprint r = fingerprintMap.get(md5sum); if(r==null) return new NoFingerprintMatch(md5sum); else return r; }
[ "@", "StaplerDispatchable", "public", "Object", "getFingerprint", "(", "String", "md5sum", ")", "throws", "IOException", "{", "Fingerprint", "r", "=", "fingerprintMap", ".", "get", "(", "md5sum", ")", ";", "if", "(", "r", "==", "null", ")", "return", "new", ...
if no finger print matches, display "not found page".
[ "if", "no", "finger", "print", "matches", "display", "not", "found", "page", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L2978-L2983
125,914
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.cleanUp
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void cleanUp() { if (theInstance != this && theInstance != null) { LOGGER.log(Level.WARNING, "This instance is no longer the singleton, ignoring cleanUp()"); return; } ...
java
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void cleanUp() { if (theInstance != this && theInstance != null) { LOGGER.log(Level.WARNING, "This instance is no longer the singleton, ignoring cleanUp()"); return; } ...
[ "@", "edu", ".", "umd", ".", "cs", ".", "findbugs", ".", "annotations", ".", "SuppressFBWarnings", "(", "\"ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD\"", ")", "public", "void", "cleanUp", "(", ")", "{", "if", "(", "theInstance", "!=", "this", "&&", "theInstance", ...
Called to shut down the system.
[ "Called", "to", "shut", "down", "the", "system", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L3277-L3351
125,915
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doConfigExecutorsSubmit
@RequirePOST public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); ...
java
@RequirePOST public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); ...
[ "@", "RequirePOST", "public", "synchronized", "void", "doConfigExecutorsSubmit", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", ",", "FormException", "{", "checkPermission", "(", "ADMINISTER", ")", "...
Accepts submission from the node configuration page.
[ "Accepts", "submission", "from", "the", "node", "configuration", "page", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L3775-L3793
125,916
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doCancelQuietDown
@RequirePOST // TODO the cancel link needs to be updated accordingly public synchronized HttpRedirect doCancelQuietDown() { checkPermission(ADMINISTER); isQuietingDown = false; getQueue().scheduleMaintenance(); return new HttpRedirect("."); }
java
@RequirePOST // TODO the cancel link needs to be updated accordingly public synchronized HttpRedirect doCancelQuietDown() { checkPermission(ADMINISTER); isQuietingDown = false; getQueue().scheduleMaintenance(); return new HttpRedirect("."); }
[ "@", "RequirePOST", "// TODO the cancel link needs to be updated accordingly", "public", "synchronized", "HttpRedirect", "doCancelQuietDown", "(", ")", "{", "checkPermission", "(", "ADMINISTER", ")", ";", "isQuietingDown", "=", "false", ";", "getQueue", "(", ")", ".", "...
Cancel previous quiet down Jenkins - preparation for a restart
[ "Cancel", "previous", "quiet", "down", "Jenkins", "-", "preparation", "for", "a", "restart" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L3839-L3845
125,917
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.checkGoodName
public static void checkGoodName(String name) throws Failure { if(name==null || name.length()==0) throw new Failure(Messages.Hudson_NoName()); if(".".equals(name.trim())) throw new Failure(Messages.Jenkins_NotAllowedName(".")); if("..".equals(name.trim())) th...
java
public static void checkGoodName(String name) throws Failure { if(name==null || name.length()==0) throw new Failure(Messages.Hudson_NoName()); if(".".equals(name.trim())) throw new Failure(Messages.Jenkins_NotAllowedName(".")); if("..".equals(name.trim())) th...
[ "public", "static", "void", "checkGoodName", "(", "String", "name", ")", "throws", "Failure", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "throw", "new", "Failure", "(", "Messages", ".", "Hudson_NoName", ...
Check if the given name is suitable as a name for job, view, etc. @throws Failure if the given name is not good
[ "Check", "if", "the", "given", "name", "is", "suitable", "as", "a", "name", "for", "job", "view", "etc", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L3939-L3957
125,918
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doSecured
public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { // TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active) if(req.getUserPrincipal()==null) { // authentication must have failed...
java
public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { // TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active) if(req.getUserPrincipal()==null) { // authentication must have failed...
[ "public", "void", "doSecured", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "// TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active)", "if", "("...
Checks if the user was successfully authenticated. @see BasicAuthenticationFilter
[ "Checks", "if", "the", "user", "was", "successfully", "authenticated", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L3976-L3992
125,919
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doLogout
public void doLogout( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String user = getAuthentication().getName(); securityRealm.doLogout(req, rsp); SecurityListener.fireLoggedOut(user); }
java
public void doLogout( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String user = getAuthentication().getName(); securityRealm.doLogout(req, rsp); SecurityListener.fireLoggedOut(user); }
[ "public", "void", "doLogout", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "String", "user", "=", "getAuthentication", "(", ")", ".", "getName", "(", ")", ";", "securityRealm", ".", "d...
Logs out the user.
[ "Logs", "out", "the", "user", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4026-L4030
125,920
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doReload
@RequirePOST public synchronized HttpResponse doReload() throws IOException { checkPermission(ADMINISTER); LOGGER.log(Level.WARNING, "Reloading Jenkins as requested by {0}", getAuthentication().getName()); // engage "loading ..." UI and then run the actual task in a separate thread ...
java
@RequirePOST public synchronized HttpResponse doReload() throws IOException { checkPermission(ADMINISTER); LOGGER.log(Level.WARNING, "Reloading Jenkins as requested by {0}", getAuthentication().getName()); // engage "loading ..." UI and then run the actual task in a separate thread ...
[ "@", "RequirePOST", "public", "synchronized", "HttpResponse", "doReload", "(", ")", "throws", "IOException", "{", "checkPermission", "(", "ADMINISTER", ")", ";", "LOGGER", ".", "log", "(", "Level", ".", "WARNING", ",", "\"Reloading Jenkins as requested by {0}\"", ",...
Reloads the configuration.
[ "Reloads", "the", "configuration", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4046-L4068
125,921
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doDoFingerprintCheck
@RequirePOST public void doDoFingerprintCheck( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { // Parse the request try (MultipartFormDataParser p = new MultipartFormDataParser(req)) { if (isUseCrumbs() && !getCrumbIssuer().validateCrumb(req, p)) { ...
java
@RequirePOST public void doDoFingerprintCheck( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { // Parse the request try (MultipartFormDataParser p = new MultipartFormDataParser(req)) { if (isUseCrumbs() && !getCrumbIssuer().validateCrumb(req, p)) { ...
[ "@", "RequirePOST", "public", "void", "doDoFingerprintCheck", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "// Parse the request", "try", "(", "MultipartFormDataParser", "p", "=", "new", "Mult...
Do a finger-print check.
[ "Do", "a", "finger", "-", "print", "check", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4097-L4108
125,922
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doGc
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("DM_GC") @RequirePOST public void doGc(StaplerResponse rsp) throws IOException { checkPermission(Jenkins.ADMINISTER); System.gc(); rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); rsp.getWriter...
java
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("DM_GC") @RequirePOST public void doGc(StaplerResponse rsp) throws IOException { checkPermission(Jenkins.ADMINISTER); System.gc(); rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); rsp.getWriter...
[ "@", "edu", ".", "umd", ".", "cs", ".", "findbugs", ".", "annotations", ".", "SuppressFBWarnings", "(", "\"DM_GC\"", ")", "@", "RequirePOST", "public", "void", "doGc", "(", "StaplerResponse", "rsp", ")", "throws", "IOException", "{", "checkPermission", "(", ...
For debugging. Expose URL to perform GC.
[ "For", "debugging", ".", "Expose", "URL", "to", "perform", "GC", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4113-L4121
125,923
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doSimulateOutOfMemory
@RequirePOST public void doSimulateOutOfMemory() throws IOException { checkPermission(ADMINISTER); System.out.println("Creating artificial OutOfMemoryError situation"); List<Object> args = new ArrayList<>(); //noinspection InfiniteLoopStatement while (true) args....
java
@RequirePOST public void doSimulateOutOfMemory() throws IOException { checkPermission(ADMINISTER); System.out.println("Creating artificial OutOfMemoryError situation"); List<Object> args = new ArrayList<>(); //noinspection InfiniteLoopStatement while (true) args....
[ "@", "RequirePOST", "public", "void", "doSimulateOutOfMemory", "(", ")", "throws", "IOException", "{", "checkPermission", "(", "ADMINISTER", ")", ";", "System", ".", "out", ".", "println", "(", "\"Creating artificial OutOfMemoryError situation\"", ")", ";", "List", ...
Simulates OutOfMemoryError. Useful to make sure OutOfMemoryHeapDump setting.
[ "Simulates", "OutOfMemoryError", ".", "Useful", "to", "make", "sure", "OutOfMemoryHeapDump", "setting", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4162-L4171
125,924
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doRestart
@CLIMethod(name="restart") public void doRestart(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, RestartNotSupportedException { checkPermission(ADMINISTER); if (req != null && req.getMethod().equals("GET")) { req.getView(this,"_restart.jelly").forward(req,r...
java
@CLIMethod(name="restart") public void doRestart(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, RestartNotSupportedException { checkPermission(ADMINISTER); if (req != null && req.getMethod().equals("GET")) { req.getView(this,"_restart.jelly").forward(req,r...
[ "@", "CLIMethod", "(", "name", "=", "\"restart\"", ")", "public", "void", "doRestart", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", ",", "RestartNotSupportedException", "{", "checkPermission", "(...
Perform a restart of Jenkins, if we can. This first replaces "app" to {@link HudsonIsRestarting}
[ "Perform", "a", "restart", "of", "Jenkins", "if", "we", "can", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4185-L4200
125,925
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doSafeRestart
@CLIMethod(name="safe-restart") public HttpResponse doSafeRestart(StaplerRequest req) throws IOException, ServletException, RestartNotSupportedException { checkPermission(ADMINISTER); if (req != null && req.getMethod().equals("GET")) return HttpResponses.forwardToView(this,"_safeRestart....
java
@CLIMethod(name="safe-restart") public HttpResponse doSafeRestart(StaplerRequest req) throws IOException, ServletException, RestartNotSupportedException { checkPermission(ADMINISTER); if (req != null && req.getMethod().equals("GET")) return HttpResponses.forwardToView(this,"_safeRestart....
[ "@", "CLIMethod", "(", "name", "=", "\"safe-restart\"", ")", "public", "HttpResponse", "doSafeRestart", "(", "StaplerRequest", "req", ")", "throws", "IOException", ",", "ServletException", ",", "RestartNotSupportedException", "{", "checkPermission", "(", "ADMINISTER", ...
Queues up a restart of Jenkins for when there are no builds running, if we can. This first replaces "app" to {@link HudsonIsRestarting} @since 1.332
[ "Queues", "up", "a", "restart", "of", "Jenkins", "for", "when", "there", "are", "no", "builds", "running", "if", "we", "can", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4209-L4220
125,926
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.restart
public void restart() throws RestartNotSupportedException { final Lifecycle lifecycle = restartableLifecycle(); servletContext.setAttribute("app", new HudsonIsRestarting()); new Thread("restart thread") { final String exitUser = getAuthentication().getName(); @Override ...
java
public void restart() throws RestartNotSupportedException { final Lifecycle lifecycle = restartableLifecycle(); servletContext.setAttribute("app", new HudsonIsRestarting()); new Thread("restart thread") { final String exitUser = getAuthentication().getName(); @Override ...
[ "public", "void", "restart", "(", ")", "throws", "RestartNotSupportedException", "{", "final", "Lifecycle", "lifecycle", "=", "restartableLifecycle", "(", ")", ";", "servletContext", ".", "setAttribute", "(", "\"app\"", ",", "new", "HudsonIsRestarting", "(", ")", ...
Performs a restart.
[ "Performs", "a", "restart", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4234-L4256
125,927
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doExit
@CLIMethod(name="shutdown") @RequirePOST public void doExit( StaplerRequest req, StaplerResponse rsp ) throws IOException { checkPermission(ADMINISTER); if (rsp!=null) { rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); try (PrintWrit...
java
@CLIMethod(name="shutdown") @RequirePOST public void doExit( StaplerRequest req, StaplerResponse rsp ) throws IOException { checkPermission(ADMINISTER); if (rsp!=null) { rsp.setStatus(HttpServletResponse.SC_OK); rsp.setContentType("text/plain"); try (PrintWrit...
[ "@", "CLIMethod", "(", "name", "=", "\"shutdown\"", ")", "@", "RequirePOST", "public", "void", "doExit", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", "{", "checkPermission", "(", "ADMINISTER", ")", ";", "if", "(", ...
Shutdown the system. @since 1.161
[ "Shutdown", "the", "system", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4326-L4353
125,928
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doSafeExit
@CLIMethod(name="safe-shutdown") @RequirePOST public HttpResponse doSafeExit(StaplerRequest req) throws IOException { checkPermission(ADMINISTER); isQuietingDown = true; final String exitUser = getAuthentication().getName(); final String exitAddr = req!=null ? req.getRemoteAddr()...
java
@CLIMethod(name="safe-shutdown") @RequirePOST public HttpResponse doSafeExit(StaplerRequest req) throws IOException { checkPermission(ADMINISTER); isQuietingDown = true; final String exitUser = getAuthentication().getName(); final String exitAddr = req!=null ? req.getRemoteAddr()...
[ "@", "CLIMethod", "(", "name", "=", "\"safe-shutdown\"", ")", "@", "RequirePOST", "public", "HttpResponse", "doSafeExit", "(", "StaplerRequest", "req", ")", "throws", "IOException", "{", "checkPermission", "(", "ADMINISTER", ")", ";", "isQuietingDown", "=", "true"...
Shutdown the system safely. @since 1.332
[ "Shutdown", "the", "system", "safely", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4359-L4387
125,929
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doEval
@RequirePOST public void doEval(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(RUN_SCRIPTS); try { MetaClass mc = WebApp.getCurrent().getMetaClass(getClass()); Script script = mc.classLoader.loadTearOff(JellyClassLoaderTearOff...
java
@RequirePOST public void doEval(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(RUN_SCRIPTS); try { MetaClass mc = WebApp.getCurrent().getMetaClass(getClass()); Script script = mc.classLoader.loadTearOff(JellyClassLoaderTearOff...
[ "@", "RequirePOST", "public", "void", "doEval", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "checkPermission", "(", "RUN_SCRIPTS", ")", ";", "try", "{", "MetaClass", "mc", "=", "WebApp"...
Evaluates the Jelly script submitted by the client. This is useful for system administration as well as unit testing.
[ "Evaluates", "the", "Jelly", "script", "submitted", "by", "the", "client", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4452-L4463
125,930
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doSignup
public void doSignup( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { if (getSecurityRealm().allowsSignup()) { req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp); return; } req.getView(SecurityRealm.class, "signup.jelly").fo...
java
public void doSignup( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { if (getSecurityRealm().allowsSignup()) { req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp); return; } req.getView(SecurityRealm.class, "signup.jelly").fo...
[ "public", "void", "doSignup", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "if", "(", "getSecurityRealm", "(", ")", ".", "allowsSignup", "(", ")", ")", "{", "req", ".", "getView", "(...
Sign up for the user account.
[ "Sign", "up", "for", "the", "user", "account", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4468-L4474
125,931
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.doIconSize
public void doIconSize( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); if(qs==null) throw new ServletException(); Cookie cookie = new Cookie("iconSize", Functions.validateIconSize(qs)); cookie.setMaxAge(/* ~4...
java
public void doIconSize( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); if(qs==null) throw new ServletException(); Cookie cookie = new Cookie("iconSize", Functions.validateIconSize(qs)); cookie.setMaxAge(/* ~4...
[ "public", "void", "doIconSize", "(", "StaplerRequest", "req", ",", "StaplerResponse", "rsp", ")", "throws", "IOException", ",", "ServletException", "{", "String", "qs", "=", "req", ".", "getQueryString", "(", ")", ";", "if", "(", "qs", "==", "null", ")", "...
Changes the icon size by changing the cookie
[ "Changes", "the", "icon", "size", "by", "changing", "the", "cookie" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4479-L4489
125,932
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.rebuildDependencyGraph
public void rebuildDependencyGraph() { DependencyGraph graph = new DependencyGraph(); graph.build(); // volatile acts a as a memory barrier here and therefore guarantees // that graph is fully build, before it's visible to other threads dependencyGraph = graph; dependency...
java
public void rebuildDependencyGraph() { DependencyGraph graph = new DependencyGraph(); graph.build(); // volatile acts a as a memory barrier here and therefore guarantees // that graph is fully build, before it's visible to other threads dependencyGraph = graph; dependency...
[ "public", "void", "rebuildDependencyGraph", "(", ")", "{", "DependencyGraph", "graph", "=", "new", "DependencyGraph", "(", ")", ";", "graph", ".", "build", "(", ")", ";", "// volatile acts a as a memory barrier here and therefore guarantees", "// that graph is fully build, ...
Rebuilds the dependency map.
[ "Rebuilds", "the", "dependency", "map", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4627-L4634
125,933
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.rebuildDependencyGraphAsync
public Future<DependencyGraph> rebuildDependencyGraphAsync() { dependencyGraphDirty.set(true); return Timer.get().schedule(new java.util.concurrent.Callable<DependencyGraph>() { @Override public DependencyGraph call() throws Exception { if (dependencyGraphDirty.ge...
java
public Future<DependencyGraph> rebuildDependencyGraphAsync() { dependencyGraphDirty.set(true); return Timer.get().schedule(new java.util.concurrent.Callable<DependencyGraph>() { @Override public DependencyGraph call() throws Exception { if (dependencyGraphDirty.ge...
[ "public", "Future", "<", "DependencyGraph", ">", "rebuildDependencyGraphAsync", "(", ")", "{", "dependencyGraphDirty", ".", "set", "(", "true", ")", ";", "return", "Timer", ".", "get", "(", ")", ".", "schedule", "(", "new", "java", ".", "util", ".", "concu...
Rebuilds the dependency map asynchronously. <p> This would keep the UI thread more responsive and helps avoid the deadlocks, as dependency graph recomputation tends to touch a lot of other things. @since 1.522
[ "Rebuilds", "the", "dependency", "map", "asynchronously", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4645-L4656
125,934
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.isSubjectToMandatoryReadPermissionCheck
public boolean isSubjectToMandatoryReadPermissionCheck(String restOfPath) { for (String name : ALWAYS_READABLE_PATHS) { if (restOfPath.startsWith(name)) { return false; } } for (String name : getUnprotectedRootActions()) { if (restOfPath.start...
java
public boolean isSubjectToMandatoryReadPermissionCheck(String restOfPath) { for (String name : ALWAYS_READABLE_PATHS) { if (restOfPath.startsWith(name)) { return false; } } for (String name : getUnprotectedRootActions()) { if (restOfPath.start...
[ "public", "boolean", "isSubjectToMandatoryReadPermissionCheck", "(", "String", "restOfPath", ")", "{", "for", "(", "String", "name", ":", "ALWAYS_READABLE_PATHS", ")", "{", "if", "(", "restOfPath", ".", "startsWith", "(", "name", ")", ")", "{", "return", "false"...
Test a path to see if it is subject to mandatory read permission checks by container-managed security @param restOfPath the URI, excluding the Jenkins root URI and query string @return true if the path is subject to mandatory read permission checks @since 2.37
[ "Test", "a", "path", "to", "see", "if", "it", "is", "subject", "to", "mandatory", "read", "permission", "checks", "by", "container", "-", "managed", "security" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4718-L4738
125,935
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.isDisplayNameUnique
boolean isDisplayNameUnique(String displayName, String currentJobName) { Collection<TopLevelItem> itemCollection = items.values(); // if there are a lot of projects, we'll have to store their // display names in a HashSet or something for a quick check for(TopLevelItem item : itemCollec...
java
boolean isDisplayNameUnique(String displayName, String currentJobName) { Collection<TopLevelItem> itemCollection = items.values(); // if there are a lot of projects, we'll have to store their // display names in a HashSet or something for a quick check for(TopLevelItem item : itemCollec...
[ "boolean", "isDisplayNameUnique", "(", "String", "displayName", ",", "String", "currentJobName", ")", "{", "Collection", "<", "TopLevelItem", ">", "itemCollection", "=", "items", ".", "values", "(", ")", ";", "// if there are a lot of projects, we'll have to store their",...
This method checks all existing jobs to see if displayName is unique. It does not check the displayName against the displayName of the job that the user is configuring though to prevent a validation warning if the user sets the displayName to what it currently is. @param displayName @param currentJobName
[ "This", "method", "checks", "all", "existing", "jobs", "to", "see", "if", "displayName", "is", "unique", ".", "It", "does", "not", "check", "the", "displayName", "against", "the", "displayName", "of", "the", "job", "that", "the", "user", "is", "configuring",...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4776-L4794
125,936
jenkinsci/jenkins
core/src/main/java/jenkins/model/Jenkins.java
Jenkins.isNameUnique
boolean isNameUnique(String name, String currentJobName) { Item item = getItem(name); if(null==item) { // the candidate name didn't return any items so the name is unique return true; } else if(item.getName().equals(currentJobName)) { // the candidate...
java
boolean isNameUnique(String name, String currentJobName) { Item item = getItem(name); if(null==item) { // the candidate name didn't return any items so the name is unique return true; } else if(item.getName().equals(currentJobName)) { // the candidate...
[ "boolean", "isNameUnique", "(", "String", "name", ",", "String", "currentJobName", ")", "{", "Item", "item", "=", "getItem", "(", "name", ")", ";", "if", "(", "null", "==", "item", ")", "{", "// the candidate name didn't return any items so the name is unique", "r...
True if there is no item in Jenkins that has this name @param name The name to test @param currentJobName The name of the job that the user is configuring
[ "True", "if", "there", "is", "no", "item", "in", "Jenkins", "that", "has", "this", "name" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/Jenkins.java#L4801-L4817
125,937
jenkinsci/jenkins
core/src/main/java/hudson/tasks/BuildWrapper.java
BuildWrapper.all
public static DescriptorExtensionList<BuildWrapper,Descriptor<BuildWrapper>> all() { // use getDescriptorList and not getExtensionList to pick up legacy instances return Jenkins.getInstance().<BuildWrapper,Descriptor<BuildWrapper>>getDescriptorList(BuildWrapper.class); }
java
public static DescriptorExtensionList<BuildWrapper,Descriptor<BuildWrapper>> all() { // use getDescriptorList and not getExtensionList to pick up legacy instances return Jenkins.getInstance().<BuildWrapper,Descriptor<BuildWrapper>>getDescriptorList(BuildWrapper.class); }
[ "public", "static", "DescriptorExtensionList", "<", "BuildWrapper", ",", "Descriptor", "<", "BuildWrapper", ">", ">", "all", "(", ")", "{", "// use getDescriptorList and not getExtensionList to pick up legacy instances", "return", "Jenkins", ".", "getInstance", "(", ")", ...
for compatibility we can't use BuildWrapperDescriptor
[ "for", "compatibility", "we", "can", "t", "use", "BuildWrapperDescriptor" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildWrapper.java#L312-L315
125,938
jenkinsci/jenkins
core/src/main/java/hudson/model/MultiStageTimeSeries.java
MultiStageTimeSeries.update
public void update(float f) { counter = (counter+1)%360; // 1hour/10sec = 60mins/10sec=3600secs/10sec = 360 sec10.update(f); if(counter%6==0) min.update(f); if(counter==0) hour.update(f); }
java
public void update(float f) { counter = (counter+1)%360; // 1hour/10sec = 60mins/10sec=3600secs/10sec = 360 sec10.update(f); if(counter%6==0) min.update(f); if(counter==0) hour.update(f); }
[ "public", "void", "update", "(", "float", "f", ")", "{", "counter", "=", "(", "counter", "+", "1", ")", "%", "360", ";", "// 1hour/10sec = 60mins/10sec=3600secs/10sec = 360", "sec10", ".", "update", "(", "f", ")", ";", "if", "(", "counter", "%", "6", "==...
Call this method every 10 sec and supply a new data point.
[ "Call", "this", "method", "every", "10", "sec", "and", "supply", "a", "new", "data", "point", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/MultiStageTimeSeries.java#L121-L126
125,939
jenkinsci/jenkins
core/src/main/java/hudson/util/BootFailure.java
BootFailure.loadAttempts
protected List<Date> loadAttempts(File home) { List<Date> dates = new ArrayList<>(); if (home!=null) { File f = getBootFailureFile(home); try { if (f.exists()) { try (BufferedReader failureFileReader = new BufferedReader(new FileReader(f))) { ...
java
protected List<Date> loadAttempts(File home) { List<Date> dates = new ArrayList<>(); if (home!=null) { File f = getBootFailureFile(home); try { if (f.exists()) { try (BufferedReader failureFileReader = new BufferedReader(new FileReader(f))) { ...
[ "protected", "List", "<", "Date", ">", "loadAttempts", "(", "File", "home", ")", "{", "List", "<", "Date", ">", "dates", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "home", "!=", "null", ")", "{", "File", "f", "=", "getBootFailureFile", ...
Parses the boot attempt file carefully so as not to cause the entire hook script to fail to execute.
[ "Parses", "the", "boot", "attempt", "file", "carefully", "so", "as", "not", "to", "cause", "the", "entire", "hook", "script", "to", "fail", "to", "execute", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/BootFailure.java#L57-L79
125,940
jenkinsci/jenkins
core/src/main/java/hudson/util/XStream2.java
XStream2.toXMLUTF8
public void toXMLUTF8(Object obj, OutputStream out) throws IOException { Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8")); w.write("<?xml version=\"1.1\" encoding=\"UTF-8\"?>\n"); toXML(obj, w); }
java
public void toXMLUTF8(Object obj, OutputStream out) throws IOException { Writer w = new OutputStreamWriter(out, Charset.forName("UTF-8")); w.write("<?xml version=\"1.1\" encoding=\"UTF-8\"?>\n"); toXML(obj, w); }
[ "public", "void", "toXMLUTF8", "(", "Object", "obj", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "Writer", "w", "=", "new", "OutputStreamWriter", "(", "out", ",", "Charset", ".", "forName", "(", "\"UTF-8\"", ")", ")", ";", "w", ".", "w...
Serializes to a byte stream. Uses UTF-8 encoding and specifies that in the XML encoding declaration. @since 1.504
[ "Serializes", "to", "a", "byte", "stream", ".", "Uses", "UTF", "-", "8", "encoding", "and", "specifies", "that", "in", "the", "XML", "encoding", "declaration", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/XStream2.java#L310-L314
125,941
jenkinsci/jenkins
core/src/main/java/hudson/model/queue/MappingWorksheet.java
ExecutorChunk.canAccept
public boolean canAccept(WorkChunk c) { if (this.size()<c.size()) return false; // too small compared towork if (c.assignedLabel!=null && !c.assignedLabel.contains(node)) return false; // label mismatch if (!(Node.SKIP_BUILD_CHECK_ON_FLYWEIGHTS &...
java
public boolean canAccept(WorkChunk c) { if (this.size()<c.size()) return false; // too small compared towork if (c.assignedLabel!=null && !c.assignedLabel.contains(node)) return false; // label mismatch if (!(Node.SKIP_BUILD_CHECK_ON_FLYWEIGHTS &...
[ "public", "boolean", "canAccept", "(", "WorkChunk", "c", ")", "{", "if", "(", "this", ".", "size", "(", ")", "<", "c", ".", "size", "(", ")", ")", "return", "false", ";", "// too small compared towork", "if", "(", "c", ".", "assignedLabel", "!=", "null...
Is this executor chunk and the given work chunk compatible? Can the latter be run on the former?
[ "Is", "this", "executor", "chunk", "and", "the", "given", "work", "chunk", "compatible?", "Can", "the", "latter", "be", "run", "on", "the", "former?" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/queue/MappingWorksheet.java#L130-L141
125,942
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/DefaultRuntimeSpringConfiguration.java
DefaultRuntimeSpringConfiguration.addAbstractBean
public BeanConfiguration addAbstractBean(String name) { BeanConfiguration bc = new DefaultBeanConfiguration(name); bc.setAbstract(true); registerBeanConfiguration(name, bc); return bc; }
java
public BeanConfiguration addAbstractBean(String name) { BeanConfiguration bc = new DefaultBeanConfiguration(name); bc.setAbstract(true); registerBeanConfiguration(name, bc); return bc; }
[ "public", "BeanConfiguration", "addAbstractBean", "(", "String", "name", ")", "{", "BeanConfiguration", "bc", "=", "new", "DefaultBeanConfiguration", "(", "name", ")", ";", "bc", ".", "setAbstract", "(", "true", ")", ";", "registerBeanConfiguration", "(", "name", ...
Adds an abstract bean and returns the BeanConfiguration instance @param name The name of the bean @return The BeanConfiguration object
[ "Adds", "an", "abstract", "bean", "and", "returns", "the", "BeanConfiguration", "instance" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/DefaultRuntimeSpringConfiguration.java#L229-L235
125,943
jenkinsci/jenkins
core/src/main/java/hudson/tasks/Shell.java
Shell.addLineFeedForNonASCII
private static String addLineFeedForNonASCII(String s) { if(!s.startsWith("#!")) { if (s.indexOf('\n')!=0) { return "\n" + s; } } return s; }
java
private static String addLineFeedForNonASCII(String s) { if(!s.startsWith("#!")) { if (s.indexOf('\n')!=0) { return "\n" + s; } } return s; }
[ "private", "static", "String", "addLineFeedForNonASCII", "(", "String", "s", ")", "{", "if", "(", "!", "s", ".", "startsWith", "(", "\"#!\"", ")", ")", "{", "if", "(", "s", ".", "indexOf", "(", "'", "'", ")", "!=", "0", ")", "{", "return", "\"\\n\"...
Older versions of bash have a bug where non-ASCII on the first line makes the shell think the file is a binary file and not a script. Adding a leading line feed works around this problem.
[ "Older", "versions", "of", "bash", "have", "a", "bug", "where", "non", "-", "ASCII", "on", "the", "first", "line", "makes", "the", "shell", "think", "the", "file", "is", "a", "binary", "file", "and", "not", "a", "script", ".", "Adding", "a", "leading",...
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/Shell.java#L76-L84
125,944
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieTask.java
LottieTask.addListener
public synchronized LottieTask<T> addListener(LottieListener<T> listener) { if (result != null && result.getValue() != null) { listener.onResult(result.getValue()); } successListeners.add(listener); return this; }
java
public synchronized LottieTask<T> addListener(LottieListener<T> listener) { if (result != null && result.getValue() != null) { listener.onResult(result.getValue()); } successListeners.add(listener); return this; }
[ "public", "synchronized", "LottieTask", "<", "T", ">", "addListener", "(", "LottieListener", "<", "T", ">", "listener", ")", "{", "if", "(", "result", "!=", "null", "&&", "result", ".", "getValue", "(", ")", "!=", "null", ")", "{", "listener", ".", "on...
Add a task listener. If the task has completed, the listener will be called synchronously. @return the task for call chaining.
[ "Add", "a", "task", "listener", ".", "If", "the", "task", "has", "completed", "the", "listener", "will", "be", "called", "synchronously", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieTask.java#L77-L84
125,945
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieTask.java
LottieTask.addFailureListener
public synchronized LottieTask<T> addFailureListener(LottieListener<Throwable> listener) { if (result != null && result.getException() != null) { listener.onResult(result.getException()); } failureListeners.add(listener); return this; }
java
public synchronized LottieTask<T> addFailureListener(LottieListener<Throwable> listener) { if (result != null && result.getException() != null) { listener.onResult(result.getException()); } failureListeners.add(listener); return this; }
[ "public", "synchronized", "LottieTask", "<", "T", ">", "addFailureListener", "(", "LottieListener", "<", "Throwable", ">", "listener", ")", "{", "if", "(", "result", "!=", "null", "&&", "result", ".", "getException", "(", ")", "!=", "null", ")", "{", "list...
Add a task failure listener. This will only be called in the even that an exception occurs. If an exception has already occurred, the listener will be called immediately. @return the task for call chaining.
[ "Add", "a", "task", "failure", "listener", ".", "This", "will", "only", "be", "called", "in", "the", "even", "that", "an", "exception", "occurs", ".", "If", "an", "exception", "has", "already", "occurred", "the", "listener", "will", "be", "called", "immedi...
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieTask.java#L101-L108
125,946
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/utils/Utils.java
Utils.renderPath
public static Bitmap renderPath(Path path) { RectF bounds = new RectF(); path.computeBounds(bounds, false); Bitmap bitmap = Bitmap.createBitmap((int) bounds.right, (int) bounds.bottom, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); Paint paint = new LPaint(); paint.setAntiAlias(tr...
java
public static Bitmap renderPath(Path path) { RectF bounds = new RectF(); path.computeBounds(bounds, false); Bitmap bitmap = Bitmap.createBitmap((int) bounds.right, (int) bounds.bottom, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); Paint paint = new LPaint(); paint.setAntiAlias(tr...
[ "public", "static", "Bitmap", "renderPath", "(", "Path", "path", ")", "{", "RectF", "bounds", "=", "new", "RectF", "(", ")", ";", "path", ".", "computeBounds", "(", "bounds", ",", "false", ")", ";", "Bitmap", "bitmap", "=", "Bitmap", ".", "createBitmap",...
For testing purposes only. DO NOT USE IN PRODUCTION.
[ "For", "testing", "purposes", "only", ".", "DO", "NOT", "USE", "IN", "PRODUCTION", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/utils/Utils.java#L233-L243
125,947
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.playAnimation
@MainThread public void playAnimation() { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { playAnimation(); } }); return; } if (systemAnimationsEnabled || get...
java
@MainThread public void playAnimation() { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { playAnimation(); } }); return; } if (systemAnimationsEnabled || get...
[ "@", "MainThread", "public", "void", "playAnimation", "(", ")", "{", "if", "(", "compositionLayer", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ...
Plays the animation from the beginning. If speed is < 0, it will start at the end and play towards the beginning
[ "Plays", "the", "animation", "from", "the", "beginning", ".", "If", "speed", "is", "<", "0", "it", "will", "start", "at", "the", "end", "and", "play", "towards", "the", "beginning" ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L368-L386
125,948
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.resumeAnimation
@MainThread public void resumeAnimation() { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { resumeAnimation(); } }); return; } animator.resumeAnimation(); }
java
@MainThread public void resumeAnimation() { if (compositionLayer == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { resumeAnimation(); } }); return; } animator.resumeAnimation(); }
[ "@", "MainThread", "public", "void", "resumeAnimation", "(", ")", "{", "if", "(", "compositionLayer", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(",...
Continues playing the animation from its current position. If speed < 0, it will play backwards from the current position.
[ "Continues", "playing", "the", "animation", "from", "its", "current", "position", ".", "If", "speed", "<", "0", "it", "will", "play", "backwards", "from", "the", "current", "position", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L398-L410
125,949
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setMinFrame
public void setMinFrame(final int minFrame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMinFrame(minFrame); } }); return; } animator.setMinFrame(minFrame); ...
java
public void setMinFrame(final int minFrame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMinFrame(minFrame); } }); return; } animator.setMinFrame(minFrame); ...
[ "public", "void", "setMinFrame", "(", "final", "int", "minFrame", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(...
Sets the minimum frame that the animation will start from when playing or looping.
[ "Sets", "the", "minimum", "frame", "that", "the", "animation", "will", "start", "from", "when", "playing", "or", "looping", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L415-L426
125,950
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setMinProgress
public void setMinProgress(final float minProgress) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMinProgress(minProgress); } }); return; } setMinFrame((int) ...
java
public void setMinProgress(final float minProgress) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMinProgress(minProgress); } }); return; } setMinFrame((int) ...
[ "public", "void", "setMinProgress", "(", "final", "float", "minProgress", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "ru...
Sets the minimum progress that the animation will start from when playing or looping.
[ "Sets", "the", "minimum", "progress", "that", "the", "animation", "will", "start", "from", "when", "playing", "or", "looping", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L438-L449
125,951
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setMaxFrame
public void setMaxFrame(final int maxFrame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMaxFrame(maxFrame); } }); return; } animator.setMaxFrame(maxFrame + ...
java
public void setMaxFrame(final int maxFrame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMaxFrame(maxFrame); } }); return; } animator.setMaxFrame(maxFrame + ...
[ "public", "void", "setMaxFrame", "(", "final", "int", "maxFrame", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(...
Sets the maximum frame that the animation will end at when playing or looping.
[ "Sets", "the", "maximum", "frame", "that", "the", "animation", "will", "end", "at", "when", "playing", "or", "looping", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L454-L465
125,952
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setMaxProgress
public void setMaxProgress(@FloatRange(from = 0f, to = 1f) final float maxProgress) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMaxProgress(maxProgress); } }); retu...
java
public void setMaxProgress(@FloatRange(from = 0f, to = 1f) final float maxProgress) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMaxProgress(maxProgress); } }); retu...
[ "public", "void", "setMaxProgress", "(", "@", "FloatRange", "(", "from", "=", "0f", ",", "to", "=", "1f", ")", "final", "float", "maxProgress", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", ...
Sets the maximum progress that the animation will end at when playing or looping.
[ "Sets", "the", "maximum", "progress", "that", "the", "animation", "will", "end", "at", "when", "playing", "or", "looping", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L477-L488
125,953
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setMinFrame
public void setMinFrame(final String markerName) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMinFrame(markerName); } }); return; } Marker marker = compositi...
java
public void setMinFrame(final String markerName) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMinFrame(markerName); } }); return; } Marker marker = compositi...
[ "public", "void", "setMinFrame", "(", "final", "String", "markerName", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "run",...
Sets the minimum frame to the start time of the specified marker. @throws IllegalArgumentException if the marker is not found.
[ "Sets", "the", "minimum", "frame", "to", "the", "start", "time", "of", "the", "specified", "marker", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L494-L509
125,954
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setFrame
public void setFrame(final int frame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setFrame(frame); } }); return; } animator.setFrame(frame); }
java
public void setFrame(final int frame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setFrame(frame); } }); return; } animator.setFrame(frame); }
[ "public", "void", "setFrame", "(", "final", "int", "frame", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "lazyCompositionTasks", ".", "add", "(", "new", "LazyCompositionTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(", "...
Sets the progress to the specified frame. If the composition isn't set yet, the progress will be set to the frame when it is.
[ "Sets", "the", "progress", "to", "the", "specified", "frame", ".", "If", "the", "composition", "isn", "t", "set", "yet", "the", "progress", "will", "be", "set", "to", "the", "frame", "when", "it", "is", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L648-L660
125,955
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
LottieDrawable.setFontAssetDelegate
public void setFontAssetDelegate( @SuppressWarnings("NullableProblems") FontAssetDelegate assetDelegate) { this.fontAssetDelegate = assetDelegate; if (fontAssetManager != null) { fontAssetManager.setDelegate(assetDelegate); } }
java
public void setFontAssetDelegate( @SuppressWarnings("NullableProblems") FontAssetDelegate assetDelegate) { this.fontAssetDelegate = assetDelegate; if (fontAssetManager != null) { fontAssetManager.setDelegate(assetDelegate); } }
[ "public", "void", "setFontAssetDelegate", "(", "@", "SuppressWarnings", "(", "\"NullableProblems\"", ")", "FontAssetDelegate", "assetDelegate", ")", "{", "this", ".", "fontAssetDelegate", "=", "assetDelegate", ";", "if", "(", "fontAssetManager", "!=", "null", ")", "...
Use this to manually set fonts.
[ "Use", "this", "to", "manually", "set", "fonts", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java#L787-L793
125,956
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/animation/keyframe/BaseKeyframeAnimation.java
BaseKeyframeAnimation.getLinearCurrentKeyframeProgress
float getLinearCurrentKeyframeProgress() { if (isDiscrete) { return 0f; } Keyframe<K> keyframe = getCurrentKeyframe(); if (keyframe.isStatic()) { return 0f; } float progressIntoFrame = progress - keyframe.getStartProgress(); float keyframeProgress = keyframe.getEndProgress() - k...
java
float getLinearCurrentKeyframeProgress() { if (isDiscrete) { return 0f; } Keyframe<K> keyframe = getCurrentKeyframe(); if (keyframe.isStatic()) { return 0f; } float progressIntoFrame = progress - keyframe.getStartProgress(); float keyframeProgress = keyframe.getEndProgress() - k...
[ "float", "getLinearCurrentKeyframeProgress", "(", ")", "{", "if", "(", "isDiscrete", ")", "{", "return", "0f", ";", "}", "Keyframe", "<", "K", ">", "keyframe", "=", "getCurrentKeyframe", "(", ")", ";", "if", "(", "keyframe", ".", "isStatic", "(", ")", ")...
Returns the progress into the current keyframe between 0 and 1. This does not take into account any interpolation that the keyframe may have.
[ "Returns", "the", "progress", "into", "the", "current", "keyframe", "between", "0", "and", "1", ".", "This", "does", "not", "take", "into", "account", "any", "interpolation", "that", "the", "keyframe", "may", "have", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/BaseKeyframeAnimation.java#L107-L119
125,957
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
LottieAnimationView.setAnimation
public void setAnimation(@RawRes final int rawRes) { this.animationResId = rawRes; animationName = null; setCompositionTask(LottieCompositionFactory.fromRawRes(getContext(), rawRes)); }
java
public void setAnimation(@RawRes final int rawRes) { this.animationResId = rawRes; animationName = null; setCompositionTask(LottieCompositionFactory.fromRawRes(getContext(), rawRes)); }
[ "public", "void", "setAnimation", "(", "@", "RawRes", "final", "int", "rawRes", ")", "{", "this", ".", "animationResId", "=", "rawRes", ";", "animationName", "=", "null", ";", "setCompositionTask", "(", "LottieCompositionFactory", ".", "fromRawRes", "(", "getCon...
Sets the animation from a file in the raw directory. This will load and deserialize the file asynchronously.
[ "Sets", "the", "animation", "from", "a", "file", "in", "the", "raw", "directory", ".", "This", "will", "load", "and", "deserialize", "the", "file", "asynchronously", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L297-L301
125,958
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
LottieAnimationView.setScale
public void setScale(float scale) { lottieDrawable.setScale(scale); if (getDrawable() == lottieDrawable) { setImageDrawable(null); setImageDrawable(lottieDrawable); } }
java
public void setScale(float scale) { lottieDrawable.setScale(scale); if (getDrawable() == lottieDrawable) { setImageDrawable(null); setImageDrawable(lottieDrawable); } }
[ "public", "void", "setScale", "(", "float", "scale", ")", "{", "lottieDrawable", ".", "setScale", "(", "scale", ")", ";", "if", "(", "getDrawable", "(", ")", "==", "lottieDrawable", ")", "{", "setImageDrawable", "(", "null", ")", ";", "setImageDrawable", "...
Set the scale on the current composition. The only cost of this function is re-rendering the current frame so you may call it frequent to scale something up or down. The smaller the animation is, the better the performance will be. You may find that scaling an animation down then rendering it in a larger ImageView and...
[ "Set", "the", "scale", "on", "the", "current", "composition", ".", "The", "only", "cost", "of", "this", "function", "is", "re", "-", "rendering", "the", "current", "frame", "so", "you", "may", "call", "it", "frequent", "to", "scale", "something", "up", "...
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L744-L750
125,959
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
LottieAnimationView.buildDrawingCache
@Override public void buildDrawingCache(boolean autoScale) { super.buildDrawingCache(autoScale); if (getLayerType() == LAYER_TYPE_SOFTWARE && getDrawingCache(autoScale) == null) { setRenderMode(HARDWARE); } }
java
@Override public void buildDrawingCache(boolean autoScale) { super.buildDrawingCache(autoScale); if (getLayerType() == LAYER_TYPE_SOFTWARE && getDrawingCache(autoScale) == null) { setRenderMode(HARDWARE); } }
[ "@", "Override", "public", "void", "buildDrawingCache", "(", "boolean", "autoScale", ")", "{", "super", ".", "buildDrawingCache", "(", "autoScale", ")", ";", "if", "(", "getLayerType", "(", ")", "==", "LAYER_TYPE_SOFTWARE", "&&", "getDrawingCache", "(", "autoSca...
If rendering via software, Android will fail to generate a bitmap if the view is too large. Rather than displaying nothing, fallback on hardware acceleration which may incur a performance hit. @see #setRenderMode(RenderMode) @see com.airbnb.lottie.LottieDrawable#draw(android.graphics.Canvas)
[ "If", "rendering", "via", "software", "Android", "will", "fail", "to", "generate", "a", "bitmap", "if", "the", "view", "is", "too", "large", ".", "Rather", "than", "displaying", "nothing", "fallback", "on", "hardware", "acceleration", "which", "may", "incur", ...
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L819-L825
125,960
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/parser/AnimatableValueParser.java
AnimatableValueParser.parse
@Nullable private static <T> List<Keyframe<T>> parse(JsonReader reader, LottieComposition composition, ValueParser<T> valueParser) throws IOException { return KeyframesParser.parse(reader, composition, 1, valueParser); }
java
@Nullable private static <T> List<Keyframe<T>> parse(JsonReader reader, LottieComposition composition, ValueParser<T> valueParser) throws IOException { return KeyframesParser.parse(reader, composition, 1, valueParser); }
[ "@", "Nullable", "private", "static", "<", "T", ">", "List", "<", "Keyframe", "<", "T", ">", ">", "parse", "(", "JsonReader", "reader", ",", "LottieComposition", "composition", ",", "ValueParser", "<", "T", ">", "valueParser", ")", "throws", "IOException", ...
Will return null if the animation can't be played such as if it has expressions.
[ "Will", "return", "null", "if", "the", "animation", "can", "t", "be", "played", "such", "as", "if", "it", "has", "expressions", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/parser/AnimatableValueParser.java#L77-L80
125,961
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java
NetworkCache.getCachedFile
@Nullable private File getCachedFile(String url) throws FileNotFoundException { File jsonFile = new File(appContext.getCacheDir(), filenameForUrl(url, FileExtension.JSON, false)); if (jsonFile.exists()) { return jsonFile; } File zipFile = new File(appContext.getCacheDir(), filenameForUrl(url, Fi...
java
@Nullable private File getCachedFile(String url) throws FileNotFoundException { File jsonFile = new File(appContext.getCacheDir(), filenameForUrl(url, FileExtension.JSON, false)); if (jsonFile.exists()) { return jsonFile; } File zipFile = new File(appContext.getCacheDir(), filenameForUrl(url, Fi...
[ "@", "Nullable", "private", "File", "getCachedFile", "(", "String", "url", ")", "throws", "FileNotFoundException", "{", "File", "jsonFile", "=", "new", "File", "(", "appContext", ".", "getCacheDir", "(", ")", ",", "filenameForUrl", "(", "url", ",", "FileExtens...
Returns the cache file for the given url if it exists. Checks for both json and zip. Returns null if neither exist.
[ "Returns", "the", "cache", "file", "for", "the", "given", "url", "if", "it", "exists", ".", "Checks", "for", "both", "json", "and", "zip", ".", "Returns", "null", "if", "neither", "exist", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/network/NetworkCache.java#L117-L128
125,962
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/TextDelegate.java
TextDelegate.setText
public void setText(String input, String output) { stringMap.put(input, output); invalidate(); }
java
public void setText(String input, String output) { stringMap.put(input, output); invalidate(); }
[ "public", "void", "setText", "(", "String", "input", ",", "String", "output", ")", "{", "stringMap", ".", "put", "(", "input", ",", "output", ")", ";", "invalidate", "(", ")", ";", "}" ]
Update the text that will be rendered for the given input text.
[ "Update", "the", "text", "that", "will", "be", "rendered", "for", "the", "given", "input", "text", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/TextDelegate.java#L54-L57
125,963
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/parser/KeyframesParser.java
KeyframesParser.setEndFrames
public static <T> void setEndFrames(List<? extends Keyframe<T>> keyframes) { int size = keyframes.size(); for (int i = 0; i < size - 1; i++) { // In the json, the keyframes only contain their starting frame. Keyframe<T> keyframe = keyframes.get(i); Keyframe<T> nextKeyframe = keyframes.get(i + ...
java
public static <T> void setEndFrames(List<? extends Keyframe<T>> keyframes) { int size = keyframes.size(); for (int i = 0; i < size - 1; i++) { // In the json, the keyframes only contain their starting frame. Keyframe<T> keyframe = keyframes.get(i); Keyframe<T> nextKeyframe = keyframes.get(i + ...
[ "public", "static", "<", "T", ">", "void", "setEndFrames", "(", "List", "<", "?", "extends", "Keyframe", "<", "T", ">", ">", "keyframes", ")", "{", "int", "size", "=", "keyframes", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";"...
The json doesn't include end frames. The data can be taken from the start frame of the next keyframe though.
[ "The", "json", "doesn", "t", "include", "end", "frames", ".", "The", "data", "can", "be", "taken", "from", "the", "start", "frame", "of", "the", "next", "keyframe", "though", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/parser/KeyframesParser.java#L62-L83
125,964
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java
LottieValueAnimator.getAnimatedValueAbsolute
@FloatRange(from = 0f, to = 1f) public float getAnimatedValueAbsolute() { if (composition == null) { return 0; } return (frame - composition.getStartFrame()) / (composition.getEndFrame() - composition.getStartFrame()); }
java
@FloatRange(from = 0f, to = 1f) public float getAnimatedValueAbsolute() { if (composition == null) { return 0; } return (frame - composition.getStartFrame()) / (composition.getEndFrame() - composition.getStartFrame()); }
[ "@", "FloatRange", "(", "from", "=", "0f", ",", "to", "=", "1f", ")", "public", "float", "getAnimatedValueAbsolute", "(", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "return", "0", ";", "}", "return", "(", "frame", "-", "composition", ...
Returns the current value of the animation from 0 to 1 regardless of the animation speed, direction, or min and max frames.
[ "Returns", "the", "current", "value", "of", "the", "animation", "from", "0", "to", "1", "regardless", "of", "the", "animation", "speed", "direction", "or", "min", "and", "max", "frames", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java#L44-L50
125,965
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java
LottieValueAnimator.getAnimatedFraction
@Override @FloatRange(from = 0f, to = 1f) public float getAnimatedFraction() { if (composition == null) { return 0; } if (isReversed()) { return (getMaxFrame() - frame) / (getMaxFrame() - getMinFrame()); } else { return (frame - getMinFrame()) / (getMaxFrame() - getMinFrame()); } ...
java
@Override @FloatRange(from = 0f, to = 1f) public float getAnimatedFraction() { if (composition == null) { return 0; } if (isReversed()) { return (getMaxFrame() - frame) / (getMaxFrame() - getMinFrame()); } else { return (frame - getMinFrame()) / (getMaxFrame() - getMinFrame()); } ...
[ "@", "Override", "@", "FloatRange", "(", "from", "=", "0f", ",", "to", "=", "1f", ")", "public", "float", "getAnimatedFraction", "(", ")", "{", "if", "(", "composition", "==", "null", ")", "{", "return", "0", ";", "}", "if", "(", "isReversed", "(", ...
Returns the current value of the currently playing animation taking into account direction, min and max frames.
[ "Returns", "the", "current", "value", "of", "the", "currently", "playing", "animation", "taking", "into", "account", "direction", "min", "and", "max", "frames", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java#L56-L65
125,966
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/parser/KeyframeParser.java
KeyframeParser.parseKeyframe
private static <T> Keyframe<T> parseKeyframe(LottieComposition composition, JsonReader reader, float scale, ValueParser<T> valueParser) throws IOException { PointF cp1 = null; PointF cp2 = null; float startFrame = 0; T startValue = null; T endValue = null; boolean hold = false; Interpo...
java
private static <T> Keyframe<T> parseKeyframe(LottieComposition composition, JsonReader reader, float scale, ValueParser<T> valueParser) throws IOException { PointF cp1 = null; PointF cp2 = null; float startFrame = 0; T startValue = null; T endValue = null; boolean hold = false; Interpo...
[ "private", "static", "<", "T", ">", "Keyframe", "<", "T", ">", "parseKeyframe", "(", "LottieComposition", "composition", ",", "JsonReader", "reader", ",", "float", "scale", ",", "ValueParser", "<", "T", ">", "valueParser", ")", "throws", "IOException", "{", ...
beginObject will already be called on the keyframe so it can be differentiated with a non animated value.
[ "beginObject", "will", "already", "be", "called", "on", "the", "keyframe", "so", "it", "can", "be", "differentiated", "with", "a", "non", "animated", "value", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/parser/KeyframeParser.java#L68-L151
125,967
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/parser/GradientColorParser.java
GradientColorParser.addOpacityStopsToGradientIfNeeded
private void addOpacityStopsToGradientIfNeeded(GradientColor gradientColor, List<Float> array) { int startIndex = colorPoints * 4; if (array.size() <= startIndex) { return; } int opacityStops = (array.size() - startIndex) / 2; double[] positions = new double[opacityStops]; double[] opacit...
java
private void addOpacityStopsToGradientIfNeeded(GradientColor gradientColor, List<Float> array) { int startIndex = colorPoints * 4; if (array.size() <= startIndex) { return; } int opacityStops = (array.size() - startIndex) / 2; double[] positions = new double[opacityStops]; double[] opacit...
[ "private", "void", "addOpacityStopsToGradientIfNeeded", "(", "GradientColor", "gradientColor", ",", "List", "<", "Float", ">", "array", ")", "{", "int", "startIndex", "=", "colorPoints", "*", "4", ";", "if", "(", "array", ".", "size", "(", ")", "<=", "startI...
This cheats a little bit. Opacity stops can be at arbitrary intervals independent of color stops. This uses the existing color stops and modifies the opacity at each existing color stop based on what the opacity would be. This should be a good approximation is nearly all cases. However, if there are many more opacity ...
[ "This", "cheats", "a", "little", "bit", ".", "Opacity", "stops", "can", "be", "at", "arbitrary", "intervals", "independent", "of", "color", "stops", ".", "This", "uses", "the", "existing", "color", "stops", "and", "modifies", "the", "opacity", "at", "each", ...
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/parser/GradientColorParser.java#L102-L131
125,968
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java
LottieCompositionFactory.fromJsonInputStream
public static LottieTask<LottieComposition> fromJsonInputStream(final InputStream stream, @Nullable final String cacheKey) { return cache(cacheKey, new Callable<LottieResult<LottieComposition>>() { @Override public LottieResult<LottieComposition> call() { return fromJsonInputStreamSync(stream, cacheKe...
java
public static LottieTask<LottieComposition> fromJsonInputStream(final InputStream stream, @Nullable final String cacheKey) { return cache(cacheKey, new Callable<LottieResult<LottieComposition>>() { @Override public LottieResult<LottieComposition> call() { return fromJsonInputStreamSync(stream, cacheKe...
[ "public", "static", "LottieTask", "<", "LottieComposition", ">", "fromJsonInputStream", "(", "final", "InputStream", "stream", ",", "@", "Nullable", "final", "String", "cacheKey", ")", "{", "return", "cache", "(", "cacheKey", ",", "new", "Callable", "<", "Lottie...
Auto-closes the stream. @see #fromJsonInputStreamSync(InputStream, String, boolean)
[ "Auto", "-", "closes", "the", "stream", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java#L157-L163
125,969
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java
LottieCompositionFactory.cache
private static LottieTask<LottieComposition> cache( @Nullable final String cacheKey, Callable<LottieResult<LottieComposition>> callable) { final LottieComposition cachedComposition = cacheKey == null ? null : LottieCompositionCache.getInstance().get(cacheKey); if (cachedComposition != null) { re...
java
private static LottieTask<LottieComposition> cache( @Nullable final String cacheKey, Callable<LottieResult<LottieComposition>> callable) { final LottieComposition cachedComposition = cacheKey == null ? null : LottieCompositionCache.getInstance().get(cacheKey); if (cachedComposition != null) { re...
[ "private", "static", "LottieTask", "<", "LottieComposition", ">", "cache", "(", "@", "Nullable", "final", "String", "cacheKey", ",", "Callable", "<", "LottieResult", "<", "LottieComposition", ">", ">", "callable", ")", "{", "final", "LottieComposition", "cachedCom...
First, check to see if there are any in-progress tasks associated with the cache key and return it if there is. If not, create a new task for the callable. Then, add the new task to the task cache and set up listeners so it gets cleared when done.
[ "First", "check", "to", "see", "if", "there", "are", "any", "in", "-", "progress", "tasks", "associated", "with", "the", "cache", "key", "and", "return", "it", "if", "there", "is", ".", "If", "not", "create", "a", "new", "task", "for", "the", "callable...
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java#L347-L378
125,970
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java
KeyPath.addKey
@CheckResult @RestrictTo(RestrictTo.Scope.LIBRARY) public KeyPath addKey(String key) { KeyPath newKeyPath = new KeyPath(this); newKeyPath.keys.add(key); return newKeyPath; }
java
@CheckResult @RestrictTo(RestrictTo.Scope.LIBRARY) public KeyPath addKey(String key) { KeyPath newKeyPath = new KeyPath(this); newKeyPath.keys.add(key); return newKeyPath; }
[ "@", "CheckResult", "@", "RestrictTo", "(", "RestrictTo", ".", "Scope", ".", "LIBRARY", ")", "public", "KeyPath", "addKey", "(", "String", "key", ")", "{", "KeyPath", "newKeyPath", "=", "new", "KeyPath", "(", "this", ")", ";", "newKeyPath", ".", "keys", ...
Returns a new KeyPath with the key added. This is used during keypath resolution. Children normally don't know about all of their parent elements so this is used to keep track of the fully qualified keypath. This returns a key keypath because during resolution, the full keypath element tree is walked and if this modifi...
[ "Returns", "a", "new", "KeyPath", "with", "the", "key", "added", ".", "This", "is", "used", "during", "keypath", "resolution", ".", "Children", "normally", "don", "t", "know", "about", "all", "of", "their", "parent", "elements", "so", "this", "is", "used",...
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L67-L73
125,971
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java
KeyPath.matches
@SuppressWarnings("RedundantIfStatement") @RestrictTo(RestrictTo.Scope.LIBRARY) public boolean matches(String key, int depth) { if (isContainer(key)) { // This is an artificial layer we programatically create. return true; } if (depth >= keys.size()) { return false; } if (keys....
java
@SuppressWarnings("RedundantIfStatement") @RestrictTo(RestrictTo.Scope.LIBRARY) public boolean matches(String key, int depth) { if (isContainer(key)) { // This is an artificial layer we programatically create. return true; } if (depth >= keys.size()) { return false; } if (keys....
[ "@", "SuppressWarnings", "(", "\"RedundantIfStatement\"", ")", "@", "RestrictTo", "(", "RestrictTo", ".", "Scope", ".", "LIBRARY", ")", "public", "boolean", "matches", "(", "String", "key", ",", "int", "depth", ")", "{", "if", "(", "isContainer", "(", "key",...
Returns whether they key matches at the specified depth.
[ "Returns", "whether", "they", "key", "matches", "at", "the", "specified", "depth", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L98-L114
125,972
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java
KeyPath.incrementDepthBy
@RestrictTo(RestrictTo.Scope.LIBRARY) public int incrementDepthBy(String key, int depth) { if (isContainer(key)) { // If it's a container then we added programatically and it isn't a part of the keypath. return 0; } if (!keys.get(depth).equals("**")) { // If it's not a globstar then it i...
java
@RestrictTo(RestrictTo.Scope.LIBRARY) public int incrementDepthBy(String key, int depth) { if (isContainer(key)) { // If it's a container then we added programatically and it isn't a part of the keypath. return 0; } if (!keys.get(depth).equals("**")) { // If it's not a globstar then it i...
[ "@", "RestrictTo", "(", "RestrictTo", ".", "Scope", ".", "LIBRARY", ")", "public", "int", "incrementDepthBy", "(", "String", "key", ",", "int", "depth", ")", "{", "if", "(", "isContainer", "(", "key", ")", ")", "{", "// If it's a container then we added progra...
For a given key and depth, returns how much the depth should be incremented by when resolving a keypath to children. This can be 0 or 2 when there is a globstar and the next key either matches or doesn't match the current key.
[ "For", "a", "given", "key", "and", "depth", "returns", "how", "much", "the", "depth", "should", "be", "incremented", "by", "when", "resolving", "a", "keypath", "to", "children", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L123-L142
125,973
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java
KeyPath.fullyResolvesTo
@RestrictTo(RestrictTo.Scope.LIBRARY) public boolean fullyResolvesTo(String key, int depth) { if (depth >= keys.size()) { return false; } boolean isLastDepth = depth == keys.size() - 1; String keyAtDepth = keys.get(depth); boolean isGlobstar = keyAtDepth.equals("**"); if (!isGlobstar) {...
java
@RestrictTo(RestrictTo.Scope.LIBRARY) public boolean fullyResolvesTo(String key, int depth) { if (depth >= keys.size()) { return false; } boolean isLastDepth = depth == keys.size() - 1; String keyAtDepth = keys.get(depth); boolean isGlobstar = keyAtDepth.equals("**"); if (!isGlobstar) {...
[ "@", "RestrictTo", "(", "RestrictTo", ".", "Scope", ".", "LIBRARY", ")", "public", "boolean", "fullyResolvesTo", "(", "String", "key", ",", "int", "depth", ")", "{", "if", "(", "depth", ">=", "keys", ".", "size", "(", ")", ")", "{", "return", "false", ...
Returns whether the key at specified depth is fully specific enough to match the full set of keys in this keypath.
[ "Returns", "whether", "the", "key", "at", "specified", "depth", "is", "fully", "specific", "enough", "to", "match", "the", "full", "set", "of", "keys", "in", "this", "keypath", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L148-L178
125,974
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/L.java
L.warn
public static void warn(String msg) { if (loggedMessages.contains(msg)) { return; } Log.w(TAG, msg); loggedMessages.add(msg); }
java
public static void warn(String msg) { if (loggedMessages.contains(msg)) { return; } Log.w(TAG, msg); loggedMessages.add(msg); }
[ "public", "static", "void", "warn", "(", "String", "msg", ")", "{", "if", "(", "loggedMessages", ".", "contains", "(", "msg", ")", ")", "{", "return", ";", "}", "Log", ".", "w", "(", "TAG", ",", "msg", ")", ";", "loggedMessages", ".", "add", "(", ...
Warn to logcat. Keeps track of messages so they are only logged once ever.
[ "Warn", "to", "logcat", ".", "Keeps", "track", "of", "messages", "so", "they", "are", "only", "logged", "once", "ever", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/L.java#L34-L40
125,975
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/network/NetworkFetcher.java
NetworkFetcher.fetchFromCache
@Nullable @WorkerThread private LottieComposition fetchFromCache() { Pair<FileExtension, InputStream> cacheResult = networkCache.fetch(); if (cacheResult == null) { return null; } FileExtension extension = cacheResult.first; InputStream inputStream = cacheResult.second; LottieResult<L...
java
@Nullable @WorkerThread private LottieComposition fetchFromCache() { Pair<FileExtension, InputStream> cacheResult = networkCache.fetch(); if (cacheResult == null) { return null; } FileExtension extension = cacheResult.first; InputStream inputStream = cacheResult.second; LottieResult<L...
[ "@", "Nullable", "@", "WorkerThread", "private", "LottieComposition", "fetchFromCache", "(", ")", "{", "Pair", "<", "FileExtension", ",", "InputStream", ">", "cacheResult", "=", "networkCache", ".", "fetch", "(", ")", ";", "if", "(", "cacheResult", "==", "null...
Returns null if the animation doesn't exist in the cache.
[ "Returns", "null", "if", "the", "animation", "doesn", "t", "exist", "in", "the", "cache", "." ]
126dabdc9f586c87822f85fe1128cdad439d30fa
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/network/NetworkFetcher.java#L54-L74
125,976
codecentric/spring-boot-admin
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/values/Registration.java
Registration.checkUrl
private boolean checkUrl(String url) { try { URI uri = new URI(url); return uri.isAbsolute(); } catch (URISyntaxException e) { return false; } }
java
private boolean checkUrl(String url) { try { URI uri = new URI(url); return uri.isAbsolute(); } catch (URISyntaxException e) { return false; } }
[ "private", "boolean", "checkUrl", "(", "String", "url", ")", "{", "try", "{", "URI", "uri", "=", "new", "URI", "(", "url", ")", ";", "return", "uri", ".", "isAbsolute", "(", ")", ";", "}", "catch", "(", "URISyntaxException", "e", ")", "{", "return", ...
Checks the syntax of the given URL. @param url The URL. @return true, if valid.
[ "Checks", "the", "syntax", "of", "the", "given", "URL", "." ]
99cfd6424184497365b2e514f2cfd9c74cfcd01d
https://github.com/codecentric/spring-boot-admin/blob/99cfd6424184497365b2e514f2cfd9c74cfcd01d/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/values/Registration.java#L94-L101
125,977
codecentric/spring-boot-admin
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/InstanceRegistry.java
InstanceRegistry.register
public Mono<InstanceId> register(Registration registration) { Assert.notNull(registration, "'registration' must not be null"); InstanceId id = generator.generateId(registration); Assert.notNull(id, "'id' must not be null"); return repository.compute(id, (key, instance) -> { i...
java
public Mono<InstanceId> register(Registration registration) { Assert.notNull(registration, "'registration' must not be null"); InstanceId id = generator.generateId(registration); Assert.notNull(id, "'id' must not be null"); return repository.compute(id, (key, instance) -> { i...
[ "public", "Mono", "<", "InstanceId", ">", "register", "(", "Registration", "registration", ")", "{", "Assert", ".", "notNull", "(", "registration", ",", "\"'registration' must not be null\"", ")", ";", "InstanceId", "id", "=", "generator", ".", "generateId", "(", ...
Register instance. @param registration instance to be registered. @return the if of the registered instance.
[ "Register", "instance", "." ]
99cfd6424184497365b2e514f2cfd9c74cfcd01d
https://github.com/codecentric/spring-boot-admin/blob/99cfd6424184497365b2e514f2cfd9c74cfcd01d/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/InstanceRegistry.java#L48-L58
125,978
codecentric/spring-boot-admin
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/InstanceRegistry.java
InstanceRegistry.deregister
public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); }
java
public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); }
[ "public", "Mono", "<", "InstanceId", ">", "deregister", "(", "InstanceId", "id", ")", "{", "return", "repository", ".", "computeIfPresent", "(", "id", ",", "(", "key", ",", "instance", ")", "->", "Mono", ".", "just", "(", "instance", ".", "deregister", "...
Remove a specific instance from services @param id the instances id to unregister @return the id of the unregistered instance
[ "Remove", "a", "specific", "instance", "from", "services" ]
99cfd6424184497365b2e514f2cfd9c74cfcd01d
https://github.com/codecentric/spring-boot-admin/blob/99cfd6424184497365b2e514f2cfd9c74cfcd01d/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/services/InstanceRegistry.java#L95-L98
125,979
codecentric/spring-boot-admin
spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ApplicationRegistrator.java
ApplicationRegistrator.register
public boolean register() { Application application = this.applicationFactory.createApplication(); boolean isRegistrationSuccessful = false; for (String adminUrl : this.adminUrls) { LongAdder attempt = this.attempts.computeIfAbsent(adminUrl, k -> new LongAdder()); boolea...
java
public boolean register() { Application application = this.applicationFactory.createApplication(); boolean isRegistrationSuccessful = false; for (String adminUrl : this.adminUrls) { LongAdder attempt = this.attempts.computeIfAbsent(adminUrl, k -> new LongAdder()); boolea...
[ "public", "boolean", "register", "(", ")", "{", "Application", "application", "=", "this", ".", "applicationFactory", ".", "createApplication", "(", ")", ";", "boolean", "isRegistrationSuccessful", "=", "false", ";", "for", "(", "String", "adminUrl", ":", "this"...
Registers the client application at spring-boot-admin-server. @return true if successful registration on at least one admin server
[ "Registers", "the", "client", "application", "at", "spring", "-", "boot", "-", "admin", "-", "server", "." ]
99cfd6424184497365b2e514f2cfd9c74cfcd01d
https://github.com/codecentric/spring-boot-admin/blob/99cfd6424184497365b2e514f2cfd9c74cfcd01d/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ApplicationRegistrator.java#L52-L72
125,980
google/gson
gson/src/main/java/com/google/gson/Gson.java
Gson.newJsonReader
public JsonReader newJsonReader(Reader reader) { JsonReader jsonReader = new JsonReader(reader); jsonReader.setLenient(lenient); return jsonReader; }
java
public JsonReader newJsonReader(Reader reader) { JsonReader jsonReader = new JsonReader(reader); jsonReader.setLenient(lenient); return jsonReader; }
[ "public", "JsonReader", "newJsonReader", "(", "Reader", "reader", ")", "{", "JsonReader", "jsonReader", "=", "new", "JsonReader", "(", "reader", ")", ";", "jsonReader", ".", "setLenient", "(", "lenient", ")", ";", "return", "jsonReader", ";", "}" ]
Returns a new JSON reader configured for the settings on this Gson instance.
[ "Returns", "a", "new", "JSON", "reader", "configured", "for", "the", "settings", "on", "this", "Gson", "instance", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L766-L770
125,981
google/gson
gson/src/main/java/com/google/gson/internal/LinkedHashTreeMap.java
LinkedHashTreeMap.rebalance
private void rebalance(Node<K, V> unbalanced, boolean insert) { for (Node<K, V> node = unbalanced; node != null; node = node.parent) { Node<K, V> left = node.left; Node<K, V> right = node.right; int leftHeight = left != null ? left.height : 0; int rightHeight = right != null ? right.height :...
java
private void rebalance(Node<K, V> unbalanced, boolean insert) { for (Node<K, V> node = unbalanced; node != null; node = node.parent) { Node<K, V> left = node.left; Node<K, V> right = node.right; int leftHeight = left != null ? left.height : 0; int rightHeight = right != null ? right.height :...
[ "private", "void", "rebalance", "(", "Node", "<", "K", ",", "V", ">", "unbalanced", ",", "boolean", "insert", ")", "{", "for", "(", "Node", "<", "K", ",", "V", ">", "node", "=", "unbalanced", ";", "node", "!=", "null", ";", "node", "=", "node", "...
Rebalances the tree by making any AVL rotations necessary between the newly-unbalanced node and the tree's root. @param insert true if the node was unbalanced by an insert; false if it was by a removal.
[ "Rebalances", "the", "tree", "by", "making", "any", "AVL", "rotations", "necessary", "between", "the", "newly", "-", "unbalanced", "node", "and", "the", "tree", "s", "root", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/LinkedHashTreeMap.java#L338-L396
125,982
google/gson
gson/src/main/java/com/google/gson/internal/LinkedHashTreeMap.java
LinkedHashTreeMap.rotateLeft
private void rotateLeft(Node<K, V> root) { Node<K, V> left = root.left; Node<K, V> pivot = root.right; Node<K, V> pivotLeft = pivot.left; Node<K, V> pivotRight = pivot.right; // move the pivot's left child to the root's right root.right = pivotLeft; if (pivotLeft != null) { pivotLeft....
java
private void rotateLeft(Node<K, V> root) { Node<K, V> left = root.left; Node<K, V> pivot = root.right; Node<K, V> pivotLeft = pivot.left; Node<K, V> pivotRight = pivot.right; // move the pivot's left child to the root's right root.right = pivotLeft; if (pivotLeft != null) { pivotLeft....
[ "private", "void", "rotateLeft", "(", "Node", "<", "K", ",", "V", ">", "root", ")", "{", "Node", "<", "K", ",", "V", ">", "left", "=", "root", ".", "left", ";", "Node", "<", "K", ",", "V", ">", "pivot", "=", "root", ".", "right", ";", "Node",...
Rotates the subtree so that its root's right child is the new root.
[ "Rotates", "the", "subtree", "so", "that", "its", "root", "s", "right", "child", "is", "the", "new", "root", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/LinkedHashTreeMap.java#L401-L424
125,983
google/gson
gson/src/main/java/com/google/gson/JsonObject.java
JsonObject.add
public void add(String property, JsonElement value) { members.put(property, value == null ? JsonNull.INSTANCE : value); }
java
public void add(String property, JsonElement value) { members.put(property, value == null ? JsonNull.INSTANCE : value); }
[ "public", "void", "add", "(", "String", "property", ",", "JsonElement", "value", ")", "{", "members", ".", "put", "(", "property", ",", "value", "==", "null", "?", "JsonNull", ".", "INSTANCE", ":", "value", ")", ";", "}" ]
Adds a member, which is a name-value pair, to self. The name must be a String, but the value can be an arbitrary JsonElement, thereby allowing you to build a full tree of JsonElements rooted at this node. @param property name of the member. @param value the member object.
[ "Adds", "a", "member", "which", "is", "a", "name", "-", "value", "pair", "to", "self", ".", "The", "name", "must", "be", "a", "String", "but", "the", "value", "can", "be", "an", "arbitrary", "JsonElement", "thereby", "allowing", "you", "to", "build", "...
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonObject.java#L57-L59
125,984
google/gson
gson/src/main/java/com/google/gson/JsonObject.java
JsonObject.addProperty
public void addProperty(String property, Character value) { add(property, value == null ? JsonNull.INSTANCE : new JsonPrimitive(value)); }
java
public void addProperty(String property, Character value) { add(property, value == null ? JsonNull.INSTANCE : new JsonPrimitive(value)); }
[ "public", "void", "addProperty", "(", "String", "property", ",", "Character", "value", ")", "{", "add", "(", "property", ",", "value", "==", "null", "?", "JsonNull", ".", "INSTANCE", ":", "new", "JsonPrimitive", "(", "value", ")", ")", ";", "}" ]
Convenience method to add a char member. The specified value is converted to a JsonPrimitive of Character. @param property name of the member. @param value the number value associated with the member.
[ "Convenience", "method", "to", "add", "a", "char", "member", ".", "The", "specified", "value", "is", "converted", "to", "a", "JsonPrimitive", "of", "Character", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonObject.java#L112-L114
125,985
google/gson
gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java
ISO8601Utils.checkOffset
private static boolean checkOffset(String value, int offset, char expected) { return (offset < value.length()) && (value.charAt(offset) == expected); }
java
private static boolean checkOffset(String value, int offset, char expected) { return (offset < value.length()) && (value.charAt(offset) == expected); }
[ "private", "static", "boolean", "checkOffset", "(", "String", "value", ",", "int", "offset", ",", "char", "expected", ")", "{", "return", "(", "offset", "<", "value", ".", "length", "(", ")", ")", "&&", "(", "value", ".", "charAt", "(", "offset", ")", ...
Check if the expected character exist at the given offset in the value. @param value the string to check at the specified offset @param offset the offset to look for the expected character @param expected the expected character @return true if the expected character exist at the given offset
[ "Check", "if", "the", "expected", "character", "exist", "at", "the", "given", "offset", "in", "the", "value", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L287-L289
125,986
google/gson
gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java
ISO8601Utils.parseInt
private static int parseInt(String value, int beginIndex, int endIndex) throws NumberFormatException { if (beginIndex < 0 || endIndex > value.length() || beginIndex > endIndex) { throw new NumberFormatException(value); } // use same logic as in Integer.parseInt() but less generic we'...
java
private static int parseInt(String value, int beginIndex, int endIndex) throws NumberFormatException { if (beginIndex < 0 || endIndex > value.length() || beginIndex > endIndex) { throw new NumberFormatException(value); } // use same logic as in Integer.parseInt() but less generic we'...
[ "private", "static", "int", "parseInt", "(", "String", "value", ",", "int", "beginIndex", ",", "int", "endIndex", ")", "throws", "NumberFormatException", "{", "if", "(", "beginIndex", "<", "0", "||", "endIndex", ">", "value", ".", "length", "(", ")", "||",...
Parse an integer located between 2 given offsets in a string @param value the string to parse @param beginIndex the start index for the integer in the string @param endIndex the end index for the integer in the string @return the int @throws NumberFormatException if the value is not a number
[ "Parse", "an", "integer", "located", "between", "2", "given", "offsets", "in", "a", "string" ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L300-L324
125,987
google/gson
gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java
ISO8601Utils.padInt
private static void padInt(StringBuilder buffer, int value, int length) { String strValue = Integer.toString(value); for (int i = length - strValue.length(); i > 0; i--) { buffer.append('0'); } buffer.append(strValue); }
java
private static void padInt(StringBuilder buffer, int value, int length) { String strValue = Integer.toString(value); for (int i = length - strValue.length(); i > 0; i--) { buffer.append('0'); } buffer.append(strValue); }
[ "private", "static", "void", "padInt", "(", "StringBuilder", "buffer", ",", "int", "value", ",", "int", "length", ")", "{", "String", "strValue", "=", "Integer", ".", "toString", "(", "value", ")", ";", "for", "(", "int", "i", "=", "length", "-", "strV...
Zero pad a number to a specified length @param buffer buffer to use for padding @param value the integer value to pad if necessary. @param length the length of the string we should zero pad
[ "Zero", "pad", "a", "number", "to", "a", "specified", "length" ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L333-L339
125,988
google/gson
gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java
ISO8601Utils.indexOfNonDigit
private static int indexOfNonDigit(String string, int offset) { for (int i = offset; i < string.length(); i++) { char c = string.charAt(i); if (c < '0' || c > '9') return i; } return string.length(); }
java
private static int indexOfNonDigit(String string, int offset) { for (int i = offset; i < string.length(); i++) { char c = string.charAt(i); if (c < '0' || c > '9') return i; } return string.length(); }
[ "private", "static", "int", "indexOfNonDigit", "(", "String", "string", ",", "int", "offset", ")", "{", "for", "(", "int", "i", "=", "offset", ";", "i", "<", "string", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "c", "=", "string", ...
Returns the index of the first character in the string that is not a digit, starting at offset.
[ "Returns", "the", "index", "of", "the", "first", "character", "in", "the", "string", "that", "is", "not", "a", "digit", "starting", "at", "offset", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L344-L350
125,989
google/gson
gson/src/main/java/com/google/gson/JsonParser.java
JsonParser.parseReader
public static JsonElement parseReader(Reader reader) throws JsonIOException, JsonSyntaxException { try { JsonReader jsonReader = new JsonReader(reader); JsonElement element = parseReader(jsonReader); if (!element.isJsonNull() && jsonReader.peek() != JsonToken.END_DOCUMENT) { throw new...
java
public static JsonElement parseReader(Reader reader) throws JsonIOException, JsonSyntaxException { try { JsonReader jsonReader = new JsonReader(reader); JsonElement element = parseReader(jsonReader); if (!element.isJsonNull() && jsonReader.peek() != JsonToken.END_DOCUMENT) { throw new...
[ "public", "static", "JsonElement", "parseReader", "(", "Reader", "reader", ")", "throws", "JsonIOException", ",", "JsonSyntaxException", "{", "try", "{", "JsonReader", "jsonReader", "=", "new", "JsonReader", "(", "reader", ")", ";", "JsonElement", "element", "=", ...
Parses the specified JSON string into a parse tree @param reader JSON text @return a parse tree of {@link JsonElement}s corresponding to the specified JSON @throws JsonParseException if the specified text is not valid JSON
[ "Parses", "the", "specified", "JSON", "string", "into", "a", "parse", "tree" ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonParser.java#L57-L72
125,990
google/gson
gson/src/main/java/com/google/gson/JsonParser.java
JsonParser.parseReader
public static JsonElement parseReader(JsonReader reader) throws JsonIOException, JsonSyntaxException { boolean lenient = reader.isLenient(); reader.setLenient(true); try { return Streams.parse(reader); } catch (StackOverflowError e) { throw new JsonParseException("Failed parsing...
java
public static JsonElement parseReader(JsonReader reader) throws JsonIOException, JsonSyntaxException { boolean lenient = reader.isLenient(); reader.setLenient(true); try { return Streams.parse(reader); } catch (StackOverflowError e) { throw new JsonParseException("Failed parsing...
[ "public", "static", "JsonElement", "parseReader", "(", "JsonReader", "reader", ")", "throws", "JsonIOException", ",", "JsonSyntaxException", "{", "boolean", "lenient", "=", "reader", ".", "isLenient", "(", ")", ";", "reader", ".", "setLenient", "(", "true", ")",...
Returns the next value from the JSON stream as a parse tree. @throws JsonParseException if there is an IOException or if the specified text is not valid JSON
[ "Returns", "the", "next", "value", "from", "the", "JSON", "stream", "as", "a", "parse", "tree", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonParser.java#L80-L93
125,991
google/gson
gson/src/main/java/com/google/gson/stream/JsonReader.java
JsonReader.beginObject
public void beginObject() throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p == PEEKED_BEGIN_OBJECT) { push(JsonScope.EMPTY_OBJECT); peeked = PEEKED_NONE; } else { throw new IllegalStateException("Expected BEGIN_OBJECT but was " + peek() + loca...
java
public void beginObject() throws IOException { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } if (p == PEEKED_BEGIN_OBJECT) { push(JsonScope.EMPTY_OBJECT); peeked = PEEKED_NONE; } else { throw new IllegalStateException("Expected BEGIN_OBJECT but was " + peek() + loca...
[ "public", "void", "beginObject", "(", ")", "throws", "IOException", "{", "int", "p", "=", "peeked", ";", "if", "(", "p", "==", "PEEKED_NONE", ")", "{", "p", "=", "doPeek", "(", ")", ";", "}", "if", "(", "p", "==", "PEEKED_BEGIN_OBJECT", ")", "{", "...
Consumes the next token from the JSON stream and asserts that it is the beginning of a new object.
[ "Consumes", "the", "next", "token", "from", "the", "JSON", "stream", "and", "asserts", "that", "it", "is", "the", "beginning", "of", "a", "new", "object", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/stream/JsonReader.java#L377-L388
125,992
google/gson
gson/src/main/java/com/google/gson/internal/Streams.java
Streams.parse
public static JsonElement parse(JsonReader reader) throws JsonParseException { boolean isEmpty = true; try { reader.peek(); isEmpty = false; return TypeAdapters.JSON_ELEMENT.read(reader); } catch (EOFException e) { /* * For compatibility with JSON 1.5 and earlier, we return a ...
java
public static JsonElement parse(JsonReader reader) throws JsonParseException { boolean isEmpty = true; try { reader.peek(); isEmpty = false; return TypeAdapters.JSON_ELEMENT.read(reader); } catch (EOFException e) { /* * For compatibility with JSON 1.5 and earlier, we return a ...
[ "public", "static", "JsonElement", "parse", "(", "JsonReader", "reader", ")", "throws", "JsonParseException", "{", "boolean", "isEmpty", "=", "true", ";", "try", "{", "reader", ".", "peek", "(", ")", ";", "isEmpty", "=", "false", ";", "return", "TypeAdapters...
Takes a reader in any state and returns the next value as a JsonElement.
[ "Takes", "a", "reader", "in", "any", "state", "and", "returns", "the", "next", "value", "as", "a", "JsonElement", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/Streams.java#L43-L66
125,993
google/gson
gson/src/main/java/com/google/gson/internal/Streams.java
Streams.write
public static void write(JsonElement element, JsonWriter writer) throws IOException { TypeAdapters.JSON_ELEMENT.write(writer, element); }
java
public static void write(JsonElement element, JsonWriter writer) throws IOException { TypeAdapters.JSON_ELEMENT.write(writer, element); }
[ "public", "static", "void", "write", "(", "JsonElement", "element", ",", "JsonWriter", "writer", ")", "throws", "IOException", "{", "TypeAdapters", ".", "JSON_ELEMENT", ".", "write", "(", "writer", ",", "element", ")", ";", "}" ]
Writes the JSON element to the writer, recursively.
[ "Writes", "the", "JSON", "element", "to", "the", "writer", "recursively", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/Streams.java#L71-L73
125,994
google/gson
proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java
ProtoTypeAdapter.getCustSerializedName
private String getCustSerializedName(FieldOptions options, String defaultName) { for (Extension<FieldOptions, String> extension : serializedNameExtensions) { if (options.hasExtension(extension)) { return options.getExtension(extension); } } return protoFormat.to(jsonFormat, defaultName);...
java
private String getCustSerializedName(FieldOptions options, String defaultName) { for (Extension<FieldOptions, String> extension : serializedNameExtensions) { if (options.hasExtension(extension)) { return options.getExtension(extension); } } return protoFormat.to(jsonFormat, defaultName);...
[ "private", "String", "getCustSerializedName", "(", "FieldOptions", "options", ",", "String", "defaultName", ")", "{", "for", "(", "Extension", "<", "FieldOptions", ",", "String", ">", "extension", ":", "serializedNameExtensions", ")", "{", "if", "(", "options", ...
Retrieves the custom field name from the given options, and if not found, returns the specified default name.
[ "Retrieves", "the", "custom", "field", "name", "from", "the", "given", "options", "and", "if", "not", "found", "returns", "the", "specified", "default", "name", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java#L333-L340
125,995
google/gson
proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java
ProtoTypeAdapter.getCustSerializedEnumValue
private String getCustSerializedEnumValue(EnumValueOptions options, String defaultValue) { for (Extension<EnumValueOptions, String> extension : serializedEnumValueExtensions) { if (options.hasExtension(extension)) { return options.getExtension(extension); } } return defaultValue; }
java
private String getCustSerializedEnumValue(EnumValueOptions options, String defaultValue) { for (Extension<EnumValueOptions, String> extension : serializedEnumValueExtensions) { if (options.hasExtension(extension)) { return options.getExtension(extension); } } return defaultValue; }
[ "private", "String", "getCustSerializedEnumValue", "(", "EnumValueOptions", "options", ",", "String", "defaultValue", ")", "{", "for", "(", "Extension", "<", "EnumValueOptions", ",", "String", ">", "extension", ":", "serializedEnumValueExtensions", ")", "{", "if", "...
Retrieves the custom enum value name from the given options, and if not found, returns the specified default value.
[ "Retrieves", "the", "custom", "enum", "value", "name", "from", "the", "given", "options", "and", "if", "not", "found", "returns", "the", "specified", "default", "value", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java#L346-L353
125,996
google/gson
codegen/src/main/java/com/google/gson/codegen/JavaWriter.java
JavaWriter.addPackage
public void addPackage(String packageName) throws IOException { if (this.packagePrefix != null) { throw new IllegalStateException(); } out.write("package "); out.write(packageName); out.write(";\n"); this.packagePrefix = packageName + "."; }
java
public void addPackage(String packageName) throws IOException { if (this.packagePrefix != null) { throw new IllegalStateException(); } out.write("package "); out.write(packageName); out.write(";\n"); this.packagePrefix = packageName + "."; }
[ "public", "void", "addPackage", "(", "String", "packageName", ")", "throws", "IOException", "{", "if", "(", "this", ".", "packagePrefix", "!=", "null", ")", "{", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "out", ".", "write", "(", "\"pack...
Emit a package declaration.
[ "Emit", "a", "package", "declaration", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L55-L63
125,997
google/gson
codegen/src/main/java/com/google/gson/codegen/JavaWriter.java
JavaWriter.field
public void field(String type, String name, int modifiers) throws IOException { field(type, name, modifiers, null); }
java
public void field(String type, String name, int modifiers) throws IOException { field(type, name, modifiers, null); }
[ "public", "void", "field", "(", "String", "type", ",", "String", "name", ",", "int", "modifiers", ")", "throws", "IOException", "{", "field", "(", "type", ",", "name", ",", "modifiers", ",", "null", ")", ";", "}" ]
Emits a field declaration.
[ "Emits", "a", "field", "declaration", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L186-L188
125,998
google/gson
codegen/src/main/java/com/google/gson/codegen/JavaWriter.java
JavaWriter.beginMethod
public void beginMethod(String returnType, String name, int modifiers, String... parameters) throws IOException { indent(); modifiers(modifiers); if (returnType != null) { type(returnType); out.write(" "); out.write(name); } else { type(name); } out.write("("); ...
java
public void beginMethod(String returnType, String name, int modifiers, String... parameters) throws IOException { indent(); modifiers(modifiers); if (returnType != null) { type(returnType); out.write(" "); out.write(name); } else { type(name); } out.write("("); ...
[ "public", "void", "beginMethod", "(", "String", "returnType", ",", "String", "name", ",", "int", "modifiers", ",", "String", "...", "parameters", ")", "throws", "IOException", "{", "indent", "(", ")", ";", "modifiers", "(", "modifiers", ")", ";", "if", "("...
Emit a method declaration. @param returnType the method's return type, or null for constructors. @param parameters alternating parameter types and names. @param name the method name, or the fully qualified class name for constructors.
[ "Emit", "a", "method", "declaration", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L213-L241
125,999
google/gson
codegen/src/main/java/com/google/gson/codegen/JavaWriter.java
JavaWriter.endMethod
public void endMethod() throws IOException { Scope popped = popScope(); if (popped == Scope.NON_ABSTRACT_METHOD) { indent(); out.write("}\n"); } else if (popped != Scope.ABSTRACT_METHOD) { throw new IllegalStateException(); } }
java
public void endMethod() throws IOException { Scope popped = popScope(); if (popped == Scope.NON_ABSTRACT_METHOD) { indent(); out.write("}\n"); } else if (popped != Scope.ABSTRACT_METHOD) { throw new IllegalStateException(); } }
[ "public", "void", "endMethod", "(", ")", "throws", "IOException", "{", "Scope", "popped", "=", "popScope", "(", ")", ";", "if", "(", "popped", "==", "Scope", ".", "NON_ABSTRACT_METHOD", ")", "{", "indent", "(", ")", ";", "out", ".", "write", "(", "\"}\...
Completes the current method declaration.
[ "Completes", "the", "current", "method", "declaration", "." ]
63ee47cb642c8018e5cddd639aa2be143220ad4b
https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L326-L334