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
public String toString( DateFormat df );
String function( DateFormat df );
/** * Converts entry to string using specified date format. * @param df * @return string value of entry */
Converts entry to string using specified date format
toString
{ "repo_name": "OBIGOGIT/etch", "path": "util/src/main/java/org/apache/etch/util/Log.java", "license": "apache-2.0", "size": 37488 }
[ "java.text.DateFormat" ]
import java.text.DateFormat;
import java.text.*;
[ "java.text" ]
java.text;
1,026,555
public void setData(Object data); public Object getData(); public void buildParameterWidgets( final Group grp);
void setData(Object data); public Object getData(); public void function( final Group grp);
/** * TODO Comment * @param grp - * @modified - */
TODO Comment
buildParameterWidgets
{ "repo_name": "tfossi/APolGe", "path": "src/tfossi/apolge/common/cmd/ICmd.java", "license": "gpl-3.0", "size": 5225 }
[ "org.eclipse.swt.widgets.Group" ]
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,824,572
public List<INode> getNodeList ( QName name ) ;
List<INode> function ( QName name ) ;
/** * Return a list of INode facaded nodes which correspond to the collection * named name. * <p> * Here we look at the children of the current node and return * that list which matches the name specified. * * @param name * @return a list of such nodes. */
Return a list of INode facaded nodes which correspond to the collection named name. Here we look at the children of the current node and return that list which matches the name specified
getNodeList
{ "repo_name": "Drifftr/devstudio-tooling-bps", "path": "plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/model/INode.java", "license": "apache-2.0", "size": 6207 }
[ "java.util.List", "javax.xml.namespace.QName" ]
import java.util.List; import javax.xml.namespace.QName;
import java.util.*; import javax.xml.namespace.*;
[ "java.util", "javax.xml" ]
java.util; javax.xml;
941,740
private void loadAddress( Address address, List<Modification> mods ) { if ( address != null ) { if ( CollectionUtils.isNotEmpty( address.getAddresses() ) ) { mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SchemaConstants ...
void function( Address address, List<Modification> mods ) { if ( address != null ) { if ( CollectionUtils.isNotEmpty( address.getAddresses() ) ) { mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SchemaConstants .POSTAL_ADDRESS_AT ) ); for ( String val : address.getAddresses() ) { mods.add( n...
/** * Given an address, {@link Address}, load into ldap modification set in preparation for ldap modify. * * @param address contains entity of type {@link Address} targeted for updating into ldap. * @param mods contains ldap modification set contains attributes to be updated in ldap. */
Given an address, <code>Address</code>, load into ldap modification set in preparation for ldap modify
loadAddress
{ "repo_name": "PennState/directory-fortress-core-1", "path": "src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java", "license": "apache-2.0", "size": 107529 }
[ "java.util.List", "org.apache.commons.collections.CollectionUtils", "org.apache.commons.lang.StringUtils", "org.apache.directory.api.ldap.model.constants.SchemaConstants", "org.apache.directory.api.ldap.model.entry.DefaultModification", "org.apache.directory.api.ldap.model.entry.Modification", "org.apac...
import java.util.List; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.directory.api.ldap.model.constants.SchemaConstants; import org.apache.directory.api.ldap.model.entry.DefaultModification; import org.apache.directory.api.ldap.model.entry.Modificat...
import java.util.*; import org.apache.commons.collections.*; import org.apache.commons.lang.*; import org.apache.directory.api.ldap.model.constants.*; import org.apache.directory.api.ldap.model.entry.*; import org.apache.directory.fortress.core.model.*;
[ "java.util", "org.apache.commons", "org.apache.directory" ]
java.util; org.apache.commons; org.apache.directory;
2,455,808
public static String addRemoteProcessFile(String destinationType, long spTimeStamp, String spPid, String spLabel) { LogRepositoryManager destManager = getManager(destinationType) ; String subProcessFileName = null ; if (destManager instanceof LogRepositoryManagerImpl) subProcessFileName = ((LogRepositoryMan...
static String function(String destinationType, long spTimeStamp, String spPid, String spLabel) { LogRepositoryManager destManager = getManager(destinationType) ; String subProcessFileName = null ; if (destManager instanceof LogRepositoryManagerImpl) subProcessFileName = ((LogRepositoryManagerImpl)destManager).addNewFil...
/** * add a remote file to the cache of files currently considered for retention on the parent. The child process uses * some form of interProcessCommunication to notify receiver of file creation, and this method is driven * @param destinationType Type of destination/repository * @param spTimeStamp timeStamp to...
add a remote file to the cache of files currently considered for retention on the parent. The child process uses some form of interProcessCommunication to notify receiver of file creation, and this method is driven
addRemoteProcessFile
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryComponent.java", "license": "epl-1.0", "size": 27479 }
[ "com.ibm.ws.logging.hpel.LogRepositoryManager", "com.ibm.ws.logging.hpel.impl.LogRepositoryManagerImpl" ]
import com.ibm.ws.logging.hpel.LogRepositoryManager; import com.ibm.ws.logging.hpel.impl.LogRepositoryManagerImpl;
import com.ibm.ws.logging.hpel.*; import com.ibm.ws.logging.hpel.impl.*;
[ "com.ibm.ws" ]
com.ibm.ws;
2,613,387
ArgumentChecker.notNull(futureOptionNumber, "futureOptionNumber"); ArgumentChecker.notNull(strike, "strike"); ArgumentChecker.notNull(surfaceDate, "surface date"); final String prefix = getFutureOptionPrefix(); final StringBuffer ticker = new StringBuffer(); ticker.append(prefix); final Exchange...
ArgumentChecker.notNull(futureOptionNumber, STR); ArgumentChecker.notNull(strike, STR); ArgumentChecker.notNull(surfaceDate, STR); final String prefix = getFutureOptionPrefix(); final StringBuffer ticker = new StringBuffer(); ticker.append(prefix); final ExchangeTradedInstrumentExpiryCalculator expiryRule = getExpiryRu...
/** * Provides an ExternalID for Bloomberg ticker, * given a reference date and an integer offset, the n'th subsequent option <p> * The format is prefix + expiry code + callPutFlag + strike + postfix <p> * e.g. S U3P 45 Comdty * <p> * @param futureOptionNumber n'th future following curve date, not nul...
Provides an ExternalID for Bloomberg ticker, given a reference date and an integer offset, the n'th subsequent option The format is prefix + expiry code + callPutFlag + strike + postfix e.g. S U3P 45 Comdty
getInstrument
{ "repo_name": "DevStreet/FinanceAnalytics", "path": "projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/volatility/surface/BloombergCommodityFutureOptionVolatilitySurfaceInstrumentProvider.java", "license": "apache-2.0", "size": 5780 }
[ "com.opengamma.financial.convention.expirycalc.ExchangeTradedInstrumentExpiryCalculator", "com.opengamma.id.ExternalId", "com.opengamma.util.ArgumentChecker", "org.threeten.bp.LocalDate" ]
import com.opengamma.financial.convention.expirycalc.ExchangeTradedInstrumentExpiryCalculator; import com.opengamma.id.ExternalId; import com.opengamma.util.ArgumentChecker; import org.threeten.bp.LocalDate;
import com.opengamma.financial.convention.expirycalc.*; import com.opengamma.id.*; import com.opengamma.util.*; import org.threeten.bp.*;
[ "com.opengamma.financial", "com.opengamma.id", "com.opengamma.util", "org.threeten.bp" ]
com.opengamma.financial; com.opengamma.id; com.opengamma.util; org.threeten.bp;
1,575,280
public void testNodeSerialize() throws Exception { for (DiscoverySpi spi : spis) { ClusterNode node = spi.getLocalNode(); assert node != null; writeObject(node); info("Serialize node success [nodeId=" + node.id() + ", spiIdx=" + spis.indexOf(spi) + ']'); ...
void function() throws Exception { for (DiscoverySpi spi : spis) { ClusterNode node = spi.getLocalNode(); assert node != null; writeObject(node); info(STR + node.id() + STR + spis.indexOf(spi) + ']'); } }
/** * Checks that node serializable. * * @throws Exception If failed. */
Checks that node serializable
testNodeSerialize
{ "repo_name": "psadusumilli/ignite", "path": "modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java", "license": "apache-2.0", "size": 17272 }
[ "org.apache.ignite.cluster.ClusterNode" ]
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.cluster.*;
[ "org.apache.ignite" ]
org.apache.ignite;
632,747
public void finishConnectAsPrimary(String verificationCode) throws IOException { if(accountManager == null) { throw new IllegalStateException("Cannot finish: No connection started!"); } else if(isRegistered()) { throw new IllegalStateException("Already registered!"); } createRegistrationId(); account...
void function(String verificationCode) throws IOException { if(accountManager == null) { throw new IllegalStateException(STR); } else if(isRegistered()) { throw new IllegalStateException(STR); } createRegistrationId(); accountManager.verifyAccountWithCode(verificationCode, store.getSignalingKey(), store.getLocalRegistr...
/** * Finish the connection and registration as primary device with the received verification code * @param verificationCode the verification code without the - * @throws IOException */
Finish the connection and registration as primary device with the received verification code
finishConnectAsPrimary
{ "repo_name": "Turakar/signal4j", "path": "src/main/java/de/thoffbauer/signal4j/SignalService.java", "license": "gpl-3.0", "size": 30493 }
[ "java.io.IOException", "org.whispersystems.libsignal.IdentityKeyPair", "org.whispersystems.libsignal.util.KeyHelper" ]
import java.io.IOException; import org.whispersystems.libsignal.IdentityKeyPair; import org.whispersystems.libsignal.util.KeyHelper;
import java.io.*; import org.whispersystems.libsignal.*; import org.whispersystems.libsignal.util.*;
[ "java.io", "org.whispersystems.libsignal" ]
java.io; org.whispersystems.libsignal;
2,154,340
Session session = HibernateUtil.getSession(); Transaction tx = null; WineryServer wineryServer = null; try { tx = session.beginTransaction(); wineryServer = (WineryServer) session.get(WineryServer.class, id); tx.commit(); } catch (HibernateException e) { if (tx != null) { tx.rollback(); } ...
Session session = HibernateUtil.getSession(); Transaction tx = null; WineryServer wineryServer = null; try { tx = session.beginTransaction(); wineryServer = (WineryServer) session.get(WineryServer.class, id); tx.commit(); } catch (HibernateException e) { if (tx != null) { tx.rollback(); } throw new PersistenceException...
/** * Returns a WineryServer for the given id. * * @param id * @return WineryServer * @throws PersistenceException * upon problems committing the underlying transaction */
Returns a WineryServer for the given id
getbyId
{ "repo_name": "CloudCycle2/CSAR_Repository", "path": "src/main/java/org/opentosca/csarrepo/model/repository/WineryServerRepository.java", "license": "apache-2.0", "size": 3842 }
[ "org.hibernate.HibernateException", "org.hibernate.Session", "org.hibernate.Transaction", "org.opentosca.csarrepo.exception.PersistenceException", "org.opentosca.csarrepo.model.WineryServer" ]
import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; import org.opentosca.csarrepo.exception.PersistenceException; import org.opentosca.csarrepo.model.WineryServer;
import org.hibernate.*; import org.opentosca.csarrepo.exception.*; import org.opentosca.csarrepo.model.*;
[ "org.hibernate", "org.opentosca.csarrepo" ]
org.hibernate; org.opentosca.csarrepo;
2,365,252
private JSONArray getJSONForHistogram(double min, double max, String field, boolean isLogarithmic, String whereClause, Queue<Map.Entry<String, FieldType>> searchValues) throws JSONException { //Get min and max steps double difference = max - min; int digits = (int) Math.floor(Math.log10(difference))...
JSONArray function(double min, double max, String field, boolean isLogarithmic, String whereClause, Queue<Map.Entry<String, FieldType>> searchValues) throws JSONException { double difference = max - min; int digits = (int) Math.floor(Math.log10(difference)); long upperBound = new BigDecimal(max).setScale(-digits, BigDe...
/** * Gets the JSON Array for a specific histogram * @param min lower bound of first class * @param max upper bound of last class * @param field numeric database-field that the histogram is based on * @param isLogarithmic * @param whereClause * @param searchValues * @return ...
Gets the JSON Array for a specific histogram
getJSONForHistogram
{ "repo_name": "alladin-IT/open-rmbt", "path": "RMBTStatisticServer/src/at/alladin/rmbt/statisticServer/OpenTestSearchResource.java", "license": "apache-2.0", "size": 41283 }
[ "java.math.BigDecimal", "java.sql.SQLException", "java.util.Map", "java.util.Queue", "org.json.JSONArray", "org.json.JSONException" ]
import java.math.BigDecimal; import java.sql.SQLException; import java.util.Map; import java.util.Queue; import org.json.JSONArray; import org.json.JSONException;
import java.math.*; import java.sql.*; import java.util.*; import org.json.*;
[ "java.math", "java.sql", "java.util", "org.json" ]
java.math; java.sql; java.util; org.json;
2,827,654
void endTablePart(boolean lastInBody, boolean lastOnPage) { addAreasAndFlushRow(lastInBody, lastOnPage); if (tablePartBackground != null) { TableLayoutManager tableLM = tclm.getTableLM(); for (Iterator iter = tablePartBackgroundAreas.iterator(); iter.hasNext();) { ...
void endTablePart(boolean lastInBody, boolean lastOnPage) { addAreasAndFlushRow(lastInBody, lastOnPage); if (tablePartBackground != null) { TableLayoutManager tableLM = tclm.getTableLM(); for (Iterator iter = tablePartBackgroundAreas.iterator(); iter.hasNext();) { Block backgroundArea = (Block) iter.next(); TraitSetter...
/** * Signals that the end of the current table part is reached. * * @param lastInBody true if the part is the last table-body element to be displayed * on the current page. In which case all the cells must be flushed even if they * aren't finished, plus the proper collapsed borders must be sel...
Signals that the end of the current table part is reached
endTablePart
{ "repo_name": "spepping/fop-cs", "path": "src/java/org/apache/fop/layoutmgr/table/RowPainter.java", "license": "apache-2.0", "size": 24560 }
[ "java.util.Iterator", "org.apache.fop.area.Block", "org.apache.fop.layoutmgr.TraitSetter" ]
import java.util.Iterator; import org.apache.fop.area.Block; import org.apache.fop.layoutmgr.TraitSetter;
import java.util.*; import org.apache.fop.area.*; import org.apache.fop.layoutmgr.*;
[ "java.util", "org.apache.fop" ]
java.util; org.apache.fop;
260,143
public void setDepositedCashieringChecksTotal(KualiDecimal depositedCashieringChecksTotal) { this.depositedCashieringChecksTotal = depositedCashieringChecksTotal; }
void function(KualiDecimal depositedCashieringChecksTotal) { this.depositedCashieringChecksTotal = depositedCashieringChecksTotal; }
/** * Sets the depositedCashieringChecksTotal attribute value. * * @param depositedCashieringChecksTotal The depositedCashieringChecksTotal to set. */
Sets the depositedCashieringChecksTotal attribute value
setDepositedCashieringChecksTotal
{ "repo_name": "bhutchinson/kfs", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/document/web/struts/CashManagementForm.java", "license": "agpl-3.0", "size": 42584 }
[ "org.kuali.rice.core.api.util.type.KualiDecimal" ]
import org.kuali.rice.core.api.util.type.KualiDecimal;
import org.kuali.rice.core.api.util.type.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,393,922
public BrowsingContext getBrowsingContext() { return _document.getBrowsingContext(); }
BrowsingContext function() { return _document.getBrowsingContext(); }
/** * Returns associated browsing context. * * @return Associated browsing context. */
Returns associated browsing context
getBrowsingContext
{ "repo_name": "ITman1/ScriptBox", "path": "src/main/java/org/fit/cssbox/scriptbox/events/Task.java", "license": "gpl-2.0", "size": 5323 }
[ "org.fit.cssbox.scriptbox.browser.BrowsingContext" ]
import org.fit.cssbox.scriptbox.browser.BrowsingContext;
import org.fit.cssbox.scriptbox.browser.*;
[ "org.fit.cssbox" ]
org.fit.cssbox;
23,208
public ActionForward execute(ActionMapping mapping_, ActionForm form_, HttpServletRequest request_, HttpServletResponse response_) { // Create the bean for all our processing and present the Alert List. LogonForm form = (LogonForm) form_; createBean(request_, form.getUserid(), fo...
ActionForward function(ActionMapping mapping_, ActionForm form_, HttpServletRequest request_, HttpServletResponse response_) { LogonForm form = (LogonForm) form_; createBean(request_, form.getUserid(), form.getUserName(), form.getPswd()); return mapping_.findForward(Constants._ACTLIST); }
/** * Action process for the user Login. * * @param mapping_ * The action map defined in struts-config.xml. * @param form_ * The form bean for this jsp. * @param request_ * The servlet request object. * @param response_ * The servlet respons...
Action process for the user Login
execute
{ "repo_name": "NCIP/cadsr-sentinel", "path": "software/src/java/gov/nih/nci/cadsr/sentinel/ui/Logon.java", "license": "bsd-3-clause", "size": 2420 }
[ "gov.nih.nci.cadsr.sentinel.tool.Constants", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForm", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping" ]
import gov.nih.nci.cadsr.sentinel.tool.Constants; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping;
import gov.nih.nci.cadsr.sentinel.tool.*; import javax.servlet.http.*; import org.apache.struts.action.*;
[ "gov.nih.nci", "javax.servlet", "org.apache.struts" ]
gov.nih.nci; javax.servlet; org.apache.struts;
1,718,994
public static double sumF(DTMAxisIterator iterator, DOM dom) { try { double result = 0.0; int node; while ((node = iterator.next()) != DTMAxisIterator.END) { result += Double.parseDouble(dom.getStringValueX(node)); } return result; ...
static double function(DTMAxisIterator iterator, DOM dom) { try { double result = 0.0; int node; while ((node = iterator.next()) != DTMAxisIterator.END) { result += Double.parseDouble(dom.getStringValueX(node)); } return result; } catch (NumberFormatException e) { return Double.NaN; } }
/** * XSLT Standard function sum(node-set). * stringToDouble is inlined */
XSLT Standard function sum(node-set). stringToDouble is inlined
sumF
{ "repo_name": "YouDiSN/OpenJDK-Research", "path": "jdk9/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java", "license": "gpl-2.0", "size": 60809 }
[ "com.sun.org.apache.xml.internal.dtm.DTMAxisIterator" ]
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.*;
[ "com.sun.org" ]
com.sun.org;
1,343,273
public void setCustomToken(Element customToken) { this.customToken = customToken; }
void function(Element customToken) { this.customToken = customToken; }
/** * Set the custom token * @param customToken */
Set the custom token
setCustomToken
{ "repo_name": "asoldano/wss4j", "path": "ws-security-common/src/main/java/org/apache/wss4j/common/ext/WSPasswordCallback.java", "license": "apache-2.0", "size": 10018 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
737,044
EReference getActivity_Default();
EReference getActivity_Default();
/** * Returns the meta object for the reference '{@link org.eclipse.bpmn2.Activity#getDefault <em>Default</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Default</em>'. * @see org.eclipse.bpmn2.Activity#getDefault() * @see #getActi...
Returns the meta object for the reference '<code>org.eclipse.bpmn2.Activity#getDefault Default</code>'.
getActivity_Default
{ "repo_name": "lqjack/fixflow", "path": "modules/fixflow-core/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java", "license": "apache-2.0", "size": 1014933 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,407,938
void scheduleImmediateIndexing(MutableStatusHolder statusHolder);
void scheduleImmediateIndexing(MutableStatusHolder statusHolder);
/** * Schedule the indexer to run immediately even if it is disabled */
Schedule the indexer to run immediately even if it is disabled
scheduleImmediateIndexing
{ "repo_name": "alancnet/artifactory", "path": "base/api/src/main/java/org/artifactory/api/repo/index/MavenIndexerService.java", "license": "apache-2.0", "size": 1596 }
[ "org.artifactory.common.MutableStatusHolder" ]
import org.artifactory.common.MutableStatusHolder;
import org.artifactory.common.*;
[ "org.artifactory.common" ]
org.artifactory.common;
1,586,091
public static final Object readValueXml(XmlPullParser parser, String[] name) throws XmlPullParserException, IOException { int eventType = parser.getEventType(); do { if (eventType == parser.START_TAG) { return readThisValueXml(parser, name, null, false); ...
static final Object function(XmlPullParser parser, String[] name) throws XmlPullParserException, IOException { int eventType = parser.getEventType(); do { if (eventType == parser.START_TAG) { return readThisValueXml(parser, name, null, false); } else if (eventType == parser.END_TAG) { throw new XmlPullParserException( ...
/** * Read a flattened object from an XmlPullParser. The XML data could * previously have been written with writeMapXml(), writeListXml(), or * writeValueXml(). The XmlPullParser must be positioned <em>at</em> the * tag that defines the value. * * @param parser The XmlPullParser from whi...
Read a flattened object from an XmlPullParser. The XML data could previously have been written with writeMapXml(), writeListXml(), or writeValueXml(). The XmlPullParser must be positioned at the tag that defines the value
readValueXml
{ "repo_name": "wiki2014/Learning-Summary", "path": "alps/cts/tests/tests/content/src/android/content/cts/util/XmlUtils.java", "license": "gpl-3.0", "size": 62083 }
[ "java.io.IOException", "org.xmlpull.v1.XmlPullParser", "org.xmlpull.v1.XmlPullParserException" ]
import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException;
import java.io.*; import org.xmlpull.v1.*;
[ "java.io", "org.xmlpull.v1" ]
java.io; org.xmlpull.v1;
12,926
super.doPreSetup(); try { xmppServer.stopXmppEndpoint(); } catch (IOException e) { LOG.warn("Failed to stop XMPP endpoint: {}", e.getMessage(), e); } }
super.doPreSetup(); try { xmppServer.stopXmppEndpoint(); } catch (IOException e) { LOG.warn(STR, e.getMessage(), e); } }
/** * Ensures that the XMPP server instance is created and 'stopped' before the camel routes are initialized */
Ensures that the XMPP server instance is created and 'stopped' before the camel routes are initialized
doPreSetup
{ "repo_name": "nicolaferraro/camel", "path": "components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppDeferredConnectionTest.java", "license": "apache-2.0", "size": 4506 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,408,107
public Vertex createName(String text, Vertex meaning, Network network) { Vertex word = createWord(text, meaning, network, Primitive.NOUN); word.addRelationship(Primitive.INSTANTIATION, Primitive.NAME); return word; }
Vertex function(String text, Vertex meaning, Network network) { Vertex word = createWord(text, meaning, network, Primitive.NOUN); word.addRelationship(Primitive.INSTANTIATION, Primitive.NAME); return word; }
/** * Create the name with the meaning. */
Create the name with the meaning
createName
{ "repo_name": "BOTlibre/BOTlibre", "path": "micro-ai-engine/android/source/org/botlibre/knowledge/Bootstrap.java", "license": "epl-1.0", "size": 53137 }
[ "org.botlibre.api.knowledge.Network", "org.botlibre.api.knowledge.Vertex" ]
import org.botlibre.api.knowledge.Network; import org.botlibre.api.knowledge.Vertex;
import org.botlibre.api.knowledge.*;
[ "org.botlibre.api" ]
org.botlibre.api;
1,603,877
public Map<String, Attribute> getAttributes() { return this.attributes; }
Map<String, Attribute> function() { return this.attributes; }
/** * Gets the attributes. * * @return the attributes */
Gets the attributes
getAttributes
{ "repo_name": "mapfish/mapfish-print", "path": "core/src/main/java/org/mapfish/print/attribute/DataSourceAttribute.java", "license": "bsd-2-clause", "size": 7849 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
650,166
public static double getInputCurrent() { return PowerJNI.getVinCurrent(); }
static double function() { return PowerJNI.getVinCurrent(); }
/** * Get the input current to the robot controller. * * @return The controller input current value in Amps */
Get the input current to the robot controller
getInputCurrent
{ "repo_name": "pjreiniger/TempAllWpi", "path": "wpilibj/src/main/java/edu/wpi/first/wpilibj/ControllerPower.java", "license": "bsd-3-clause", "size": 3913 }
[ "edu.wpi.first.wpilibj.hal.PowerJNI" ]
import edu.wpi.first.wpilibj.hal.PowerJNI;
import edu.wpi.first.wpilibj.hal.*;
[ "edu.wpi.first" ]
edu.wpi.first;
1,515,036
public void onAddTypeOfPlantsAction() throws IOException { FXMLLoader loader = new FXMLLoader(this.getClass().getResource("/fr/loicdelorme/followUpYourGarden/views/TypeOfPlantsForm.fxml")); Stage stage = new Stage(); stage.setScene(new Scene(loader.load())); TypeOfPlantsFormController controller = ...
void function() throws IOException { FXMLLoader loader = new FXMLLoader(this.getClass().getResource(STR)); Stage stage = new Stage(); stage.setScene(new Scene(loader.load())); TypeOfPlantsFormController controller = loader.getController(); controller.initializeData(null, this.followUpYourGardenServices.getTypeOfPlantsS...
/** * The on click add type of plants action. * * @throws IOException * If the file can't be opened. */
The on click add type of plants action
onAddTypeOfPlantsAction
{ "repo_name": "LoicDelorme/Follow-Up-Your-Garden", "path": "src/fr/loicdelorme/followUpYourGarden/controllers/TasksToBeCarryOutScheduleController.java", "license": "mit", "size": 21804 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,637,048
public static Date getEndDateOfMonth(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DAY_OF_MONTH, calendar.getMaximum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calenda...
static Date function(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DAY_OF_MONTH, calendar.getMaximum(Calendar.DAY_OF_MONTH)); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); calendar.set(Calendar.MILLI...
/** * Compute the date of the last day in the month of the specified date. * @param date the specified date. * @return a date for the last day of the month of the specified date. */
Compute the date of the last day in the month of the specified date
getEndDateOfMonth
{ "repo_name": "NicolasEYSSERIC/Silverpeas-Core", "path": "lib-core/src/main/java/com/stratelia/webactiv/util/DateUtil.java", "license": "agpl-3.0", "size": 25701 }
[ "java.util.Calendar", "java.util.Date" ]
import java.util.Calendar; import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
711,189
public void setComparator(TypeComparatorFactory<?> comparator, int id) { this.comparators[id] = comparator; } // --------------------------------------------------------------------------------------------
void function(TypeComparatorFactory<?> comparator, int id) { this.comparators[id] = comparator; }
/** * Sets the specified comparator for this PlanNode. * * @param comparator The comparator to set. * @param id The ID of the comparator to set. */
Sets the specified comparator for this PlanNode
setComparator
{ "repo_name": "jinglining/flink", "path": "flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/SingleInputPlanNode.java", "license": "apache-2.0", "size": 8434 }
[ "org.apache.flink.api.common.typeutils.TypeComparatorFactory" ]
import org.apache.flink.api.common.typeutils.TypeComparatorFactory;
import org.apache.flink.api.common.typeutils.*;
[ "org.apache.flink" ]
org.apache.flink;
1,791,551
private ConsumerRecord<K, V> parseRecord(TopicPartition partition, LogEntry logEntry) { Record record = logEntry.record(); if (this.checkCrcs) { try { record.ensureValid(); } catch (InvalidRecordException e) { throw new KafkaException("Record ...
ConsumerRecord<K, V> function(TopicPartition partition, LogEntry logEntry) { Record record = logEntry.record(); if (this.checkCrcs) { try { record.ensureValid(); } catch (InvalidRecordException e) { throw new KafkaException(STR + partition + STR + logEntry.offset() + STR + e.getMessage()); } } try { long offset = logEn...
/** * Parse the record entry, deserializing the key / value fields if necessary */
Parse the record entry, deserializing the key / value fields if necessary
parseRecord
{ "repo_name": "geeag/kafka", "path": "clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java", "license": "apache-2.0", "size": 47756 }
[ "java.nio.ByteBuffer", "java.util.List", "org.apache.kafka.clients.consumer.ConsumerRecord", "org.apache.kafka.common.KafkaException", "org.apache.kafka.common.TopicPartition", "org.apache.kafka.common.errors.SerializationException", "org.apache.kafka.common.record.InvalidRecordException", "org.apache...
import java.nio.ByteBuffer; import java.util.List; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.errors.SerializationException; import org.apache.kafka.common.record.InvalidRecordExcep...
import java.nio.*; import java.util.*; import org.apache.kafka.clients.consumer.*; import org.apache.kafka.common.*; import org.apache.kafka.common.errors.*; import org.apache.kafka.common.record.*; import org.apache.kafka.common.utils.*;
[ "java.nio", "java.util", "org.apache.kafka" ]
java.nio; java.util; org.apache.kafka;
1,648,587
void moveToVisualPosition(@Nonnull VisualPosition pos);
void moveToVisualPosition(@Nonnull VisualPosition pos);
/** * Moves the caret to the specified visual position. * * @param pos the position to move to. */
Moves the caret to the specified visual position
moveToVisualPosition
{ "repo_name": "consulo/consulo", "path": "modules/base/editor-ui-api/src/main/java/com/intellij/openapi/editor/Caret.java", "license": "apache-2.0", "size": 14019 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
2,349,865
public void renameSnapshot(String snapshotDir, String snapshotOldName, String snapshotNewName) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope("renameSnapshot")) { namenode.renameSnapshot(snapshotDir, snapshotOldName, snapshotNewName); } catch (RemoteException re) {...
void function(String snapshotDir, String snapshotOldName, String snapshotNewName) throws IOException { checkOpen(); try (TraceScope ignored = tracer.newScope(STR)) { namenode.renameSnapshot(snapshotDir, snapshotOldName, snapshotNewName); } catch (RemoteException re) { throw re.unwrapRemoteException(); } }
/** * Rename a snapshot. * @param snapshotDir The directory path where the snapshot was taken * @param snapshotOldName Old name of the snapshot * @param snapshotNewName New name of the snapshot * @throws IOException * @see ClientProtocol#renameSnapshot(String, String, String) */
Rename a snapshot
renameSnapshot
{ "repo_name": "aliyun-beta/aliyun-oss-hadoop-fs", "path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java", "license": "apache-2.0", "size": 108503 }
[ "java.io.IOException", "org.apache.hadoop.ipc.RemoteException", "org.apache.htrace.core.TraceScope" ]
import java.io.IOException; import org.apache.hadoop.ipc.RemoteException; import org.apache.htrace.core.TraceScope;
import java.io.*; import org.apache.hadoop.ipc.*; import org.apache.htrace.core.*;
[ "java.io", "org.apache.hadoop", "org.apache.htrace" ]
java.io; org.apache.hadoop; org.apache.htrace;
1,820,711
public int compare(Publication publication1, Publication publication2) { int EQUAL = 0; int BEFORE = -1; int AFTER = 1; if (publication1 == publication2){ return EQUAL; } else if (publication1 == null){ return AFTER; } else if...
int function(Publication publication1, Publication publication2) { int EQUAL = 0; int BEFORE = -1; int AFTER = 1; if (publication1 == publication2){ return EQUAL; } else if (publication1 == null){ return AFTER; } else if (publication2 == null){ return BEFORE; } else { int comp = publicationComparator.compare(publicatio...
/** * It uses a AbstractPublicationComparator to compares the bibliographic details and then will compare first the curation depth, then the source and then the released date. * * @param publication1 a {@link psidev.psi.mi.jami.model.Publication} object. * @param publication2 a {@link psidev.psi.mi....
It uses a AbstractPublicationComparator to compares the bibliographic details and then will compare first the curation depth, then the source and then the released date
compare
{ "repo_name": "MICommunity/psi-jami", "path": "jami-core/src/main/java/psidev/psi/mi/jami/utils/comparator/publication/CuratedPublicationComparator.java", "license": "apache-2.0", "size": 4334 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,319,203
@Test void testInitNegotiateSecurityFilterProvider() throws ServletException { final SimpleFilterConfig filterConfig = new SimpleFilterConfig(); filterConfig.setParameter("securityFilterProviders", "waffle.servlet.spi.NegotiateSecurityFilterProvider"); filterConfig.setParameter("waffle.s...
void testInitNegotiateSecurityFilterProvider() throws ServletException { final SimpleFilterConfig filterConfig = new SimpleFilterConfig(); filterConfig.setParameter(STR, STR); filterConfig.setParameter(STR, STR); this.filter.init(filterConfig); Assertions.assertEquals(this.filter.getPrincipalFormat(), PrincipalFormat.F...
/** * Test init negotiate security filter provider. * * @throws ServletException * the servlet exception */
Test init negotiate security filter provider
testInitNegotiateSecurityFilterProvider
{ "repo_name": "hazendaz/waffle", "path": "Source/JNA/waffle-tests/src/test/java/waffle/servlet/NegotiateSecurityFilterTest.java", "license": "mit", "size": 19878 }
[ "javax.servlet.ServletException", "org.junit.jupiter.api.Assertions" ]
import javax.servlet.ServletException; import org.junit.jupiter.api.Assertions;
import javax.servlet.*; import org.junit.jupiter.api.*;
[ "javax.servlet", "org.junit.jupiter" ]
javax.servlet; org.junit.jupiter;
801,360
@SafeHtmlTemplates.Template("<div name=\"{0}\" style=\"{1}\"><a href=\"javascript:;\">{2}</a></div>") SafeHtml cell(String name, SafeStyles styles, String value); } private static Templates templates = GWT.create(Templates.class); public TagListCell() { super("click", "keydown...
@SafeHtmlTemplates.Template(STR{0}\STR{1}\STRjavascript:;\STR) SafeHtml cell(String name, SafeStyles styles, String value); } private static Templates templates = GWT.create(Templates.class); public TagListCell() { super("click", STR); }
/** * The template for this Cell, which includes styles and a value. * * @param styles the styles to include in the style attribute of the div * @param value the safe value. Since the value type is {@link SafeHtml}, it will * not be escaped before including it in the ...
The template for this Cell, which includes styles and a value
cell
{ "repo_name": "justinhrobbins/FlashCards_App", "path": "FlashCards_UI/FlashCards_GWT/src/main/java/org/robbins/flashcards/client/ui/widgets/TagListCell.java", "license": "apache-2.0", "size": 4791 }
[ "com.google.gwt.core.client.GWT", "com.google.gwt.safecss.shared.SafeStyles", "com.google.gwt.safehtml.client.SafeHtmlTemplates", "com.google.gwt.safehtml.shared.SafeHtml" ]
import com.google.gwt.core.client.GWT; import com.google.gwt.safecss.shared.SafeStyles; import com.google.gwt.safehtml.client.SafeHtmlTemplates; import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.core.client.*; import com.google.gwt.safecss.shared.*; import com.google.gwt.safehtml.client.*; import com.google.gwt.safehtml.shared.*;
[ "com.google.gwt" ]
com.google.gwt;
2,123,095
public BigDecimal getPlannedAmt () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PlannedAmt); if (bd == null) return Env.ZERO; return bd; }
BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PlannedAmt); if (bd == null) return Env.ZERO; return bd; }
/** Get Planned Amount. @return Planned amount for this project */
Get Planned Amount
getPlannedAmt
{ "repo_name": "pplatek/adempiere", "path": "base/src/org/compiere/model/X_C_ProjectLine.java", "license": "gpl-2.0", "size": 15521 }
[ "java.math.BigDecimal", "org.compiere.util.Env" ]
import java.math.BigDecimal; import org.compiere.util.Env;
import java.math.*; import org.compiere.util.*;
[ "java.math", "org.compiere.util" ]
java.math; org.compiere.util;
36,752
protected void openConnection() { try { if (settings.isListenConnectorKind()) { logWriter.println("Accepting JDWP connection"); transport.accept(settings.getTimeout(), settings.getTimeout()); } else { String address = settings.get...
void function() { try { if (settings.isListenConnectorKind()) { logWriter.println(STR); transport.accept(settings.getTimeout(), settings.getTimeout()); } else { String address = settings.getTransportAddress(); logWriter.println(STR); transport.attach(address, settings.getTimeout(), settings.getTimeout()); } setConnecti...
/** * Opens connection with debuggee. */
Opens connection with debuggee
openConnection
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/jdktools/modules/jpda/src/test/java/org/apache/harmony/jpda/tests/jdwp/share/JDWPUnitDebuggeeWrapper.java", "license": "gpl-2.0", "size": 5640 }
[ "java.io.IOException", "org.apache.harmony.jpda.tests.framework.TestErrorException" ]
import java.io.IOException; import org.apache.harmony.jpda.tests.framework.TestErrorException;
import java.io.*; import org.apache.harmony.jpda.tests.framework.*;
[ "java.io", "org.apache.harmony" ]
java.io; org.apache.harmony;
848,682
public ResourceNameAvailabilityInner checkNameAvailability(String name, CheckNameResourceTypes type, Boolean isFqdn) { return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).toBlocking().single().body(); }
ResourceNameAvailabilityInner function(String name, CheckNameResourceTypes type, Boolean isFqdn) { return checkNameAvailabilityWithServiceResponseAsync(name, type, isFqdn).toBlocking().single().body(); }
/** * Check if a resource name is available. * Check if a resource name is available. * * @param name Resource name to verify. * @param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.We...
Check if a resource name is available. Check if a resource name is available
checkNameAvailability
{ "repo_name": "hovsepm/azure-sdk-for-java", "path": "appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java", "license": "mit", "size": 161895 }
[ "com.microsoft.azure.management.appservice.v2018_02_01.CheckNameResourceTypes" ]
import com.microsoft.azure.management.appservice.v2018_02_01.CheckNameResourceTypes;
import com.microsoft.azure.management.appservice.v2018_02_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
937,471
public byte lookup(Segment text, int offset, int length) { if(length == 0) return Token.NULL; Keyword k = map[getSegmentMapKey(text, offset, length)]; while(k != null) { if(length != k.keyword.length) { k = k.next; continue; } if(SyntaxUtilities.regionMatches(ignoreCase,text,offset, ...
byte function(Segment text, int offset, int length) { if(length == 0) return Token.NULL; Keyword k = map[getSegmentMapKey(text, offset, length)]; while(k != null) { if(length != k.keyword.length) { k = k.next; continue; } if(SyntaxUtilities.regionMatches(ignoreCase,text,offset, k.keyword)) return k.id; k = k.next; } re...
/** * Looks up a key. * @param text The text segment * @param offset The offset of the substring within the text segment * @param length The length of the substring */
Looks up a key
lookup
{ "repo_name": "NCIP/cagrid", "path": "cagrid/Software/core/caGrid/projects/introduce/src/java/Portal/gov/nih/nci/cagrid/introduce/portal/common/jedit/KeywordMap.java", "license": "bsd-3-clause", "size": 3384 }
[ "javax.swing.text.Segment" ]
import javax.swing.text.Segment;
import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
1,655,519
public static Logger createLogger(Class clazz) { return Logger.getInstance(clazz.getName()); }
static Logger function(Class clazz) { return Logger.getInstance(clazz.getName()); }
/** * Creates or returns the instance of a Logger for the given class. */
Creates or returns the instance of a Logger for the given class
createLogger
{ "repo_name": "consulo/consulo-sql", "path": "src/com/dci/intellij/dbn/common/LoggerFactory.java", "license": "apache-2.0", "size": 2087 }
[ "com.intellij.openapi.diagnostic.Logger" ]
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.diagnostic.*;
[ "com.intellij.openapi" ]
com.intellij.openapi;
2,879,739
protected void encodeBufferSuffix(OutputStream a) throws IOException { super.pStream.println(" \nend"); super.pStream.flush(); }
void function(OutputStream a) throws IOException { super.pStream.println(STR); super.pStream.flush(); }
/** * encodeBufferSuffix writes the single line containing space (' ') and * the line containing the word 'end' to the output stream. */
encodeBufferSuffix writes the single line containing space (' ') and the line containing the word 'end' to the output stream
encodeBufferSuffix
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/sun/misc/UUEncoder.java", "license": "mit", "size": 6512 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,572,291
private void createTableViewer() { tableViewer = new TableViewer( table ); tableViewer.setUseHashlookup( true ); //following is if we want default sorting... my thought is no... }
void function() { tableViewer = new TableViewer( table ); tableViewer.setUseHashlookup( true ); }
/** * Create the viewer. */
Create the viewer
createTableViewer
{ "repo_name": "pkman/droolsjbpm-tools", "path": "drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/dsl/editor/DSLEditor.java", "license": "apache-2.0", "size": 25212 }
[ "org.eclipse.jface.viewers.TableViewer" ]
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,188,697
public void addPropertyChangeListener(PropertyChangeListener listener) { this.propertyChangeSupport.addPropertyChangeListener(listener); }
void function(PropertyChangeListener listener) { this.propertyChangeSupport.addPropertyChangeListener(listener); }
/** * Add the given listener * @param listener * the listener to add */
Add the given listener
addPropertyChangeListener
{ "repo_name": "cgd/data-plots", "path": "src/java/org/jax/analyticgraph/graph/AxisDescription.java", "license": "gpl-3.0", "size": 9401 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
778,837
@Test @MediumTest public void testInvalidMinidumpNameGeneratesNoUploads() throws IOException { MinidumpUploadJob minidumpUploadJob = new ExpectNoUploadsMinidumpUploadJobImpl(mTestRule.getExistingCacheDir()); // Note the omitted ".try0" suffix. File fileUsingLegacyNam...
void function() throws IOException { MinidumpUploadJob minidumpUploadJob = new ExpectNoUploadsMinidumpUploadJobImpl(mTestRule.getExistingCacheDir()); File fileUsingLegacyNamingScheme = createMinidumpFileInCrashDir(STR); MinidumpUploadTestUtility.uploadMinidumpsSync( minidumpUploadJob, false ); Assert.assertTrue(fileUsi...
/** * Prior to M60, the ".try0" suffix was optional; however now it is not. This test verifies that * the code rejects minidumps that lack this suffix. */
Prior to M60, the ".try0" suffix was optional; however now it is not. This test verifies that the code rejects minidumps that lack this suffix
testInvalidMinidumpNameGeneratesNoUploads
{ "repo_name": "scheib/chromium", "path": "components/minidump_uploader/android/javatests/src/org/chromium/components/minidump_uploader/MinidumpUploadJobImplTest.java", "license": "bsd-3-clause", "size": 17934 }
[ "java.io.File", "java.io.IOException", "org.junit.Assert" ]
import java.io.File; import java.io.IOException; import org.junit.Assert;
import java.io.*; import org.junit.*;
[ "java.io", "org.junit" ]
java.io; org.junit;
1,957,329
public void setWorkListener(WorkListener workListener) { this.workListener = workListener; } /** * Specify a custom {@link TaskDecorator} to be applied to any {@link Runnable}
void function(WorkListener workListener) { this.workListener = workListener; } /** * Specify a custom {@link TaskDecorator} to be applied to any {@link Runnable}
/** * Specify a JCA WorkListener to apply, if any. * <p>This shared WorkListener instance will be passed on to the * WorkManager by all {@link #execute} calls on this TaskExecutor. */
Specify a JCA WorkListener to apply, if any. This shared WorkListener instance will be passed on to the WorkManager by all <code>#execute</code> calls on this TaskExecutor
setWorkListener
{ "repo_name": "boggad/jdk9-sample", "path": "sample-catalog/spring-jdk9/src/spring.tx/org/springframework/jca/work/WorkManagerTaskExecutor.java", "license": "mit", "size": 11008 }
[ "javax.resource.spi.work.WorkListener", "org.springframework.core.task.TaskDecorator" ]
import javax.resource.spi.work.WorkListener; import org.springframework.core.task.TaskDecorator;
import javax.resource.spi.work.*; import org.springframework.core.task.*;
[ "javax.resource", "org.springframework.core" ]
javax.resource; org.springframework.core;
1,489,915
YangElement.setPackage(NAMESPACE, "ietfInetTypes"); Inet.registerSchema(); }
YangElement.setPackage(NAMESPACE, STR); Inet.registerSchema(); }
/** * Enable the elements in this namespace to be aware * of the data model and use the generated classes. */
Enable the elements in this namespace to be aware of the data model and use the generated classes
enable
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/ietfInetTypes/Inet.java", "license": "apache-2.0", "size": 1548 }
[ "com.tailf.jnc.YangElement" ]
import com.tailf.jnc.YangElement;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
911,068
public static ArrayList<Instruction> recompileHopsDag( StatementBlock sb, ArrayList<Hop> hops, LocalVariableMap vars, RecompileStatus status, boolean inplace, boolean litreplace, long tid ) throws DMLRuntimeException, HopsException, LopsException, IOException { ArrayList<Instruction> newInst = null; //n...
static ArrayList<Instruction> function( StatementBlock sb, ArrayList<Hop> hops, LocalVariableMap vars, RecompileStatus status, boolean inplace, boolean litreplace, long tid ) throws DMLRuntimeException, HopsException, LopsException, IOException { ArrayList<Instruction> newInst = null; synchronized( hops ) { LOG.debug (...
/** * A) Recompile basic program block hop DAG. * * We support to basic types inplace or via deep copy. Deep copy is the default and is required * in order to apply non-reversible rewrites. In-place is required in order to modify the existing * hops (e.g., for parfor pre-recompilation). * * @param sb ...
A) Recompile basic program block hop DAG. We support to basic types inplace or via deep copy. Deep copy is the default and is required in order to apply non-reversible rewrites. In-place is required in order to modify the existing hops (e.g., for parfor pre-recompilation)
recompileHopsDag
{ "repo_name": "akchinSTC/systemml", "path": "src/main/java/org/apache/sysml/hops/recompile/Recompiler.java", "license": "apache-2.0", "size": 69607 }
[ "java.io.IOException", "java.util.ArrayList", "org.apache.sysml.api.DMLScript", "org.apache.sysml.conf.ConfigurationManager", "org.apache.sysml.conf.DMLConfig", "org.apache.sysml.hops.Hop", "org.apache.sysml.hops.HopsException", "org.apache.sysml.hops.MemoTable", "org.apache.sysml.hops.OptimizerUtil...
import java.io.IOException; import java.util.ArrayList; import org.apache.sysml.api.DMLScript; import org.apache.sysml.conf.ConfigurationManager; import org.apache.sysml.conf.DMLConfig; import org.apache.sysml.hops.Hop; import org.apache.sysml.hops.HopsException; import org.apache.sysml.hops.MemoTable; import org.apach...
import java.io.*; import java.util.*; import org.apache.sysml.api.*; import org.apache.sysml.conf.*; import org.apache.sysml.hops.*; import org.apache.sysml.hops.codegen.*; import org.apache.sysml.lops.*; import org.apache.sysml.lops.compile.*; import org.apache.sysml.parser.*; import org.apache.sysml.runtime.*; import...
[ "java.io", "java.util", "org.apache.sysml" ]
java.io; java.util; org.apache.sysml;
2,455,746
private void updateRestoreStateOnMaster(final UpdateIndexShardRestoreStatusRequest request) { logger.trace("received updated snapshot restore state [{}]", request); updatedSnapshotStateQueue.add(request); clusterService.submitStateUpdateTask("update snapshot state", new ClusterStateUpdateTa...
void function(final UpdateIndexShardRestoreStatusRequest request) { logger.trace(STR, request); updatedSnapshotStateQueue.add(request); clusterService.submitStateUpdateTask(STR, new ClusterStateUpdateTask() { private final List<UpdateIndexShardRestoreStatusRequest> drainedRequests = new ArrayList<>(); private Map<Snaps...
/** * Updates shard restore record in the cluster state. * * @param request update shard status request */
Updates shard restore record in the cluster state
updateRestoreStateOnMaster
{ "repo_name": "episerver/elasticsearch", "path": "core/src/main/java/org/elasticsearch/snapshots/RestoreService.java", "license": "apache-2.0", "size": 53820 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map", "org.elasticsearch.cluster.ClusterStateUpdateTask", "org.elasticsearch.cluster.RestoreInProgress", "org.elasticsearch.cluster.metadata.SnapshotId", "org.elasticsearch.common.collect.ImmutableOpenMap", "org.elasticsearch.common.collect.Tuple", ...
import java.util.ArrayList; import java.util.List; import java.util.Map; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.RestoreInProgress; import org.elasticsearch.cluster.metadata.SnapshotId; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.c...
import java.util.*; import org.elasticsearch.cluster.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.common.collect.*; import org.elasticsearch.index.shard.*;
[ "java.util", "org.elasticsearch.cluster", "org.elasticsearch.common", "org.elasticsearch.index" ]
java.util; org.elasticsearch.cluster; org.elasticsearch.common; org.elasticsearch.index;
1,526,197
@Generated @Selector("cancelTunnelWithError:") public native void cancelTunnelWithError(NSError error);
@Selector(STR) native void function(NSError error);
/** * cancelTunnelWithError: * <p> * This function is called by tunnel provider implementations to initiate tunnel destruction when a network error is encountered that renders the tunnel no longer viable. Subclasses should not override this method. * * @param error An NSError object containing ...
cancelTunnelWithError: This function is called by tunnel provider implementations to initiate tunnel destruction when a network error is encountered that renders the tunnel no longer viable. Subclasses should not override this method
cancelTunnelWithError
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/networkextension/NEPacketTunnelProvider.java", "license": "apache-2.0", "size": 10784 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
1,447,866
public static boolean isAuthenticated() { SecurityContext securityContext = SecurityContextHolder.getContext(); Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); if (authorities != null) { for (GrantedAuthority authority : ...
static boolean function() { SecurityContext securityContext = SecurityContextHolder.getContext(); Collection<? extends GrantedAuthority> authorities = securityContext.getAuthentication().getAuthorities(); if (authorities != null) { for (GrantedAuthority authority : authorities) { if (authority.getAuthority().equals(Aut...
/** * Check if a user is authenticated. * * @return true if the user is authenticated, false otherwise */
Check if a user is authenticated
isAuthenticated
{ "repo_name": "ludo1026/telosys-tools-saas", "path": "src/main/java/org/telosystools/saas/security/SecurityUtils.java", "license": "gpl-3.0", "size": 2643 }
[ "java.util.Collection", "org.springframework.security.core.GrantedAuthority", "org.springframework.security.core.context.SecurityContext", "org.springframework.security.core.context.SecurityContextHolder" ]
import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder;
import java.util.*; import org.springframework.security.core.*; import org.springframework.security.core.context.*;
[ "java.util", "org.springframework.security" ]
java.util; org.springframework.security;
2,466,288
String getNodeAttr(final Node node, final String name) { final Node attr = node.getAttributes().getNamedItem(name); if (attr == null || attr.getNodeValue().isEmpty()) { throw new SbToolsRuntimeException(node.getNodeName() + " has no attribute " + name + " or it is empty"); } ...
String getNodeAttr(final Node node, final String name) { final Node attr = node.getAttributes().getNamedItem(name); if (attr == null attr.getNodeValue().isEmpty()) { throw new SbToolsRuntimeException(node.getNodeName() + STR + name + STR); } return attr.getNodeValue(); }
/** * Get an attribute of a DOM node. * * @param node - the node to process * @param name - the name of the attribute to fetch * * @return The value of the attribute * * @throws SbToolsRuntimeException if the node does not contain the attribute or if the attribute * is ...
Get an attribute of a DOM node
getNodeAttr
{ "repo_name": "selfbus/tools-libraries", "path": "sbtools-common-gui/src/main/java/org/selfbus/sbtools/common/gui/window/XmlToolBarFactory.java", "license": "gpl-3.0", "size": 5211 }
[ "org.selfbus.sbtools.common.gui.misc.SbToolsRuntimeException", "org.w3c.dom.Node" ]
import org.selfbus.sbtools.common.gui.misc.SbToolsRuntimeException; import org.w3c.dom.Node;
import org.selfbus.sbtools.common.gui.misc.*; import org.w3c.dom.*;
[ "org.selfbus.sbtools", "org.w3c.dom" ]
org.selfbus.sbtools; org.w3c.dom;
388,400
protected Collection getEdges_internal() { HashSet edges = new HashSet(); Collection inEdgeSets = getPredsToInEdges().values(); Collection outEdgeSets = getSuccsToOutEdges().values(); for (Iterator e_iter = inEdgeSets.iterator(); e_iter.hasNext(); ) edges.addAll...
Collection function() { HashSet edges = new HashSet(); Collection inEdgeSets = getPredsToInEdges().values(); Collection outEdgeSets = getSuccsToOutEdges().values(); for (Iterator e_iter = inEdgeSets.iterator(); e_iter.hasNext(); ) edges.addAll((Set)e_iter.next()); for (Iterator e_iter = outEdgeSets.iterator(); e_iter.h...
/** * Returns a list of all incident edges of this vertex. * Requires time proportional to the number of incident edges. * * @see AbstractSparseVertex#getEdges_internal() */
Returns a list of all incident edges of this vertex. Requires time proportional to the number of incident edges
getEdges_internal
{ "repo_name": "markus1978/clickwatch", "path": "external/edu.uci.ics.jung/src/edu/uci/ics/jung/graph/impl/DirectedSparseVertex.java", "license": "apache-2.0", "size": 5947 }
[ "java.util.Collection", "java.util.HashSet", "java.util.Iterator", "java.util.Set" ]
import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,591,985
static HashMap<String, SettingSection> readFile(final File ini, boolean isCustomGame, SettingsActivityView view) { HashMap<String, SettingSection> sections = new Settings.SettingsSectionMap(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(ini)); ...
static HashMap<String, SettingSection> readFile(final File ini, boolean isCustomGame, SettingsActivityView view) { HashMap<String, SettingSection> sections = new Settings.SettingsSectionMap(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(ini)); SettingSection current = null; for (Strin...
/** * Reads a given .ini file from disk and returns it as a HashMap of Settings, themselves * effectively a HashMap of key/value settings. If unsuccessful, outputs an error telling why it * failed. * * @param ini The ini file to load the settings from * @param view The current view. */
Reads a given .ini file from disk and returns it as a HashMap of Settings, themselves effectively a HashMap of key/value settings. If unsuccessful, outputs an error telling why it failed
readFile
{ "repo_name": "JonnyH/dolphin", "path": "Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java", "license": "gpl-2.0", "size": 31143 }
[ "java.io.BufferedReader", "java.io.File", "java.io.FileNotFoundException", "java.io.FileReader", "java.io.IOException", "java.util.HashMap", "org.dolphinemu.dolphinemu.features.settings.model.Setting", "org.dolphinemu.dolphinemu.features.settings.model.SettingSection", "org.dolphinemu.dolphinemu.fea...
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import org.dolphinemu.dolphinemu.features.settings.model.Setting; import org.dolphinemu.dolphinemu.features.settings.model.SettingSection; import org...
import java.io.*; import java.util.*; import org.dolphinemu.dolphinemu.features.settings.model.*; import org.dolphinemu.dolphinemu.features.settings.ui.*; import org.dolphinemu.dolphinemu.utils.*;
[ "java.io", "java.util", "org.dolphinemu.dolphinemu" ]
java.io; java.util; org.dolphinemu.dolphinemu;
523,723
public static void initLibraries(HashMap<String, String[]> libraries) { libraries.put("mockup", new String[] { SHAPES_PATH + "/mockup/mxMockupButtons.js" }); libraries.put("arrows2", new String[] { SHAPES_PATH + "/mxArrows.js" }); libraries.put("bpmn", new String[] { SHAPES_PATH + "/bpmn/mxBpmnShape2....
static void function(HashMap<String, String[]> libraries) { libraries.put(STR, new String[] { SHAPES_PATH + STR }); libraries.put(STR, new String[] { SHAPES_PATH + STR }); libraries.put("bpmn", new String[] { SHAPES_PATH + STR, STENCIL_PATH + STR }); libraries.put("er", new String[] { SHAPES_PATH + STR }); libraries.pu...
/** * Sets up collection of stencils */
Sets up collection of stencils
initLibraries
{ "repo_name": "jgraph/drawio", "path": "src/main/java/com/mxgraph/online/EmbedServlet2.java", "license": "apache-2.0", "size": 13757 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,892,157
private ValidationResult validateParameterInteger(Map<String,String> properties) { String val = properties.get(PARAMETER_NAME_INTEGER); int intValue = -1; try { checkInteger(val); } catch (NumberFormatException nfe) { return new MyValidationResult(false, "...
ValidationResult function(Map<String,String> properties) { String val = properties.get(PARAMETER_NAME_INTEGER); int intValue = -1; try { checkInteger(val); } catch (NumberFormatException nfe) { return new MyValidationResult(false, STR); } return ValidationResult.SUCCESS; }
/** * Validates the parameter Integer. * * @param properties the view instance parameters * @return the validation result */
Validates the parameter Integer
validateParameterInteger
{ "repo_name": "arenadata/ambari", "path": "ambari-views/examples/property-validator-view/src/main/java/org/apache/ambari/view/property/MyValidator.java", "license": "apache-2.0", "size": 7937 }
[ "java.util.Map", "org.apache.ambari.view.validation.ValidationResult" ]
import java.util.Map; import org.apache.ambari.view.validation.ValidationResult;
import java.util.*; import org.apache.ambari.view.validation.*;
[ "java.util", "org.apache.ambari" ]
java.util; org.apache.ambari;
207,927
public void setName(final String name) throws CouldntSaveDataException { Preconditions.checkNotNull(name, "IE00049: Name argument can not be null"); if (m_name.equals(name)) { return; } m_provider.setName(m_addressSpace, name); m_name = name; for (final IAddressSpaceConfigurationList...
void function(final String name) throws CouldntSaveDataException { Preconditions.checkNotNull(name, STR); if (m_name.equals(name)) { return; } m_provider.setName(m_addressSpace, name); m_name = name; for (final IAddressSpaceConfigurationListener listener : m_listeners) { try { listener.changedName(m_addressSpace, name)...
/** * Sets the name of the address space. * * @param name The new name of the address space. * * @throws CouldntSaveDataException Thrown if the new name could not be written to the database. */
Sets the name of the address space
setName
{ "repo_name": "google/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/disassembly/AddressSpaces/CAddressSpaceConfiguration.java", "license": "apache-2.0", "size": 10654 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.binnavi.CUtilityFunctions", "com.google.security.zynamics.binnavi.Database" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.CUtilityFunctions; import com.google.security.zynamics.binnavi.Database;
import com.google.common.base.*; import com.google.security.zynamics.binnavi.*;
[ "com.google.common", "com.google.security" ]
com.google.common; com.google.security;
2,134,975
public void considerCandidatePlan(CompiledPlan plan, AbstractParsedStmt parsedStmt) { //System.out.println(String.format("[Raw plan]:%n%s", rawplan.rootPlanGraph.toExplainPlanString())); // run the set of microptimizations, which may return many plans (or not) ScanDeterminizer.apply(plan, m...
void function(CompiledPlan plan, AbstractParsedStmt parsedStmt) { ScanDeterminizer.apply(plan, m_detMode); plan.sql = m_sql; m_stats = new PlanStatistics(); AbstractPlanNode planGraph = plan.rootPlanGraph; planGraph.computeEstimatesRecursively(m_stats, m_cluster, m_db, m_estimates, m_paramHints); plan.cost = m_costMode...
/** Picks the best cost plan for a given raw plan * @param rawplan */
Picks the best cost plan for a given raw plan
considerCandidatePlan
{ "repo_name": "zheguang/voltdb", "path": "src/frontend/org/voltdb/planner/PlanSelector.java", "license": "agpl-3.0", "size": 12115 }
[ "org.voltdb.plannodes.AbstractPlanNode" ]
import org.voltdb.plannodes.AbstractPlanNode;
import org.voltdb.plannodes.*;
[ "org.voltdb.plannodes" ]
org.voltdb.plannodes;
440,327
public static void cleanup() { for (String temp : files) { new File(temp).delete(); } // Cleaning up the files list files.clear(); }
static void function() { for (String temp : files) { new File(temp).delete(); } files.clear(); }
/** * This method is used to cleanup all the files already downloaded */
This method is used to cleanup all the files already downloaded
cleanup
{ "repo_name": "mengchen2/SeLion_Demo", "path": "server/src/main/java/com/paypal/selion/utils/FileDownloader.java", "license": "apache-2.0", "size": 13183 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,536,720
@Nonnull public static String getPackageName(@Nullable Class<?> cls) { if (cls == null) { return EMPTY_STRING; } return getPackageName(cls.getName()); }
static String function(@Nullable Class<?> cls) { if (cls == null) { return EMPTY_STRING; } return getPackageName(cls.getName()); }
/** * <p>Gets the package name of a <code>Class</code>.</p> * * @param cls the class to get the package name for, may be <code>null</code>. * @return the package name or an empty string */
Gets the package name of a <code>Class</code>
getPackageName
{ "repo_name": "levymoreira/griffon", "path": "subprojects/griffon-core/src/main/java/griffon/util/GriffonClassUtils.java", "license": "apache-2.0", "size": 129659 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
235,230
public void showPage(int pagenum) { pageShown(pagenum); SwingUtilities.invokeLater(new GotoLater(pagenum)); } class GotoLater implements Runnable { int page; public GotoLater(int pagenum) { page = pagenum; }
void function(int pagenum) { pageShown(pagenum); SwingUtilities.invokeLater(new GotoLater(pagenum)); } class GotoLater implements Runnable { int page; public GotoLater(int pagenum) { page = pagenum; }
/** * Notifies the listeners that a page has been selected. Performs * the notification in the AWT thread. * Also highlights the selected page. Does this first so that feedback * is immediate. */
Notifies the listeners that a page has been selected. Performs the notification in the AWT thread. Also highlights the selected page. Does this first so that feedback is immediate
showPage
{ "repo_name": "HarmonyEnterpriseSolutions/harmony-platform", "path": "java/src/com/sun/pdfview/ThumbPanel.java", "license": "gpl-2.0", "size": 12748 }
[ "javax.swing.SwingUtilities" ]
import javax.swing.SwingUtilities;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
867,079
public LabelBuilder bold() { label.setFont(label.getFont().deriveFont(Font.BOLD)); return this; }
LabelBuilder function() { label.setFont(label.getFont().deriveFont(Font.BOLD)); return this; }
/** * Make the label font bold. */
Make the label font bold
bold
{ "repo_name": "jonestimd/swing-extensions", "path": "src/main/java/io/github/jonestimd/swing/LabelBuilder.java", "license": "mit", "size": 4709 }
[ "java.awt.Font" ]
import java.awt.Font;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,119,116
public static Network findFirstHostNetwork(HostSystem host) { Network network = null; Network[] networks = null; if (host != null) { try { networks = host.getNetworks(); if (networks != null && networks.length > 0) { network = networks[0]; LOGGER.info("Network found : " + network.getName()...
static Network function(HostSystem host) { Network network = null; Network[] networks = null; if (host != null) { try { networks = host.getNetworks(); if (networks != null && networks.length > 0) { network = networks[0]; LOGGER.info(STR + network.getName()); } } catch (RemoteException ex) { LOGGER.error(STR + host.getN...
/** * Find the first Host network. */
Find the first Host network
findFirstHostNetwork
{ "repo_name": "occiware/Multi-Cloud-Studio", "path": "plugins/org.eclipse.cmf.occi.multicloud.vmware.connector/src/org/ecplise/cmf/occi/multicloud/vmware/connector/driver/HostHelper.java", "license": "epl-1.0", "size": 4466 }
[ "com.vmware.vim25.mo.HostSystem", "com.vmware.vim25.mo.Network", "java.rmi.RemoteException" ]
import com.vmware.vim25.mo.HostSystem; import com.vmware.vim25.mo.Network; import java.rmi.RemoteException;
import com.vmware.vim25.mo.*; import java.rmi.*;
[ "com.vmware.vim25", "java.rmi" ]
com.vmware.vim25; java.rmi;
303,743
public static String createHash(String password) throws NoSuchAlgorithmException, InvalidKeySpecException { return createHash(password.toCharArray()); }
static String function(String password) throws NoSuchAlgorithmException, InvalidKeySpecException { return createHash(password.toCharArray()); }
/** * Returns a salted PBKDF2 hash of the password. * * @param password * the password to hash * @return a salted PBKDF2 hash of the password */
Returns a salted PBKDF2 hash of the password
createHash
{ "repo_name": "machadolucas/watchout", "path": "src/main/java/com/riskvis/util/PasswordHash.java", "license": "apache-2.0", "size": 5316 }
[ "java.security.NoSuchAlgorithmException", "java.security.spec.InvalidKeySpecException" ]
import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException;
import java.security.*; import java.security.spec.*;
[ "java.security" ]
java.security;
74,661
public void registerCommand(String command) { holder.put(command, new AtomicReference<BroadcastStatus>(BroadcastStatus.Idle)); }
void function(String command) { holder.put(command, new AtomicReference<BroadcastStatus>(BroadcastStatus.Idle)); }
/** * Maps a command to a broadcast status. */
Maps a command to a broadcast status
registerCommand
{ "repo_name": "deleidos/digitaledge-platform", "path": "commons-core/src/main/java/com/deleidos/rtws/commons/net/listener/executor/BroadcastStatusMap.java", "license": "apache-2.0", "size": 14331 }
[ "com.deleidos.rtws.commons.net.listener.common.BroadcastStatus", "java.util.concurrent.atomic.AtomicReference" ]
import com.deleidos.rtws.commons.net.listener.common.BroadcastStatus; import java.util.concurrent.atomic.AtomicReference;
import com.deleidos.rtws.commons.net.listener.common.*; import java.util.concurrent.atomic.*;
[ "com.deleidos.rtws", "java.util" ]
com.deleidos.rtws; java.util;
2,573,330
@Test public void Broken_testSync() throws Exception { TableName tableName = TableName.valueOf(currentTest.getMethodName()); MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl(1); // First verify that using streams all works. Path p = new Path(dir, currentTest.getMethodName() +...
void function() throws Exception { TableName tableName = TableName.valueOf(currentTest.getMethodName()); MultiVersionConcurrencyControl mvcc = new MultiVersionConcurrencyControl(1); Path p = new Path(dir, currentTest.getMethodName() + STR); FSDataOutputStream out = fs.create(p); out.write(tableName.getName()); Method s...
/** * Test new HDFS-265 sync. * @throws Exception */
Test new HDFS-265 sync
Broken_testSync
{ "repo_name": "mahak/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALFactory.java", "license": "apache-2.0", "size": 36493 }
[ "java.lang.reflect.Method", "java.util.NavigableMap", "java.util.TreeMap", "org.apache.hadoop.fs.FSDataInputStream", "org.apache.hadoop.fs.FSDataOutputStream", "org.apache.hadoop.fs.Path", "org.apache.hadoop.hbase.KeyValue", "org.apache.hadoop.hbase.TableName", "org.apache.hadoop.hbase.client.Region...
import java.lang.reflect.Method; import java.util.NavigableMap; import java.util.TreeMap; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.TableName; import org.apache....
import java.lang.reflect.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.util.*; import org.junit.*;
[ "java.lang", "java.util", "org.apache.hadoop", "org.junit" ]
java.lang; java.util; org.apache.hadoop; org.junit;
1,421,423
private static void fillInGOOGLEDRIVESecuritySpecificationMap(Map<String, Object> newMap, Specification ds) { List<Map<String,String>> accessTokenList = new ArrayList<Map<String,String>>(); for (int i = 0; i < ds.getChildCount(); i++) { SpecificationNode sn = ds.getChild(i); if (sn.getType().equal...
static void function(Map<String, Object> newMap, Specification ds) { List<Map<String,String>> accessTokenList = new ArrayList<Map<String,String>>(); for (int i = 0; i < ds.getChildCount(); i++) { SpecificationNode sn = ds.getChild(i); if (sn.getType().equals(JOB_ACCESS_NODE_TYPE)) { String token = sn.getAttributeValue(...
/** * Fill in specification Velocity parameter map for GOOGLEDRIVESecurity tab. */
Fill in specification Velocity parameter map for GOOGLEDRIVESecurity tab
fillInGOOGLEDRIVESecuritySpecificationMap
{ "repo_name": "kishorejangid/manifoldcf", "path": "connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java", "license": "apache-2.0", "size": 59614 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map", "org.apache.manifoldcf.core.interfaces.Specification", "org.apache.manifoldcf.core.interfaces.SpecificationNode" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.manifoldcf.core.interfaces.Specification; import org.apache.manifoldcf.core.interfaces.SpecificationNode;
import java.util.*; import org.apache.manifoldcf.core.interfaces.*;
[ "java.util", "org.apache.manifoldcf" ]
java.util; org.apache.manifoldcf;
240,170
@Pointcut("if()") public static boolean isConfigEnabled() { if (!isSet) { String config = System.getProperty(APIConstants.ENABLE_CORRELATION_LOGS); if (StringUtils.isNotEmpty(config)) { isEnabled = Boolean.parseBoolean(config); isSet = true; ...
@Pointcut("if()") static boolean function() { if (!isSet) { String config = System.getProperty(APIConstants.ENABLE_CORRELATION_LOGS); if (StringUtils.isNotEmpty(config)) { isEnabled = Boolean.parseBoolean(config); isSet = true; } } return isEnabled; }
/** * This pointcut looks for the system property to enable/ disable timing logs * * @return true if the property value is given as true */
This pointcut looks for the system property to enable/ disable timing logs
isConfigEnabled
{ "repo_name": "ruks/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.cleanup.service/src/main/java/org/wso2/carbon/apimgt/cleanup/service/MethodTimeLogger.java", "license": "apache-2.0", "size": 4917 }
[ "org.apache.commons.lang3.StringUtils", "org.aspectj.lang.annotation.Pointcut", "org.wso2.carbon.apimgt.impl.APIConstants" ]
import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.annotation.Pointcut; import org.wso2.carbon.apimgt.impl.APIConstants;
import org.apache.commons.lang3.*; import org.aspectj.lang.annotation.*; import org.wso2.carbon.apimgt.impl.*;
[ "org.apache.commons", "org.aspectj.lang", "org.wso2.carbon" ]
org.apache.commons; org.aspectj.lang; org.wso2.carbon;
1,348,221
public static <K, V> BinaryFunction<K, Map<K, V>, V> getMapValueFrom( Map<K, V> rMap) { return Functions.swapParams(new GetMapValue<K, V>(null), rMap); }
static <K, V> BinaryFunction<K, Map<K, V>, V> function( Map<K, V> rMap) { return Functions.swapParams(new GetMapValue<K, V>(null), rMap); }
/*************************************** * Returns a new function instance that returns a value from a certain map. * The key of the value to return will be the (left) input parameter of the * returned function. This is the swapped parameter version of the function * returned by {@link #getMapValue(Object)}. ...
Returns a new function instance that returns a value from a certain map. The key of the value to return will be the (left) input parameter of the returned function. This is the swapped parameter version of the function returned by <code>#getMapValue(Object)</code>
getMapValueFrom
{ "repo_name": "esoco/objectrelations", "path": "src/main/java/de/esoco/lib/expression/CollectionFunctions.java", "license": "apache-2.0", "size": 19051 }
[ "de.esoco.lib.expression.function.GetElement", "java.util.Map" ]
import de.esoco.lib.expression.function.GetElement; import java.util.Map;
import de.esoco.lib.expression.function.*; import java.util.*;
[ "de.esoco.lib", "java.util" ]
de.esoco.lib; java.util;
2,057,409
@Override public void setProjectAttributes(List<Attribute> attributes) { List<AttributeViewImpl> attributeWidgets = Lists.newArrayList(); for (Attribute attribute : attributes) { attributeWidgets.add(createAttributeWidget(attribute)); }
void function(List<Attribute> attributes) { List<AttributeViewImpl> attributeWidgets = Lists.newArrayList(); for (Attribute attribute : attributes) { attributeWidgets.add(createAttributeWidget(attribute)); }
/** * Updates the UI to display the given set of Attributes. */
Updates the UI to display the given set of Attributes
setProjectAttributes
{ "repo_name": "rodion-goritskov/test-analytics-ng", "path": "src/main/java/com/google/testing/testify/risk/frontend/client/view/impl/AttributesViewImpl.java", "license": "apache-2.0", "size": 7648 }
[ "com.google.common.collect.Lists", "com.google.testing.testify.risk.frontend.model.Attribute", "java.util.List" ]
import com.google.common.collect.Lists; import com.google.testing.testify.risk.frontend.model.Attribute; import java.util.List;
import com.google.common.collect.*; import com.google.testing.testify.risk.frontend.model.*; import java.util.*;
[ "com.google.common", "com.google.testing", "java.util" ]
com.google.common; com.google.testing; java.util;
93,033
protected Value eval(Env env, Value qThis, StringValue methodName, int hashCode, Expr []argExprs) { Value []args = evalArgs(env, argExprs); env.pushCall(this, qThis, args); try { env.checkTimeout(); return qThis.callMethod(env, methodName, has...
Value function(Env env, Value qThis, StringValue methodName, int hashCode, Expr []argExprs) { Value []args = evalArgs(env, argExprs); env.pushCall(this, qThis, args); try { env.checkTimeout(); return qThis.callMethod(env, methodName, hashCode, args); } finally { env.popCall(); } }
/** * Evaluates the expression. * * @param env the calling environment. * * @return the expression value. */
Evaluates the expression
eval
{ "repo_name": "dwango/quercus", "path": "src/main/java/com/caucho/quercus/expr/AbstractMethodExpr.java", "license": "gpl-2.0", "size": 2566 }
[ "com.caucho.quercus.env.Env", "com.caucho.quercus.env.StringValue", "com.caucho.quercus.env.Value" ]
import com.caucho.quercus.env.Env; import com.caucho.quercus.env.StringValue; import com.caucho.quercus.env.Value;
import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
1,073,163
public void testParseClassPathUnix() throws Exception { assumeTrue("test is designed for unix-like systems only", ":".equals(System.getProperty("path.separator"))); assumeTrue("test is designed for unix-like systems only", "/".equals(System.getProperty("file.separator"))); Path element1 = c...
void function() throws Exception { assumeTrue(STR, ":".equals(System.getProperty(STR))); assumeTrue(STR, "/".equals(System.getProperty(STR))); Path element1 = createTempDir(); Path element2 = createTempDir(); URL expected[] = { element1.toUri().toURL(), element2.toUri().toURL() }; assertArrayEquals(expected, JarHell.pa...
/** * Parse a simple classpath with two elements on unix */
Parse a simple classpath with two elements on unix
testParseClassPathUnix
{ "repo_name": "wbowling/elasticsearch", "path": "core/src/test/java/org/elasticsearch/bootstrap/JarHellTests.java", "license": "apache-2.0", "size": 15785 }
[ "java.nio.file.Path" ]
import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
1,355,015
public static File createAgentFile( final String p_agentname ) throws IOException { if ( ( p_agentname == null ) || ( p_agentname.isEmpty() ) ) throw new IllegalArgumentException( CCommon.getResourceString( IEnvironment.class, "aslempty" ) ); final File l_asl = CConfiguration.getIns...
static File function( final String p_agentname ) throws IOException { if ( ( p_agentname == null ) ( p_agentname.isEmpty() ) ) throw new IllegalArgumentException( CCommon.getResourceString( IEnvironment.class, STR ) ); final File l_asl = CConfiguration.getInstance().getLocation( "mas", p_agentname + c_filesuffix ); if ...
/** * creates an agent filename on an agent name * * @param p_agentname agent name * @return file object * * @throws IOException throws IO exception on file creating error */
creates an agent filename on an agent name
createAgentFile
{ "repo_name": "flashpixx/MecSim", "path": "src/main/java/de/tu_clausthal/in/mec/object/mas/jason/IEnvironment.java", "license": "gpl-3.0", "size": 10960 }
[ "de.tu_clausthal.in.mec.CConfiguration", "de.tu_clausthal.in.mec.common.CCommon", "java.io.File", "java.io.IOException" ]
import de.tu_clausthal.in.mec.CConfiguration; import de.tu_clausthal.in.mec.common.CCommon; import java.io.File; import java.io.IOException;
import de.tu_clausthal.in.mec.*; import de.tu_clausthal.in.mec.common.*; import java.io.*;
[ "de.tu_clausthal.in", "java.io" ]
de.tu_clausthal.in; java.io;
2,817,781
return LayoutInflater.from(context).inflate(R.layout.list_item, parent, false); }
return LayoutInflater.from(context).inflate(R.layout.list_item, parent, false); }
/** * Makes a new blank list item view. No data is set (or bound) to the views yet. * * @param context app context * @param cursor The cursor from which to get the data. The cursor is already * moved to the correct position. * @param parent The parent to which the new view...
Makes a new blank list item view. No data is set (or bound) to the views yet
newView
{ "repo_name": "tomilina/Pets", "path": "app/src/main/java/com/example/android/pets/PetCursorAdapter.java", "license": "apache-2.0", "size": 2609 }
[ "android.view.LayoutInflater" ]
import android.view.LayoutInflater;
import android.view.*;
[ "android.view" ]
android.view;
2,555,832
@Override public void loadDataFromFile() throws InitializationException { // Variable declarations int ObjectLinesLoaded = 0; BufferedReader inFile; String tmpFileRecord; String[] ObjectSplitFields; int Index; int t...
void function() throws InitializationException { int ObjectLinesLoaded = 0; BufferedReader inFile; String tmpFileRecord; String[] ObjectSplitFields; int Index; int tmpFieldCount = 0; String tmpGroup; long tmpRangeFrom; long tmpRangeTo; long tmpValidityFrom; long tmpValidityTo; try { inFile = new BufferedReader(new File...
/** * Load the data from the defined file * * @throws InitializationException */
Load the data from the defined file
loadDataFromFile
{ "repo_name": "isparkes/OpenRate", "path": "src/main/java/OpenRate/cache/NumberRangeCache.java", "license": "apache-2.0", "size": 19807 }
[ "java.io.BufferedReader", "java.io.FileNotFoundException", "java.io.FileReader" ]
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader;
import java.io.*;
[ "java.io" ]
java.io;
2,245,282
public static boolean isFileExistInWorkspace(String path) { if (path == null) { return false; } IFile iFile = getWorksapceFileFromPath(path); if (iFile == null) { return false; } return iFile.exists(); }
static boolean function(String path) { if (path == null) { return false; } IFile iFile = getWorksapceFileFromPath(path); if (iFile == null) { return false; } return iFile.exists(); }
/** * Tests whether the file that represents the specified path exists. * * @param path the path. * @return true if and only if file that represents the specified path exists; false otherwise. */
Tests whether the file that represents the specified path exists
isFileExistInWorkspace
{ "repo_name": "kuriking/testdc2", "path": "net.dependableos.dcase.diagram.common/src/net/dependableos/dcase/diagram/common/util/FileUtil.java", "license": "epl-1.0", "size": 6526 }
[ "org.eclipse.core.resources.IFile" ]
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.*;
[ "org.eclipse.core" ]
org.eclipse.core;
1,457,448
public ExecuteIn getExecuteIn();
ExecuteIn function();
/** * The mechanism by which this command is to be executed, either synchronously &quot;in the * {@link ExecuteIn#FOREGROUND foreground}&quot; or is to be executed asynchronously &quot;in the * {@link ExecuteIn#BACKGROUND background}&quot; through the {@link BackgroundCommandService}. */
The mechanism by which this command is to be executed, either synchronously &quot;in the <code>ExecuteIn#FOREGROUND foreground</code>&quot; or is to be executed asynchronously &quot;in the <code>ExecuteIn#BACKGROUND background</code>&quot; through the <code>BackgroundCommandService</code>
getExecuteIn
{ "repo_name": "howepeng/isis", "path": "core/applib/src/main/java/org/apache/isis/applib/services/command/Command.java", "license": "apache-2.0", "size": 14121 }
[ "org.apache.isis.applib.annotation.Command" ]
import org.apache.isis.applib.annotation.Command;
import org.apache.isis.applib.annotation.*;
[ "org.apache.isis" ]
org.apache.isis;
760,328
public static Plugin plugin(String groupId, String artifactId) { return plugin(groupId, artifactId, null); }
static Plugin function(String groupId, String artifactId) { return plugin(groupId, artifactId, null); }
/** * Defines the plugin without its version * * @param groupId The group id * @param artifactId The artifact id * @return The plugin instance */
Defines the plugin without its version
plugin
{ "repo_name": "lotaris/rox-commons-maven-plugin", "path": "src/main/java/org/twdata/maven/mojoexecutor/MojoExecutor.java", "license": "mit", "size": 9298 }
[ "org.apache.maven.model.Plugin" ]
import org.apache.maven.model.Plugin;
import org.apache.maven.model.*;
[ "org.apache.maven" ]
org.apache.maven;
1,287,999
public synchronized Object makeObject(Object key) throws Exception { Object obj = null; UserPassKey upkey = (UserPassKey)key; PooledConnection pc = null; String username = upkey.getUsername(); String password = upkey.getPassword(); if (username == null) { ...
synchronized Object function(Object key) throws Exception { Object obj = null; UserPassKey upkey = (UserPassKey)key; PooledConnection pc = null; String username = upkey.getUsername(); String password = upkey.getPassword(); if (username == null) { pc = _cpds.getPooledConnection(); } else { pc = _cpds.getPooledConnection...
/** * Creates a new {@link PooledConnectionAndInfo} from the given {@link UserPassKey}. * * @param key {@link UserPassKey} containing user credentials * @throws SQLException if the connection could not be created. * @see org.apache.tomcat.dbcp.pool.KeyedPoolableObjectFactory#makeObject(java.la...
Creates a new <code>PooledConnectionAndInfo</code> from the given <code>UserPassKey</code>
makeObject
{ "repo_name": "xiaolds/tomcat7", "path": "tomcat-build-libs/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/datasources/KeyedCPDSConnectionFactory.java", "license": "apache-2.0", "size": 13221 }
[ "javax.sql.PooledConnection" ]
import javax.sql.PooledConnection;
import javax.sql.*;
[ "javax.sql" ]
javax.sql;
229,184
DateTime getCreateTime();
DateTime getCreateTime();
/** * Return the DateTime the job was created * * @return the time the job was created */
Return the DateTime the job was created
getCreateTime
{ "repo_name": "rashidaligee/kylo", "path": "core/job-repository/job-repository-api/src/main/java/com/thinkbiganalytics/jobrepo/query/model/ExecutedJob.java", "license": "apache-2.0", "size": 6391 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
2,243,149
private String state(final String host, final int port) throws IOException { final String stdout = this.script.exec( host, new ArrayMap<String, String>().with("port", Integer.toString(port)) ); final String state; if (stdout.contains("DEAD")) { sta...
String function(final String host, final int port) throws IOException { final String stdout = this.script.exec( host, new ArrayMap<String, String>().with("port", Integer.toString(port)) ); final String state; if (stdout.contains("DEAD")) { state = "dead"; Logger.info( this, STR, port, host ); } else { state = "alive"; ...
/** * Get state. * @param host Host name of the tank * @param port Port to check (HTTP) * @return State * @throws IOException If fails */
Get state
state
{ "repo_name": "pecko/thindeck", "path": "src/main/java/com/thindeck/agents/CheckState.java", "license": "bsd-3-clause", "size": 4493 }
[ "com.jcabi.immutable.ArrayMap", "com.jcabi.log.Logger", "java.io.IOException" ]
import com.jcabi.immutable.ArrayMap; import com.jcabi.log.Logger; import java.io.IOException;
import com.jcabi.immutable.*; import com.jcabi.log.*; import java.io.*;
[ "com.jcabi.immutable", "com.jcabi.log", "java.io" ]
com.jcabi.immutable; com.jcabi.log; java.io;
877,604
void setTool(final ToolParameter tool);
void setTool(final ToolParameter tool);
/** * Set a new tool for the next set of operations * This will generate the needed g-code for this machine * * @param tool */
Set a new tool for the next set of operations This will generate the needed g-code for this machine
setTool
{ "repo_name": "rvt/cnctools", "path": "cnctools/src/main/java/com/rvantwisk/cnctools/gcode/CncToolsGCodegenerator.java", "license": "bsd-3-clause", "size": 1017 }
[ "com.rvantwisk.cnctools.data.ToolParameter" ]
import com.rvantwisk.cnctools.data.ToolParameter;
import com.rvantwisk.cnctools.data.*;
[ "com.rvantwisk.cnctools" ]
com.rvantwisk.cnctools;
2,749,361
public static ValidatorResult validatePath(String path) { ValidatorResult result = new ValidatorResult(); if (path == null || path.length() == 0) { result.addError(new ValidatorError( "configmanager.filedetails.path.empty", path)); return resu...
static ValidatorResult function(String path) { ValidatorResult result = new ValidatorResult(); if (path == null path.length() == 0) { result.addError(new ValidatorError( STR, path)); return result; } if (!path.startsWith("/")) { result.addError(new ValidatorError( STR, path)); } if (path.endsWith("/")) { result.addErro...
/** * Validate config-file pathname. The rules are pretty basic: * * <ul> * <li>MUST start with '/' * <li>CANNOT end with a '/' * <li>CANNOT be relative - no '..' anywhere * </ul> * That's it. * @param path pathname to be validated * @return a Validator Result. */
Validate config-file pathname. The rules are pretty basic: MUST start with '/' CANNOT end with a '/' CANNOT be relative - no '..' anywhere That's it
validatePath
{ "repo_name": "shastah/spacewalk", "path": "java/code/src/com/redhat/rhn/manager/configuration/ConfigurationValidation.java", "license": "gpl-2.0", "size": 8060 }
[ "com.redhat.rhn.common.validator.ValidatorError", "com.redhat.rhn.common.validator.ValidatorResult" ]
import com.redhat.rhn.common.validator.ValidatorError; import com.redhat.rhn.common.validator.ValidatorResult;
import com.redhat.rhn.common.validator.*;
[ "com.redhat.rhn" ]
com.redhat.rhn;
315,071
public void setExpiry(Expiry expiry) { JodaBeanUtils.notNull(expiry, "expiry"); this._expiry = expiry; }
void function(Expiry expiry) { JodaBeanUtils.notNull(expiry, STR); this._expiry = expiry; }
/** * Sets the expiry. * @param expiry the new value of the property, not null */
Sets the expiry
setExpiry
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/option/NonDeliverableFXOptionSecurity.java", "license": "apache-2.0", "size": 24557 }
[ "com.opengamma.util.time.Expiry", "org.joda.beans.JodaBeanUtils" ]
import com.opengamma.util.time.Expiry; import org.joda.beans.JodaBeanUtils;
import com.opengamma.util.time.*; import org.joda.beans.*;
[ "com.opengamma.util", "org.joda.beans" ]
com.opengamma.util; org.joda.beans;
1,905,377
TransactionMetadata getTransactionMetadata(TxnID txnID) throws PulsarAdminException;
TransactionMetadata getTransactionMetadata(TxnID txnID) throws PulsarAdminException;
/** * Get transaction metadata. * * @param txnID the ID of this transaction * @return the metadata of this transaction. */
Get transaction metadata
getTransactionMetadata
{ "repo_name": "massakam/pulsar", "path": "pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Transactions.java", "license": "apache-2.0", "size": 9907 }
[ "org.apache.pulsar.client.api.transaction.TxnID", "org.apache.pulsar.common.policies.data.TransactionMetadata" ]
import org.apache.pulsar.client.api.transaction.TxnID; import org.apache.pulsar.common.policies.data.TransactionMetadata;
import org.apache.pulsar.client.api.transaction.*; import org.apache.pulsar.common.policies.data.*;
[ "org.apache.pulsar" ]
org.apache.pulsar;
136,824
private void readData(long absolutePosition, ByteBuffer target, int length) { int remaining = length; while (remaining > 0) { dropFragmentsTo(absolutePosition); int positionInFragment = (int) (absolutePosition - totalBytesDropped); int toCopy = Math.min(remaining, fragmentLength - positionIn...
void function(long absolutePosition, ByteBuffer target, int length) { int remaining = length; while (remaining > 0) { dropFragmentsTo(absolutePosition); int positionInFragment = (int) (absolutePosition - totalBytesDropped); int toCopy = Math.min(remaining, fragmentLength - positionInFragment); target.put(dataQueue.peek...
/** * Reads data from the front of the rolling buffer. * * @param absolutePosition The absolute position from which data should be read. * @param target The buffer into which data should be written. * @param length The number of bytes to read. */
Reads data from the front of the rolling buffer
readData
{ "repo_name": "Octavianus/Close-Loop-Visual-Stimulus-Display-System", "path": "library/src/main/java/com/google/android/exoplayer/hls/parser/RollingSampleBuffer.java", "license": "apache-2.0", "size": 10702 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,594,967
@Beta public static ExecutorService getExitingExecutorService( ThreadPoolExecutor executor, long terminationTimeout, TimeUnit timeUnit) { return new Application() .getExitingExecutorService(executor, terminationTimeout, timeUnit); }
static ExecutorService function( ThreadPoolExecutor executor, long terminationTimeout, TimeUnit timeUnit) { return new Application() .getExitingExecutorService(executor, terminationTimeout, timeUnit); }
/** * Converts the given ThreadPoolExecutor into an ExecutorService that exits * when the application is complete. It does so by using daemon threads and * adding a shutdown hook to wait for their completion. * * <p>This is mainly for fixed thread pools. * See {@link Executors#newFixedThreadPool(int)...
Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application is complete. It does so by using daemon threads and adding a shutdown hook to wait for their completion. This is mainly for fixed thread pools. See <code>Executors#newFixedThreadPool(int)</code>
getExitingExecutorService
{ "repo_name": "wspeirs/sop4j-base", "path": "src/main/java/com/sop4j/base/google/common/util/concurrent/MoreExecutors.java", "license": "apache-2.0", "size": 31275 }
[ "java.util.concurrent.ExecutorService", "java.util.concurrent.ThreadPoolExecutor", "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.ExecutorService; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
317,533
private static void showShareDialog(final Activity activity, final String title, final String url, final Bitmap screenshot) { Intent intent = getShareIntent(title, url, null); PackageManager manager = activity.getPackageManager(); List<ResolveInfo> resolveInfoList = manager.query...
static void function(final Activity activity, final String title, final String url, final Bitmap screenshot) { Intent intent = getShareIntent(title, url, null); PackageManager manager = activity.getPackageManager(); List<ResolveInfo> resolveInfoList = manager.queryIntentActivities(intent, 0); assert resolveInfoList.siz...
/** * Creates and shows a share intent picker dialog. * * @param activity Activity that is used to access package manager. * @param title Title of the page to be shared. * @param url URL of the page to be shared. * @param screenshot Screenshot of the page to be shared. */
Creates and shows a share intent picker dialog
showShareDialog
{ "repo_name": "guorendong/iridium-browser-ubuntu", "path": "chrome/android/java/src/org/chromium/chrome/browser/share/ShareHelper.java", "license": "bsd-3-clause", "size": 12581 }
[ "android.app.Activity", "android.content.Intent", "android.content.pm.PackageManager", "android.content.pm.ResolveInfo", "android.graphics.Bitmap", "android.support.v7.app.AlertDialog", "java.util.Collections", "java.util.List" ]
import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.graphics.Bitmap; import android.support.v7.app.AlertDialog; import java.util.Collections; import java.util.List;
import android.app.*; import android.content.*; import android.content.pm.*; import android.graphics.*; import android.support.v7.app.*; import java.util.*;
[ "android.app", "android.content", "android.graphics", "android.support", "java.util" ]
android.app; android.content; android.graphics; android.support; java.util;
788,196
public void TInterpreterRestoreCursor(){ Cursor cursorBar = new Cursor(Cursor.DEFAULT_CURSOR); this.setCursor(cursorBar); }
void function(){ Cursor cursorBar = new Cursor(Cursor.DEFAULT_CURSOR); this.setCursor(cursorBar); }
/** * Restore Default Cursor. * */
Restore Default Cursor
TInterpreterRestoreCursor
{ "repo_name": "hendyyou/FST", "path": "src/tico/interpreter/TInterpreter.java", "license": "gpl-3.0", "size": 14431 }
[ "java.awt.Cursor" ]
import java.awt.Cursor;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,332,427
public LineString createLineString(Coordinate[] coordinates) { if (coordinates == null) { return new LineString(srid, precision); } Coordinate[] clones = new Coordinate[coordinates.length]; for (int i = 0; i < coordinates.length; i++) { clones[i] = (Coordinate) coordinates[i].clone(); } return new ...
LineString function(Coordinate[] coordinates) { if (coordinates == null) { return new LineString(srid, precision); } Coordinate[] clones = new Coordinate[coordinates.length]; for (int i = 0; i < coordinates.length; i++) { clones[i] = (Coordinate) coordinates[i].clone(); } return new LineString(srid, precision, clones);...
/** * Create a new {@link LineString}, given an array of coordinates. * * @param coordinates * An array of {@link Coordinate} objects. * @return Returns a {@link LineString} object. */
Create a new <code>LineString</code>, given an array of coordinates
createLineString
{ "repo_name": "geomajas/geomajas-project-client-gwt", "path": "client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java", "license": "agpl-3.0", "size": 9524 }
[ "org.geomajas.geometry.Coordinate" ]
import org.geomajas.geometry.Coordinate;
import org.geomajas.geometry.*;
[ "org.geomajas.geometry" ]
org.geomajas.geometry;
301,986
public boolean validateUserGroupSelection(Map<Integer,List<List<Integer>>> groupSelectionMap,List<Integer> selectionList){ boolean retValue=true; for (int key : groupSelectionMap.keySet()) { List<List<Integer>> groups = groupSelectionMap.get(key); for (List<Integer> grp : groups) { if (selectionList.si...
boolean function(Map<Integer,List<List<Integer>>> groupSelectionMap,List<Integer> selectionList){ boolean retValue=true; for (int key : groupSelectionMap.keySet()) { List<List<Integer>> groups = groupSelectionMap.get(key); for (List<Integer> grp : groups) { if (selectionList.size() == grp.size()) { if (!ListUtils.isEqu...
/** * Validate user group selection. * * @param groupSelectionMap * the group selection map * @param selectionList * the selection list * @return true, if successful */
Validate user group selection
validateUserGroupSelection
{ "repo_name": "capitalone/Hydrograph", "path": "hydrograph.ui/hydrograph.ui.dataviewer/src/main/java/hydrograph/ui/dataviewer/filter/FilterHelper.java", "license": "apache-2.0", "size": 49299 }
[ "java.util.List", "java.util.Map", "org.apache.commons.collections.ListUtils" ]
import java.util.List; import java.util.Map; import org.apache.commons.collections.ListUtils;
import java.util.*; import org.apache.commons.collections.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,706,438
public void incrementIntent(LocalDateTime ldtEntry, String intentName) { log.trace("incrementIntent(ldtEntry={}, intentName={}", ldtEntry, intentName); incrementIntent(ldtEntry, intentName, 1); }
void function(LocalDateTime ldtEntry, String intentName) { log.trace(STR, ldtEntry, intentName); incrementIntent(ldtEntry, intentName, 1); }
/** * Increment the IntentLog count by one for the given intentName that occurred * at ldtEntry time. IntentLog stores counts each intentName occurred * on a per-week basis. * * @param ldtEntry LocalDateTime when the intentName occurred * @param intentName String of the intent invoked by...
Increment the IntentLog count by one for the given intentName that occurred at ldtEntry time. IntentLog stores counts each intentName occurred on a per-week basis
incrementIntent
{ "repo_name": "jtbaldwin/Alexa-Trash-Day", "path": "src/main/java/trashday/model/IntentLog.java", "license": "mit", "size": 8217 }
[ "java.time.LocalDateTime" ]
import java.time.LocalDateTime;
import java.time.*;
[ "java.time" ]
java.time;
2,059,026
public static IgniteCheckedException cast(Throwable t) { assert t != null; while (true) { if (t instanceof Error) throw (Error)t; if (t instanceof GridClosureException) { t = ((GridClosureException)t).unwrap(); continue; ...
static IgniteCheckedException function(Throwable t) { assert t != null; while (true) { if (t instanceof Error) throw (Error)t; if (t instanceof GridClosureException) { t = ((GridClosureException)t).unwrap(); continue; } if (t instanceof IgniteCheckedException) return (IgniteCheckedException)t; if (!(t instanceof Ignite...
/** * Casts this throwable as {@link IgniteCheckedException}. Creates wrapping * {@link IgniteCheckedException}, if needed. * * @param t Throwable to cast. * @return Grid exception. */
Casts this throwable as <code>IgniteCheckedException</code>. Creates wrapping <code>IgniteCheckedException</code>, if needed
cast
{ "repo_name": "WilliamDo/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 325083 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.IgniteException", "org.apache.ignite.internal.util.lang.GridClosureException" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.internal.util.lang.GridClosureException;
import org.apache.ignite.*; import org.apache.ignite.internal.util.lang.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,202,724
public static Set<Policy> getAvailableImplementationPolicies() { Set<Policy> implementations = new HashSet<Policy>(); for (Policy p : _policies) { if (p.supports(PolicyType.IMPLEMENTATION)) { implementations.add(p); } } return Collections.unmod...
static Set<Policy> function() { Set<Policy> implementations = new HashSet<Policy>(); for (Policy p : _policies) { if (p.supports(PolicyType.IMPLEMENTATION)) { implementations.add(p); } } return Collections.unmodifiableSet(implementations); }
/** * Returns a set of available implementation policies. * @return policies */
Returns a set of available implementation policies
getAvailableImplementationPolicies
{ "repo_name": "tadayosi/switchyard", "path": "core/api/src/main/java/org/switchyard/policy/PolicyFactory.java", "license": "apache-2.0", "size": 4627 }
[ "java.util.Collections", "java.util.HashSet", "java.util.Set", "org.switchyard.policy.Policy" ]
import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.switchyard.policy.Policy;
import java.util.*; import org.switchyard.policy.*;
[ "java.util", "org.switchyard.policy" ]
java.util; org.switchyard.policy;
884,975
public CcLibraryHelper addPrivateHeaders(Iterable<Artifact> privateHeaders) { Iterables.addAll(this.privateHeaders, privateHeaders); return this; }
CcLibraryHelper function(Iterable<Artifact> privateHeaders) { Iterables.addAll(this.privateHeaders, privateHeaders); return this; }
/** * Add the corresponding files as private header files, i.e., these files will not be compiled, * but are not made visible as includes to dependent rules in module maps. */
Add the corresponding files as private header files, i.e., these files will not be compiled, but are not made visible as includes to dependent rules in module maps
addPrivateHeaders
{ "repo_name": "Topher-the-Geek/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java", "license": "apache-2.0", "size": 40433 }
[ "com.google.common.collect.Iterables", "com.google.devtools.build.lib.actions.Artifact" ]
import com.google.common.collect.Iterables; import com.google.devtools.build.lib.actions.Artifact;
import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
1,052,013
public void addPoint(String name, Color color, boolean isNameColored, ILocational locational) { addPoint(name, color.getRGB(), isNameColored, locational); }
void function(String name, Color color, boolean isNameColored, ILocational locational) { addPoint(name, color.getRGB(), isNameColored, locational); }
/** * Adds a point to be displayed on client. * @param name the name that will be displayed over the point * @param color the color * @param isNameColored if {@code true} name will be colored as well. * @param locational the ILocational to take coordinates for this point */
Adds a point to be displayed on client
addPoint
{ "repo_name": "rubenswagner/L2J-Global", "path": "java/com/l2jglobal/gameserver/network/serverpackets/ExServerPrimitive.java", "license": "gpl-3.0", "size": 17405 }
[ "com.l2jglobal.gameserver.model.interfaces.ILocational", "java.awt.Color" ]
import com.l2jglobal.gameserver.model.interfaces.ILocational; import java.awt.Color;
import com.l2jglobal.gameserver.model.interfaces.*; import java.awt.*;
[ "com.l2jglobal.gameserver", "java.awt" ]
com.l2jglobal.gameserver; java.awt;
1,906,084
protected void hydrateExport(BufferedReader csvFile, Sources sources) throws IOException { CSVStrategy strategy = new CSVStrategy(',', '"', '#', true, true); ValueProcessorProvider vpp = new ValueProcessorProvider(); CSVReader<Export> exportReader = new CSVReaderBuilder<Export>(csvFile).strateg...
void function(BufferedReader csvFile, Sources sources) throws IOException { CSVStrategy strategy = new CSVStrategy(',', '"', '#', true, true); ValueProcessorProvider vpp = new ValueProcessorProvider(); CSVReader<Export> exportReader = new CSVReaderBuilder<Export>(csvFile).strategy(strategy).entryParser( new AnnotationE...
/** * Hydrate Export with in Sources Object from Export CSV Pojos. * @param csvFile * @param sources * @throws IOException */
Hydrate Export with in Sources Object from Export CSV Pojos
hydrateExport
{ "repo_name": "servinglynk/servinglynk-hmis", "path": "hmis-model-v2015/src/main/java/com/servinglynk/hmis/warehouse/dao/helper/BulkUploadHelper.java", "license": "mpl-2.0", "size": 73968 }
[ "com.googlecode.jcsv.CSVStrategy", "com.googlecode.jcsv.annotations.internal.ValueProcessorProvider", "com.googlecode.jcsv.reader.CSVReader", "com.googlecode.jcsv.reader.internal.AnnotationEntryParser", "com.googlecode.jcsv.reader.internal.CSVReaderBuilder", "com.servinglynk.hmis.warehouse.csv.Export", ...
import com.googlecode.jcsv.CSVStrategy; import com.googlecode.jcsv.annotations.internal.ValueProcessorProvider; import com.googlecode.jcsv.reader.CSVReader; import com.googlecode.jcsv.reader.internal.AnnotationEntryParser; import com.googlecode.jcsv.reader.internal.CSVReaderBuilder; import com.servinglynk.hmis.warehous...
import com.googlecode.jcsv.*; import com.googlecode.jcsv.annotations.internal.*; import com.googlecode.jcsv.reader.*; import com.googlecode.jcsv.reader.internal.*; import com.servinglynk.hmis.warehouse.csv.*; import com.servinglynk.hmis.warehouse.domain.*; import java.io.*; import java.util.*;
[ "com.googlecode.jcsv", "com.servinglynk.hmis", "java.io", "java.util" ]
com.googlecode.jcsv; com.servinglynk.hmis; java.io; java.util;
2,688,306
@Override public void validate() throws InvalidValueException { super.validate(); for (final Iterator<Object> i = propertyIds.iterator(); i.hasNext();) { fields.get(i.next()).validate(); } }
void function() throws InvalidValueException { super.validate(); for (final Iterator<Object> i = propertyIds.iterator(); i.hasNext();) { fields.get(i.next()).validate(); } }
/** * Checks the validity of the Form and all of its fields. * * @see Validatable#validate() */
Checks the validity of the Form and all of its fields
validate
{ "repo_name": "peterl1084/framework", "path": "compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java", "license": "apache-2.0", "size": 44414 }
[ "com.vaadin.v7.data.Validator", "java.util.Iterator" ]
import com.vaadin.v7.data.Validator; import java.util.Iterator;
import com.vaadin.v7.data.*; import java.util.*;
[ "com.vaadin.v7", "java.util" ]
com.vaadin.v7; java.util;
149,490
protected void initUserObject() { if (m_fieldconfiguration == null) { try { m_fieldconfiguration = m_searchManager.getFieldConfiguration(getParamFieldconfiguration()); if (m_fieldconfiguration == null) { m_fieldconfiguration = new CmsSearchFie...
void function() { if (m_fieldconfiguration == null) { try { m_fieldconfiguration = m_searchManager.getFieldConfiguration(getParamFieldconfiguration()); if (m_fieldconfiguration == null) { m_fieldconfiguration = new CmsSearchFieldConfiguration(); } } catch (Exception e) { m_fieldconfiguration = new CmsSearchFieldConfigu...
/** * Initializes the user object to work with depending on the dialog state and request parameters.<p> * */
Initializes the user object to work with depending on the dialog state and request parameters
initUserObject
{ "repo_name": "serrapos/opencms-core", "path": "src-modules/org/opencms/workplace/tools/searchindex/A_CmsFieldConfigurationDialog.java", "license": "lgpl-2.1", "size": 10646 }
[ "org.opencms.search.fields.CmsSearchFieldConfiguration" ]
import org.opencms.search.fields.CmsSearchFieldConfiguration;
import org.opencms.search.fields.*;
[ "org.opencms.search" ]
org.opencms.search;
381,912
@Override protected double evaluateInstance( Map<String,Double> goldSenseRatings, Map<String,Double> testSenseRatings, int numSenses) { int inCommon = 0; for (String sense : goldSenseRatings.keySet()) { if (testSenseRatings.containsKey(sense)) ...
@Override double function( Map<String,Double> goldSenseRatings, Map<String,Double> testSenseRatings, int numSenses) { int inCommon = 0; for (String sense : goldSenseRatings.keySet()) { if (testSenseRatings.containsKey(sense)) inCommon++; } int unionSize = goldSenseRatings.size() + testSenseRatings.size() - inCommon; do...
/** * Computes the Jaccard Index of the two sense listings */
Computes the Jaccard Index of the two sense listings
evaluateInstance
{ "repo_name": "mpelevina/context-eval", "path": "semeval_2013_13/cluster-comparison-tools/src/main/java/edu/ucla/clustercomparison/JaccardIndex.java", "license": "apache-2.0", "size": 2035 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,190,828
void setRoot(EObject value);
void setRoot(EObject value);
/** * Sets the value of the '{@link org.w3._1999.xlink.DocumentRoot#getRoot <em>Root</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Root</em>' containment reference. * @see #getRoot() * @generated */
Sets the value of the '<code>org.w3._1999.xlink.DocumentRoot#getRoot Root</code>' containment reference.
setRoot
{ "repo_name": "GRA-UML/tool", "path": "plugins/org.ijis.gra.ebxml.cpp-cpa/src/org/w3/_1999/xlink/DocumentRoot.java", "license": "epl-1.0", "size": 12676 }
[ "org.eclipse.emf.ecore.EObject" ]
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,086,938
protected void decUsedResource(Resource res) { synchronized (resourceUsage) { Resources.subtractFrom(resourceUsage, res); if (parent != null) { parent.decUsedResource(res); } } }
void function(Resource res) { synchronized (resourceUsage) { Resources.subtractFrom(resourceUsage, res); if (parent != null) { parent.decUsedResource(res); } } }
/** * Decrease resource usage for this queue and all parent queues. * * @param res the resource to decrease */
Decrease resource usage for this queue and all parent queues
decUsedResource
{ "repo_name": "apurtell/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSQueue.java", "license": "apache-2.0", "size": 19280 }
[ "org.apache.hadoop.yarn.api.records.Resource", "org.apache.hadoop.yarn.util.resource.Resources" ]
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.util.resource.Resources;
import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.util.resource.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,052,584
@Nullable public static Method getNonPublicMethod(Class<?> cls, String name, Class<?>... paramTypes) { try { Method mtd = cls.getDeclaredMethod(name, paramTypes); mtd.setAccessible(true); return mtd; } catch (NoSuchMethodException ignored) { ...
@Nullable static Method function(Class<?> cls, String name, Class<?>... paramTypes) { try { Method mtd = cls.getDeclaredMethod(name, paramTypes); mtd.setAccessible(true); return mtd; } catch (NoSuchMethodException ignored) { } return null; }
/** * Gets a method from the class. * * Method.getMethod() does not return non-public method. * * @param cls Target class. * @param name Name of the method. * @param paramTypes Method parameters. * @return Method or {@code null}. */
Gets a method from the class. Method.getMethod() does not return non-public method
getNonPublicMethod
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 388551 }
[ "java.lang.reflect.Method", "org.jetbrains.annotations.Nullable" ]
import java.lang.reflect.Method; import org.jetbrains.annotations.Nullable;
import java.lang.reflect.*; import org.jetbrains.annotations.*;
[ "java.lang", "org.jetbrains.annotations" ]
java.lang; org.jetbrains.annotations;
1,549,812
public void disassociateFromCurves(ConcreteCurve curveToKeep) { HashSet<ConcreteCurve> copy = new HashSet<ConcreteCurve>(); copy.addAll(getCurves()); for (ConcreteCurve curve : copy) { // could implement with calling removeFromAllEnclosingCurves and then re-add, but if more thing...
void function(ConcreteCurve curveToKeep) { HashSet<ConcreteCurve> copy = new HashSet<ConcreteCurve>(); copy.addAll(getCurves()); for (ConcreteCurve curve : copy) { if (curve != curveToKeep) { curve.removeEnclosedZone(this); } } }
/** * Same as removeFromAllEnclosingCurves, but keeps the passed in curve. * <p/> * Needed because we often want to remove a curve fom a boundary rectangle, and remove all traces of it from what * remains in the rectangle, but keep the curve as an image of what it once was. * * @param curv...
Same as removeFromAllEnclosingCurves, but keeps the passed in curve. Needed because we often want to remove a curve fom a boundary rectangle, and remove all traces of it from what remains in the rectangle, but keep the curve as an image of what it once was
disassociateFromCurves
{ "repo_name": "MichaelJCompton/ConceptDiagrams", "path": "src/main/java/org/ontologyengineering/conceptdiagrams/web/shared/concretesyntax/ConcreteZone.java", "license": "bsd-2-clause", "size": 10190 }
[ "java.util.HashSet" ]
import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
472,063