method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
protected Source resolveServletContextURI(String path) throws TransformerException { while (path.startsWith("//")) { path = path.substring(1); } try { URL url = this.servletContext.getResource(path); InputStream in = this.servletContext.getResourceAsStream(path); if (in != null) { if (url != null) { return new StreamSource(in, url.toExternalForm()); } else { return new StreamSource(in); } } else { throw new TransformerException("Resource does not exist. \"" + path + "\" is not accessible through the servlet context."); } } catch (MalformedURLException mfue) { throw new TransformerException( "Error accessing resource using servlet context: " + path, mfue); } }
Source function(String path) throws TransformerException { while (path.startsWith(STRResource does not exist. \STR\STR); } } catch (MalformedURLException mfue) { throw new TransformerException( STR + path, mfue); } }
/** * Resolves the "servlet-context:" URI. * @param path the path part after the protocol (should start with a "/") * @return the resolved Source or null if the resource was not found * @throws TransformerException if no URL can be constructed from the path */
Resolves the "servlet-context:" URI
resolveServletContextURI
{ "repo_name": "bystrobank/fopservlet", "path": "src/main/java/org/apache/fop/servlet/ServletContextURIResolver.java", "license": "apache-2.0", "size": 3787 }
[ "java.net.MalformedURLException", "javax.xml.transform.Source", "javax.xml.transform.TransformerException" ]
import java.net.MalformedURLException; import javax.xml.transform.Source; import javax.xml.transform.TransformerException;
import java.net.*; import javax.xml.transform.*;
[ "java.net", "javax.xml" ]
java.net; javax.xml;
142,194
public @Nonnull String getDisplayName() { return getFullName(); } /** * true if {@link AbstractBuild#hasParticipant} or {@link hudson.model.Cause.UserIdCause}
@Nonnull String function() { return getFullName(); } /** * true if {@link AbstractBuild#hasParticipant} or {@link hudson.model.Cause.UserIdCause}
/** * Returns the user name. */
Returns the user name
getDisplayName
{ "repo_name": "recena/jenkins", "path": "core/src/main/java/hudson/model/User.java", "license": "mit", "size": 45496 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,404,295
public static List<SQLRecognizer> get(String sql, String dbType) { return SQL_RECOGNIZER_FACTORY.create(sql, dbType); }
static List<SQLRecognizer> function(String sql, String dbType) { return SQL_RECOGNIZER_FACTORY.create(sql, dbType); }
/** * Get sql recognizer. * * @param sql the sql * @param dbType the db type * @return the sql recognizer */
Get sql recognizer
get
{ "repo_name": "seata/seata", "path": "rm-datasource/src/main/java/io/seata/rm/datasource/sql/SQLVisitorFactory.java", "license": "apache-2.0", "size": 1689 }
[ "io.seata.sqlparser.SQLRecognizer", "java.util.List" ]
import io.seata.sqlparser.SQLRecognizer; import java.util.List;
import io.seata.sqlparser.*; import java.util.*;
[ "io.seata.sqlparser", "java.util" ]
io.seata.sqlparser; java.util;
469,561
public void setRegisterDescription(final List<RegisterDescription> information) { m_information = information; }
void function(final List<RegisterDescription> information) { m_information = information; }
/** * Changes the register description information. * * @param information The new register information. */
Changes the register description information
setRegisterDescription
{ "repo_name": "AmesianX/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Gui/Debug/RegisterPanel/CRegisterProvider.java", "license": "apache-2.0", "size": 8519 }
[ "com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterDescription", "java.util.List" ]
import com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterDescription; import java.util.List;
import com.google.security.zynamics.binnavi.debug.models.targetinformation.*; import java.util.*;
[ "com.google.security", "java.util" ]
com.google.security; java.util;
345,772
public static String getClassLocation(Class<?> clazz) { String className = "/" + clazz.getName().replace('.', '/') + ".class"; URL u = clazz.getResource(className); String s = u.toString(); if (s.startsWith("jar:file:/")) { int pos = s.indexOf(".jar!/"); if (pos != -1) { if (File.separator.equals("\\")) s = s.substring("jar:file:/".length(), pos + ".jar".length()); else s = s.substring("jar:file:".length(), pos + ".jar".length()); s = s.replaceAll("%20", " "); } else { s = "?"; } } else if (s.startsWith("file:/")) { if (File.separator.equals("\\")) s = s.substring("file:/".length()); else s = s.substring("file:".length()); s = s.substring(0, s.lastIndexOf(className)).replaceAll("%20", " "); } else { s = "?"; } return s; }
static String function(Class<?> clazz) { String className = "/" + clazz.getName().replace('.', '/') + STR; URL u = clazz.getResource(className); String s = u.toString(); if (s.startsWith(STR)) { int pos = s.indexOf(STR); if (pos != -1) { if (File.separator.equals("\\")) s = s.substring(STR.length(), pos + ".jar".length()); else s = s.substring(STR.length(), pos + ".jar".length()); s = s.replaceAll("%20", " "); } else { s = "?"; } } else if (s.startsWith(STR)) { if (File.separator.equals("\\")) s = s.substring(STR.length()); else s = s.substring("file:".length()); s = s.substring(0, s.lastIndexOf(className)).replaceAll("%20", " "); } else { s = "?"; } return s; }
/** * Return the path(jar o directory) where the given class was found. * * @param clazz * The class to be verified * @return A not <code>null</code> {@link String} with the path of the given class. */
Return the path(jar o directory) where the given class was found
getClassLocation
{ "repo_name": "alessandroleite/formulaj", "path": "src/main/java/formulaj/common/base/ClassUtils.java", "license": "gpl-3.0", "size": 20440 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,014,989
public final Node getDst() { return dst; }
final Node function() { return dst; }
/** * Gets value of dst parameter * * @return value of dst parameter */
Gets value of dst parameter
getDst
{ "repo_name": "openweave/openweave-core", "path": "third_party/android/platform-libcore/android-platform-libcore/dom/src/test/java/org/w3c/domts/UserDataNotification.java", "license": "apache-2.0", "size": 1980 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,338,559
@Override public String getThumbnailLastUpdatedTime(APIIdentifier apiIdentifier) throws APIManagementException { String artifactPath = APIConstants.API_IMAGE_LOCATION + RegistryConstants.PATH_SEPARATOR + apiIdentifier.getProviderName() + RegistryConstants.PATH_SEPARATOR + apiIdentifier.getApiName() + RegistryConstants.PATH_SEPARATOR + apiIdentifier.getVersion(); String thumbPath = artifactPath + RegistryConstants.PATH_SEPARATOR + APIConstants.API_ICON_IMAGE; try { if (registry.resourceExists(thumbPath)) { Resource res = registry.get(thumbPath); Date lastModifiedTime = res.getLastModified(); return lastModifiedTime == null ? String.valueOf(res.getCreatedTime().getTime()) : String.valueOf(lastModifiedTime.getTime()); } } catch (RegistryException e) { String msg = "Error while loading API icon from the registry"; log.error(msg, e); throw new APIManagementException(msg, e); } return null; }
String function(APIIdentifier apiIdentifier) throws APIManagementException { String artifactPath = APIConstants.API_IMAGE_LOCATION + RegistryConstants.PATH_SEPARATOR + apiIdentifier.getProviderName() + RegistryConstants.PATH_SEPARATOR + apiIdentifier.getApiName() + RegistryConstants.PATH_SEPARATOR + apiIdentifier.getVersion(); String thumbPath = artifactPath + RegistryConstants.PATH_SEPARATOR + APIConstants.API_ICON_IMAGE; try { if (registry.resourceExists(thumbPath)) { Resource res = registry.get(thumbPath); Date lastModifiedTime = res.getLastModified(); return lastModifiedTime == null ? String.valueOf(res.getCreatedTime().getTime()) : String.valueOf(lastModifiedTime.getTime()); } } catch (RegistryException e) { String msg = STR; log.error(msg, e); throw new APIManagementException(msg, e); } return null; }
/** * get the thumbnailLastUpdatedTime for a thumbnail for a given api * * @param apiIdentifier * @return * @throws APIManagementException */
get the thumbnailLastUpdatedTime for a thumbnail for a given api
getThumbnailLastUpdatedTime
{ "repo_name": "pubudu538/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/AbstractAPIManager.java", "license": "apache-2.0", "size": 165292 }
[ "java.util.Date", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.APIIdentifier", "org.wso2.carbon.registry.core.RegistryConstants", "org.wso2.carbon.registry.core.Resource", "org.wso2.carbon.registry.core.exceptions.RegistryException" ]
import java.util.Date; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.registry.core.RegistryConstants; import org.wso2.carbon.registry.core.Resource; import org.wso2.carbon.registry.core.exceptions.RegistryException;
import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.registry.core.*; import org.wso2.carbon.registry.core.exceptions.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
223,699
public static boolean isRed(TraceEvent te) { if (te.getType() == TraceEvent.CLEAR_CONNECTION || te.getType() == TraceEvent.CLEAR_CONNECTION_LISTENER) return true; return false; }
static boolean function(TraceEvent te) { if (te.getType() == TraceEvent.CLEAR_CONNECTION te.getType() == TraceEvent.CLEAR_CONNECTION_LISTENER) return true; return false; }
/** * Is red * @param te The event * @return The value */
Is red
isRed
{ "repo_name": "jandsu/ironjacamar", "path": "tracer/src/main/java/org/ironjacamar/tracer/TraceEventHelper.java", "license": "epl-1.0", "size": 35263 }
[ "org.ironjacamar.core.tracer.TraceEvent" ]
import org.ironjacamar.core.tracer.TraceEvent;
import org.ironjacamar.core.tracer.*;
[ "org.ironjacamar.core" ]
org.ironjacamar.core;
2,741,987
public FTPFile mdtmFile(String pathname) throws IOException { if (FTPReply.isPositiveCompletion(mdtm(pathname))) { String reply = getReplyStrings()[0].substring(4); // skip the return code (e.g. 213) and the space FTPFile file = new FTPFile(); file.setName(pathname); file.setRawListing(reply); file.setTimestamp(MLSxEntryParser.parseGMTdateTime(reply)); return file; } return null; }
FTPFile function(String pathname) throws IOException { if (FTPReply.isPositiveCompletion(mdtm(pathname))) { String reply = getReplyStrings()[0].substring(4); FTPFile file = new FTPFile(); file.setName(pathname); file.setRawListing(reply); file.setTimestamp(MLSxEntryParser.parseGMTdateTime(reply)); return file; } return null; }
/** * Issue the FTP MDTM command (not supported by all servers) to retrieve the last * modification time of a file. The modification string should be in the * ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in * GMT, but not all FTP servers honour this. * * @param pathname The file path to query. * @return A FTPFile representing the last file modification time, may be {@code null}. * The FTPFile timestamp will be null if a parse error occurs. * @throws IOException if an I/O error occurs. * @since 3.4 */
Issue the FTP MDTM command (not supported by all servers) to retrieve the last modification time of a file. The modification string should be in the ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in GMT, but not all FTP servers honour this
mdtmFile
{ "repo_name": "AriaLyy/DownloadUtil", "path": "AriaFtpPlug/src/main/java/aria/apache/commons/net/ftp/FTPClient.java", "license": "apache-2.0", "size": 152886 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,541,576
public void connect() throws KettleException { connect(null, null); }
void function() throws KettleException { connect(null, null); }
/** * Connect to LDAP server * @throws KettleException */
Connect to LDAP server
connect
{ "repo_name": "jjeb/kettle-trunk", "path": "engine/src/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java", "license": "apache-2.0", "size": 30234 }
[ "org.pentaho.di.core.exception.KettleException" ]
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.exception.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,276,141
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111") @RequestWrapper(localName = "getLabelsByStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111", className = "com.google.api.ads.admanager.jaxws.v202111.LabelServiceInterfacegetLabelsByStatement") @ResponseWrapper(localName = "getLabelsByStatementResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111", className = "com.google.api.ads.admanager.jaxws.v202111.LabelServiceInterfacegetLabelsByStatementResponse") public LabelPage getLabelsByStatement( @WebParam(name = "filterStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111") Statement filterStatement) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRgetLabelsByStatementSTRhttps: @ResponseWrapper(localName = "getLabelsByStatementResponseSTRhttps: LabelPage function( @WebParam(name = "filterStatementSTRhttps: Statement filterStatement) throws ApiException_Exception ;
/** * * Gets a {@link LabelPage} of {@link Label} objects that satisfy the * given {@link Statement#query}. The following fields are supported for * filtering: * * <table> * <tr> * <th scope="col">PQL Property</th> <th scope="col">Object Property</th> * </tr> * <tr> * <td>{@code id}</td> * <td>{@link Label#id}</td> * </tr> * <tr> * <td>{@code type}</td> * <td>{@link Label#type}</td> * </tr> * <tr> * <td>{@code name}</td> * <td>{@link Label#name}</td> * </tr> * <tr> * <td>{@code description}</td> * <td>{@link Label#description}</td> * </tr> * <tr> * <td>{@code isActive}</td> * <td>{@link Label#isActive}</td> * </tr> * </table> * * * @param filterStatement a Publisher Query Language statement used to filter * a set of labels. * @return the labels that match the given filter * * * @param filterStatement * @return * returns com.google.api.ads.admanager.jaxws.v202111.LabelPage * @throws ApiException_Exception */
Gets a <code>LabelPage</code> of <code>Label</code> objects that satisfy the given <code>Statement#query</code>. The following fields are supported for filtering: PQL Property Object Property id <code>Label#id</code> type <code>Label#type</code> name <code>Label#name</code> description <code>Label#description</code> isActive <code>Label#isActive</code>
getLabelsByStatement
{ "repo_name": "googleads/googleads-java-lib", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/v202111/LabelServiceInterface.java", "license": "apache-2.0", "size": 7412 }
[ "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import javax.jws.*; import javax.xml.ws.*;
[ "javax.jws", "javax.xml" ]
javax.jws; javax.xml;
129,057
public void insertItem(String item, String value, String title, int index, boolean isValueSet) { if(this.doTrimDisplay){ if(!isValueSet && !item.equalsIgnoreCase("--Select--") && item.contains(":") && item.contains("-")){ //do this only for the QDM dropdown. String stripoffOID = MatContext.get().stripOffOID(item); item = stripoffOID; } SelectElement select = getElement().cast(); OptionElement option = Document.get().createOptionElement(); if(item.length() > this.maxWidth){ String shortText = item.substring(0,65); option.setText(shortText); }else{ option.setText(item); } option.setValue(value); option.setTitle(title); if ((index == -1) || (index == select.getLength())) { select.add(option, null); } else { OptionElement before = select.getOptions().getItem(index); select.add(option, before); } } else{ super.insertItem(item, value, index); } }
void function(String item, String value, String title, int index, boolean isValueSet) { if(this.doTrimDisplay){ if(!isValueSet && !item.equalsIgnoreCase(STR) && item.contains(":") && item.contains("-")){ String stripoffOID = MatContext.get().stripOffOID(item); item = stripoffOID; } SelectElement select = getElement().cast(); OptionElement option = Document.get().createOptionElement(); if(item.length() > this.maxWidth){ String shortText = item.substring(0,65); option.setText(shortText); }else{ option.setText(item); } option.setValue(value); option.setTitle(title); if ((index == -1) (index == select.getLength())) { select.add(option, null); } else { OptionElement before = select.getOptions().getItem(index); select.add(option, before); } } else{ super.insertItem(item, value, index); } }
/** * Insert item. * * @param item * the item * @param value * the value * @param title * the title * @param index * the index * @param isValueSet * the is value set */
Insert item
insertItem
{ "repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint", "path": "mat/src/mat/client/shared/ListBoxMVP.java", "license": "apache-2.0", "size": 6794 }
[ "com.google.gwt.dom.client.Document", "com.google.gwt.dom.client.OptionElement", "com.google.gwt.dom.client.SelectElement" ]
import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.OptionElement; import com.google.gwt.dom.client.SelectElement;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
967,485
public @NonNull Note newNote() { return newNote(true); }
@NonNull Note function() { return newNote(true); }
/** * Return a new note with the default model from the deck * @return The new note */
Return a new note with the default model from the deck
newNote
{ "repo_name": "donald-w/Anki-Android", "path": "AnkiDroid/src/main/java/com/ichi2/libanki/Collection.java", "license": "gpl-3.0", "size": 89072 }
[ "androidx.annotation.NonNull" ]
import androidx.annotation.NonNull;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
2,080,850
public Object next() throws NamingException { return nextElement(); }
Object function() throws NamingException { return nextElement(); }
/** * Retrieves the next element in the enumeration. */
Retrieves the next element in the enumeration
next
{ "repo_name": "whitingjr/JbossWeb_7_2_0", "path": "src/main/java/org/apache/naming/NamingContextEnumeration.java", "license": "apache-2.0", "size": 2368 }
[ "javax.naming.NamingException" ]
import javax.naming.NamingException;
import javax.naming.*;
[ "javax.naming" ]
javax.naming;
2,801,826
public TLAbsInputUser getId() { return this.id; }
TLAbsInputUser function() { return this.id; }
/** * Gets id. * * @return the id */
Gets id
getId
{ "repo_name": "rubenlagus/TelegramApi", "path": "src/main/java/org/telegram/api/functions/contacts/TLRequestContactsBlock.java", "license": "mit", "size": 1960 }
[ "org.telegram.api.input.user.TLAbsInputUser" ]
import org.telegram.api.input.user.TLAbsInputUser;
import org.telegram.api.input.user.*;
[ "org.telegram.api" ]
org.telegram.api;
2,073,404
public Shape getSeriesShape(int series); /** * Sets the shape used for a series and sends a {@link RendererChangeEvent}
Shape function(int series); /** * Sets the shape used for a series and sends a {@link RendererChangeEvent}
/** * Returns a shape used to represent the items in a series. * * @param series the series (zero-based index). * * @return The shape (possibly <code>null</code>). * * @see #setSeriesShape(int, Shape) */
Returns a shape used to represent the items in a series
getSeriesShape
{ "repo_name": "ibestvina/multithread-centiscape", "path": "CentiScaPe2.1/src/main/java/org/jfree/chart/renderer/category/CategoryItemRenderer.java", "license": "mit", "size": 66885 }
[ "java.awt.Shape", "org.jfree.chart.event.RendererChangeEvent" ]
import java.awt.Shape; import org.jfree.chart.event.RendererChangeEvent;
import java.awt.*; import org.jfree.chart.event.*;
[ "java.awt", "org.jfree.chart" ]
java.awt; org.jfree.chart;
1,517,015
public void submitJob(int dst, Reservation res, long delay, Job job) { job.setReservationId(res.getId()); super.submitJob(dst, delay, job); }
void function(int dst, Reservation res, long delay, Job job) { job.setReservationId(res.getId()); super.submitJob(dst, delay, job); }
/** * Submits a job to a given entity, such as a server * @param dst the id of the destination entity * @param res the reservation made for the job * @param delay the delay to wait before submitting the job * @param job the job to be submitted */
Submits a job to a given entity, such as a server
submitJob
{ "repo_name": "assuncaomarcos/servsim", "path": "src/main/java/me/marcosassuncao/servsim/server/ReservationServerUser.java", "license": "apache-2.0", "size": 4561 }
[ "me.marcosassuncao.servsim.job.Job", "me.marcosassuncao.servsim.job.Reservation" ]
import me.marcosassuncao.servsim.job.Job; import me.marcosassuncao.servsim.job.Reservation;
import me.marcosassuncao.servsim.job.*;
[ "me.marcosassuncao.servsim" ]
me.marcosassuncao.servsim;
747,644
void thumbnailProgress(ImageWriter source, float percentageDone);
void thumbnailProgress(ImageWriter source, float percentageDone);
/** * Reports the approximate percentage of completion of a thumbnail write * operation. * * @param source the <code>ImageWriter</code> object calling this method * @param percentageDone the approximate percentage of decoding completed */
Reports the approximate percentage of completion of a thumbnail write operation
thumbnailProgress
{ "repo_name": "aosm/gcc_40", "path": "libjava/javax/imageio/event/IIOWriteProgressListener.java", "license": "gpl-2.0", "size": 3774 }
[ "javax.imageio.ImageWriter" ]
import javax.imageio.ImageWriter;
import javax.imageio.*;
[ "javax.imageio" ]
javax.imageio;
892,967
public CircuitSwitch getCircuitSwitch(Location l) { return plugin.getStorage().getCircuitSwitchByLocation(l); }
CircuitSwitch function(Location l) { return plugin.getStorage().getCircuitSwitchByLocation(l); }
/** Given a location, return the CircuitSwitch associated with that location (if any). * * @param l * @return */
Given a location, return the CircuitSwitch associated with that location (if any)
getCircuitSwitch
{ "repo_name": "andune/LightSwitch", "path": "src/main/java/org/morganm/lightswitch/LightSwitchManager.java", "license": "gpl-2.0", "size": 6747 }
[ "org.bukkit.Location", "org.morganm.lightswitch.entity.CircuitSwitch" ]
import org.bukkit.Location; import org.morganm.lightswitch.entity.CircuitSwitch;
import org.bukkit.*; import org.morganm.lightswitch.entity.*;
[ "org.bukkit", "org.morganm.lightswitch" ]
org.bukkit; org.morganm.lightswitch;
1,894,182
protected List<String> getTestHarnessSpringBeansLocation() { return Collections.singletonList( DEFAULT_TEST_HARNESS_SPRING_BEANS ); }
List<String> function() { return Collections.singletonList( DEFAULT_TEST_HARNESS_SPRING_BEANS ); }
/** * Returns the location of the test harness spring beans context file. * Subclasses may override to specify a different location. * @return the location of the test harness spring beans context file. */
Returns the location of the test harness spring beans context file. Subclasses may override to specify a different location
getTestHarnessSpringBeansLocation
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/it/internal-tools/src/main/java/org/kuali/rice/test/RiceTestCase.java", "license": "apache-2.0", "size": 17636 }
[ "java.util.Collections", "java.util.List" ]
import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,499,777
LBool isSat = script.checkSat(); if (isSat == LBool.UNKNOWN) { assert ReasonUnknown.TIMEOUT.equals(script.getInfo(":reason-unknown")) : script.getInfo(":reason-unknown"); throw new UncheckedInterruptedException(); } else if (isSat == LBool.UNSAT) { return null; } Model model = script.getModel(); Region.Builder builder; if (properties.isPure()) { List<BigInteger> weights = new ArrayList<>(); for (Term term : regionWeights) weights.add(getValue(model, term)); builder = Region.Builder.createPure(utility, weights); } else { List<BigInteger> backwardWeight = new ArrayList<>(); List<BigInteger> forwardWeight = new ArrayList<>(); for (Term term : regionBackwardWeights) backwardWeight.add(getValue(model, term)); for (Term term : regionForwardWeights) forwardWeight.add(getValue(model, term)); builder = new Region.Builder(utility, backwardWeight, forwardWeight); } Region r = builder.withInitialMarking(getValue(model, regionInitialMarking)); debug("region: ", r); return r; }
LBool isSat = script.checkSat(); if (isSat == LBool.UNKNOWN) { assert ReasonUnknown.TIMEOUT.equals(script.getInfo(STR)) : script.getInfo(STR); throw new UncheckedInterruptedException(); } else if (isSat == LBool.UNSAT) { return null; } Model model = script.getModel(); Region.Builder builder; if (properties.isPure()) { List<BigInteger> weights = new ArrayList<>(); for (Term term : regionWeights) weights.add(getValue(model, term)); builder = Region.Builder.createPure(utility, weights); } else { List<BigInteger> backwardWeight = new ArrayList<>(); List<BigInteger> forwardWeight = new ArrayList<>(); for (Term term : regionBackwardWeights) backwardWeight.add(getValue(model, term)); for (Term term : regionForwardWeights) forwardWeight.add(getValue(model, term)); builder = new Region.Builder(utility, backwardWeight, forwardWeight); } Region r = builder.withInitialMarking(getValue(model, regionInitialMarking)); debug(STR, r); return r; }
/** * Try to get a region from the script. * @return A region or null. */
Try to get a region from the script
regionFromSolution
{ "repo_name": "CvO-Theory/apt", "path": "src/module/uniol/apt/analysis/synthesize/separation/InequalitySystemSeparation.java", "license": "gpl-2.0", "size": 8651 }
[ "de.uni_freiburg.informatik.ultimate.logic.Model", "de.uni_freiburg.informatik.ultimate.logic.ReasonUnknown", "de.uni_freiburg.informatik.ultimate.logic.Script", "de.uni_freiburg.informatik.ultimate.logic.Term", "java.math.BigInteger", "java.util.ArrayList", "java.util.List" ]
import de.uni_freiburg.informatik.ultimate.logic.Model; import de.uni_freiburg.informatik.ultimate.logic.ReasonUnknown; import de.uni_freiburg.informatik.ultimate.logic.Script; import de.uni_freiburg.informatik.ultimate.logic.Term; import java.math.BigInteger; import java.util.ArrayList; import java.util.List;
import de.uni_freiburg.informatik.ultimate.logic.*; import java.math.*; import java.util.*;
[ "de.uni_freiburg.informatik", "java.math", "java.util" ]
de.uni_freiburg.informatik; java.math; java.util;
536,988
@Test public void testCancelQueryIfPartitionsCantBeReservedOnMapNodes() throws Exception { // Releases thread that kills query when map nodes receive query request. At least one map node received is ok. GridMessageListener qryStarted = (node, msg, plc) -> { if (msg instanceof GridH2QueryRequest) TestSQLFunctions.cancelLatch.countDown(); }; for (int i = 0; i < NODES_COUNT; i++) grid(i).context().io().addMessageListener(GridTopic.TOPIC_QUERY, qryStarted); // Suspends distributed queries on the map nodes. MockedIndexing.failReservations = true; try { IgniteInternalFuture cancelFut = cancel(1, asyncCancel); GridTestUtils.assertThrows(log, () -> { ignite.cache(DEFAULT_CACHE_NAME).query( new SqlFieldsQuery("select * from Integer where _val <> 42") ).getAll(); return null; }, CacheException.class, "The query was cancelled while executing."); cancelFut.get(CHECK_RESULT_TIMEOUT); } finally { for (int i = 0; i < NODES_COUNT; i++) grid(i).context().io().removeMessageListener(GridTopic.TOPIC_QUERY, qryStarted); } }
void function() throws Exception { GridMessageListener qryStarted = (node, msg, plc) -> { if (msg instanceof GridH2QueryRequest) TestSQLFunctions.cancelLatch.countDown(); }; for (int i = 0; i < NODES_COUNT; i++) grid(i).context().io().addMessageListener(GridTopic.TOPIC_QUERY, qryStarted); MockedIndexing.failReservations = true; try { IgniteInternalFuture cancelFut = cancel(1, asyncCancel); GridTestUtils.assertThrows(log, () -> { ignite.cache(DEFAULT_CACHE_NAME).query( new SqlFieldsQuery(STR) ).getAll(); return null; }, CacheException.class, STR); cancelFut.get(CHECK_RESULT_TIMEOUT); } finally { for (int i = 0; i < NODES_COUNT; i++) grid(i).context().io().removeMessageListener(GridTopic.TOPIC_QUERY, qryStarted); } }
/** * Check if query hangs (due to reducer spins retrying to reserve partitions but they can't be reserved), we still * able to cancel it. Used mocked indexing simulates 100% unability. */
Check if query hangs (due to reducer spins retrying to reserve partitions but they can't be reserved), we still able to cancel it. Used mocked indexing simulates 100% unability
testCancelQueryIfPartitionsCantBeReservedOnMapNodes
{ "repo_name": "SomeFire/ignite", "path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java", "license": "apache-2.0", "size": 56085 }
[ "javax.cache.CacheException", "org.apache.ignite.cache.query.SqlFieldsQuery", "org.apache.ignite.internal.GridTopic", "org.apache.ignite.internal.IgniteInternalFuture", "org.apache.ignite.internal.managers.communication.GridMessageListener", "org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2QueryRequest", "org.apache.ignite.testframework.GridTestUtils" ]
import javax.cache.CacheException; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.GridTopic; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.managers.communication.GridMessageListener; import org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2QueryRequest; import org.apache.ignite.testframework.GridTestUtils;
import javax.cache.*; import org.apache.ignite.cache.query.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.managers.communication.*; import org.apache.ignite.internal.processors.query.h2.twostep.msg.*; import org.apache.ignite.testframework.*;
[ "javax.cache", "org.apache.ignite" ]
javax.cache; org.apache.ignite;
792,406
@Override public void closeWriter(Object writerId) { FlatFileBeanWriter writer = getWriter(writerId, false); IOUtil.close(writer); }
void function(Object writerId) { FlatFileBeanWriter writer = getWriter(writerId, false); IOUtil.close(writer); }
/** Closes the writer and returns its content as string. * @param writerId the id of the writer to close */
Closes the writer and returns its content as string
closeWriter
{ "repo_name": "AludraTest/aludratest", "path": "src/main/java/org/aludratest/content/flat/webdecs/WebdecsFlatContent.java", "license": "apache-2.0", "size": 6038 }
[ "org.databene.commons.IOUtil" ]
import org.databene.commons.IOUtil;
import org.databene.commons.*;
[ "org.databene.commons" ]
org.databene.commons;
350,040
private static KafkaIO.Read<Integer, Long> mkKafkaReadTransform( int numElements, @Nullable SerializableFunction<KV<Integer, Long>, Instant> timestampFn) { List<String> topics = ImmutableList.of("topic_a", "topic_b"); KafkaIO.Read<Integer, Long> reader = KafkaIO.<Integer, Long>read() .withBootstrapServers("myServer1:9092,myServer2:9092") .withTopics(topics) .withConsumerFactoryFn(new ConsumerFactoryFn( topics, 10, numElements, OffsetResetStrategy.EARLIEST)) // 20 partitions .withKeyCoder(BigEndianIntegerCoder.of()) .withValueCoder(BigEndianLongCoder.of()) .withMaxNumRecords(numElements); if (timestampFn != null) { return reader.withTimestampFn(timestampFn); } else { return reader; } } private static class AssertMultipleOf implements SerializableFunction<Iterable<Long>, Void> { private final int num; public AssertMultipleOf(int num) { this.num = num; }
static KafkaIO.Read<Integer, Long> function( int numElements, @Nullable SerializableFunction<KV<Integer, Long>, Instant> timestampFn) { List<String> topics = ImmutableList.of(STR, STR); KafkaIO.Read<Integer, Long> reader = KafkaIO.<Integer, Long>read() .withBootstrapServers(STR) .withTopics(topics) .withConsumerFactoryFn(new ConsumerFactoryFn( topics, 10, numElements, OffsetResetStrategy.EARLIEST)) .withKeyCoder(BigEndianIntegerCoder.of()) .withValueCoder(BigEndianLongCoder.of()) .withMaxNumRecords(numElements); if (timestampFn != null) { return reader.withTimestampFn(timestampFn); } else { return reader; } } private static class AssertMultipleOf implements SerializableFunction<Iterable<Long>, Void> { private final int num; public AssertMultipleOf(int num) { this.num = num; }
/** * Creates a consumer with two topics, with 5 partitions each. * numElements are (round-robin) assigned all the 10 partitions. */
Creates a consumer with two topics, with 5 partitions each. numElements are (round-robin) assigned all the 10 partitions
mkKafkaReadTransform
{ "repo_name": "xsm110/Apache-Beam", "path": "sdks/java/io/kafka/src/test/java/org/apache/beam/sdk/io/kafka/KafkaIOTest.java", "license": "apache-2.0", "size": 31560 }
[ "com.google.common.collect.ImmutableList", "java.util.List", "javax.annotation.Nullable", "org.apache.beam.sdk.coders.BigEndianIntegerCoder", "org.apache.beam.sdk.coders.BigEndianLongCoder", "org.apache.beam.sdk.io.Read", "org.apache.beam.sdk.transforms.SerializableFunction", "org.apache.kafka.clients.consumer.OffsetResetStrategy", "org.joda.time.Instant" ]
import com.google.common.collect.ImmutableList; import java.util.List; import javax.annotation.Nullable; import org.apache.beam.sdk.coders.BigEndianIntegerCoder; import org.apache.beam.sdk.coders.BigEndianLongCoder; import org.apache.beam.sdk.io.Read; import org.apache.beam.sdk.transforms.SerializableFunction; import org.apache.kafka.clients.consumer.OffsetResetStrategy; import org.joda.time.Instant;
import com.google.common.collect.*; import java.util.*; import javax.annotation.*; import org.apache.beam.sdk.coders.*; import org.apache.beam.sdk.io.*; import org.apache.beam.sdk.transforms.*; import org.apache.kafka.clients.consumer.*; import org.joda.time.*;
[ "com.google.common", "java.util", "javax.annotation", "org.apache.beam", "org.apache.kafka", "org.joda.time" ]
com.google.common; java.util; javax.annotation; org.apache.beam; org.apache.kafka; org.joda.time;
693,010
public boolean shouldExecute() { EntityLivingBase entitylivingbase = this.thePet.getOwnerEntity(); if (entitylivingbase == null) { return false; } else if (this.thePet.isSitting()) { return false; } else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double)(this.minDist * this.minDist)) { return false; } else { this.theOwner = entitylivingbase; return true; } }
boolean function() { EntityLivingBase entitylivingbase = this.thePet.getOwnerEntity(); if (entitylivingbase == null) { return false; } else if (this.thePet.isSitting()) { return false; } else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double)(this.minDist * this.minDist)) { return false; } else { this.theOwner = entitylivingbase; return true; } }
/** * Returns whether the EntityAIBase should begin execution. */
Returns whether the EntityAIBase should begin execution
shouldExecute
{ "repo_name": "trixmot/mod1", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/ai/EntityAIFollowOwner.java", "license": "lgpl-2.1", "size": 4857 }
[ "net.minecraft.entity.EntityLivingBase" ]
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
2,213,712
protected Node newNode() { return new SVGOMFEDistantLightElement(); }
Node function() { return new SVGOMFEDistantLightElement(); }
/** * Returns a new uninitialized instance of this object's class. */
Returns a new uninitialized instance of this object's class
newNode
{ "repo_name": "Groostav/CMPT880-term-project", "path": "intruder/benchs/batik/batik-1.7/sources/org/apache/batik/dom/svg/SVGOMFEDistantLightElement.java", "license": "apache-2.0", "size": 3982 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,878,985
public String compareFiles(String expected, String actual) { BufferedReader exp = null,act = null; String diff = ""; try { exp = new BufferedReader(new FileReader(expected)); act = new BufferedReader(new FileReader(actual)); boolean same = true; int line = 0; while (true) { line++; String sexp = exp.readLine(); String sact = act.readLine(); if (sexp == null && sact == null) return diff.isEmpty() ? null : diff; if (sexp == null && sact != null) { diff += ("More actual input than expected" + eol); return diff; } if (sexp != null && sact == null) { diff += ("Less actual input than expected" + eol); return diff; } if (!sexp.equals(sact) && (isWindows || !sexp.equals(sact.replace('/','\\')))) { diff += ("Lines differ at " + line + eol) + ("EXP: " + sexp + eol) + ("ACT: " + sact + eol); } } } catch (FileNotFoundException e) { diff += ("No expected file found: " + expected + eol); } catch (Exception e) { diff += ("Exception on file comparison" + eol); } finally { try { if (exp != null) exp.close(); if (act != null) act.close(); } catch (Exception e) {} } return diff.isEmpty() ? null : diff; }
String function(String expected, String actual) { BufferedReader exp = null,act = null; String diff = STRMore actual input than expectedSTRLess actual input than expectedSTRLines differ at STREXP: STRACT: STRNo expected file found: STRException on file comparison" + eol); } finally { try { if (exp != null) exp.close(); if (act != null) act.close(); } catch (Exception e) {} } return diff.isEmpty() ? null : diff; }
/** Compares two files, returning null if the same; returning a String of * explanation if they are different. */
Compares two files, returning null if the same; returning a String of explanation if they are different
compareFiles
{ "repo_name": "shunghsiyu/OpenJML_XOR", "path": "OpenJML/tests/tests/JmlTestCase.java", "license": "gpl-2.0", "size": 18164 }
[ "java.io.BufferedReader" ]
import java.io.BufferedReader;
import java.io.*;
[ "java.io" ]
java.io;
390,453
public void testSimpleClassLoader() throws Exception { System.out.println("\nStarting ClassPathLoaderJUnitTest#testSimpleClassLoader"); ClassLoader cl = new SimpleClassLoader(getClass().getClassLoader()); String classToLoad = "java.lang.String"; Class<?> clazz = Class.forName(classToLoad, true, cl); assertNotNull(clazz); String resourceToGet = "java/lang/String.class"; URL url = cl.getResource(resourceToGet); assertNotNull(url); InputStream is = cl.getResourceAsStream(resourceToGet); assertNotNull(is); }
void function() throws Exception { System.out.println(STR); ClassLoader cl = new SimpleClassLoader(getClass().getClassLoader()); String classToLoad = STR; Class<?> clazz = Class.forName(classToLoad, true, cl); assertNotNull(clazz); String resourceToGet = STR; URL url = cl.getResource(resourceToGet); assertNotNull(url); InputStream is = cl.getResourceAsStream(resourceToGet); assertNotNull(is); }
/** * Verifies that the {@link SimpleClassLoader} works and finds classes that the parent can find. This is a control * which ensures that tests depending on <tt>SimpleClassLoader</tt> are valid. */
Verifies that the <code>SimpleClassLoader</code> works and finds classes that the parent can find. This is a control which ensures that tests depending on SimpleClassLoader are valid
testSimpleClassLoader
{ "repo_name": "robertgeiger/incubator-geode", "path": "gemfire-core/src/test/java/com/gemstone/gemfire/internal/ClassPathLoaderJUnitTest.java", "license": "apache-2.0", "size": 44668 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
707,715
public Iterator<StorageDirectory> dirIterator() { return dirIterator(null); }
Iterator<StorageDirectory> function() { return dirIterator(null); }
/** * Return default iterator * This iterator returns all entries in storageDirs */
Return default iterator This iterator returns all entries in storageDirs
dirIterator
{ "repo_name": "bruthe/hadoop-2.6.0r", "path": "src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java", "license": "apache-2.0", "size": 39839 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,411,052
public static int write(final ByteBuf buff, final ValueType valueType, final String metricName, final long timestamp, final Map<String, String> tags) { final int offset = buff.writerIndex(); buff.writeByte(TYPE_CODE); buff.writeByte(valueType==null ? 0 : valueType.ordinal()+1); buff.writeLong(timestamp); BufferManager.writeUTF(metricName, buff); buff.writeByte(tags.size()); for(Map.Entry<String, String> entry: tags.entrySet()) { BufferManager.writeUTF(entry.getKey(), buff); BufferManager.writeUTF(entry.getValue(), buff); } return buff.writerIndex() - offset; } /** * {@inheritDoc}
static int function(final ByteBuf buff, final ValueType valueType, final String metricName, final long timestamp, final Map<String, String> tags) { final int offset = buff.writerIndex(); buff.writeByte(TYPE_CODE); buff.writeByte(valueType==null ? 0 : valueType.ordinal()+1); buff.writeLong(timestamp); BufferManager.writeUTF(metricName, buff); buff.writeByte(tags.size()); for(Map.Entry<String, String> entry: tags.entrySet()) { BufferManager.writeUTF(entry.getKey(), buff); BufferManager.writeUTF(entry.getValue(), buff); } return buff.writerIndex() - offset; } /** * {@inheritDoc}
/** * Writes a metric definition to the passed buffer * @param buff The buffer to write to * @param valueType The value type * @param metricName The metric name * @param timestamp The metric timestamp * @param tags The metric tags * @return the number of bytes written */
Writes a metric definition to the passed buffer
write
{ "repo_name": "nickman/HeliosStreams", "path": "stream-common/src/main/java/com/heliosapm/streams/metrics/StreamedMetricValue.java", "license": "apache-2.0", "size": 19972 }
[ "com.heliosapm.utils.buffer.BufferManager", "io.netty.buffer.ByteBuf", "java.util.Map" ]
import com.heliosapm.utils.buffer.BufferManager; import io.netty.buffer.ByteBuf; import java.util.Map;
import com.heliosapm.utils.buffer.*; import io.netty.buffer.*; import java.util.*;
[ "com.heliosapm.utils", "io.netty.buffer", "java.util" ]
com.heliosapm.utils; io.netty.buffer; java.util;
2,190,172
void gotoCamera(File file) throws Exception { if (file == null) { throw new Exception("file is null obj"); } if (!file.exists()) { throw new Exception("file is not exists"); } this.file = file; Intent intent = new Intent(); intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file)); startActivityForResult(intent, REQUEST_CODE_CAPTURE); }
void gotoCamera(File file) throws Exception { if (file == null) { throw new Exception(STR); } if (!file.exists()) { throw new Exception(STR); } this.file = file; Intent intent = new Intent(); intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file)); startActivityForResult(intent, REQUEST_CODE_CAPTURE); }
/** * open camera (need permission) * * @param file which is used to image */
open camera (need permission)
gotoCamera
{ "repo_name": "ChangsenLai/codedemos", "path": "app/src/main/java/com/csl/codedemos/util/CameraUtilActivity.java", "license": "apache-2.0", "size": 3089 }
[ "android.content.Intent", "android.net.Uri", "android.provider.MediaStore", "java.io.File" ]
import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; import java.io.File;
import android.content.*; import android.net.*; import android.provider.*; import java.io.*;
[ "android.content", "android.net", "android.provider", "java.io" ]
android.content; android.net; android.provider; java.io;
1,395,723
@Test public final void testUsePortalWithNoDestination() { final Portal port = new Portal(); final Player player = PlayerTestHelper.createPlayer("player"); assertFalse("port has no destination", port.usePortal(player)); }
final void function() { final Portal port = new Portal(); final Player player = PlayerTestHelper.createPlayer(STR); assertFalse(STR, port.usePortal(player)); }
/** * Tests for usePortalWithNoDestination. */
Tests for usePortalWithNoDestination
testUsePortalWithNoDestination
{ "repo_name": "acsid/stendhal", "path": "tests/games/stendhal/server/entity/mapstuff/portal/PortalTest.java", "license": "gpl-2.0", "size": 6479 }
[ "games.stendhal.server.entity.player.Player", "org.junit.Assert" ]
import games.stendhal.server.entity.player.Player; import org.junit.Assert;
import games.stendhal.server.entity.player.*; import org.junit.*;
[ "games.stendhal.server", "org.junit" ]
games.stendhal.server; org.junit;
1,023,731
protected void updateCloudletProcessing() { // if some time passed since last processing // R: for term is to allow loop at simulation start. Otherwise, one initial // simulation step is skipped and schedulers are not properly initialized if (CloudSim.clock() < 0.111 || CloudSim.clock() > getLastProcessTime() + CloudSim.getMinTimeBetweenEvents()) { List<? extends Host> list = getVmAllocationPolicy().getHostList(); double smallerTime = Double.MAX_VALUE; // for each host... for (int i = 0; i < list.size(); i++) { Host host = list.get(i); // inform VMs to update processing double time = host.updateVmsProcessing(CloudSim.clock()); // what time do we expect that the next cloudlet will finish? if (time < smallerTime) { smallerTime = time; } } // gurantees a minimal interval before scheduling the event if (smallerTime < CloudSim.clock() + CloudSim.getMinTimeBetweenEvents() + 0.01) { smallerTime = CloudSim.clock() + CloudSim.getMinTimeBetweenEvents() + 0.01; } if (smallerTime != Double.MAX_VALUE) { schedule(getId(), (smallerTime - CloudSim.clock()), CloudSimTags.VM_DATACENTER_EVENT); } setLastProcessTime(CloudSim.clock()); } }
void function() { if (CloudSim.clock() < 0.111 CloudSim.clock() > getLastProcessTime() + CloudSim.getMinTimeBetweenEvents()) { List<? extends Host> list = getVmAllocationPolicy().getHostList(); double smallerTime = Double.MAX_VALUE; for (int i = 0; i < list.size(); i++) { Host host = list.get(i); double time = host.updateVmsProcessing(CloudSim.clock()); if (time < smallerTime) { smallerTime = time; } } if (smallerTime < CloudSim.clock() + CloudSim.getMinTimeBetweenEvents() + 0.01) { smallerTime = CloudSim.clock() + CloudSim.getMinTimeBetweenEvents() + 0.01; } if (smallerTime != Double.MAX_VALUE) { schedule(getId(), (smallerTime - CloudSim.clock()), CloudSimTags.VM_DATACENTER_EVENT); } setLastProcessTime(CloudSim.clock()); } }
/** * Updates processing of each cloudlet running in this Datacenter. It is necessary because * Hosts and VirtualMachines are simple objects, not entities. So, they don't receive events and * updating cloudlets inside them must be called from the outside. * * @pre $none * @post $none */
Updates processing of each cloudlet running in this Datacenter. It is necessary because Hosts and VirtualMachines are simple objects, not entities. So, they don't receive events and updating cloudlets inside them must be called from the outside
updateCloudletProcessing
{ "repo_name": "mhe504/MigSim", "path": "src/org/cloudbus/cloudsim/Datacenter.java", "license": "mit", "size": 34380 }
[ "java.util.List", "org.cloudbus.cloudsim.core.CloudSim", "org.cloudbus.cloudsim.core.CloudSimTags" ]
import java.util.List; import org.cloudbus.cloudsim.core.CloudSim; import org.cloudbus.cloudsim.core.CloudSimTags;
import java.util.*; import org.cloudbus.cloudsim.core.*;
[ "java.util", "org.cloudbus.cloudsim" ]
java.util; org.cloudbus.cloudsim;
2,556,386
Package getPackage(IntermediateParseResults intermediateResults, String packageId) { Package aPackage = intermediateResults.getPackage(packageId); if (aPackage == null) { aPackage = dataService.findOneById(PackageMetadata.PACKAGE, packageId, Package.class); } return aPackage; }
Package getPackage(IntermediateParseResults intermediateResults, String packageId) { Package aPackage = intermediateResults.getPackage(packageId); if (aPackage == null) { aPackage = dataService.findOneById(PackageMetadata.PACKAGE, packageId, Package.class); } return aPackage; }
/** * Retrieves a {@link Package} by name from parsed data or existing data. * * @param intermediateResults parsed data * @param packageId package name * @return package or <code>null</code> if no package with the given name exists in parsed or * existing data */
Retrieves a <code>Package</code> by name from parsed data or existing data
getPackage
{ "repo_name": "sidohaakma/molgenis", "path": "molgenis-data-import/src/main/java/org/molgenis/data/importer/emx/EmxMetadataParser.java", "license": "lgpl-3.0", "size": 58239 }
[ "org.molgenis.data.meta.model.Package", "org.molgenis.data.meta.model.PackageMetadata" ]
import org.molgenis.data.meta.model.Package; import org.molgenis.data.meta.model.PackageMetadata;
import org.molgenis.data.meta.model.*;
[ "org.molgenis.data" ]
org.molgenis.data;
2,250,984
private double getMit(final String field, final String gu) { double currentVal = 0; double length = 0; for (final SbPartObjOffen tmp : objList) { if (((tmp.getOwner() != null) && tmp.getOwner().equals(gu))) { final double value = tmp.get(field); if (value == 0.0) { continue; } currentVal += value * tmp.getLength(); length += tmp.getLength(); } } if (length == 0) { return 0; } else { return currentVal / length; } }
double function(final String field, final String gu) { double currentVal = 0; double length = 0; for (final SbPartObjOffen tmp : objList) { if (((tmp.getOwner() != null) && tmp.getOwner().equals(gu))) { final double value = tmp.get(field); if (value == 0.0) { continue; } currentVal += value * tmp.getLength(); length += tmp.getLength(); } } if (length == 0) { return 0; } else { return currentVal / length; } }
/** * DOCUMENT ME! * * @param field gemNr DOCUMENT ME! * @param gu gewId DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getMit
{ "repo_name": "cismet/watergis-client", "path": "src/main/java/de/cismet/watergis/reports/GerinneOSbReport.java", "license": "lgpl-3.0", "size": 56987 }
[ "de.cismet.watergis.reports.types.SbPartObjOffen" ]
import de.cismet.watergis.reports.types.SbPartObjOffen;
import de.cismet.watergis.reports.types.*;
[ "de.cismet.watergis" ]
de.cismet.watergis;
2,912,223
public FancyMessage statisticTooltip(final Statistic which, EntityType entity) { Type type = which.getType(); if (type == Type.UNTYPED) { throw new IllegalArgumentException("That statistic needs no additional parameter!"); } if (type != Type.ENTITY) { throw new IllegalArgumentException("Wrong parameter type for that statistic - needs " + type + "!"); } try { Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getEntityStatistic", Statistic.class, EntityType.class).invoke(null, which, entity); return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic)); } catch (IllegalAccessException e) { Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e); return this; } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e); return this; } catch (InvocationTargetException e) { Bukkit.getLogger().log(Level.WARNING, "A error has occured durring invoking of method.", e); return this; } }
FancyMessage function(final Statistic which, EntityType entity) { Type type = which.getType(); if (type == Type.UNTYPED) { throw new IllegalArgumentException(STR); } if (type != Type.ENTITY) { throw new IllegalArgumentException(STR + type + "!"); } try { Object statistic = Reflection.getMethod(Reflection.getOBCClass(STR), STR, Statistic.class, EntityType.class).invoke(null, which, entity); return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass(STR), "name").get(statistic)); } catch (IllegalAccessException e) { Bukkit.getLogger().log(Level.WARNING, STR, e); return this; } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, STR, e); return this; } catch (InvocationTargetException e) { Bukkit.getLogger().log(Level.WARNING, STR, e); return this; } }
/** * Set the behavior of the current editing component to display information about a statistic parameter with an entity type when the client hovers over the text. * <p>Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied.</p> * @param which The statistic to display. * @param entity The sole entity type parameter to the statistic. * @return This builder instance. * @exception IllegalArgumentException If the statistic requires a parameter which was not supplied, or was supplied a parameter that was not required. */
Set the behavior of the current editing component to display information about a statistic parameter with an entity type when the client hovers over the text. Tooltips do not inherit display characteristics, such as color and styles, from the message component on which they are applied
statisticTooltip
{ "repo_name": "zedentox/RedProtect", "path": "src/main/java/br/net/fabiozumbi12/RedProtect/Fanciful/FancyMessage.java", "license": "gpl-3.0", "size": 37707 }
[ "br.net.fabiozumbi12.RedProtect", "java.lang.reflect.InvocationTargetException", "java.util.logging.Level", "org.bukkit.Bukkit", "org.bukkit.Statistic", "org.bukkit.entity.EntityType" ]
import br.net.fabiozumbi12.RedProtect; import java.lang.reflect.InvocationTargetException; import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.Statistic; import org.bukkit.entity.EntityType;
import br.net.fabiozumbi12.*; import java.lang.reflect.*; import java.util.logging.*; import org.bukkit.*; import org.bukkit.entity.*;
[ "br.net.fabiozumbi12", "java.lang", "java.util", "org.bukkit", "org.bukkit.entity" ]
br.net.fabiozumbi12; java.lang; java.util; org.bukkit; org.bukkit.entity;
691,495
@Action(name = "Describe Network Interfaces", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) public Map<String, String> execute(@Param(value = ENDPOINT) String endpoint, @Param(value = IDENTITY, required = true) String identity, @Param(value = CREDENTIAL, required = true, encrypted = true) String credential, @Param(value = PROXY_HOST) String proxyHost, @Param(value = PROXY_PORT) String proxyPort, @Param(value = PROXY_USERNAME) String proxyUsername, @Param(value = PROXY_PASSWORD, encrypted = true) String proxyPassword, @Param(value = HEADERS) String headers, @Param(value = QUERY_PARAMS) String queryParams, @Param(value = VERSION) String version, @Param(value = DELIMITER) String delimiter, @Param(value = FILTER_ADDRESSES_PRIVATE_IP_ADDRESS) String filterAddressesPrivateIpAddress, @Param(value = FILTER_ADDRESSES_PRIMARY) String filterAddressesPrimary, @Param(value = FILTER_ADDRESSES_ASSOCIATION_PUBLIC_IP) String filterAddressesAssociationPublicIp, @Param(value = FILTER_ADDRESSES_ASSOCIATION_OWNER_ID) String filterAddressesAssociationOwnerId, @Param(value = FILTER_ASSOCIATION_ASSOCIATION_ID) String filterAssociationAssociationId, @Param(value = FILTER_ASSOCIATION_ALLOCATION_ID) String filterAssociationAllocationId, @Param(value = FILTER_ASSOCIATION_IP_OWNER_ID) String filterAssociationIpOwnerId, @Param(value = FILTER_ASSOCIATION_PUBLIC_IP) String filterAssociationPublicIp, @Param(value = FILTER_ASSOCIATION_PUBLIC_DNS_NAME) String filterAssociationPublicDnsName, @Param(value = FILTER_ATTACHMENT_ATTACHMENT_ID) String filterAttachmentAttachmentId, @Param(value = FILTER_ATTACHMENT_ATTACH_TIME) String filterAttachmentAttachTime, @Param(value = FILTER_ATTACHMENT_DELETE_ON_TERMINATION) String filterAttachmentDeleteOnTermination, @Param(value = FILTER_ATTACHMENT_DEVICE_INDEX) String filterAttachmentDeviceIndex, @Param(value = FILTER_ATTACHMENT_INSTANCE_ID) String filterAttachmentInstanceId, @Param(value = FILTER_ATTACHMENT_INSTANCE_OWNER_ID) String filterAttachmentInstanceOwnerId, @Param(value = FILTER_ATTACHMENT_NAT_GATEWAY_ID) String filterAttachmentNatGatewayId, @Param(value = FILTER_ATTACHMENT_STATUS) String filterAttachmentStatus, @Param(value = FILTER_AVAILABILITY_ZONE) String filterAvailabilityZone, @Param(value = FILTER_DESCRIPTION) String filterDescription, @Param(value = FILTER_GROUP_ID) String filterGroupId, @Param(value = FILTER_GROUP_NAME) String filterGroupName, @Param(value = FILTER_IPV6_ADDRESSES_IPV6_ADDRESS) String filterIpv6AddressesIpv6Address, @Param(value = FILTER_MAC_ADDRESS) String filterMacAddress, @Param(value = FILTER_NETWORK_INTERFACE_ID) String filterNetworkInterfaceId, @Param(value = FILTER_OWNER_ID) String filterOwnerId, @Param(value = FILTER_PRIVATE_IP_ADDRESS) String filterPrivateIpAddress, @Param(value = FILTER_PRIVATE_DNS_NAME) String filterPrivateDnsName, @Param(value = FILTER_REQUESTER_ID) String filterRequesterId, @Param(value = FILTER_REQUESTER_MANAGED) String filterRequesterManaged, @Param(value = FILTER_SOURCE_DEST_CHECK) String filterSourceDestCheck, @Param(value = FILTER_STATUS) String filterStatus, @Param(value = FILTER_SUBNET_ID) String filterSubnetId, @Param(value = FILTER_TAG) String filterTag, @Param(value = FILTER_TAG_KEY) String filterTagKey, @Param(value = FILTER_TAG_VALUE) String filterTagValue, @Param(value = FILTER_VPC_ID) String filterVpcId, @Param(value = NETWORK_INTERFACE_ID) String networkInterfaceId) { try { version = getDefaultStringInput(version, NETWORK_DEFAULT_API_VERSION); final CommonInputs commonInputs = new CommonInputs.Builder() .withEndpoint(endpoint, EC2_API, EMPTY) .withIdentity(identity) .withCredential(credential) .withProxyHost(proxyHost) .withProxyPort(proxyPort) .withProxyUsername(proxyUsername) .withProxyPassword(proxyPassword) .withHeaders(headers) .withQueryParams(queryParams) .withVersion(version) .withDelimiter(delimiter) .withAction(DESCRIBE_NETWORK_INTERFACES) .withApiService(EC2_API) .withRequestUri(EMPTY) .withRequestPayload(EMPTY) .withHttpClientMethod(HTTP_CLIENT_METHOD_GET) .build(); final NetworkInputs networkInputs = new NetworkInputs.Builder() .withNetworkInterfaceId(networkInterfaceId) .build(); final List<ImmutablePair<String, String>> filterPairs = Arrays.asList( of(NetworkFilter.ADDRESSES_ASSOCIATION_OWNER_ID, filterAttachmentAttachTime), of(NetworkFilter.ADDRESSES_PRIVATE_IP_ADDRESS, filterAddressesPrivateIpAddress), of(NetworkFilter.ADDRESSES_PRIMARY, filterAddressesPrimary), of(NetworkFilter.ADDRESSES_ASSOCIATION_PUBLIC_IP, filterAddressesAssociationPublicIp), of(NetworkFilter.ADDRESSES_ASSOCIATION_OWNER_ID, filterAddressesAssociationOwnerId), of(NetworkFilter.ASSOCIATION_ASSOCIATION_ID, filterAssociationAssociationId), of(NetworkFilter.ASSOCIATION_ALLOCATION_ID, filterAssociationAllocationId), of(NetworkFilter.ASSOCIATION_IP_OWNER_ID, filterAssociationIpOwnerId), of(NetworkFilter.ASSOCIATION_PUBLIC_IP, filterAssociationPublicIp), of(NetworkFilter.ASSOCIATION_PUBLIC_DNS_NAME, filterAssociationPublicDnsName), of(NetworkFilter.ATTACHMENT_ATTACHMENT_ID, filterAttachmentAttachmentId), of(NetworkFilter.ATTACHMENT_ATTACH_TIME, filterAttachmentAttachTime), of(NetworkFilter.ATTACHMENT_DELETE_ON_TERMINATION, filterAttachmentDeleteOnTermination), of(NetworkFilter.ATTACHMENT_DEVICE_INDEX, filterAttachmentDeviceIndex), of(NetworkFilter.ATTACHMENT_INSTANCE_ID, filterAttachmentInstanceId), of(NetworkFilter.ATTACHMENT_INSTANCE_OWNER_ID, filterAttachmentInstanceOwnerId), of(NetworkFilter.ATTACHMENT_NAT_GATEWAY_ID, filterAttachmentNatGatewayId), of(NetworkFilter.ATTACHMENT_STATUS, filterAttachmentStatus), of(NetworkFilter.AVAILABILITY_ZONE, filterAvailabilityZone), of(NetworkFilter.DESCRIPTION, filterDescription), of(NetworkFilter.GROUP_ID, filterGroupId), of(NetworkFilter.GROUP_NAME, filterGroupName), of(NetworkFilter.IPV6_ADDRESSES_IPV6_ADDRESS, filterIpv6AddressesIpv6Address), of(NetworkFilter.MAC_ADDRESS, filterMacAddress), of(NetworkFilter.NETWORK_INTERFACE_ID, filterNetworkInterfaceId), of(NetworkFilter.OWNER_ID, filterOwnerId), of(NetworkFilter.PRIVATE_IP_ADDRESS, filterPrivateIpAddress), of(NetworkFilter.PRIVATE_DNS_NAME, filterPrivateDnsName), of(NetworkFilter.REQUESTER_ID, filterRequesterId), of(NetworkFilter.REQUESTER_MANAGED, filterRequesterManaged), of(NetworkFilter.SOURCE_DEST_CHECK, filterSourceDestCheck), of(NetworkFilter.STATUS, filterStatus), of(NetworkFilter.SUBNET_ID, filterSubnetId), of(NetworkFilter.TAG_KEY, filterTagKey), of(NetworkFilter.TAG_VALUE, filterTagValue), of(NetworkFilter.VPC_ID, filterVpcId) ); final FilterInputs.Builder filterInputsBuilder = new FilterInputs.Builder() .withDelimiter(commonInputs.getDelimiter()); for (ImmutablePair<String, String> filterPair : filterPairs) { if (isNotEmpty(filterPair.getRight())) { filterInputsBuilder.withNewFilter(filterPair.getLeft(), filterPair.getRight()); } } if (isNotEmpty(filterTag)) { processTagFilter(filterTag, commonInputs.getDelimiter(), filterInputsBuilder); } final FilterInputs filterInputs = filterInputsBuilder.build(); return new QueryApiExecutor().execute(commonInputs, networkInputs, filterInputs); } catch (Exception exception) { return ExceptionProcessor.getExceptionResult(exception); } }
@Action(name = STR, outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED), @Response(text = FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR, isOnFail = true) }) Map<String, String> function(@Param(value = ENDPOINT) String endpoint, @Param(value = IDENTITY, required = true) String identity, @Param(value = CREDENTIAL, required = true, encrypted = true) String credential, @Param(value = PROXY_HOST) String proxyHost, @Param(value = PROXY_PORT) String proxyPort, @Param(value = PROXY_USERNAME) String proxyUsername, @Param(value = PROXY_PASSWORD, encrypted = true) String proxyPassword, @Param(value = HEADERS) String headers, @Param(value = QUERY_PARAMS) String queryParams, @Param(value = VERSION) String version, @Param(value = DELIMITER) String delimiter, @Param(value = FILTER_ADDRESSES_PRIVATE_IP_ADDRESS) String filterAddressesPrivateIpAddress, @Param(value = FILTER_ADDRESSES_PRIMARY) String filterAddressesPrimary, @Param(value = FILTER_ADDRESSES_ASSOCIATION_PUBLIC_IP) String filterAddressesAssociationPublicIp, @Param(value = FILTER_ADDRESSES_ASSOCIATION_OWNER_ID) String filterAddressesAssociationOwnerId, @Param(value = FILTER_ASSOCIATION_ASSOCIATION_ID) String filterAssociationAssociationId, @Param(value = FILTER_ASSOCIATION_ALLOCATION_ID) String filterAssociationAllocationId, @Param(value = FILTER_ASSOCIATION_IP_OWNER_ID) String filterAssociationIpOwnerId, @Param(value = FILTER_ASSOCIATION_PUBLIC_IP) String filterAssociationPublicIp, @Param(value = FILTER_ASSOCIATION_PUBLIC_DNS_NAME) String filterAssociationPublicDnsName, @Param(value = FILTER_ATTACHMENT_ATTACHMENT_ID) String filterAttachmentAttachmentId, @Param(value = FILTER_ATTACHMENT_ATTACH_TIME) String filterAttachmentAttachTime, @Param(value = FILTER_ATTACHMENT_DELETE_ON_TERMINATION) String filterAttachmentDeleteOnTermination, @Param(value = FILTER_ATTACHMENT_DEVICE_INDEX) String filterAttachmentDeviceIndex, @Param(value = FILTER_ATTACHMENT_INSTANCE_ID) String filterAttachmentInstanceId, @Param(value = FILTER_ATTACHMENT_INSTANCE_OWNER_ID) String filterAttachmentInstanceOwnerId, @Param(value = FILTER_ATTACHMENT_NAT_GATEWAY_ID) String filterAttachmentNatGatewayId, @Param(value = FILTER_ATTACHMENT_STATUS) String filterAttachmentStatus, @Param(value = FILTER_AVAILABILITY_ZONE) String filterAvailabilityZone, @Param(value = FILTER_DESCRIPTION) String filterDescription, @Param(value = FILTER_GROUP_ID) String filterGroupId, @Param(value = FILTER_GROUP_NAME) String filterGroupName, @Param(value = FILTER_IPV6_ADDRESSES_IPV6_ADDRESS) String filterIpv6AddressesIpv6Address, @Param(value = FILTER_MAC_ADDRESS) String filterMacAddress, @Param(value = FILTER_NETWORK_INTERFACE_ID) String filterNetworkInterfaceId, @Param(value = FILTER_OWNER_ID) String filterOwnerId, @Param(value = FILTER_PRIVATE_IP_ADDRESS) String filterPrivateIpAddress, @Param(value = FILTER_PRIVATE_DNS_NAME) String filterPrivateDnsName, @Param(value = FILTER_REQUESTER_ID) String filterRequesterId, @Param(value = FILTER_REQUESTER_MANAGED) String filterRequesterManaged, @Param(value = FILTER_SOURCE_DEST_CHECK) String filterSourceDestCheck, @Param(value = FILTER_STATUS) String filterStatus, @Param(value = FILTER_SUBNET_ID) String filterSubnetId, @Param(value = FILTER_TAG) String filterTag, @Param(value = FILTER_TAG_KEY) String filterTagKey, @Param(value = FILTER_TAG_VALUE) String filterTagValue, @Param(value = FILTER_VPC_ID) String filterVpcId, @Param(value = NETWORK_INTERFACE_ID) String networkInterfaceId) { try { version = getDefaultStringInput(version, NETWORK_DEFAULT_API_VERSION); final CommonInputs commonInputs = new CommonInputs.Builder() .withEndpoint(endpoint, EC2_API, EMPTY) .withIdentity(identity) .withCredential(credential) .withProxyHost(proxyHost) .withProxyPort(proxyPort) .withProxyUsername(proxyUsername) .withProxyPassword(proxyPassword) .withHeaders(headers) .withQueryParams(queryParams) .withVersion(version) .withDelimiter(delimiter) .withAction(DESCRIBE_NETWORK_INTERFACES) .withApiService(EC2_API) .withRequestUri(EMPTY) .withRequestPayload(EMPTY) .withHttpClientMethod(HTTP_CLIENT_METHOD_GET) .build(); final NetworkInputs networkInputs = new NetworkInputs.Builder() .withNetworkInterfaceId(networkInterfaceId) .build(); final List<ImmutablePair<String, String>> filterPairs = Arrays.asList( of(NetworkFilter.ADDRESSES_ASSOCIATION_OWNER_ID, filterAttachmentAttachTime), of(NetworkFilter.ADDRESSES_PRIVATE_IP_ADDRESS, filterAddressesPrivateIpAddress), of(NetworkFilter.ADDRESSES_PRIMARY, filterAddressesPrimary), of(NetworkFilter.ADDRESSES_ASSOCIATION_PUBLIC_IP, filterAddressesAssociationPublicIp), of(NetworkFilter.ADDRESSES_ASSOCIATION_OWNER_ID, filterAddressesAssociationOwnerId), of(NetworkFilter.ASSOCIATION_ASSOCIATION_ID, filterAssociationAssociationId), of(NetworkFilter.ASSOCIATION_ALLOCATION_ID, filterAssociationAllocationId), of(NetworkFilter.ASSOCIATION_IP_OWNER_ID, filterAssociationIpOwnerId), of(NetworkFilter.ASSOCIATION_PUBLIC_IP, filterAssociationPublicIp), of(NetworkFilter.ASSOCIATION_PUBLIC_DNS_NAME, filterAssociationPublicDnsName), of(NetworkFilter.ATTACHMENT_ATTACHMENT_ID, filterAttachmentAttachmentId), of(NetworkFilter.ATTACHMENT_ATTACH_TIME, filterAttachmentAttachTime), of(NetworkFilter.ATTACHMENT_DELETE_ON_TERMINATION, filterAttachmentDeleteOnTermination), of(NetworkFilter.ATTACHMENT_DEVICE_INDEX, filterAttachmentDeviceIndex), of(NetworkFilter.ATTACHMENT_INSTANCE_ID, filterAttachmentInstanceId), of(NetworkFilter.ATTACHMENT_INSTANCE_OWNER_ID, filterAttachmentInstanceOwnerId), of(NetworkFilter.ATTACHMENT_NAT_GATEWAY_ID, filterAttachmentNatGatewayId), of(NetworkFilter.ATTACHMENT_STATUS, filterAttachmentStatus), of(NetworkFilter.AVAILABILITY_ZONE, filterAvailabilityZone), of(NetworkFilter.DESCRIPTION, filterDescription), of(NetworkFilter.GROUP_ID, filterGroupId), of(NetworkFilter.GROUP_NAME, filterGroupName), of(NetworkFilter.IPV6_ADDRESSES_IPV6_ADDRESS, filterIpv6AddressesIpv6Address), of(NetworkFilter.MAC_ADDRESS, filterMacAddress), of(NetworkFilter.NETWORK_INTERFACE_ID, filterNetworkInterfaceId), of(NetworkFilter.OWNER_ID, filterOwnerId), of(NetworkFilter.PRIVATE_IP_ADDRESS, filterPrivateIpAddress), of(NetworkFilter.PRIVATE_DNS_NAME, filterPrivateDnsName), of(NetworkFilter.REQUESTER_ID, filterRequesterId), of(NetworkFilter.REQUESTER_MANAGED, filterRequesterManaged), of(NetworkFilter.SOURCE_DEST_CHECK, filterSourceDestCheck), of(NetworkFilter.STATUS, filterStatus), of(NetworkFilter.SUBNET_ID, filterSubnetId), of(NetworkFilter.TAG_KEY, filterTagKey), of(NetworkFilter.TAG_VALUE, filterTagValue), of(NetworkFilter.VPC_ID, filterVpcId) ); final FilterInputs.Builder filterInputsBuilder = new FilterInputs.Builder() .withDelimiter(commonInputs.getDelimiter()); for (ImmutablePair<String, String> filterPair : filterPairs) { if (isNotEmpty(filterPair.getRight())) { filterInputsBuilder.withNewFilter(filterPair.getLeft(), filterPair.getRight()); } } if (isNotEmpty(filterTag)) { processTagFilter(filterTag, commonInputs.getDelimiter(), filterInputsBuilder); } final FilterInputs filterInputs = filterInputsBuilder.build(); return new QueryApiExecutor().execute(commonInputs, networkInputs, filterInputs); } catch (Exception exception) { return ExceptionProcessor.getExceptionResult(exception); } }
/** * Describes one or more of your network interfaces. * * @param endpoint Optional - Endpoint to which request will be sent. * Default: "https://ec2.amazonaws.com" * @param identity ID of the secret access key associated with your Amazon AWS or * IAM account. * Example: "AKIAIOSFODNN7EXAMPLE" * @param credential Secret access key associated with your Amazon AWS or IAM account. * Example: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" * @param proxyHost Optional - proxy server used to connect to Amazon API. If empty no * proxy will be used. * @param proxyPort Optional - proxy server port. You must either specify values for both * proxyHost and proxyPort inputs or leave them both empty. * @param proxyUsername Optional - proxy server user name. * Default: "" * @param proxyPassword Optional - proxy server password associated with the proxyUsername * input value. * @param version Optional - Version of the web service to made the call against it. * Example: "2016-11-15" * Default: "2016-11-15" * @param headers Optional - string containing the headers to use for the request * separated by new line (CRLF). The header name-value pair will be * separated by ":" * Format: Conforming with HTTP standard for headers (RFC 2616) * Examples: "Accept:text/plain" * Default: "" * @param queryParams Optional - string containing query parameters that will be appended * to the URL. The names and the values must not be URL encoded because * if they are encoded then a double encoded will occur. The separator * between name-value pairs is "&" symbol. The query name will be * separated from query value by "=" * Examples: "parameterName1=parameterValue1&parameterName2=parameterValue2" * Default: "" * @param delimiter Optional - Delimiter that will be used. * @param filterAddressesPrivateIpAddress Optional - The private IPv4 addresses associated with the network * interface. * @param filterAddressesPrimary Optional - Whether the private IPv4 address is the primary IP address * associated with the network interface. * @param filterAddressesAssociationPublicIp Optional - The association ID returned when the network interface was * associated with the Elastic IP address (IPv4). * @param filterAddressesAssociationOwnerId Optional - The owner ID of the addresses associated with the network * interface. * @param filterAssociationAssociationId Optional - The association ID returned when the network interface * was associated with an IPv4 address. * @param filterAssociationAllocationId Optional - The allocation ID returned when you allocated the Elastic * IP address (IPv4) for your network interface. * @param filterAssociationIpOwnerId Optional - The owner of the Elastic IP address (IPv4) associated * with the network interface. * @param filterAssociationPublicIp Optional - The address of the Elastic IP address (IPv4) bound to the * network interface. * @param filterAssociationPublicDnsName Optional - The public DNS name for the network interface (IPv4). * @param filterAttachmentAttachmentId Optional - The ID of the interface attachment. * @param filterAttachmentAttachTime Optional - The time that the network interface was attached to an * instance. * @param filterAttachmentDeleteOnTermination Optional - Indicates whether the attachment is deleted when an * instance is terminated. * @param filterAttachmentDeviceIndex Optional - The device index to which the network interface is attached. * @param filterAttachmentInstanceId Optional - The ID of the instance to which the network interface is * attached. * @param filterAttachmentInstanceOwnerId Optional - The owner ID of the instance to which the network * interface is attached. * @param filterAttachmentNatGatewayId Optional - The ID of the NAT gateway to which the network interface * is attached. * @param filterAttachmentStatus Optional - The status of the attachment. * Valid values: attaching, attached, detaching, detached. * @param filterAvailabilityZone Optional - The Availability Zone of the network interface. * @param filterDescription Optional - The description of the network interface. * @param filterGroupId Optional - The ID of a security group associated with the network * interface. * @param filterGroupName Optional - The name of a security group associated with the network * interface. * @param filterIpv6AddressesIpv6Address Optional - An IPv6 address associated with the network interface. * @param filterMacAddress Optional - The MAC address of the network interface. * @param filterNetworkInterfaceId Optional - The ID of the network interface. * @param filterOwnerId Optional - The AWS account ID of the network interface owner. * @param filterPrivateIpAddress Optional - The private IPv4 address or addresses of the network * interface. * @param filterPrivateDnsName Optional - The private DNS name of the network interface (IPv4). * @param filterRequesterId Optional - The ID of the entity that launched the instance on your * behalf (for example, AWS Management Console, Auto Scaling, and so on). * @param filterRequesterManaged Optional - Indicates whether the network interface is being managed * by an AWS service (for example, AWS Management Console, Auto Scaling, * and so on). * @param filterSourceDestCheck Optional - Indicates whether the network interface performs * source/destination checking. A value of true means checking is * enabled, and false means checking is disabled. The value must be * false for the network interface to perform network address * translation (NAT) in your VPC. * @param filterStatus Optional - The status of the network interface. If the network * interface is not attached to an instance, the status is available; * if a network interface is attached to an instance the status is in-use. * Valid values: in-use, available. * @param filterSubnetId Optional - The ID of the subnet for the network interface. * @param filterTag Optional - The key/value combination of a tag assigned to the resource. * Specify the key of the tag in the filter name and the value of the * tag in the filter value. * Example: Purpose1=X,Purpose2=B * @param filterTagKey Optional - The key of a tag assigned to the resource. This filter is * independent of the filterTagValue filter. For example, if you use both * filterTagKey = "Purpose" and filterTagValue = "X", you get any * resources assigned both the tag key Purpose (regardless of what * the tag's value is), and the tag value X (regardless of what the * tag's key is). If you want to list only resources where Purpose is X, * see the filterTag. * @param filterTagValue Optional - The value of a tag assigned to the resource. This filter * is independent of the filterTagKey. * @param filterVpcId Optional - The ID of the VPC for the network interface. * @param networkInterfaceId Optional - String that contains one or more network interface IDs. * Example: "eni-12345678,eni-87654321" * Default: "" * @return A map with strings as keys and strings as values that contains: outcome of the action (or failure message * and the exception if there is one), returnCode of the operation and the ID of the request */
Describes one or more of your network interfaces
execute
{ "repo_name": "CloudSlang/cs-actions", "path": "cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/network/DescribeNetworkInterfacesAction.java", "license": "apache-2.0", "size": 30164 }
[ "com.hp.oo.sdk.content.annotations.Action", "com.hp.oo.sdk.content.annotations.Output", "com.hp.oo.sdk.content.annotations.Param", "com.hp.oo.sdk.content.annotations.Response", "com.hp.oo.sdk.content.plugin.ActionMetadata", "io.cloudslang.content.amazon.entities.aws.NetworkFilter", "io.cloudslang.content.amazon.entities.inputs.CommonInputs", "io.cloudslang.content.amazon.entities.inputs.FilterInputs", "io.cloudslang.content.amazon.entities.inputs.NetworkInputs", "io.cloudslang.content.amazon.execute.QueryApiExecutor", "io.cloudslang.content.amazon.factory.helpers.FilterUtils", "io.cloudslang.content.amazon.utils.ExceptionProcessor", "io.cloudslang.content.amazon.utils.InputsUtil", "io.cloudslang.content.constants.ReturnCodes", "java.util.Arrays", "java.util.List", "java.util.Map", "org.apache.commons.lang3.tuple.ImmutablePair" ]
import com.hp.oo.sdk.content.annotations.Action; import com.hp.oo.sdk.content.annotations.Output; import com.hp.oo.sdk.content.annotations.Param; import com.hp.oo.sdk.content.annotations.Response; import com.hp.oo.sdk.content.plugin.ActionMetadata; import io.cloudslang.content.amazon.entities.aws.NetworkFilter; import io.cloudslang.content.amazon.entities.inputs.CommonInputs; import io.cloudslang.content.amazon.entities.inputs.FilterInputs; import io.cloudslang.content.amazon.entities.inputs.NetworkInputs; import io.cloudslang.content.amazon.execute.QueryApiExecutor; import io.cloudslang.content.amazon.factory.helpers.FilterUtils; import io.cloudslang.content.amazon.utils.ExceptionProcessor; import io.cloudslang.content.amazon.utils.InputsUtil; import io.cloudslang.content.constants.ReturnCodes; import java.util.Arrays; import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair;
import com.hp.oo.sdk.content.annotations.*; import com.hp.oo.sdk.content.plugin.*; import io.cloudslang.content.amazon.entities.aws.*; import io.cloudslang.content.amazon.entities.inputs.*; import io.cloudslang.content.amazon.execute.*; import io.cloudslang.content.amazon.factory.helpers.*; import io.cloudslang.content.amazon.utils.*; import io.cloudslang.content.constants.*; import java.util.*; import org.apache.commons.lang3.tuple.*;
[ "com.hp.oo", "io.cloudslang.content", "java.util", "org.apache.commons" ]
com.hp.oo; io.cloudslang.content; java.util; org.apache.commons;
2,232,148
void enterRuleInnerVarID(@NotNull XtendParser.RuleInnerVarIDContext ctx); void exitRuleInnerVarID(@NotNull XtendParser.RuleInnerVarIDContext ctx);
void enterRuleInnerVarID(@NotNull XtendParser.RuleInnerVarIDContext ctx); void exitRuleInnerVarID(@NotNull XtendParser.RuleInnerVarIDContext ctx);
/** * Exit a parse tree produced by {@link XtendParser#ruleInnerVarID}. * @param ctx the parse tree */
Exit a parse tree produced by <code>XtendParser#ruleInnerVarID</code>
exitRuleInnerVarID
{ "repo_name": "szarnekow/XtendParserGeneratorComparison", "path": "antrl3_vs_antlr4/src/xtend/antlr4_2/XtendListener.java", "license": "epl-1.0", "size": 44107 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,197,782
Writer getCompressedWriter(HttpServletRequest req) throws IOException;
Writer getCompressedWriter(HttpServletRequest req) throws IOException;
/** * Works like {@link #getCompressedOutputStream(HttpServletRequest)} but this * method is for {@link #getWriter()}. */
Works like <code>#getCompressedOutputStream(HttpServletRequest)</code> but this method is for <code>#getWriter()</code>
getCompressedWriter
{ "repo_name": "eclipse/hudson.stapler", "path": "stapler-core/src/main/java/org/kohsuke/stapler/StaplerResponse.java", "license": "apache-2.0", "size": 7729 }
[ "java.io.IOException", "java.io.Writer", "javax.servlet.http.HttpServletRequest" ]
import java.io.IOException; import java.io.Writer; import javax.servlet.http.HttpServletRequest;
import java.io.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
527,900
public void ifgt(String target) throws IOException { if (wideIndex) { out.writeByte(NOT_IFGT); out.writeShort(WIDEFIXOFFSET); Branch branch = createBranch(target); out.writeByte(GOTO_W); out.writeInt(branch); } else { Branch branch = createBranch(target); out.writeOpCode(IFGT); out.writeShort(branch); } }
void function(String target) throws IOException { if (wideIndex) { out.writeByte(NOT_IFGT); out.writeShort(WIDEFIXOFFSET); Branch branch = createBranch(target); out.writeByte(GOTO_W); out.writeInt(branch); } else { Branch branch = createBranch(target); out.writeOpCode(IFGT); out.writeShort(branch); } }
/** * gt succeeds if and only if value &gt; 0 * @param target * @throws IOException */
gt succeeds if and only if value &gt; 0
ifgt
{ "repo_name": "tvesalainen/bcc", "path": "src/main/java/org/vesalainen/bcc/Assembler.java", "license": "gpl-3.0", "size": 53751 }
[ "java.io.IOException", "org.vesalainen.bcc.Label" ]
import java.io.IOException; import org.vesalainen.bcc.Label;
import java.io.*; import org.vesalainen.bcc.*;
[ "java.io", "org.vesalainen.bcc" ]
java.io; org.vesalainen.bcc;
713,226
public String toJSONString() { if (!dirty && (jsonString != null)) { return jsonString; } final StringWriter string = new StringWriter(); final JsonWriter json = new JsonWriter(string); try { writeJson(json); json.close(); } catch (final IOException e) { throw new RuntimeException("invalid message"); } jsonString = string.toString(); dirty = false; return jsonString; }
String function() { if (!dirty && (jsonString != null)) { return jsonString; } final StringWriter string = new StringWriter(); final JsonWriter json = new JsonWriter(string); try { writeJson(json); json.close(); } catch (final IOException e) { throw new RuntimeException(STR); } jsonString = string.toString(); dirty = false; return jsonString; }
/** * Serialize this fancy message, converting it into syntactically-valid JSON using a {@link JsonWriter}. * This JSON should be compatible with vanilla formatter commands such as {@code /tellraw}. * @return The JSON string representing this object. */
Serialize this fancy message, converting it into syntactically-valid JSON using a <code>JsonWriter</code>. This JSON should be compatible with vanilla formatter commands such as /tellraw
toJSONString
{ "repo_name": "SilverCory/PlotSquared", "path": "Bukkit/src/main/java/com/plotsquared/bukkit/chat/FancyMessage.java", "license": "gpl-3.0", "size": 41847 }
[ "com.google.gson.stream.JsonWriter", "java.io.IOException", "java.io.StringWriter" ]
import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.io.StringWriter;
import com.google.gson.stream.*; import java.io.*;
[ "com.google.gson", "java.io" ]
com.google.gson; java.io;
958,123
List<Extension> getAllEnabledExtensions(String extensionPointId);
List<Extension> getAllEnabledExtensions(String extensionPointId);
/** * Gets all enabled extensions for the specified extensionPointId * * @param extensionPointId the extensionPointId to match against * @return a list of Extensions * @should get all extensions for the specified extensionPointId */
Gets all enabled extensions for the specified extensionPointId
getAllEnabledExtensions
{ "repo_name": "openmrs-gci/openmrs-module-appframework", "path": "api/src/main/java/org/openmrs/module/appframework/service/AppFrameworkService.java", "license": "mpl-2.0", "size": 5408 }
[ "java.util.List", "org.openmrs.module.appframework.domain.Extension" ]
import java.util.List; import org.openmrs.module.appframework.domain.Extension;
import java.util.*; import org.openmrs.module.appframework.domain.*;
[ "java.util", "org.openmrs.module" ]
java.util; org.openmrs.module;
2,323,299
public Inode checkin(Inode node, List<Permission> permissions, User user, boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotStateException, DotValidationException;
Inode function(Inode node, List<Permission> permissions, User user, boolean respectFrontendRoles) throws IllegalArgumentException, DotDataException, DotSecurityException, DotStateException, DotValidationException;
/** * Will check in a new version of you node. The inode of your * object to checkin must not be set. * * @param node * - The inode of your node must be 0. * @param contentRelationships * - throws IllegalArgumentException if null. Used to set * relationships to new node version * @param cats * - throws IllegalArgumentException if null. Used to set * categories to new node version * @param permissions * - throws IllegalArgumentException if null. Used to set * permissions to new node version * @param user * @param respectFrontendRoles * @throws IllegalArgumentException * @throws DotDataException * @throws DotSecurityException * @throws DotStateException * If inode not = to 0 * @throws DotValidationException * If content is not valid */
Will check in a new version of you node. The inode of your object to checkin must not be set
checkin
{ "repo_name": "zhiqinghuang/core", "path": "src/com/dotmarketing/business/skeleton/DotCMSAPIPostHook.java", "license": "gpl-3.0", "size": 24644 }
[ "com.dotmarketing.beans.Inode", "com.dotmarketing.beans.Permission", "com.dotmarketing.business.DotStateException", "com.dotmarketing.business.DotValidationException", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.liferay.portal.model.User", "java.util.List" ]
import com.dotmarketing.beans.Inode; import com.dotmarketing.beans.Permission; import com.dotmarketing.business.DotStateException; import com.dotmarketing.business.DotValidationException; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.liferay.portal.model.User; import java.util.List;
import com.dotmarketing.beans.*; import com.dotmarketing.business.*; import com.dotmarketing.exception.*; import com.liferay.portal.model.*; import java.util.*;
[ "com.dotmarketing.beans", "com.dotmarketing.business", "com.dotmarketing.exception", "com.liferay.portal", "java.util" ]
com.dotmarketing.beans; com.dotmarketing.business; com.dotmarketing.exception; com.liferay.portal; java.util;
1,967,167
public long storeHLPolicy(PolicyHighLevel policy, Collection<String> errors) { logger.info("Storing HL policy in the database: " + policy.getName()); logger.debug(policy.toString()); Session session = null; Transaction tx = null; long result = -1; try{ session = InitSessionFactory.getInstance().openSession(); tx = session.beginTransaction(); session.save(policy); tx.commit(); session.close(); logger.info("Storing process ends with success. Id of the new policy: " + policy.getId()); result = policy.getId(); }catch(Exception e){ saveException("storeHLPolicy failed : " + policy.toString(), e, errors); closeSession(tx, session); result = -1; } return result; }
long function(PolicyHighLevel policy, Collection<String> errors) { logger.info(STR + policy.getName()); logger.debug(policy.toString()); Session session = null; Transaction tx = null; long result = -1; try{ session = InitSessionFactory.getInstance().openSession(); tx = session.beginTransaction(); session.save(policy); tx.commit(); session.close(); logger.info(STR + policy.getId()); result = policy.getId(); }catch(Exception e){ saveException(STR + policy.toString(), e, errors); closeSession(tx, session); result = -1; } return result; }
/** * stores new high-level policy in pold database * @param policy hilgh-level policy * @param errors possible errors * @return id of this policy if stored successfully, -1 when process fails */
stores new high-level policy in pold database
storeHLPolicy
{ "repo_name": "mwach/tactics", "path": "src/main/java/itti/com/pl/eda/tactics/hibernate/controller/HibernateWrapper.java", "license": "gpl-2.0", "size": 69814 }
[ "java.util.Collection", "org.hibernate.Session", "org.hibernate.Transaction" ]
import java.util.Collection; import org.hibernate.Session; import org.hibernate.Transaction;
import java.util.*; import org.hibernate.*;
[ "java.util", "org.hibernate" ]
java.util; org.hibernate;
2,098,978
public static Locale setLoggingLocale( Locale locale ) { return LOGGING_LOCALE.getAndSet(locale != null ? locale : Locale.getDefault()); }
static Locale function( Locale locale ) { return LOGGING_LOCALE.getAndSet(locale != null ? locale : Locale.getDefault()); }
/** * Set the locale used for the logs. This should be used when the logs are to be written is a specific locale, independent of * the {@link Locale#getDefault() default locale}. To use the default locale, call this method with a null value. * * @param locale the desired locale to use for the logs, or null if the system locale should be used * @return the previous locale * @see #getLoggingLocale() */
Set the locale used for the logs. This should be used when the logs are to be written is a specific locale, independent of the <code>Locale#getDefault() default locale</code>. To use the default locale, call this method with a null value
setLoggingLocale
{ "repo_name": "SQLBulkQueryTool/SQLBulkQueryTool", "path": "core/src/main/java/org/jboss/bqt/core/Logger.java", "license": "lgpl-2.1", "size": 14441 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
226,442
DCResource getData(DCResource resource) throws IllegalArgumentException;
DCResource getData(DCResource resource) throws IllegalArgumentException;
/** * Shortcut to getData (modelType, iri, version) using provided resource's * @param resource * @return * @throws ClientException if bad URI, & other JAXRS exceptions accordingly */
Shortcut to getData (modelType, iri, version) using provided resource's
getData
{ "repo_name": "ozwillo/ozwillo-datacore", "path": "ozwillo-datacore-rest-cxf/src/main/java/org/oasis/datacore/rest/client/DatacoreCachedClient.java", "license": "agpl-3.0", "size": 2165 }
[ "org.oasis.datacore.rest.api.DCResource" ]
import org.oasis.datacore.rest.api.DCResource;
import org.oasis.datacore.rest.api.*;
[ "org.oasis.datacore" ]
org.oasis.datacore;
800,434
protected ErrorCode removeScriptInternal(UUID scriptId) { Connection conn = null; PreparedStatement pstm = null; try { conn = DbPoolConnection.getInstance().getConnection(); pstm = conn.prepareStatement("DELETE FROM script_new WHERE id = ?"); pstm.setLong(1, Long.parseLong(scriptId.getValue())); if(pstm.executeUpdate()>0) return ErrorCode.success; } catch(Exception e) { logger.error("", e); } finally { DbPoolConnection.getInstance().closeStatment(pstm); DbPoolConnection.getInstance().closeConn(conn); } return ErrorCode.dbFail; }
ErrorCode function(UUID scriptId) { Connection conn = null; PreparedStatement pstm = null; try { conn = DbPoolConnection.getInstance().getConnection(); pstm = conn.prepareStatement(STR); pstm.setLong(1, Long.parseLong(scriptId.getValue())); if(pstm.executeUpdate()>0) return ErrorCode.success; } catch(Exception e) { logger.error("", e); } finally { DbPoolConnection.getInstance().closeStatment(pstm); DbPoolConnection.getInstance().closeConn(conn); } return ErrorCode.dbFail; }
/** * (non-Javadoc) * <p> Title:removeScriptInternal</p> * @param scriptId * @return * @see com.sogou.qadev.service.cynthia.service.impl.AbstractScriptAccessSession#removeScriptInternal(com.sogou.qadev.service.cynthia.bean.UUID) */
(non-Javadoc) Title:removeScriptInternal
removeScriptInternal
{ "repo_name": "wb1991/Cynthia_Maven", "path": "src/main/java/com/sogou/qadev/service/cynthia/dao/ScriptAccessSessionMySQL.java", "license": "gpl-2.0", "size": 32016 }
[ "com.sogou.qadev.service.cynthia.service.DataAccessSession", "com.sogou.qadev.service.cynthia.service.DbPoolConnection", "java.sql.Connection", "java.sql.PreparedStatement" ]
import com.sogou.qadev.service.cynthia.service.DataAccessSession; import com.sogou.qadev.service.cynthia.service.DbPoolConnection; import java.sql.Connection; import java.sql.PreparedStatement;
import com.sogou.qadev.service.cynthia.service.*; import java.sql.*;
[ "com.sogou.qadev", "java.sql" ]
com.sogou.qadev; java.sql;
2,284,117
public void dumpStats() { CommunicationSpi spi = getSpi(); if (spi instanceof TcpCommunicationSpi) ((TcpCommunicationSpi)spi).dumpStats(); }
void function() { CommunicationSpi spi = getSpi(); if (spi instanceof TcpCommunicationSpi) ((TcpCommunicationSpi)spi).dumpStats(); }
/** * Dumps SPI stats to diagnostic logs in case TcpCommunicationSpi is used, no-op otherwise. */
Dumps SPI stats to diagnostic logs in case TcpCommunicationSpi is used, no-op otherwise
dumpStats
{ "repo_name": "ptupitsyn/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java", "license": "apache-2.0", "size": 102404 }
[ "org.apache.ignite.spi.communication.CommunicationSpi", "org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi" ]
import org.apache.ignite.spi.communication.CommunicationSpi; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.communication.*; import org.apache.ignite.spi.communication.tcp.*;
[ "org.apache.ignite" ]
org.apache.ignite;
294,139
public final void testWrongHibernatePeselsAreWrong() { for (final HibernatePeselTestBean testBean : HibernatePeselTestCases.getWrongTestBeans()) { super.validationTest(testBean, false, "org.hibernate.validator.internal.constraintvalidators.hv.pl.PESELValidator"); } }
final void function() { for (final HibernatePeselTestBean testBean : HibernatePeselTestCases.getWrongTestBeans()) { super.validationTest(testBean, false, STR); } }
/** * wrong pesels are not allowed. */
wrong pesels are not allowed
testWrongHibernatePeselsAreWrong
{ "repo_name": "ManfredTremmel/gwt-bean-validators", "path": "gwt-bean-validators/src/test/java/de/knightsoftnet/validators/client/GwtTstHibernatePesel.java", "license": "apache-2.0", "size": 1942 }
[ "de.knightsoftnet.validators.shared.beans.HibernatePeselTestBean", "de.knightsoftnet.validators.shared.testcases.HibernatePeselTestCases" ]
import de.knightsoftnet.validators.shared.beans.HibernatePeselTestBean; import de.knightsoftnet.validators.shared.testcases.HibernatePeselTestCases;
import de.knightsoftnet.validators.shared.beans.*; import de.knightsoftnet.validators.shared.testcases.*;
[ "de.knightsoftnet.validators" ]
de.knightsoftnet.validators;
2,573,145
public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals("default")) sites.remove(s); } sites.add(new UpdateSite("default",site)); return HttpResponses.redirectToContextRoot(); }
HttpResponse function(@QueryParameter String site) throws IOException { Hudson hudson = Hudson.getInstance(); hudson.checkPermission(Hudson.ADMINISTER); UpdateCenter uc = hudson.getUpdateCenter(); PersistedList<UpdateSite> sites = uc.getSites(); for (UpdateSite s : sites) { if (s.getId().equals(STR)) sites.remove(s); } sites.add(new UpdateSite(STR,site)); return HttpResponses.redirectToContextRoot(); }
/** * Bare-minimum configuration mechanism to change the update center. */
Bare-minimum configuration mechanism to change the update center
doSiteConfigure
{ "repo_name": "pantheon-systems/jenkins", "path": "core/src/main/java/hudson/PluginManager.java", "license": "mit", "size": 28005 }
[ "hudson.model.Hudson", "hudson.model.UpdateCenter", "hudson.model.UpdateSite", "hudson.util.PersistedList", "java.io.IOException", "org.kohsuke.stapler.HttpResponse", "org.kohsuke.stapler.HttpResponses", "org.kohsuke.stapler.QueryParameter" ]
import hudson.model.Hudson; import hudson.model.UpdateCenter; import hudson.model.UpdateSite; import hudson.util.PersistedList; import java.io.IOException; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; import org.kohsuke.stapler.QueryParameter;
import hudson.model.*; import hudson.util.*; import java.io.*; import org.kohsuke.stapler.*;
[ "hudson.model", "hudson.util", "java.io", "org.kohsuke.stapler" ]
hudson.model; hudson.util; java.io; org.kohsuke.stapler;
2,188,404
@Override public void onPostExecute(String result) { if (dialog.isShowing()) { dialog.dismiss(); } Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show(); finish(); } public void onProgressUpdate(String...progress) {}
void function(String result) { if (dialog.isShowing()) { dialog.dismiss(); } Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show(); finish(); } public void onProgressUpdate(String...progress) {}
/** * on getting result */
on getting result
onPostExecute
{ "repo_name": "ahmetcan/AndroidInsecurebankv2", "path": "InsecureBankv2/app/src/main/java/com/android/insecurebankv2/ExchangeActivity.java", "license": "mit", "size": 16459 }
[ "android.widget.Toast" ]
import android.widget.Toast;
import android.widget.*;
[ "android.widget" ]
android.widget;
1,086,605
Future<HybridConnectionGetResponse> getHybridConnectionAsync(String webSpaceName, String webSiteName, String hybridConnectionName);
Future<HybridConnectionGetResponse> getHybridConnectionAsync(String webSpaceName, String webSiteName, String hybridConnectionName);
/** * Retrieves a particular hybrid connection that belongs to a specific site. * * @param webSpaceName Required. The name of the web space. * @param webSiteName Required. The name of the web site. * @param hybridConnectionName Required. The name of the hybrid connection * entity * @return The Get Hybrid Connection operation response. */
Retrieves a particular hybrid connection that belongs to a specific site
getHybridConnectionAsync
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-websites/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperations.java", "license": "apache-2.0", "size": 61544 }
[ "com.microsoft.windowsazure.management.websites.models.HybridConnectionGetResponse", "java.util.concurrent.Future" ]
import com.microsoft.windowsazure.management.websites.models.HybridConnectionGetResponse; import java.util.concurrent.Future;
import com.microsoft.windowsazure.management.websites.models.*; import java.util.concurrent.*;
[ "com.microsoft.windowsazure", "java.util" ]
com.microsoft.windowsazure; java.util;
1,223,759
private static void constructProcessSMAPInfo(ProcessTreeSmapMemInfo pInfo, String procfsDir) { BufferedReader in = null; InputStreamReader fReader = null; try { File pidDir = new File(procfsDir, pInfo.getPid()); File file = new File(pidDir, SMAPS); if (!file.exists()) { return; } fReader = new InputStreamReader( new FileInputStream(file), Charset.forName("UTF-8")); in = new BufferedReader(fReader); ProcessSmapMemoryInfo memoryMappingInfo = null; List<String> lines = IOUtils.readLines(in); for (String line : lines) { line = line.trim(); try { Matcher address = ADDRESS_PATTERN.matcher(line); if (address.find()) { memoryMappingInfo = new ProcessSmapMemoryInfo(line); memoryMappingInfo.setPermission(address.group(4)); pInfo.getMemoryInfoList().add(memoryMappingInfo); continue; } Matcher memInfo = MEM_INFO_PATTERN.matcher(line); if (memInfo.find()) { String key = memInfo.group(1).trim(); String value = memInfo.group(2).replace(KB, "").trim(); if (LOG.isDebugEnabled()) { LOG.debug("MemInfo : " + key + " : Value : " + value); } memoryMappingInfo.setMemInfo(key, value); } } catch (Throwable t) { LOG .warn("Error parsing smaps line : " + line + "; " + t.getMessage()); } } } catch (FileNotFoundException f) { LOG.error(f.getMessage()); } catch (IOException e) { LOG.error(e.getMessage()); } catch (Throwable t) { LOG.error(t.getMessage()); } finally { IOUtils.closeQuietly(in); } } static class ProcessTreeSmapMemInfo { private String pid; private List<ProcessSmapMemoryInfo> memoryInfoList; public ProcessTreeSmapMemInfo(String pid) { this.pid = pid; this.memoryInfoList = new LinkedList<ProcessSmapMemoryInfo>(); }
static void function(ProcessTreeSmapMemInfo pInfo, String procfsDir) { BufferedReader in = null; InputStreamReader fReader = null; try { File pidDir = new File(procfsDir, pInfo.getPid()); File file = new File(pidDir, SMAPS); if (!file.exists()) { return; } fReader = new InputStreamReader( new FileInputStream(file), Charset.forName("UTF-8")); in = new BufferedReader(fReader); ProcessSmapMemoryInfo memoryMappingInfo = null; List<String> lines = IOUtils.readLines(in); for (String line : lines) { line = line.trim(); try { Matcher address = ADDRESS_PATTERN.matcher(line); if (address.find()) { memoryMappingInfo = new ProcessSmapMemoryInfo(line); memoryMappingInfo.setPermission(address.group(4)); pInfo.getMemoryInfoList().add(memoryMappingInfo); continue; } Matcher memInfo = MEM_INFO_PATTERN.matcher(line); if (memInfo.find()) { String key = memInfo.group(1).trim(); String value = memInfo.group(2).replace(KB, STRMemInfo : STR : Value : STRError parsing smaps line : STR; " + t.getMessage()); } } } catch (FileNotFoundException f) { LOG.error(f.getMessage()); } catch (IOException e) { LOG.error(e.getMessage()); } catch (Throwable t) { LOG.error(t.getMessage()); } finally { IOUtils.closeQuietly(in); } } static class ProcessTreeSmapMemInfo { private String pid; private List<ProcessSmapMemoryInfo> memoryInfoList; public ProcessTreeSmapMemInfo(String pid) { this.pid = pid; this.memoryInfoList = new LinkedList<ProcessSmapMemoryInfo>(); }
/** * Update memory related information * * @param pInfo * @param procfsDir */
Update memory related information
constructProcessSMAPInfo
{ "repo_name": "robzor92/hops", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java", "license": "apache-2.0", "size": 32109 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.IOException", "java.io.InputStreamReader", "java.nio.charset.Charset", "java.util.LinkedList", "java.util.List", "java.util.regex.Matcher", "org.apache.commons.io.IOUtils" ]
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; import org.apache.commons.io.IOUtils;
import java.io.*; import java.nio.charset.*; import java.util.*; import java.util.regex.*; import org.apache.commons.io.*;
[ "java.io", "java.nio", "java.util", "org.apache.commons" ]
java.io; java.nio; java.util; org.apache.commons;
2,331,281
protected void addInstancePathPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_RealTimeAtom_instancePath_feature"), getString("_UI_PropertyDescriptor_description", "_UI_RealTimeAtom_instancePath_feature", "_UI_RealTimeAtom_type"), RulesPackage.Literals.REAL_TIME_ATOM__INSTANCE_PATH, true, false, true, null, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), RulesPackage.Literals.REAL_TIME_ATOM__INSTANCE_PATH, true, false, true, null, null, null)); }
/** * This adds a property descriptor for the Instance Path feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Instance Path feature.
addInstancePathPropertyDescriptor
{ "repo_name": "paetti1988/qmate", "path": "MATE/org.tud.inf.st.mbt.emf.edit/src-gen/org/tud/inf/st/mbt/rules/provider/RealTimeAtomItemProvider.java", "license": "apache-2.0", "size": 5894 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.tud.inf.st.mbt.rules.RulesPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.tud.inf.st.mbt.rules.RulesPackage;
import org.eclipse.emf.edit.provider.*; import org.tud.inf.st.mbt.rules.*;
[ "org.eclipse.emf", "org.tud.inf" ]
org.eclipse.emf; org.tud.inf;
972,805
public double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge) { DateRange range = (DateRange) getRange(); double axisMin = this.timeline.toTimelineValue(range.getLowerMillis()); double axisMax = this.timeline.toTimelineValue(range.getUpperMillis()); double min = 0.0; double max = 0.0; if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getMaxX(); } else if (RectangleEdge.isLeftOrRight(edge)) { min = area.getMaxY(); max = area.getY(); } double result; if (isInverted()) { result = axisMax - ((java2DValue - min) / (max - min) * (axisMax - axisMin)); } else { result = axisMin + ((java2DValue - min) / (max - min) * (axisMax - axisMin)); } return this.timeline.toMillisecond((long) result); }
double function(double java2DValue, Rectangle2D area, RectangleEdge edge) { DateRange range = (DateRange) getRange(); double axisMin = this.timeline.toTimelineValue(range.getLowerMillis()); double axisMax = this.timeline.toTimelineValue(range.getUpperMillis()); double min = 0.0; double max = 0.0; if (RectangleEdge.isTopOrBottom(edge)) { min = area.getX(); max = area.getMaxX(); } else if (RectangleEdge.isLeftOrRight(edge)) { min = area.getMaxY(); max = area.getY(); } double result; if (isInverted()) { result = axisMax - ((java2DValue - min) / (max - min) * (axisMax - axisMin)); } else { result = axisMin + ((java2DValue - min) / (max - min) * (axisMax - axisMin)); } return this.timeline.toMillisecond((long) result); }
/** * Translates a Java2D coordinate into the corresponding data value. To * perform this translation, you need to know the area used for plotting * data, and which edge the axis is located on. * * @param java2DValue the coordinate in Java2D space. * @param area the rectangle (in Java2D space) where the data is to be * plotted. * @param edge the axis location. * * @return A data value. */
Translates a Java2D coordinate into the corresponding data value. To perform this translation, you need to know the area used for plotting data, and which edge the axis is located on
java2DToValue
{ "repo_name": "SOCR/HTML5_WebSite", "path": "SOCR2.8/src/jfreechart/org/jfree/chart/axis/DateAxis.java", "license": "lgpl-3.0", "size": 70762 }
[ "java.awt.geom.Rectangle2D", "org.jfree.data.time.DateRange", "org.jfree.ui.RectangleEdge" ]
import java.awt.geom.Rectangle2D; import org.jfree.data.time.DateRange; import org.jfree.ui.RectangleEdge;
import java.awt.geom.*; import org.jfree.data.time.*; import org.jfree.ui.*;
[ "java.awt", "org.jfree.data", "org.jfree.ui" ]
java.awt; org.jfree.data; org.jfree.ui;
2,383,363
public void characters(char[] ch, int start, int length) throws SAXException { // Content of the tag String tagString = new String(ch, start, length); // Info-tag content if (this.openInfoTag) { currentFile.setInfo(tagString); } }
void function(char[] ch, int start, int length) throws SAXException { String tagString = new String(ch, start, length); if (this.openInfoTag) { currentFile.setInfo(tagString); } }
/** * Get the content string of the tag. * <tag>content</tag> */
Get the content string of the tag. content
characters
{ "repo_name": "stenosis/roommate-app", "path": "src/roommateapp/info/io/CHandlerPublicUpdater.java", "license": "gpl-3.0", "size": 4113 }
[ "org.xml.sax.SAXException" ]
import org.xml.sax.SAXException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
2,895,764
V read(StreamInput in, K key) throws IOException;
V read(StreamInput in, K key) throws IOException;
/** * Reads value from stream. Reading operation can be made dependent on map key. */
Reads value from stream. Reading operation can be made dependent on map key
read
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/cluster/DiffableUtils.java", "license": "apache-2.0", "size": 27712 }
[ "java.io.IOException", "org.elasticsearch.common.io.stream.StreamInput" ]
import java.io.IOException; import org.elasticsearch.common.io.stream.StreamInput;
import java.io.*; import org.elasticsearch.common.io.stream.*;
[ "java.io", "org.elasticsearch.common" ]
java.io; org.elasticsearch.common;
1,008,439
public void scheduleTaskAtFixedRateIncludingTaskRunningTime(long initialDelay, long period, Runnable task) { mScheduledThreadPoolExecutor.scheduleWithFixedDelay(task, initialDelay, period, TimeUnit.MILLISECONDS); }
void function(long initialDelay, long period, Runnable task) { mScheduledThreadPoolExecutor.scheduleWithFixedDelay(task, initialDelay, period, TimeUnit.MILLISECONDS); }
/** * Schedule task at fixed rate including task running time. * * @param initialDelay the initial delay * @param period the period * @param task the task */
Schedule task at fixed rate including task running time
scheduleTaskAtFixedRateIncludingTaskRunningTime
{ "repo_name": "SkySeraph-XKnife/XKnife-Android", "path": "library/xkl_utils/src/main/java/com/skyseraph/xknife/lib/module/task/task/ThreadPoolExecutorWrapper.java", "license": "apache-2.0", "size": 4456 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,267,248
void checkProperties(Properties properties);
void checkProperties(Properties properties);
/** * Check the given properties to make sure any unset values are properly configured. * @param properties The properties to check, usually System.getProperties() */
Check the given properties to make sure any unset values are properly configured
checkProperties
{ "repo_name": "friedhardware/druid", "path": "services/src/main/java/io/druid/cli/PropertyChecker.java", "license": "apache-2.0", "size": 1620 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
1,219,350
public void setGroupBy(Collection<String> groupBy) { this.groupBy = groupBy; }
void function(Collection<String> groupBy) { this.groupBy = groupBy; }
/** * Sets the properties for which search services should aggregate results for. * * @param groupBy * - collection of properties */
Sets the properties for which search services should aggregate results for
setGroupBy
{ "repo_name": "SirmaITT/conservation-space-1.7.0", "path": "docker/sirma-platform/platform/seip-parent/platform/domain-model/domain-model-api/src/main/java/com/sirma/itt/seip/domain/search/SearchArguments.java", "license": "lgpl-3.0", "size": 19289 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,178,208
private Mono<ReadPrimaryResult> readPrimaryAsync( RxDocumentServiceRequest entity, int readQuorum, boolean useSessionToken) { if (entity.requestContext.timeoutHelper.isElapsed()) { return Mono.error(new GoneException()); } // We would have already refreshed address before reaching here. Avoid performing here. entity.requestContext.forceRefreshAddressCache = false; Mono<StoreResult> storeResultObs = this.storeReader.readPrimaryAsync( entity, true , useSessionToken); return storeResultObs.flatMap( storeResult -> { if (!storeResult.isValid) { try { return Mono.error(storeResult.getException()); } catch (InternalServerErrorException e) { return Mono.error(e); } } if (storeResult.currentReplicaSetSize <= 0 || storeResult.lsn < 0 || storeResult.quorumAckedLSN < 0) { String message = String.format( "INVALID value received from response header. CurrentReplicaSetSize %d, StoreLSN %d, QuorumAckedLSN %d", storeResult.currentReplicaSetSize, storeResult.lsn, storeResult.quorumAckedLSN); // might not be returned if primary is still building the secondary replicas (during churn) logger.error(message); // throw exception instead of returning inconsistent result. return Mono.error(new GoneException(String.format(RMResources.ReadQuorumNotMet, readQuorum))); } if (storeResult.currentReplicaSetSize > readQuorum) { logger.warn( "Unexpected response. Replica Set size is {} which is greater than min value {}", storeResult.currentReplicaSetSize, readQuorum); return Mono.just(new ReadPrimaryResult(entity.requestContext.requestChargeTracker, false, true, null)); } // To accommodate for store latency, where an LSN may be acked by not persisted in the store, we compare the quorum acked LSN and store LSN. // In case of sync replication, the store LSN will follow the quorum committed LSN // In case of async replication (if enabled for bounded staleness), the store LSN can be ahead of the quorum committed LSN if the primary is able write to faster than secondary acks. // We pick higher of the 2 LSN and wait for the other to reach that LSN. if (storeResult.lsn != storeResult.quorumAckedLSN) { logger.warn("Store LSN {} and quorum acked LSN {} don't match", storeResult.lsn, storeResult.quorumAckedLSN); long higherLsn = storeResult.lsn > storeResult.quorumAckedLSN ? storeResult.lsn : storeResult.quorumAckedLSN; Mono<RxDocumentServiceRequest> waitForLsnRequestObs = BarrierRequestHelper.createAsync(entity, this.authorizationTokenProvider, higherLsn, null); return waitForLsnRequestObs.flatMap( waitForLsnRequest -> { Mono<PrimaryReadOutcome> primaryWaitForLsnResponseObs = this.waitForPrimaryLsnAsync(waitForLsnRequest, higherLsn, readQuorum); return primaryWaitForLsnResponseObs.map( primaryWaitForLsnResponse -> { if (primaryWaitForLsnResponse == PrimaryReadOutcome.QuorumNotMet) { return new ReadPrimaryResult( entity.requestContext.requestChargeTracker, false, false, null); } else if (primaryWaitForLsnResponse == PrimaryReadOutcome.QuorumInconclusive) { return new ReadPrimaryResult( entity.requestContext.requestChargeTracker, false, true, null); } return new ReadPrimaryResult( entity.requestContext.requestChargeTracker, true, false, storeResult); } ); } ); } return Mono.just(new ReadPrimaryResult( entity.requestContext.requestChargeTracker, true, false, storeResult)); } ); }
Mono<ReadPrimaryResult> function( RxDocumentServiceRequest entity, int readQuorum, boolean useSessionToken) { if (entity.requestContext.timeoutHelper.isElapsed()) { return Mono.error(new GoneException()); } entity.requestContext.forceRefreshAddressCache = false; Mono<StoreResult> storeResultObs = this.storeReader.readPrimaryAsync( entity, true , useSessionToken); return storeResultObs.flatMap( storeResult -> { if (!storeResult.isValid) { try { return Mono.error(storeResult.getException()); } catch (InternalServerErrorException e) { return Mono.error(e); } } if (storeResult.currentReplicaSetSize <= 0 storeResult.lsn < 0 storeResult.quorumAckedLSN < 0) { String message = String.format( STR, storeResult.currentReplicaSetSize, storeResult.lsn, storeResult.quorumAckedLSN); logger.error(message); return Mono.error(new GoneException(String.format(RMResources.ReadQuorumNotMet, readQuorum))); } if (storeResult.currentReplicaSetSize > readQuorum) { logger.warn( STR, storeResult.currentReplicaSetSize, readQuorum); return Mono.just(new ReadPrimaryResult(entity.requestContext.requestChargeTracker, false, true, null)); } if (storeResult.lsn != storeResult.quorumAckedLSN) { logger.warn(STR, storeResult.lsn, storeResult.quorumAckedLSN); long higherLsn = storeResult.lsn > storeResult.quorumAckedLSN ? storeResult.lsn : storeResult.quorumAckedLSN; Mono<RxDocumentServiceRequest> waitForLsnRequestObs = BarrierRequestHelper.createAsync(entity, this.authorizationTokenProvider, higherLsn, null); return waitForLsnRequestObs.flatMap( waitForLsnRequest -> { Mono<PrimaryReadOutcome> primaryWaitForLsnResponseObs = this.waitForPrimaryLsnAsync(waitForLsnRequest, higherLsn, readQuorum); return primaryWaitForLsnResponseObs.map( primaryWaitForLsnResponse -> { if (primaryWaitForLsnResponse == PrimaryReadOutcome.QuorumNotMet) { return new ReadPrimaryResult( entity.requestContext.requestChargeTracker, false, false, null); } else if (primaryWaitForLsnResponse == PrimaryReadOutcome.QuorumInconclusive) { return new ReadPrimaryResult( entity.requestContext.requestChargeTracker, false, true, null); } return new ReadPrimaryResult( entity.requestContext.requestChargeTracker, true, false, storeResult); } ); } ); } return Mono.just(new ReadPrimaryResult( entity.requestContext.requestChargeTracker, true, false, storeResult)); } ); }
/** * READ and get response from Primary * * @param entity * @param readQuorum * @param useSessionToken * @return */
READ and get response from Primary
readPrimaryAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/cosmos/microsoft-azure-cosmos/src/main/java/com/azure/data/cosmos/internal/directconnectivity/QuorumReader.java", "license": "mit", "size": 43005 }
[ "com.azure.data.cosmos.GoneException", "com.azure.data.cosmos.InternalServerErrorException", "com.azure.data.cosmos.internal.RMResources", "com.azure.data.cosmos.internal.RxDocumentServiceRequest" ]
import com.azure.data.cosmos.GoneException; import com.azure.data.cosmos.InternalServerErrorException; import com.azure.data.cosmos.internal.RMResources; import com.azure.data.cosmos.internal.RxDocumentServiceRequest;
import com.azure.data.cosmos.*; import com.azure.data.cosmos.internal.*;
[ "com.azure.data" ]
com.azure.data;
2,085,680
public static void scrollToMiddle (Widget target) { Window.scrollTo(Window.getScrollLeft(), getScrollToMiddle(target)); }
static void function (Widget target) { Window.scrollTo(Window.getScrollLeft(), getScrollToMiddle(target)); }
/** * Centers the target widget vertically in the browser viewport. If the widget is taller than * the viewport, its top is aligned with the top of the viewport. */
Centers the target widget vertically in the browser viewport. If the widget is taller than the viewport, its top is aligned with the top of the viewport
scrollToMiddle
{ "repo_name": "threerings/gwt-utils", "path": "src/main/java/com/threerings/gwt/util/WindowUtil.java", "license": "lgpl-2.1", "size": 5709 }
[ "com.google.gwt.user.client.Window", "com.google.gwt.user.client.ui.Widget" ]
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.*; import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
1,392,806
public Bridge getInstance() { return new BatikHistogramNormalizationElementBridge(); }
Bridge function() { return new BatikHistogramNormalizationElementBridge(); }
/** * Returns a new instance of this bridge. */
Returns a new instance of this bridge
getInstance
{ "repo_name": "sflyphotobooks/crp-batik", "path": "sources/org/apache/batik/extension/svg/BatikHistogramNormalizationElementBridge.java", "license": "apache-2.0", "size": 7261 }
[ "org.apache.batik.bridge.Bridge" ]
import org.apache.batik.bridge.Bridge;
import org.apache.batik.bridge.*;
[ "org.apache.batik" ]
org.apache.batik;
2,175,039
@Test public void testGetAllMetrics() { Counter onosCounter = new Counter(); onosCounter.inc(); Meter onosMeter = new Meter(); onosMeter.mark(); Timer onosTimer = new Timer(); onosTimer.update(1, TimeUnit.MILLISECONDS); ImmutableMap<String, Metric> metrics = new ImmutableMap.Builder<String, Metric>() .put("onosCounter", onosCounter) .put("onosMeter", onosMeter) .put("onosTimer", onosTimer) .build(); expect(mockMetricsService.getMetrics()) .andReturn(metrics) .anyTimes(); replay(mockMetricsService); WebResource rs = resource(); String response = rs.path("metrics").get(String.class); assertThat(response, containsString("{\"metrics\":[")); JsonObject result = Json.parse(response).asObject(); assertThat(result, notNullValue()); JsonArray jsonMetrics = result.get("metrics").asArray(); assertThat(jsonMetrics, notNullValue()); assertThat(jsonMetrics.size(), is(3)); assertTrue(matchesMetric(metrics.get("onosCounter")).matchesSafely(jsonMetrics.get(0).asObject())); assertTrue(matchesMetric(metrics.get("onosMeter")).matchesSafely(jsonMetrics.get(1).asObject())); assertTrue(matchesMetric(metrics.get("onosTimer")).matchesSafely(jsonMetrics.get(2).asObject())); } public static class MetricJsonMatcher extends TypeSafeMatcher<JsonObject> { private final Metric metric; private String reason = ""; public MetricJsonMatcher(Metric metricValue) { this.metric = metricValue; }
void function() { Counter onosCounter = new Counter(); onosCounter.inc(); Meter onosMeter = new Meter(); onosMeter.mark(); Timer onosTimer = new Timer(); onosTimer.update(1, TimeUnit.MILLISECONDS); ImmutableMap<String, Metric> metrics = new ImmutableMap.Builder<String, Metric>() .put(STR, onosCounter) .put(STR, onosMeter) .put(STR, onosTimer) .build(); expect(mockMetricsService.getMetrics()) .andReturn(metrics) .anyTimes(); replay(mockMetricsService); WebResource rs = resource(); String response = rs.path(STR).get(String.class); assertThat(response, containsString("{\"metrics\":[")); JsonObject result = Json.parse(response).asObject(); assertThat(result, notNullValue()); JsonArray jsonMetrics = result.get(STR).asArray(); assertThat(jsonMetrics, notNullValue()); assertThat(jsonMetrics.size(), is(3)); assertTrue(matchesMetric(metrics.get(STR)).matchesSafely(jsonMetrics.get(0).asObject())); assertTrue(matchesMetric(metrics.get(STR)).matchesSafely(jsonMetrics.get(1).asObject())); assertTrue(matchesMetric(metrics.get(STR)).matchesSafely(jsonMetrics.get(2).asObject())); } public static class MetricJsonMatcher extends TypeSafeMatcher<JsonObject> { private final Metric metric; private String reason = ""; public MetricJsonMatcher(Metric metricValue) { this.metric = metricValue; }
/** * Tests GetAllMetrics method. */
Tests GetAllMetrics method
testGetAllMetrics
{ "repo_name": "sonu283304/onos", "path": "web/api/src/test/java/org/onosproject/rest/MetricsResourceTest.java", "license": "apache-2.0", "size": 8888 }
[ "com.codahale.metrics.Counter", "com.codahale.metrics.Meter", "com.codahale.metrics.Metric", "com.codahale.metrics.Timer", "com.eclipsesource.json.Json", "com.eclipsesource.json.JsonArray", "com.eclipsesource.json.JsonObject", "com.google.common.collect.ImmutableMap", "com.sun.jersey.api.client.WebResource", "java.util.concurrent.TimeUnit", "org.easymock.EasyMock", "org.hamcrest.Matchers", "org.hamcrest.TypeSafeMatcher", "org.junit.Assert" ]
import com.codahale.metrics.Counter; import com.codahale.metrics.Meter; import com.codahale.metrics.Metric; import com.codahale.metrics.Timer; import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObject; import com.google.common.collect.ImmutableMap; import com.sun.jersey.api.client.WebResource; import java.util.concurrent.TimeUnit; import org.easymock.EasyMock; import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.junit.Assert;
import com.codahale.metrics.*; import com.eclipsesource.json.*; import com.google.common.collect.*; import com.sun.jersey.api.client.*; import java.util.concurrent.*; import org.easymock.*; import org.hamcrest.*; import org.junit.*;
[ "com.codahale.metrics", "com.eclipsesource.json", "com.google.common", "com.sun.jersey", "java.util", "org.easymock", "org.hamcrest", "org.junit" ]
com.codahale.metrics; com.eclipsesource.json; com.google.common; com.sun.jersey; java.util; org.easymock; org.hamcrest; org.junit;
2,423,763
@Override protected AmazonAppConfigAsync build(AwsAsyncClientParams params) { return new AmazonAppConfigAsyncClient(params); }
AmazonAppConfigAsync function(AwsAsyncClientParams params) { return new AmazonAppConfigAsyncClient(params); }
/** * Construct an asynchronous implementation of AmazonAppConfigAsync using the current builder configuration. * * @param params * Current builder configuration represented as a parameter object. * @return Fully configured implementation of AmazonAppConfigAsync. */
Construct an asynchronous implementation of AmazonAppConfigAsync using the current builder configuration
build
{ "repo_name": "aws/aws-sdk-java", "path": "aws-java-sdk-appconfig/src/main/java/com/amazonaws/services/appconfig/AmazonAppConfigAsyncClientBuilder.java", "license": "apache-2.0", "size": 2440 }
[ "com.amazonaws.client.AwsAsyncClientParams" ]
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.client.*;
[ "com.amazonaws.client" ]
com.amazonaws.client;
2,280,995
@Test public void testMixed4() throws Exception { String q = query + "b = filter a by " + "age >= 20 and mrkt == 'us' and name == 'foo' and " + "srcid == dstid;" + "store b into 'out';"; test(q, Arrays.asList("srcid", "dstid", "mrkt"), "((mrkt == 'us') and (srcid == dstid))", "((age >= 20) and (name == 'foo'))"); }
void function() throws Exception { String q = query + STR + STR + STR + STR; test(q, Arrays.asList("srcid", "dstid", "mrkt"), STR, STR); }
/** * test case where filter has both conditions on partition cols and non * partition cols and the filter condition will be split to extract the * conditions on partition columns - this testcase also has a condition * based on comparison of two partition columns */
test case where filter has both conditions on partition cols and non partition cols and the filter condition will be split to extract the conditions on partition columns - this testcase also has a condition based on comparison of two partition columns
testMixed4
{ "repo_name": "apache/pig", "path": "test/org/apache/pig/test/TestNewPartitionFilterPushDown.java", "license": "apache-2.0", "size": 44644 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,099,473
public static void blacklistEntity(Class<? extends EntityLivingBase> clz) { try { Class.forName("morph.common.core.ApiHandler").getDeclaredMethod("blacklistEntity", Class.class).invoke(null, clz); } catch (Exception e) { } }
static void function(Class<? extends EntityLivingBase> clz) { try { Class.forName(STR).getDeclaredMethod(STR, Class.class).invoke(null, clz); } catch (Exception e) { } }
/** * Blacklists an entity from being morphed into. * Previously saved morphs of the classtype will not be removed. * @param Class (extends EntityLivingBase) */
Blacklists an entity from being morphed into. Previously saved morphs of the classtype will not be removed
blacklistEntity
{ "repo_name": "Alex-the-666/Morph", "path": "src/main/java/morph/api/Api.java", "license": "lgpl-3.0", "size": 5632 }
[ "net.minecraft.entity.EntityLivingBase" ]
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
413,235
void split(final Circle splitCircle, final List<Edge> outsideList, final List<Edge> insideList) { // get the inside arc, synchronizing its phase with the edge itself final double edgeStart = circle.getPhase(start.getLocation().getVector()); final Arc arc = circle.getInsideArc(splitCircle); final double arcRelativeStart = MathUtils.normalizeAngle(arc.getInf(), edgeStart + FastMath.PI) - edgeStart; final double arcRelativeEnd = arcRelativeStart + arc.getSize(); final double unwrappedEnd = arcRelativeEnd - MathUtils.TWO_PI; // build the sub-edges final double tolerance = circle.getTolerance(); Vertex previousVertex = start; if (unwrappedEnd >= length - tolerance) { // the edge is entirely contained inside the circle // we don't split anything insideList.add(this); } else { // there are at least some parts of the edge that should be outside // (even is they are later be filtered out as being too small) double alreadyManagedLength = 0; if (unwrappedEnd >= 0) { // the start of the edge is inside the circle previousVertex = addSubEdge(previousVertex, new Vertex(new S2Point(circle.getPointAt(edgeStart + unwrappedEnd))), unwrappedEnd, insideList); alreadyManagedLength = unwrappedEnd; } if (arcRelativeStart >= length - tolerance) { // the edge ends while still outside of the circle if (unwrappedEnd >= 0) { addSubEdge(previousVertex, end, length - alreadyManagedLength, outsideList); } else { // the edge is entirely outside of the circle // we don't split anything outsideList.add(this); } } else { // the edge is long enough to enter inside the circle previousVertex = addSubEdge(previousVertex, new Vertex(new S2Point(circle.getPointAt(edgeStart + arcRelativeStart))), arcRelativeStart - alreadyManagedLength, outsideList); alreadyManagedLength = arcRelativeStart; if (arcRelativeEnd >= length - tolerance) { // the edge ends while still inside of the circle addSubEdge(previousVertex, end, length - alreadyManagedLength, insideList); } else { // the edge is long enough to exit outside of the circle previousVertex = addSubEdge(previousVertex, new Vertex(new S2Point(circle.getPointAt(edgeStart + arcRelativeEnd))), arcRelativeEnd - alreadyManagedLength, insideList); alreadyManagedLength = arcRelativeEnd; addSubEdge(previousVertex, end, length - alreadyManagedLength, outsideList); } } } } /** Add a sub-edge to a list if long enough. * <p> * If the length of the sub-edge to add is smaller than the {@link Circle#getTolerance()}
void split(final Circle splitCircle, final List<Edge> outsideList, final List<Edge> insideList) { final double edgeStart = circle.getPhase(start.getLocation().getVector()); final Arc arc = circle.getInsideArc(splitCircle); final double arcRelativeStart = MathUtils.normalizeAngle(arc.getInf(), edgeStart + FastMath.PI) - edgeStart; final double arcRelativeEnd = arcRelativeStart + arc.getSize(); final double unwrappedEnd = arcRelativeEnd - MathUtils.TWO_PI; final double tolerance = circle.getTolerance(); Vertex previousVertex = start; if (unwrappedEnd >= length - tolerance) { insideList.add(this); } else { double alreadyManagedLength = 0; if (unwrappedEnd >= 0) { previousVertex = addSubEdge(previousVertex, new Vertex(new S2Point(circle.getPointAt(edgeStart + unwrappedEnd))), unwrappedEnd, insideList); alreadyManagedLength = unwrappedEnd; } if (arcRelativeStart >= length - tolerance) { if (unwrappedEnd >= 0) { addSubEdge(previousVertex, end, length - alreadyManagedLength, outsideList); } else { outsideList.add(this); } } else { previousVertex = addSubEdge(previousVertex, new Vertex(new S2Point(circle.getPointAt(edgeStart + arcRelativeStart))), arcRelativeStart - alreadyManagedLength, outsideList); alreadyManagedLength = arcRelativeStart; if (arcRelativeEnd >= length - tolerance) { addSubEdge(previousVertex, end, length - alreadyManagedLength, insideList); } else { previousVertex = addSubEdge(previousVertex, new Vertex(new S2Point(circle.getPointAt(edgeStart + arcRelativeEnd))), arcRelativeEnd - alreadyManagedLength, insideList); alreadyManagedLength = arcRelativeEnd; addSubEdge(previousVertex, end, length - alreadyManagedLength, outsideList); } } } } /** Add a sub-edge to a list if long enough. * <p> * If the length of the sub-edge to add is smaller than the {@link Circle#getTolerance()}
/** Split the edge. * <p> * Once split, this edge is not referenced anymore by the vertices, * it is replaced by the two or three sub-edges and intermediate splitting * vertices are introduced to connect these sub-edges together. * </p> * @param splitCircle circle splitting the edge in several parts * @param outsideList list where to put parts that are outside of the split circle * @param insideList list where to put parts that are inside the split circle */
Split the edge. Once split, this edge is not referenced anymore by the vertices, it is replaced by the two or three sub-edges and intermediate splitting vertices are introduced to connect these sub-edges together.
split
{ "repo_name": "sdinot/hipparchus", "path": "hipparchus-geometry/src/main/java/org/hipparchus/geometry/spherical/twod/Edge.java", "license": "apache-2.0", "size": 8552 }
[ "java.util.List", "org.hipparchus.geometry.spherical.oned.Arc", "org.hipparchus.util.FastMath", "org.hipparchus.util.MathUtils" ]
import java.util.List; import org.hipparchus.geometry.spherical.oned.Arc; import org.hipparchus.util.FastMath; import org.hipparchus.util.MathUtils;
import java.util.*; import org.hipparchus.geometry.spherical.oned.*; import org.hipparchus.util.*;
[ "java.util", "org.hipparchus.geometry", "org.hipparchus.util" ]
java.util; org.hipparchus.geometry; org.hipparchus.util;
2,502,284
private Control createUpDownBtt(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout compositeLayout = new GridLayout(); compositeLayout.marginHeight = 0; compositeLayout.marginWidth = 0; composite.setLayout(compositeLayout); composite.setLayoutData(new GridData(SWT.NONE, SWT.FILL, false, true)); Composite bttArea = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; bttArea.setLayout(layout); bttArea.setLayoutData(new GridData(SWT.NONE, SWT.CENTER, false, true)); upButton = new Button(bttArea, SWT.PUSH); upButton.setText("&Up"); upButton.addListener(SWT.Selection, event -> handleUpButton(event)); setButtonLayoutData(upButton); ((GridData) upButton.getLayoutData()).verticalIndent = tableLabelSize.y; upButton.setEnabled(false); downButton = new Button(bttArea, SWT.PUSH); downButton.setText("Dow&n"); downButton.addListener(SWT.Selection, event -> handleDownButton(event)); setButtonLayoutData(downButton); downButton.setEnabled(false); return bttArea; }
Control function(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout compositeLayout = new GridLayout(); compositeLayout.marginHeight = 0; compositeLayout.marginWidth = 0; composite.setLayout(compositeLayout); composite.setLayoutData(new GridData(SWT.NONE, SWT.FILL, false, true)); Composite bttArea = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; bttArea.setLayout(layout); bttArea.setLayoutData(new GridData(SWT.NONE, SWT.CENTER, false, true)); upButton = new Button(bttArea, SWT.PUSH); upButton.setText("&Up"); upButton.addListener(SWT.Selection, event -> handleUpButton(event)); setButtonLayoutData(upButton); ((GridData) upButton.getLayoutData()).verticalIndent = tableLabelSize.y; upButton.setEnabled(false); downButton = new Button(bttArea, SWT.PUSH); downButton.setText("Dow&n"); downButton.addListener(SWT.Selection, event -> handleDownButton(event)); setButtonLayoutData(downButton); downButton.setEnabled(false); return bttArea; }
/** * The Up and Down button to change column ordering. */
The Up and Down button to change column ordering
createUpDownBtt
{ "repo_name": "fqqb/yamcs-studio", "path": "bundles/org.yamcs.studio.core.ui/src/main/java/org/yamcs/studio/core/ui/utils/ViewerColumnsDialog.java", "license": "epl-1.0", "size": 16863 }
[ "org.eclipse.swt.layout.GridData", "org.eclipse.swt.layout.GridLayout", "org.eclipse.swt.widgets.Button", "org.eclipse.swt.widgets.Composite", "org.eclipse.swt.widgets.Control" ]
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,327,275
private static boolean isOptimizable(final Step step) { return ((step instanceof VertexStep && ((VertexStep) step).returnsVertex()) || (step instanceof PropertiesStep && PropertyType.VALUE.equals(((PropertiesStep) step).getReturnType()))) && (step.getTraversal().getEndStep().getLabels().isEmpty() || step.getNextStep() instanceof CountGlobalStep); }
static boolean function(final Step step) { return ((step instanceof VertexStep && ((VertexStep) step).returnsVertex()) (step instanceof PropertiesStep && PropertyType.VALUE.equals(((PropertiesStep) step).getReturnType()))) && (step.getTraversal().getEndStep().getLabels().isEmpty() step.getNextStep() instanceof CountGlobalStep); }
/** * Checks whether a given step is optimizable or not. * * @param step the step to check * @return <code>true</code> if the step is optimizable, otherwise <code>false</code> */
Checks whether a given step is optimizable or not
isOptimizable
{ "repo_name": "rmagen/incubator-tinkerpop", "path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/AdjacentToIncidentStrategy.java", "license": "apache-2.0", "size": 6310 }
[ "org.apache.tinkerpop.gremlin.process.traversal.Step", "org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep", "org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertiesStep", "org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep", "org.apache.tinkerpop.gremlin.structure.PropertyType" ]
import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertiesStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep; import org.apache.tinkerpop.gremlin.structure.PropertyType;
import org.apache.tinkerpop.gremlin.process.traversal.*; import org.apache.tinkerpop.gremlin.process.traversal.step.map.*; import org.apache.tinkerpop.gremlin.structure.*;
[ "org.apache.tinkerpop" ]
org.apache.tinkerpop;
1,191,935
public static MozuClient deletePriceListEntryClient(String priceListCode, String productCode, String currencyCode) throws Exception { return deletePriceListEntryClient( priceListCode, productCode, currencyCode, null); }
static MozuClient function(String priceListCode, String productCode, String currencyCode) throws Exception { return deletePriceListEntryClient( priceListCode, productCode, currencyCode, null); }
/** * Deletes a price list entry. * <p><pre><code> * MozuClient mozuClient=DeletePriceListEntryClient( priceListCode, productCode, currencyCode); * client.setBaseAddress(url); * client.executeRequest(); * </code></pre></p> * @param currencyCode The three character ISO currency code, such as USD for US Dollars. * @param priceListCode The code of the specified price list associated with the price list entry. * @param productCode The unique, user-defined product code of a product, used throughout Mozu to reference and associate to a product. * @return Mozu.Api.MozuClient */
Deletes a price list entry. <code><code> MozuClient mozuClient=DeletePriceListEntryClient( priceListCode, productCode, currencyCode); client.setBaseAddress(url); client.executeRequest(); </code></code>
deletePriceListEntryClient
{ "repo_name": "lakshmi-nair/mozu-java", "path": "mozu-java-core/src/main/java/com/mozu/api/clients/commerce/catalog/admin/pricelists/PriceListEntryClient.java", "license": "mit", "size": 16453 }
[ "com.mozu.api.MozuClient" ]
import com.mozu.api.MozuClient;
import com.mozu.api.*;
[ "com.mozu.api" ]
com.mozu.api;
2,694,151
private List<HTMLNode> performHTMLSubstitutions(String value, String[] patterns, HTMLNode[] values) throws L10nParseException { HTMLNode tempNode = new HTMLNode("#"); addHTMLSubstitutions(tempNode, value, patterns, values); return tempNode.getChildren(); }
List<HTMLNode> function(String value, String[] patterns, HTMLNode[] values) throws L10nParseException { HTMLNode tempNode = new HTMLNode("#"); addHTMLSubstitutions(tempNode, value, patterns, values); return tempNode.getChildren(); }
/** * Convert a string to a list of {@link HTMLNode}s, replacing substitution variables found in * {@code patterns} with corresponding nodes from {@code values}. */
Convert a string to a list of <code>HTMLNode</code>s, replacing substitution variables found in patterns with corresponding nodes from values
performHTMLSubstitutions
{ "repo_name": "freenet/fred", "path": "src/freenet/l10n/BaseL10n.java", "license": "gpl-2.0", "size": 30172 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,655,050
Collection<ClusterNode> aliveRemoteCacheNodes(@Nullable String cacheName, final long topVer) { return filter(topVer, aliveRmtCacheNodes.get(maskNull(cacheName))); }
Collection<ClusterNode> aliveRemoteCacheNodes(@Nullable String cacheName, final long topVer) { return filter(topVer, aliveRmtCacheNodes.get(maskNull(cacheName))); }
/** * Gets all alive remote nodes that have cache with given name. * * @param cacheName Cache name. * @param topVer Topology version. * @return Collection of nodes. */
Gets all alive remote nodes that have cache with given name
aliveRemoteCacheNodes
{ "repo_name": "dmagda/incubator-ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java", "license": "apache-2.0", "size": 103840 }
[ "java.util.Collection", "org.apache.ignite.cluster.ClusterNode", "org.jetbrains.annotations.Nullable" ]
import java.util.Collection; import org.apache.ignite.cluster.ClusterNode; import org.jetbrains.annotations.Nullable;
import java.util.*; import org.apache.ignite.cluster.*; import org.jetbrains.annotations.*;
[ "java.util", "org.apache.ignite", "org.jetbrains.annotations" ]
java.util; org.apache.ignite; org.jetbrains.annotations;
143,901
public SortedSet<Broker> deadBrokers() { SortedSet<Broker> brokers = brokers(); brokers.removeAll(healthyBrokers()); return brokers; }
SortedSet<Broker> function() { SortedSet<Broker> brokers = brokers(); brokers.removeAll(healthyBrokers()); return brokers; }
/** * Get the dead brokers in the cluster. */
Get the dead brokers in the cluster
deadBrokers
{ "repo_name": "GergoHong/cruise-control", "path": "cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/model/ClusterModel.java", "license": "bsd-2-clause", "size": 52254 }
[ "java.util.SortedSet" ]
import java.util.SortedSet;
import java.util.*;
[ "java.util" ]
java.util;
1,430,447
public Map<LogicCriteria, Result> eval(Integer patientId, Map<String, Object> parameters, LogicCriteria... criteria) throws LogicException;
Map<LogicCriteria, Result> function(Integer patientId, Map<String, Object> parameters, LogicCriteria... criteria) throws LogicException;
/** * Evaluates multiple {@link LogicCriteria} for a single patient. * (The criteria argument is an array and comes last because using a List would give this method * the same type erasure as the {@link String}... version.) * * @param patientId which patient to run the rules on * @param parameters global parameters to be passed to all rule evaluations * @param criteria what criteria to run * @return results of the rule evaluations * @throws LogicException * @since 1.6.3, 1.7.2, and 1.8 */
Evaluates multiple <code>LogicCriteria</code> for a single patient. (The criteria argument is an array and comes last because using a List would give this method the same type erasure as the <code>String</code>... version.)
eval
{ "repo_name": "vinayvenu/openmrs-core", "path": "api/src/main/java/org/openmrs/logic/LogicService.java", "license": "mpl-2.0", "size": 13208 }
[ "java.util.Map", "org.openmrs.logic.result.Result" ]
import java.util.Map; import org.openmrs.logic.result.Result;
import java.util.*; import org.openmrs.logic.result.*;
[ "java.util", "org.openmrs.logic" ]
java.util; org.openmrs.logic;
2,828,608
private Deferred<Object> disconnectEverything() { HashMap<String, RegionClient> ip2client_copy; synchronized (ip2client) { // Make a local copy so we can shutdown every Region Server client // without hold the lock while we iterate over the data structure. ip2client_copy = new HashMap<String, RegionClient>(ip2client); } final ArrayList<Deferred<Object>> d = new ArrayList<Deferred<Object>>(ip2client_copy.values().size() + 1); // Shut down all client connections, clear cache. for (final RegionClient client : ip2client_copy.values()) { d.add(client.shutdown()); } if (rootregion != null && rootregion.isAlive()) { // It's OK if we already did that in the loop above. d.add(rootregion.shutdown()); } ip2client_copy = null;
Deferred<Object> function() { HashMap<String, RegionClient> ip2client_copy; synchronized (ip2client) { ip2client_copy = new HashMap<String, RegionClient>(ip2client); } final ArrayList<Deferred<Object>> d = new ArrayList<Deferred<Object>>(ip2client_copy.values().size() + 1); for (final RegionClient client : ip2client_copy.values()) { d.add(client.shutdown()); } if (rootregion != null && rootregion.isAlive()) { d.add(rootregion.shutdown()); } ip2client_copy = null;
/** * Closes every socket, which will also flush all internal region caches. */
Closes every socket, which will also flush all internal region caches
disconnectEverything
{ "repo_name": "Flipboard/asynchbase", "path": "src/HBaseClient.java", "license": "bsd-3-clause", "size": 144376 }
[ "com.stumbleupon.async.Deferred", "java.util.ArrayList", "java.util.HashMap" ]
import com.stumbleupon.async.Deferred; import java.util.ArrayList; import java.util.HashMap;
import com.stumbleupon.async.*; import java.util.*;
[ "com.stumbleupon.async", "java.util" ]
com.stumbleupon.async; java.util;
2,502,584
public void testStateCoverage() { // System.out.println("Starting testStateCoverage"); FsmCoverage(new StateCoverage(), 3, new int[] {1,1, 2,2, 3,3, 20,3}); }
void function() { FsmCoverage(new StateCoverage(), 3, new int[] {1,1, 2,2, 3,3, 20,3}); }
/** This test is a bit dependent on the path of the random walk. * It may need adjusting when the seed or random walk algorithm changes. */
This test is a bit dependent on the path of the random walk. It may need adjusting when the seed or random walk algorithm changes
testStateCoverage
{ "repo_name": "patrickfav/tuwien", "path": "master/swt workspace/ModelJUnit 2.0 beta1/modeljunit/src/test/java/nz/ac/waikato/modeljunit/RandomTesterTest.java", "license": "apache-2.0", "size": 7049 }
[ "nz.ac.waikato.modeljunit.coverage.StateCoverage" ]
import nz.ac.waikato.modeljunit.coverage.StateCoverage;
import nz.ac.waikato.modeljunit.coverage.*;
[ "nz.ac.waikato" ]
nz.ac.waikato;
2,896,271
public void completeStoragePolicyTransition(StoragePolicyTransitionParamsDto storagePolicyTransitionParamsDto);
void function(StoragePolicyTransitionParamsDto storagePolicyTransitionParamsDto);
/** * Completes a storage policy transition as per specified storage policy selection. * * @param storagePolicyTransitionParamsDto the storage policy transition DTO that contains parameters needed to complete a storage policy transition */
Completes a storage policy transition as per specified storage policy selection
completeStoragePolicyTransition
{ "repo_name": "FINRAOS/herd", "path": "herd-code/herd-service/src/main/java/org/finra/herd/service/StoragePolicyProcessorHelperService.java", "license": "apache-2.0", "size": 3057 }
[ "org.finra.herd.model.dto.StoragePolicyTransitionParamsDto" ]
import org.finra.herd.model.dto.StoragePolicyTransitionParamsDto;
import org.finra.herd.model.dto.*;
[ "org.finra.herd" ]
org.finra.herd;
599,444
public static synchronized void mark() { try { out.writeLong(-1L); flushBuffer(); } catch(IOException e) { throw new CoverageIOException(e); } }
static synchronized void function() { try { out.writeLong(-1L); flushBuffer(); } catch(IOException e) { throw new CoverageIOException(e); } }
/** * Put an end marker into the coverage data denoting a new series of tests are * being executed from this points on. This method effectively output a -1L * byte array into the output stream. * */
Put an end marker into the coverage data denoting a new series of tests are being executed from this points on. This method effectively output a -1L byte array into the output stream
mark
{ "repo_name": "abailly/patchwork", "path": "patchwork-control/src/main/java/oqube/patchwork/report/Coverage.java", "license": "lgpl-2.1", "size": 8758 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,184,344
@Override public void start() throws CantStartPluginException { logManager.log(ExtraUserActorPluginRoot.getLogLevelByClass(this.getClass().getName()), "Extra User Actor Plugin Initializing...", null, null); try { extraUserActorDao = new ExtraUserActorDao(pluginDatabaseSystem, pluginId); extraUserActorDao.initialize(); } catch (CantInitializeExtraUserActorDatabaseException e) { errorManager.reportUnexpectedPluginException(Plugins.BITDUBAI_ACTOR_EXTRA_USER, UnexpectedPluginExceptionSeverity.DISABLES_THIS_PLUGIN, e); throw new CantStartPluginException(CantStartPluginException.DEFAULT_MESSAGE, e, "There is a problem when trying to initialize ExtraUser DAO", null); } catch (Exception e) { errorManager.reportUnexpectedPluginException(Plugins.BITDUBAI_ACTOR_EXTRA_USER, UnexpectedPluginExceptionSeverity.DISABLES_THIS_PLUGIN, e); throw new CantStartPluginException(CantStartPluginException.DEFAULT_MESSAGE, e, "There is a problem I can't identify.", null); } logManager.log(ExtraUserActorPluginRoot.getLogLevelByClass(this.getClass().getName()), "Extra User Actor Plugin Successfully initialized...", null, null); this.serviceStatus = ServiceStatus.STARTED; }
void function() throws CantStartPluginException { logManager.log(ExtraUserActorPluginRoot.getLogLevelByClass(this.getClass().getName()), STR, null, null); try { extraUserActorDao = new ExtraUserActorDao(pluginDatabaseSystem, pluginId); extraUserActorDao.initialize(); } catch (CantInitializeExtraUserActorDatabaseException e) { errorManager.reportUnexpectedPluginException(Plugins.BITDUBAI_ACTOR_EXTRA_USER, UnexpectedPluginExceptionSeverity.DISABLES_THIS_PLUGIN, e); throw new CantStartPluginException(CantStartPluginException.DEFAULT_MESSAGE, e, STR, null); } catch (Exception e) { errorManager.reportUnexpectedPluginException(Plugins.BITDUBAI_ACTOR_EXTRA_USER, UnexpectedPluginExceptionSeverity.DISABLES_THIS_PLUGIN, e); throw new CantStartPluginException(CantStartPluginException.DEFAULT_MESSAGE, e, STR, null); } logManager.log(ExtraUserActorPluginRoot.getLogLevelByClass(this.getClass().getName()), STR, null, null); this.serviceStatus = ServiceStatus.STARTED; }
/** * Service Interface implementation. */
Service Interface implementation
start
{ "repo_name": "fvasquezjatar/fermat-unused", "path": "DMP/plugin/actor/fermat-dmp-plugin-actor-extra-user-bitdubai/src/main/java/com/bitdubai/fermat_dmp_plugin/layer/actor/extra_user/developer/bitdubai/version_1/ExtraUserActorPluginRoot.java", "license": "mit", "size": 26598 }
[ "com.bitdubai.fermat_api.CantStartPluginException", "com.bitdubai.fermat_api.layer.all_definition.enums.Plugins", "com.bitdubai.fermat_api.layer.all_definition.enums.ServiceStatus", "com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.database.ExtraUserActorDao", "com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.exceptions.CantInitializeExtraUserActorDatabaseException", "com.bitdubai.fermat_pip_api.layer.pip_platform_service.error_manager.UnexpectedPluginExceptionSeverity" ]
import com.bitdubai.fermat_api.CantStartPluginException; import com.bitdubai.fermat_api.layer.all_definition.enums.Plugins; import com.bitdubai.fermat_api.layer.all_definition.enums.ServiceStatus; import com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.database.ExtraUserActorDao; import com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.exceptions.CantInitializeExtraUserActorDatabaseException; import com.bitdubai.fermat_pip_api.layer.pip_platform_service.error_manager.UnexpectedPluginExceptionSeverity;
import com.bitdubai.fermat_api.*; import com.bitdubai.fermat_api.layer.all_definition.enums.*; import com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.database.*; import com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.exceptions.*; import com.bitdubai.fermat_pip_api.layer.pip_platform_service.error_manager.*;
[ "com.bitdubai.fermat_api", "com.bitdubai.fermat_dmp_plugin", "com.bitdubai.fermat_pip_api" ]
com.bitdubai.fermat_api; com.bitdubai.fermat_dmp_plugin; com.bitdubai.fermat_pip_api;
2,204,930
public void testSanityCheck() throws Exception { assertNotNull("Failed to locate implementation of IntegrationService.", service); Mode[] testModes = new Mode[] { Mode.UTEST, Mode.PROD }; for (Mode m : testModes) { Integration integration = service.createIntegration("", m, true, null, getNoDefaultPreloadsApp().getQualifiedName(), null); assertNotNull(String.format( "Failed to create an integration object using IntegrationService in %s mode. Returned null.", m), integration); try { injectSimpleComponent(integration); } catch (Exception unexpected) { fail(String .format("Failed to use IntegrationService to inject a component in %s mode with the following exception:", m) + unexpected.getMessage()); } } }
void function() throws Exception { assertNotNull(STR, service); Mode[] testModes = new Mode[] { Mode.UTEST, Mode.PROD }; for (Mode m : testModes) { Integration integration = service.createIntegration(STRFailed to create an integration object using IntegrationService in %s mode. Returned null.STRFailed to use IntegrationService to inject a component in %s mode with the following exception:", m) + unexpected.getMessage()); } } }
/** * Sanity check for IntegrationService. * * @throws Exception */
Sanity check for IntegrationService
testSanityCheck
{ "repo_name": "lhong375/aura", "path": "aura-impl/src/test/java/org/auraframework/impl/IntegrationServiceImplTest.java", "license": "apache-2.0", "size": 19045 }
[ "org.auraframework.integration.Integration", "org.auraframework.service.IntegrationService", "org.auraframework.system.AuraContext" ]
import org.auraframework.integration.Integration; import org.auraframework.service.IntegrationService; import org.auraframework.system.AuraContext;
import org.auraframework.integration.*; import org.auraframework.service.*; import org.auraframework.system.*;
[ "org.auraframework.integration", "org.auraframework.service", "org.auraframework.system" ]
org.auraframework.integration; org.auraframework.service; org.auraframework.system;
1,412,328
int countStepExecutionsForStep(String jobName, String stepName) throws NoSuchStepException;
int countStepExecutionsForStep(String jobName, String stepName) throws NoSuchStepException;
/** * Count the step executions in the repository for a given step name (or pattern). * @param jobName the job name (or a pattern with wildcards) * @param stepName the step name (or a pattern with wildcards) * * @return the number of executions * @throws NoSuchStepException thrown if step specified does not exist */
Count the step executions in the repository for a given step name (or pattern)
countStepExecutionsForStep
{ "repo_name": "ghillert/spring-cloud-dataflow", "path": "spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/batch/JobService.java", "license": "apache-2.0", "size": 14921 }
[ "org.springframework.batch.core.step.NoSuchStepException" ]
import org.springframework.batch.core.step.NoSuchStepException;
import org.springframework.batch.core.step.*;
[ "org.springframework.batch" ]
org.springframework.batch;
1,036,305
protected boolean checkAndAddToActiveSize(MutableSegment currActive, Cell cellToAdd, MemStoreSizing memstoreSizing) { long cellSize = MutableSegment.getCellLength(cellToAdd); boolean successAdd = false; while (true) { long segmentDataSize = currActive.getDataSize(); if (!inWalReplay && segmentDataSize > inmemoryFlushSize) { // when replaying edits from WAL there is no need in in-memory flush regardless the size // otherwise size below flush threshold try to update atomically break; } if (currActive.compareAndSetDataSize(segmentDataSize, segmentDataSize + cellSize)) { if (memstoreSizing != null) { memstoreSizing.incMemStoreSize(cellSize, 0, 0, 0); } successAdd = true; break; } } if (!inWalReplay && currActive.getDataSize() > inmemoryFlushSize) { // size above flush threshold so we flush in memory this.tryFlushInMemoryAndCompactingAsync(currActive); } return successAdd; }
boolean function(MutableSegment currActive, Cell cellToAdd, MemStoreSizing memstoreSizing) { long cellSize = MutableSegment.getCellLength(cellToAdd); boolean successAdd = false; while (true) { long segmentDataSize = currActive.getDataSize(); if (!inWalReplay && segmentDataSize > inmemoryFlushSize) { break; } if (currActive.compareAndSetDataSize(segmentDataSize, segmentDataSize + cellSize)) { if (memstoreSizing != null) { memstoreSizing.incMemStoreSize(cellSize, 0, 0, 0); } successAdd = true; break; } } if (!inWalReplay && currActive.getDataSize() > inmemoryFlushSize) { this.tryFlushInMemoryAndCompactingAsync(currActive); } return successAdd; }
/** * Check whether anything need to be done based on the current active set size. The method is * invoked upon every addition to the active set. For CompactingMemStore, flush the active set to * the read-only memory if it's size is above threshold * @param currActive intended segment to update * @param cellToAdd cell to be added to the segment * @param memstoreSizing object to accumulate changed size * @return true if the cell can be added to the currActive */
Check whether anything need to be done based on the current active set size. The method is invoked upon every addition to the active set. For CompactingMemStore, flush the active set to the read-only memory if it's size is above threshold
checkAndAddToActiveSize
{ "repo_name": "mahak/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java", "license": "apache-2.0", "size": 25131 }
[ "org.apache.hadoop.hbase.Cell" ]
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
387,656
public List<SourceEdit> getEdits() { return edits; }
List<SourceEdit> function() { return edits; }
/** * A list of the edits used to effect the change. */
A list of the edits used to effect the change
getEdits
{ "repo_name": "lukechurch/dart-analysis-server-temp-working", "path": "tool/spec/generated/java/types/SourceFileEdit.java", "license": "bsd-3-clause", "size": 5138 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,532,614
public void assertXpathNotExists(final String xpathExpression, final WebComponent component) throws XpathException, IOException, SAXException { String xhtml = toWrappedXHtml(component); assertXpathNotExists(xpathExpression, xhtml); }
void function(final String xpathExpression, final WebComponent component) throws XpathException, IOException, SAXException { String xhtml = toWrappedXHtml(component); assertXpathNotExists(xpathExpression, xhtml); }
/** * Renders the <code>component</code> to xhtml and then asserts that the <code>xpathExpression</code> does not exist * in that xhtml. * * @param xpathExpression the xpath expression to process * @param component the component to validate * @throws IOException if there is an I/O error * @throws SAXException if there is a parsing error * @throws XpathException if there is a xpath error */
Renders the <code>component</code> to xhtml and then asserts that the <code>xpathExpression</code> does not exist in that xhtml
assertXpathNotExists
{ "repo_name": "jonathanaustin/wcomponents", "path": "wcomponents-core/src/test/java/com/github/bordertech/wcomponents/render/webxml/AbstractWebXmlRendererTestCase.java", "license": "gpl-3.0", "size": 18162 }
[ "com.github.bordertech.wcomponents.WebComponent", "java.io.IOException", "org.custommonkey.xmlunit.exceptions.XpathException", "org.xml.sax.SAXException" ]
import com.github.bordertech.wcomponents.WebComponent; import java.io.IOException; import org.custommonkey.xmlunit.exceptions.XpathException; import org.xml.sax.SAXException;
import com.github.bordertech.wcomponents.*; import java.io.*; import org.custommonkey.xmlunit.exceptions.*; import org.xml.sax.*;
[ "com.github.bordertech", "java.io", "org.custommonkey.xmlunit", "org.xml.sax" ]
com.github.bordertech; java.io; org.custommonkey.xmlunit; org.xml.sax;
2,889,273
public static Map<String, Object> getExchangeProperties(Exchange exchange, Map<String, Object> properties) { int nProperties = 0; for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) { if (entry.getKey().startsWith(FacebookConstants.FACEBOOK_PROPERTY_PREFIX)) { properties.put(entry.getKey().substring(FacebookConstants.FACEBOOK_PROPERTY_PREFIX.length()), entry.getValue()); nProperties++; } } LOG.debug("Found {} properties in exchange", nProperties); return properties; }
static Map<String, Object> function(Exchange exchange, Map<String, Object> properties) { int nProperties = 0; for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) { if (entry.getKey().startsWith(FacebookConstants.FACEBOOK_PROPERTY_PREFIX)) { properties.put(entry.getKey().substring(FacebookConstants.FACEBOOK_PROPERTY_PREFIX.length()), entry.getValue()); nProperties++; } } LOG.debug(STR, nProperties); return properties; }
/** * Gets exchange header properties that start with {@link FacebookConstants}.FACEBOOK_PROPERTY_PREFIX. * * @param exchange Camel exchange * @param properties map to collect properties with required prefix */
Gets exchange header properties that start with <code>FacebookConstants</code>.FACEBOOK_PROPERTY_PREFIX
getExchangeProperties
{ "repo_name": "nikhilvibhav/camel", "path": "components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookPropertiesHelper.java", "license": "apache-2.0", "size": 6418 }
[ "java.util.Map", "org.apache.camel.Exchange", "org.apache.camel.component.facebook.FacebookConstants" ]
import java.util.Map; import org.apache.camel.Exchange; import org.apache.camel.component.facebook.FacebookConstants;
import java.util.*; import org.apache.camel.*; import org.apache.camel.component.facebook.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
1,911,943
@SuppressWarnings("unchecked") IgniteInternalFuture<IgniteInternalTx> commitTxAsync(final GridNearTxLocal tx) { FutureHolder holder = lastFut.get(); holder.lock(); try { IgniteInternalFuture fut = holder.future();
@SuppressWarnings(STR) IgniteInternalFuture<IgniteInternalTx> commitTxAsync(final GridNearTxLocal tx) { FutureHolder holder = lastFut.get(); holder.lock(); try { IgniteInternalFuture fut = holder.future();
/** * Asynchronously commits transaction after all previous asynchronous operations are completed. * * @param tx Transaction to commit. * @return Transaction commit future. */
Asynchronously commits transaction after all previous asynchronous operations are completed
commitTxAsync
{ "repo_name": "ptupitsyn/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java", "license": "apache-2.0", "size": 228325 }
[ "org.apache.ignite.internal.IgniteInternalFuture", "org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal", "org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx" ]
import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal; import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.distributed.near.*; import org.apache.ignite.internal.processors.cache.transactions.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,146,038
synchronized public JTabbedPane buildTabPanels() { // add the welcome screen if (!serviceGUIMap.containsKey(welcomeTabText)) { welcome = new Welcome(welcomeTabText, this, tabs); welcome.init(); serviceGUIMap.put(welcomeTabText, welcome); } HashMap<String, ServiceInterface> services = Runtime.getRegistry(); log.info("buildTabPanels service count " + Runtime.getRegistry().size()); TreeMap<String, ServiceInterface> sortedMap = new TreeMap<String, ServiceInterface>(services); Iterator<String> it = sortedMap.keySet().iterator(); synchronized (sortedMap) { // FIXED YAY !!!! while (it.hasNext()) { String serviceName = it.next(); addTab(serviceName); } } frame.pack(); return tabs; }
synchronized JTabbedPane function() { if (!serviceGUIMap.containsKey(welcomeTabText)) { welcome = new Welcome(welcomeTabText, this, tabs); welcome.init(); serviceGUIMap.put(welcomeTabText, welcome); } HashMap<String, ServiceInterface> services = Runtime.getRegistry(); log.info(STR + Runtime.getRegistry().size()); TreeMap<String, ServiceInterface> sortedMap = new TreeMap<String, ServiceInterface>(services); Iterator<String> it = sortedMap.keySet().iterator(); synchronized (sortedMap) { while (it.hasNext()) { String serviceName = it.next(); addTab(serviceName); } } frame.pack(); return tabs; }
/** * builds all the service tabs for the first time called when GUIService * starts * * @return */
builds all the service tabs for the first time called when GUIService starts
buildTabPanels
{ "repo_name": "DarkRebel/myrobotlab", "path": "src/org/myrobotlab/service/GUIService.java", "license": "apache-2.0", "size": 21330 }
[ "java.util.HashMap", "java.util.Iterator", "java.util.TreeMap", "javax.swing.JTabbedPane", "org.myrobotlab.control.Welcome", "org.myrobotlab.service.interfaces.ServiceInterface" ]
import java.util.HashMap; import java.util.Iterator; import java.util.TreeMap; import javax.swing.JTabbedPane; import org.myrobotlab.control.Welcome; import org.myrobotlab.service.interfaces.ServiceInterface;
import java.util.*; import javax.swing.*; import org.myrobotlab.control.*; import org.myrobotlab.service.interfaces.*;
[ "java.util", "javax.swing", "org.myrobotlab.control", "org.myrobotlab.service" ]
java.util; javax.swing; org.myrobotlab.control; org.myrobotlab.service;
2,264,065
ImmutableList<SourcePath> getExtraXcodeSources();
ImmutableList<SourcePath> getExtraXcodeSources();
/** * extra_xcode_sources will add the files to the list of files to be compiled in the Xcode * target. */
extra_xcode_sources will add the files to the list of files to be compiled in the Xcode target
getExtraXcodeSources
{ "repo_name": "dsyang/buck", "path": "src/com/facebook/buck/cxx/CxxLibraryDescription.java", "license": "apache-2.0", "size": 51444 }
[ "com.facebook.buck.rules.SourcePath", "com.google.common.collect.ImmutableList" ]
import com.facebook.buck.rules.SourcePath; import com.google.common.collect.ImmutableList;
import com.facebook.buck.rules.*; import com.google.common.collect.*;
[ "com.facebook.buck", "com.google.common" ]
com.facebook.buck; com.google.common;
2,571,953
public SearchSourceBuilder sort(SortBuilder sort) { if (sorts == null) { sorts = Lists.newArrayList(); } sorts.add(sort); return this; }
SearchSourceBuilder function(SortBuilder sort) { if (sorts == null) { sorts = Lists.newArrayList(); } sorts.add(sort); return this; }
/** * Adds a sort builder. */
Adds a sort builder
sort
{ "repo_name": "arowla/elasticsearch", "path": "src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java", "license": "apache-2.0", "size": 33479 }
[ "com.google.common.collect.Lists", "org.elasticsearch.search.sort.SortBuilder" ]
import com.google.common.collect.Lists; import org.elasticsearch.search.sort.SortBuilder;
import com.google.common.collect.*; import org.elasticsearch.search.sort.*;
[ "com.google.common", "org.elasticsearch.search" ]
com.google.common; org.elasticsearch.search;
1,740,154
public String getRpcaddress(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return DatabaseDescriptor.getBroadcastRpcAddress().getHostAddress(); else if (Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS) == null) return endpoint.getHostAddress(); else return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS).value; }
String function(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return DatabaseDescriptor.getBroadcastRpcAddress().getHostAddress(); else if (Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS) == null) return endpoint.getHostAddress(); else return Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS).value; }
/** * Return the rpc address associated with an endpoint as a string. * @param endpoint The endpoint to get rpc address for * @return the rpc address */
Return the rpc address associated with an endpoint as a string
getRpcaddress
{ "repo_name": "guanxi55nba/key-value-store", "path": "src/java/org/apache/cassandra/service/StorageService.java", "license": "apache-2.0", "size": 171991 }
[ "java.net.InetAddress", "org.apache.cassandra.config.DatabaseDescriptor", "org.apache.cassandra.gms.ApplicationState", "org.apache.cassandra.gms.Gossiper", "org.apache.cassandra.utils.FBUtilities" ]
import java.net.InetAddress; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.gms.ApplicationState; import org.apache.cassandra.gms.Gossiper; import org.apache.cassandra.utils.FBUtilities;
import java.net.*; import org.apache.cassandra.config.*; import org.apache.cassandra.gms.*; import org.apache.cassandra.utils.*;
[ "java.net", "org.apache.cassandra" ]
java.net; org.apache.cassandra;
29,121
private RefactoringStatus checkForConflictingRename(IFunction[] methods, String newName) { RefactoringStatus status= new RefactoringStatus(); for (Iterator iter= fFinalSimilarElementToName.keySet().iterator(); iter.hasNext();) { IJavaScriptElement element= (IJavaScriptElement) iter.next(); if (element instanceof IFunction) { IFunction alreadyRegisteredMethod= (IFunction) element; String alreadyRegisteredMethodName= (String) fFinalSimilarElementToName.get(element); for (int i= 0; i < methods.length; i++) { IFunction method2= methods[i]; if ( (alreadyRegisteredMethodName.equals(newName)) && (method2.getDeclaringType().equals(alreadyRegisteredMethod.getDeclaringType())) && (sameParams(alreadyRegisteredMethod, method2))) { String message= Messages.format(RefactoringCoreMessages.RenameTypeProcessor_cannot_rename_methods_same_new_name, new String[] { alreadyRegisteredMethod.getElementName(), method2.getElementName(), alreadyRegisteredMethod.getDeclaringType().getFullyQualifiedName(), newName }); status.addFatalError(message); return status; } } } } return status; }
RefactoringStatus function(IFunction[] methods, String newName) { RefactoringStatus status= new RefactoringStatus(); for (Iterator iter= fFinalSimilarElementToName.keySet().iterator(); iter.hasNext();) { IJavaScriptElement element= (IJavaScriptElement) iter.next(); if (element instanceof IFunction) { IFunction alreadyRegisteredMethod= (IFunction) element; String alreadyRegisteredMethodName= (String) fFinalSimilarElementToName.get(element); for (int i= 0; i < methods.length; i++) { IFunction method2= methods[i]; if ( (alreadyRegisteredMethodName.equals(newName)) && (method2.getDeclaringType().equals(alreadyRegisteredMethod.getDeclaringType())) && (sameParams(alreadyRegisteredMethod, method2))) { String message= Messages.format(RefactoringCoreMessages.RenameTypeProcessor_cannot_rename_methods_same_new_name, new String[] { alreadyRegisteredMethod.getElementName(), method2.getElementName(), alreadyRegisteredMethod.getDeclaringType().getFullyQualifiedName(), newName }); status.addFatalError(message); return status; } } } } return status; }
/** * Checks whether one of the given methods, which will all be renamed to * "newName", shares a type with another already registered method which is * renamed to the same new name and shares the same parameters. * @param methods * @param newName * @return status * * @see #checkForConflictingRename(IField, String) */
Checks whether one of the given methods, which will all be renamed to "newName", shares a type with another already registered method which is renamed to the same new name and shares the same parameters
checkForConflictingRename
{ "repo_name": "boniatillo-com/PhaserEditor", "path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameTypeProcessor.java", "license": "epl-1.0", "size": 70520 }
[ "java.util.Iterator", "org.eclipse.ltk.core.refactoring.RefactoringStatus", "org.eclipse.wst.jsdt.core.IFunction", "org.eclipse.wst.jsdt.core.IJavaScriptElement", "org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringCoreMessages", "org.eclipse.wst.jsdt.internal.corext.util.Messages" ]
import java.util.Iterator; import org.eclipse.ltk.core.refactoring.RefactoringStatus; import org.eclipse.wst.jsdt.core.IFunction; import org.eclipse.wst.jsdt.core.IJavaScriptElement; import org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.wst.jsdt.internal.corext.util.Messages;
import java.util.*; import org.eclipse.ltk.core.refactoring.*; import org.eclipse.wst.jsdt.core.*; import org.eclipse.wst.jsdt.internal.corext.refactoring.*; import org.eclipse.wst.jsdt.internal.corext.util.*;
[ "java.util", "org.eclipse.ltk", "org.eclipse.wst" ]
java.util; org.eclipse.ltk; org.eclipse.wst;
1,951,072
@Nonnull @Override public MetricContext getMetricContext() { return this.metricContext; }
MetricContext function() { return this.metricContext; }
/*************************************************** /* Catalog metrics * /**************************************************/
Catalog metrics
getMetricContext
{ "repo_name": "jack-moseley/gobblin", "path": "gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java", "license": "apache-2.0", "size": 15782 }
[ "org.apache.gobblin.metrics.MetricContext" ]
import org.apache.gobblin.metrics.MetricContext;
import org.apache.gobblin.metrics.*;
[ "org.apache.gobblin" ]
org.apache.gobblin;
1,163,700
private static void appendDeclarationLiteralForAnnotation(Module module, StringBuilder sb) { char sentinel = findSentinel(module); sb.append(":").append(sentinel).append(module.getVersion()).append(sentinel).append(module.getNameAsString()); }
static void function(Module module, StringBuilder sb) { char sentinel = findSentinel(module); sb.append(":").append(sentinel).append(module.getVersion()).append(sentinel).append(module.getNameAsString()); }
/** * Appends into the given builder a String representation of the given * module, suitable for parsing my the DeclarationParser. */
Appends into the given builder a String representation of the given module, suitable for parsing my the DeclarationParser
appendDeclarationLiteralForAnnotation
{ "repo_name": "gijsleussink/ceylon", "path": "compiler-java/src/com/redhat/ceylon/compiler/java/codegen/ExpressionTransformer.java", "license": "apache-2.0", "size": 383425 }
[ "com.redhat.ceylon.model.typechecker.model.Module" ]
import com.redhat.ceylon.model.typechecker.model.Module;
import com.redhat.ceylon.model.typechecker.model.*;
[ "com.redhat.ceylon" ]
com.redhat.ceylon;
1,992,982
public String setParameterValue(final String paramID, final ITime value) throws Exception { if (getParameterByID(paramID) == null) { throw new Exception("ID " + paramID + " is no known parameter id"); } if (!((TemporalValueDomain) getParameterByID(paramID).getValueDomain()) .containsValue(value)) { return "Value " + value + " is not contained in valueDomain " + (getParameterByID(paramID).getValueDomain()); } if (paramCon.containsParameterShellWithServiceSidedName(paramID)) { paramCon.setParameterValue(paramID, value); } else { paramCon.addParameterShell(paramID, value); } return null; }
String function(final String paramID, final ITime value) throws Exception { if (getParameterByID(paramID) == null) { throw new Exception(STR + paramID + STR); } if (!((TemporalValueDomain) getParameterByID(paramID).getValueDomain()) .containsValue(value)) { return STR + value + STR + (getParameterByID(paramID).getValueDomain()); } if (paramCon.containsParameterShellWithServiceSidedName(paramID)) { paramCon.setParameterValue(paramID, value); } else { paramCon.addParameterShell(paramID, value); } return null; }
/** * Sets the value of a parameter to value * * @param paramID * the paramID to set * @param value * the inputvalue as ITime * @return null if everything is ok, an errormessage as String * @throws IllegalArgumentException * @throws OXFException */
Sets the value of a parameter to value
setParameterValue
{ "repo_name": "52North/uDig-SOS-plugin", "path": "src/org/n52/udig/catalog/internal/sos/dataStore/config/ParameterConfiguration.java", "license": "gpl-2.0", "size": 33538 }
[ "org.n52.oxf.owsCommon.capabilities.ITime", "org.n52.oxf.valueDomains.time.TemporalValueDomain" ]
import org.n52.oxf.owsCommon.capabilities.ITime; import org.n52.oxf.valueDomains.time.TemporalValueDomain;
import org.n52.oxf.*;
[ "org.n52.oxf" ]
org.n52.oxf;
161,515
public void testNoAllocationFound() { final RoutingAllocation allocation; if (randomBoolean()) { allocation = routingAllocationWithOnePrimaryNoReplicas(yesAllocationDeciders(), false, Version.CURRENT, "allocId"); } else { allocation = routingAllocationWithOnePrimaryNoReplicas(yesAllocationDeciders(), false, Version.V_2_1_0); } testAllocator.addData(node1, ShardStateMetaData.NO_VERSION, null, randomBoolean()); boolean changed = testAllocator.allocateUnassigned(allocation); assertThat(changed, equalTo(false)); assertThat(allocation.routingNodes().unassigned().ignored().size(), equalTo(1)); assertThat(allocation.routingNodes().unassigned().ignored().get(0).shardId(), equalTo(shardId)); }
void function() { final RoutingAllocation allocation; if (randomBoolean()) { allocation = routingAllocationWithOnePrimaryNoReplicas(yesAllocationDeciders(), false, Version.CURRENT, STR); } else { allocation = routingAllocationWithOnePrimaryNoReplicas(yesAllocationDeciders(), false, Version.V_2_1_0); } testAllocator.addData(node1, ShardStateMetaData.NO_VERSION, null, randomBoolean()); boolean changed = testAllocator.allocateUnassigned(allocation); assertThat(changed, equalTo(false)); assertThat(allocation.routingNodes().unassigned().ignored().size(), equalTo(1)); assertThat(allocation.routingNodes().unassigned().ignored().get(0).shardId(), equalTo(shardId)); }
/** * Tests when the node returns that no data was found for it ({@link ShardStateMetaData#NO_VERSION} for version and null for allocation id), * it will be moved to ignore unassigned. */
Tests when the node returns that no data was found for it (<code>ShardStateMetaData#NO_VERSION</code> for version and null for allocation id), it will be moved to ignore unassigned
testNoAllocationFound
{ "repo_name": "mmaracic/elasticsearch", "path": "core/src/test/java/org/elasticsearch/gateway/PrimaryShardAllocatorTests.java", "license": "apache-2.0", "size": 33980 }
[ "org.elasticsearch.Version", "org.elasticsearch.cluster.routing.allocation.RoutingAllocation", "org.elasticsearch.index.shard.ShardStateMetaData", "org.hamcrest.Matchers" ]
import org.elasticsearch.Version; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.index.shard.ShardStateMetaData; import org.hamcrest.Matchers;
import org.elasticsearch.*; import org.elasticsearch.cluster.routing.allocation.*; import org.elasticsearch.index.shard.*; import org.hamcrest.*;
[ "org.elasticsearch", "org.elasticsearch.cluster", "org.elasticsearch.index", "org.hamcrest" ]
org.elasticsearch; org.elasticsearch.cluster; org.elasticsearch.index; org.hamcrest;
1,579,938
boolean isBlockFlammable(int x, int y, int z, Direction faceDirection);
boolean isBlockFlammable(int x, int y, int z, Direction faceDirection);
/** * Test whether the given face of the block can catch fire. * * @param x The X position * @param y The Y position * @param z The Z position * @param faceDirection The face of the block to check * @return Is flammable */
Test whether the given face of the block can catch fire
isBlockFlammable
{ "repo_name": "caseif/SpongeAPI", "path": "src/main/java/org/spongepowered/api/world/extent/Extent.java", "license": "mit", "size": 33478 }
[ "org.spongepowered.api.util.Direction" ]
import org.spongepowered.api.util.Direction;
import org.spongepowered.api.util.*;
[ "org.spongepowered.api" ]
org.spongepowered.api;
1,601,454
public Map<String, Element> getBodyPartElements() { Map<String, Element> messageBodyParts = new HashMap<String, Element>(); for (Map.Entry<String, OMElement> part : bodyParts.entrySet()) { messageBodyParts.put(part.getKey(), OMUtils.toDOM(part.getValue())); } return messageBodyParts; }
Map<String, Element> function() { Map<String, Element> messageBodyParts = new HashMap<String, Element>(); for (Map.Entry<String, OMElement> part : bodyParts.entrySet()) { messageBodyParts.put(part.getKey(), OMUtils.toDOM(part.getValue())); } return messageBodyParts; }
/** * Gets the body part elements of the message. * @return : The body part elements map. */
Gets the body part elements of the message
getBodyPartElements
{ "repo_name": "chathurace/carbon-business-process", "path": "components/common/src/main/java/org/wso2/carbon/bpel/common/WSDLAwareMessage.java", "license": "apache-2.0", "size": 3696 }
[ "java.util.HashMap", "java.util.Map", "org.apache.axiom.om.OMElement", "org.w3c.dom.Element" ]
import java.util.HashMap; import java.util.Map; import org.apache.axiom.om.OMElement; import org.w3c.dom.Element;
import java.util.*; import org.apache.axiom.om.*; import org.w3c.dom.*;
[ "java.util", "org.apache.axiom", "org.w3c.dom" ]
java.util; org.apache.axiom; org.w3c.dom;
584,865
public void removeModelBuilderListener( IModelBuilderListener<M> listener );
void function( IModelBuilderListener<M> listener );
/** * Remove a model builder listener * @param event */
Remove a model builder listener
removeModelBuilderListener
{ "repo_name": "condast/AieonF", "path": "Workspace/org.aieonf.model/src/org/aieonf/model/xml/IModelParser.java", "license": "apache-2.0", "size": 481 }
[ "org.aieonf.model.builder.IModelBuilderListener" ]
import org.aieonf.model.builder.IModelBuilderListener;
import org.aieonf.model.builder.*;
[ "org.aieonf.model" ]
org.aieonf.model;
1,512,101
public LocalResource localizeResource( Path src, Path dest, LocalResourceType type, Configuration conf) throws IOException { FileSystem destFS = dest.getFileSystem(conf); // We call copyFromLocal below, so we basically assume src is a local file. FileSystem srcFs = FileSystem.getLocal(conf); if (src != null && !checkPreExisting(srcFs, src, dest, conf)) { // copy the src to the destination and create local resource. // do not overwrite. String srcStr = src.toString(); LOG.info("Localizing resource because it does not exist: " + srcStr + " to dest: " + dest); Object notifierNew = new Object(), notifierOld = copyNotifiers.putIfAbsent(srcStr, notifierNew), notifier = (notifierOld == null) ? notifierNew : notifierOld; // To avoid timing issues with notifications (and given that HDFS check is anyway the // authoritative one), don't wait infinitely for the notifier, just wait a little bit // and check HDFS before and after. if (notifierOld != null && checkOrWaitForTheFile(srcFs, src, dest, conf, notifierOld, 1, 150, false)) { return createLocalResource(destFS, dest, type, LocalResourceVisibility.PRIVATE); } try { destFS.copyFromLocalFile(false, false, src, dest); synchronized (notifier) { notifier.notifyAll(); // Notify if we have successfully copied the file. } copyNotifiers.remove(srcStr, notifier); } catch (IOException e) { if ("Exception while contacting value generator".equals(e.getMessage())) { // HADOOP-13155, fixed version: 2.8.0, 3.0.0-alpha1 throw new IOException("copyFromLocalFile failed due to HDFS KMS failure", e); } LOG.info("Looks like another thread or process is writing the same file"); int waitAttempts = HiveConf.getIntVar( conf, ConfVars.HIVE_LOCALIZE_RESOURCE_NUM_WAIT_ATTEMPTS); long sleepInterval = HiveConf.getTimeVar( conf, HiveConf.ConfVars.HIVE_LOCALIZE_RESOURCE_WAIT_INTERVAL, TimeUnit.MILLISECONDS); // Only log on the first wait, and check after wait on the last iteration. if (!checkOrWaitForTheFile( srcFs, src, dest, conf, notifierOld, waitAttempts, sleepInterval, true)) { LOG.error("Could not find the jar that was being uploaded"); throw new IOException("Previous writer likely failed to write " + dest + ". Failing because I am unlikely to write too."); } } finally { if (notifier == notifierNew) { copyNotifiers.remove(srcStr, notifierNew); } } } return createLocalResource(destFS, dest, type, LocalResourceVisibility.PRIVATE); }
LocalResource function( Path src, Path dest, LocalResourceType type, Configuration conf) throws IOException { FileSystem destFS = dest.getFileSystem(conf); FileSystem srcFs = FileSystem.getLocal(conf); if (src != null && !checkPreExisting(srcFs, src, dest, conf)) { String srcStr = src.toString(); LOG.info(STR + srcStr + STR + dest); Object notifierNew = new Object(), notifierOld = copyNotifiers.putIfAbsent(srcStr, notifierNew), notifier = (notifierOld == null) ? notifierNew : notifierOld; if (notifierOld != null && checkOrWaitForTheFile(srcFs, src, dest, conf, notifierOld, 1, 150, false)) { return createLocalResource(destFS, dest, type, LocalResourceVisibility.PRIVATE); } try { destFS.copyFromLocalFile(false, false, src, dest); synchronized (notifier) { notifier.notifyAll(); } copyNotifiers.remove(srcStr, notifier); } catch (IOException e) { if (STR.equals(e.getMessage())) { throw new IOException(STR, e); } LOG.info(STR); int waitAttempts = HiveConf.getIntVar( conf, ConfVars.HIVE_LOCALIZE_RESOURCE_NUM_WAIT_ATTEMPTS); long sleepInterval = HiveConf.getTimeVar( conf, HiveConf.ConfVars.HIVE_LOCALIZE_RESOURCE_WAIT_INTERVAL, TimeUnit.MILLISECONDS); if (!checkOrWaitForTheFile( srcFs, src, dest, conf, notifierOld, waitAttempts, sleepInterval, true)) { LOG.error(STR); throw new IOException(STR + dest + STR); } } finally { if (notifier == notifierNew) { copyNotifiers.remove(srcStr, notifierNew); } } } return createLocalResource(destFS, dest, type, LocalResourceVisibility.PRIVATE); }
/** * Localizes a resources. Should be thread-safe. * @param src path to the source for the resource * @param dest path in hdfs for the resource * @param type local resource type (File/Archive) * @param conf * @return localresource from tez localization. * @throws IOException when any file system related calls fails. */
Localizes a resources. Should be thread-safe
localizeResource
{ "repo_name": "vergilchiu/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java", "license": "apache-2.0", "size": 56122 }
[ "java.io.IOException", "java.util.concurrent.TimeUnit", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path", "org.apache.hadoop.hive.conf.HiveConf", "org.apache.hadoop.yarn.api.records.LocalResource", "org.apache.hadoop.yarn.api.records.LocalResourceType", "org.apache.hadoop.yarn.api.records.LocalResourceVisibility" ]
import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.yarn.api.records.LocalResource; import org.apache.hadoop.yarn.api.records.LocalResourceType; import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
import java.io.*; import java.util.concurrent.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hive.conf.*; import org.apache.hadoop.yarn.api.records.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,799,158