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 static boolean matches(Set<Type> types1, Set<Type> types2) {
for (Type type : types1) {
if (matches(type, types2)) {
return true;
}
}
return false;
} | static boolean function(Set<Type> types1, Set<Type> types2) { for (Type type : types1) { if (matches(type, types2)) { return true; } } return false; } | /**
* Check whether whether any of the types1 matches a type in types2
*
* @param types1
* @param types2
* @return
*/ | Check whether whether any of the types1 matches a type in types2 | matches | {
"repo_name": "Repeid/repeid",
"path": "common/src/main/java/org/repeid/common/util/reflections/Reflections.java",
"license": "gpl-2.0",
"size": 38193
} | [
"java.lang.reflect.Type",
"java.util.Set"
] | import java.lang.reflect.Type; import java.util.Set; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 1,696,080 |
public List<T> toList(); | List<T> function(); | /**
* Returns the List of DataRecords that this collection is based upon.
*
* @return List<DataRecord>
*/ | Returns the List of DataRecords that this collection is based upon | toList | {
"repo_name": "SciGaP/DEPRECATED-Cipres-Airavata-POC",
"path": "saminda/cipres-airavata/sdk/src/main/java/org/ngbw/sdk/api/core/GenericDataRecordCollection.java",
"license": "apache-2.0",
"size": 3124
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 552,724 |
protected void parseShapeElem(Element elem, mxVsdxModel model)
{
String childName = elem.getNodeName();
if (childName.equals("Cell"))
{
this.cellElements.put(elem.getAttribute("N"), elem);
}
else if (childName.equals("Section"))
{
this.parseSection(elem);
}
} | void function(Element elem, mxVsdxModel model) { String childName = elem.getNodeName(); if (childName.equals("Cell")) { this.cellElements.put(elem.getAttribute("N"), elem); } else if (childName.equals(STR)) { this.parseSection(elem); } } | /**
* Caches the specified element
* @param elem the element to cache
*/ | Caches the specified element | parseShapeElem | {
"repo_name": "flyingCloudRain/drawio",
"path": "src/com/mxgraph/io/vsdx/Style.java",
"license": "apache-2.0",
"size": 31639
} | [
"org.w3c.dom.Element"
] | import org.w3c.dom.Element; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,250,010 |
public ActionForward doBar(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
barCount++;
ActionMessages messages = new ActionMessag... | ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { barCount++; ActionMessages messages = new ActionMessages(); messages.add("bar", new ActionMessage(STR, barCount+STRsuccess")); } | /**
* Example "bar" method.
*
* @param mapping The ActionMapping used to select this instance
* @param form The optional ActionForm bean for this request
* @param request The servlet request we are processing
* @param response The servlet response we are creating
*
* @exception E... | Example "bar" method | doBar | {
"repo_name": "davcamer/clients",
"path": "projects-for-testing/struts/apps/examples/src/main/java/org/apache/struts/webapp/dispatch/MappingDispatchExampleAction.java",
"license": "apache-2.0",
"size": 3338
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.apache.struts.action.ActionMessage",
"org.apache.struts.action.ActionMessages"
] | 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 org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMess... | import javax.servlet.http.*; import org.apache.struts.action.*; | [
"javax.servlet",
"org.apache.struts"
] | javax.servlet; org.apache.struts; | 1,274,111 |
public int read(
byte[] b,
int off,
int len)
throws IOException
{
if (bufOff >= maxBuf)
{
if (nextChunk() < 0)
{
return -1;
}
}
int toSupply = Math.min(len, available());
System.arraycopy... | int function( byte[] b, int off, int len) throws IOException { if (bufOff >= maxBuf) { if (nextChunk() < 0) { return -1; } } int toSupply = Math.min(len, available()); System.arraycopy(buf, bufOff, b, off, toSupply); bufOff += toSupply; return toSupply; } | /**
* Reads data from the underlying stream and processes it with the cipher until the cipher
* outputs data, and then returns up to <code>len</code> bytes in the provided array.
* <p>
* If the underlying stream is exhausted by this call, the cipher will be finalised.
* </p>
* @param b t... | Reads data from the underlying stream and processes it with the cipher until the cipher outputs data, and then returns up to <code>len</code> bytes in the provided array. If the underlying stream is exhausted by this call, the cipher will be finalised. | read | {
"repo_name": "Skywalker-11/spongycastle",
"path": "core/src/main/java/org/spongycastle/crypto/io/CipherInputStream.java",
"license": "mit",
"size": 13812
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 589,288 |
public void addListDataListener(ListDataListener l) {
listenerList.add(ListDataListener.class, l);
} | void function(ListDataListener l) { listenerList.add(ListDataListener.class, l); } | /**
* Adds a listener to the list that's notified each time a change to the data
* model occurs.
*
* @param l
* the <code>ListDataListener</code> to be added
*/ | Adds a listener to the list that's notified each time a change to the data model occurs | addListDataListener | {
"repo_name": "wangqi/gameserver",
"path": "admin/src/main/java/com/xinqihd/sns/gameserver/admin/model/MyTableModel.java",
"license": "apache-2.0",
"size": 10525
} | [
"javax.swing.event.ListDataListener"
] | import javax.swing.event.ListDataListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 1,224,093 |
static RetryRule onStatus(HttpStatus... statuses) {
return builder().onStatus(statuses).thenBackoff();
} | static RetryRule onStatus(HttpStatus... statuses) { return builder().onStatus(statuses).thenBackoff(); } | /**
* Returns a newly created {@link RetryRule} that will retry with the
* {@linkplain Backoff#ofDefault() default backoff} if the response status is one of
* the specified {@link HttpStatus}es.
*/ | Returns a newly created <code>RetryRule</code> that will retry with the Backoff#ofDefault() default backoff if the response status is one of the specified <code>HttpStatus</code>es | onStatus | {
"repo_name": "minwoox/armeria",
"path": "core/src/main/java/com/linecorp/armeria/client/retry/RetryRule.java",
"license": "apache-2.0",
"size": 11880
} | [
"com.linecorp.armeria.common.HttpStatus"
] | import com.linecorp.armeria.common.HttpStatus; | import com.linecorp.armeria.common.*; | [
"com.linecorp.armeria"
] | com.linecorp.armeria; | 278,058 |
return (Statement) getSource();
} | return (Statement) getSource(); } | /**
* Get the DML statement.
*
* @return the DML statement.
*/ | Get the DML statement | getStatement | {
"repo_name": "GoogleCloudPlatform/spring-cloud-gcp",
"path": "spring-cloud-gcp-data-spanner/src/main/java/com/google/cloud/spring/data/spanner/core/mapping/event/ExecuteDmlEvent.java",
"license": "apache-2.0",
"size": 1579
} | [
"com.google.cloud.spanner.Statement"
] | import com.google.cloud.spanner.Statement; | import com.google.cloud.spanner.*; | [
"com.google.cloud"
] | com.google.cloud; | 1,586,288 |
public IStreamingResponse<T> onFailure(Consumer<Throwable> error);
| IStreamingResponse<T> function(Consumer<Throwable> error); | /**
* Callback for consumption of failure both from the endpoint and internally
* @param data
*/ | Callback for consumption of failure both from the endpoint and internally | onFailure | {
"repo_name": "seanlruff/org.binxance.api",
"path": "src/main/java/org/binxance/api/IStreamingResponse.java",
"license": "mit",
"size": 904
} | [
"java.util.function.Consumer"
] | import java.util.function.Consumer; | import java.util.function.*; | [
"java.util"
] | java.util; | 596,422 |
protected Node firstChild(Node n) {
if (n.getNodeType() == Node.ENTITY_REFERENCE_NODE &&
!expandEntityReferences) {
return null;
}
Node result = n.getFirstChild();
if (result == null) {
return null;
}
switch (acceptNode(result)) {
... | Node function(Node n) { if (n.getNodeType() == Node.ENTITY_REFERENCE_NODE && !expandEntityReferences) { return null; } Node result = n.getFirstChild(); if (result == null) { return null; } switch (acceptNode(result)) { case NodeFilter.FILTER_ACCEPT: return result; case NodeFilter.FILTER_SKIP: Node t = firstChild(result... | /**
* Returns the first child of the given node.
*/ | Returns the first child of the given node | firstChild | {
"repo_name": "shyamalschandra/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/traversal/DOMTreeWalker.java",
"license": "apache-2.0",
"size": 10742
} | [
"org.w3c.dom.Node",
"org.w3c.dom.traversal.NodeFilter"
] | import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeFilter; | import org.w3c.dom.*; import org.w3c.dom.traversal.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,826,352 |
@NonNull
public static <T> String notInSelection(@NonNull final String column,
@NonNull final Iterable<T> arguments) {
//noinspection ConstantConditions
if (column == null || column.isEmpty()) {
throw new IllegalArgumentException("column must not be null or empty");
... | static <T> String function(@NonNull final String column, @NonNull final Iterable<T> arguments) { if (column == null column.isEmpty()) { throw new IllegalArgumentException(STR); } final StringBuilder selection = new StringBuilder(256); selection.append(column); selection.append(STR); selection.append('('); appendCommaSe... | /**
* Builds IN selection with long args
*
* @param column the column name to build selection for
* @param arguments the arguments
* @return the IN selection
*/ | Builds IN selection with long args | notInSelection | {
"repo_name": "Doctoror/PainlessMusicPlayer",
"path": "data/src/main/java/com/doctoror/fuckoffmusicplayer/data/util/SelectionUtils.java",
"license": "apache-2.0",
"size": 6292
} | [
"android.support.annotation.NonNull"
] | import android.support.annotation.NonNull; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 1,265,472 |
public static String print1DArray(Object aObject) {
if (aObject.getClass().isArray()) {
if (aObject instanceof Object[]) // can we cast to Object[]
return Arrays.toString((Object[]) aObject);
else { // we can't cast to Object[] - case of primitive arrays
... | static String function(Object aObject) { if (aObject.getClass().isArray()) { if (aObject instanceof Object[]) return Arrays.toString((Object[]) aObject); else { int length = Array.getLength(aObject); Object[] objArr = new Object[length]; for (int i=0; i<length; i++) objArr[i] = Array.get(aObject, i); return Arrays.toSt... | /**
* Prints the specified array to a returned String.
*
* @param aObject the array object to print.
* @return the array in string form suitable for display.
*/ | Prints the specified array to a returned String | print1DArray | {
"repo_name": "antidata/htm.java",
"path": "src/main/java/org/numenta/nupic/util/SparseMatrix.java",
"license": "agpl-3.0",
"size": 15209
} | [
"java.lang.reflect.Array",
"java.util.Arrays"
] | import java.lang.reflect.Array; import java.util.Arrays; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 1,703,072 |
private boolean synchronizedRequestPermissionToExecute() {
boolean result = false;
synchronized (this) {
switch (state.get()) {
case CLOSED:
result = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
... | boolean function() { boolean result = false; synchronized (this) { switch (state.get()) { case CLOSED: result = true; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, STR); } break; case HALF_OPEN: if (halfOpenRunningExecutions < policy.getSuccessThreshold()) { halfOpenRunningExecutions++... | /**
* Implements the logic for requestPermissionToExecute for the cases where synchronization is required
*
* @return whether execution is permitted
*/ | Implements the logic for requestPermissionToExecute for the cases where synchronization is required | synchronizedRequestPermissionToExecute | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/impl/CircuitBreakerStateImpl.java",
"license": "epl-1.0",
"size": 12326
} | [
"com.ibm.websphere.ras.Tr",
"com.ibm.websphere.ras.TraceComponent"
] | import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; | import com.ibm.websphere.ras.*; | [
"com.ibm.websphere"
] | com.ibm.websphere; | 1,357,065 |
private StringBuilder handleElementAttributes(Node node) {
StringBuilder attributePath = new StringBuilder();
if (node.hasAttributes()) {
NamedNodeMap attributes = node.getAttributes();
if (attributes.getLength() > 0) {
attributePath.append("[");
... | StringBuilder function(Node node) { StringBuilder attributePath = new StringBuilder(); if (node.hasAttributes()) { NamedNodeMap attributes = node.getAttributes(); if (attributes.getLength() > 0) { attributePath.append("["); for (int i = 0; i < attributes.getLength(); i++) { if (i > 0) { attributePath.append(STR); } Nod... | /**
* Handle the attributes for an element in an XPath expression.
*
* @param node the node to get the attributes from.
* @return the attributes of the node as XPath expression.
*/ | Handle the attributes for an element in an XPath expression | handleElementAttributes | {
"repo_name": "uweplonus/tool-jpa-processor",
"path": "aggregator/test-util/src/main/java/org/sw4j/tool/annotation/jpa/test/util/ITUtil.java",
"license": "gpl-3.0",
"size": 9950
} | [
"org.w3c.dom.NamedNodeMap",
"org.w3c.dom.Node"
] | import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,910,396 |
private void jButton1ActionPerformed(final java.awt.event.ActionEvent evt) { //GEN-FIRST:event_jButton1ActionPerformed
final int position = jXTable1.getSelectedRow();
new SwingWorker<Boolean, Object>() { | void function(final java.awt.event.ActionEvent evt) { final int position = jXTable1.getSelectedRow(); new SwingWorker<Boolean, Object>() { | /**
* DOCUMENT ME!
*
* @param evt DOCUMENT ME!
*/ | DOCUMENT ME | jButton1ActionPerformed | {
"repo_name": "cismet/cismap-commons",
"path": "src/main/java/de/cismet/cismap/commons/rasterservice/georeferencing/RasterGeoReferencingPanel.java",
"license": "lgpl-3.0",
"size": 50569
} | [
"javax.swing.SwingWorker"
] | import javax.swing.SwingWorker; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,130,277 |
public CSVRecord lowestHumidityInManyFiles() {
DirectoryResource dr = new DirectoryResource();
CSVRecord lowest = null;
for (File file : dr.selectedFiles()) {
FileResource fr = new FileResource(file);
CSVParser parser = fr.getCSVParser();
... | CSVRecord function() { DirectoryResource dr = new DirectoryResource(); CSVRecord lowest = null; for (File file : dr.selectedFiles()) { FileResource fr = new FileResource(file); CSVParser parser = fr.getCSVParser(); CSVRecord current = lowestHumidityInFile(parser); if (lowest == null) lowest = current; else { double cur... | /**
* Find a lowest humidity in many files selected.
* @return CSVRecord found with the lowest humidity
*/ | Find a lowest humidity in many files selected | lowestHumidityInManyFiles | {
"repo_name": "polde-live/duke-java-1",
"path": "CSVWeather/CSVWeatherReader.java",
"license": "unlicense",
"size": 6465
} | [
"edu.duke.DirectoryResource",
"edu.duke.FileResource",
"java.io.File",
"org.apache.commons.csv.CSVParser"
] | import edu.duke.DirectoryResource; import edu.duke.FileResource; import java.io.File; import org.apache.commons.csv.CSVParser; | import edu.duke.*; import java.io.*; import org.apache.commons.csv.*; | [
"edu.duke",
"java.io",
"org.apache.commons"
] | edu.duke; java.io; org.apache.commons; | 1,593,022 |
EClass getCastExpression(); | EClass getCastExpression(); | /**
* Returns the meta object for class '{@link org.xtext.example.delphi.astm.CastExpression <em>Cast Expression</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Cast Expression</em>'.
* @see org.xtext.example.delphi.astm.CastExpression
* @generated
*/ | Returns the meta object for class '<code>org.xtext.example.delphi.astm.CastExpression Cast Expression</code>'. | getCastExpression | {
"repo_name": "adolfosbh/cs2as",
"path": "org.xtext.example.delphi/emf-gen/org/xtext/example/delphi/astm/AstmPackage.java",
"license": "epl-1.0",
"size": 670467
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,037,385 |
public BigInteger getPublicExponent() {
if (exponent == null) {
publicKeyBlob = getPublicKeyBlob(hCryptKey);
exponent = new BigInteger(getExponent(publicKeyBlob));
}
return exponent;
} | BigInteger function() { if (exponent == null) { publicKeyBlob = getPublicKeyBlob(hCryptKey); exponent = new BigInteger(getExponent(publicKeyBlob)); } return exponent; } | /**
* Returns the public exponent.
*/ | Returns the public exponent | getPublicExponent | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/windows/classes/sun/security/mscapi/RSAPublicKey.java",
"license": "apache-2.0",
"size": 5609
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 2,799,523 |
@ServiceMethod(returns = ReturnType.SINGLE)
VirtualMachineExtensionInner createOrUpdate(
String resourceGroupName,
String vmName,
String vmExtensionName,
VirtualMachineExtensionInner extensionParameters); | @ServiceMethod(returns = ReturnType.SINGLE) VirtualMachineExtensionInner createOrUpdate( String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters); | /**
* The operation to create or update the extension.
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine where the extension should be created or updated.
* @param vmExtensionName The name of the virtual machine extension.
* @param... | The operation to create or update the extension | createOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java",
"license": "mit",
"size": 30057
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.compute.fluent.models.VirtualMachineExtensionInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.compute.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,896,098 |
private Map<GroupStoreKeyMapKey, StoredGroupEntry>
getGroupStoreKeyMap() {
return groupStoreEntriesByKey.asJavaMap();
} | Map<GroupStoreKeyMapKey, StoredGroupEntry> function() { return groupStoreEntriesByKey.asJavaMap(); } | /**
* Returns the group store eventual consistent key map.
*
* @return Map representing group key table.
*/ | Returns the group store eventual consistent key map | getGroupStoreKeyMap | {
"repo_name": "opennetworkinglab/onos",
"path": "core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java",
"license": "apache-2.0",
"size": 75910
} | [
"java.util.Map",
"org.onosproject.net.group.StoredGroupEntry"
] | import java.util.Map; import org.onosproject.net.group.StoredGroupEntry; | import java.util.*; import org.onosproject.net.group.*; | [
"java.util",
"org.onosproject.net"
] | java.util; org.onosproject.net; | 2,004,032 |
if (isInited) return (FunctionblockPackage)EPackage.Registry.INSTANCE.getEPackage(FunctionblockPackage.eNS_URI);
// Obtain or create and register package
FunctionblockPackageImpl theFunctionblockPackage = (FunctionblockPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FunctionblockPackageImpl ? EPa... | if (isInited) return (FunctionblockPackage)EPackage.Registry.INSTANCE.getEPackage(FunctionblockPackage.eNS_URI); FunctionblockPackageImpl theFunctionblockPackage = (FunctionblockPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FunctionblockPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new Funct... | /**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link FunctionblockPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that fi... | Creates, registers, and initializes the Package for this model, and for any others upon which it depends. This method is used to initialize <code>FunctionblockPackage#eINSTANCE</code> when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | init | {
"repo_name": "nagavijays/vorto",
"path": "bundles/org.eclipse.vorto.core/src/org/eclipse/vorto/core/api/model/functionblock/impl/FunctionblockPackageImpl.java",
"license": "epl-1.0",
"size": 25401
} | [
"org.eclipse.emf.ecore.EPackage",
"org.eclipse.vorto.core.api.model.datatype.DatatypePackage",
"org.eclipse.vorto.core.api.model.functionblock.FunctionblockPackage",
"org.eclipse.vorto.core.api.model.model.ModelPackage",
"org.eclipse.vorto.core.api.model.model.impl.ModelPackageImpl"
] | import org.eclipse.emf.ecore.EPackage; import org.eclipse.vorto.core.api.model.datatype.DatatypePackage; import org.eclipse.vorto.core.api.model.functionblock.FunctionblockPackage; import org.eclipse.vorto.core.api.model.model.ModelPackage; import org.eclipse.vorto.core.api.model.model.impl.ModelPackageImpl; | import org.eclipse.emf.ecore.*; import org.eclipse.vorto.core.api.model.datatype.*; import org.eclipse.vorto.core.api.model.functionblock.*; import org.eclipse.vorto.core.api.model.model.*; import org.eclipse.vorto.core.api.model.model.impl.*; | [
"org.eclipse.emf",
"org.eclipse.vorto"
] | org.eclipse.emf; org.eclipse.vorto; | 2,822,006 |
boolean validTreeLocation()
{
int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]};
int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]};
int i = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePo... | boolean validTreeLocation() { int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; int i = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); Block soil = Block.blocks... | /**
* Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height
* limit, is valid.
*/ | Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height limit, is valid | validTreeLocation | {
"repo_name": "Stormister/Rediscovered-Mod-1.6.4",
"path": "source/main/RediscoveredMod/WorldGenBigCherryTrees.java",
"license": "gpl-3.0",
"size": 16634
} | [
"net.minecraft.block.Block",
"net.minecraft.block.BlockSapling",
"net.minecraftforge.common.ForgeDirection"
] | import net.minecraft.block.Block; import net.minecraft.block.BlockSapling; import net.minecraftforge.common.ForgeDirection; | import net.minecraft.block.*; import net.minecraftforge.common.*; | [
"net.minecraft.block",
"net.minecraftforge.common"
] | net.minecraft.block; net.minecraftforge.common; | 2,768,995 |
EReference getExplorationCandidate_ApplicationAlternatives(); | EReference getExplorationCandidate_ApplicationAlternatives(); | /**
* Returns the meta object for the reference list '{@link ch.hilbri.assist.model.ExplorationCandidate#getApplicationAlternatives <em>Application Alternatives</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Application Alternatives</e... | Returns the meta object for the reference list '<code>ch.hilbri.assist.model.ExplorationCandidate#getApplicationAlternatives Application Alternatives</code>'. | getExplorationCandidate_ApplicationAlternatives | {
"repo_name": "RobertHilbrich/assist",
"path": "ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/ModelPackage.java",
"license": "gpl-2.0",
"size": 419306
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 304,267 |
public String getRefClass(ObjectOutput out) {
return "UnicastServerRef";
} | String function(ObjectOutput out) { return STR; } | /**
* Returns the class of the ref type to be serialized.
*/ | Returns the class of the ref type to be serialized | getRefClass | {
"repo_name": "FauxFaux/jdk9-jdk",
"path": "src/java.rmi/share/classes/sun/rmi/server/UnicastServerRef.java",
"license": "gpl-2.0",
"size": 24303
} | [
"java.io.ObjectOutput"
] | import java.io.ObjectOutput; | import java.io.*; | [
"java.io"
] | java.io; | 59,693 |
Result preAppend(final ObserverContext<RegionCoprocessorEnvironment> c,
final Append append)
throws IOException; | Result preAppend(final ObserverContext<RegionCoprocessorEnvironment> c, final Append append) throws IOException; | /**
* Called before Append
* <p>
* Call CoprocessorEnvironment#bypass to skip default actions
* <p>
* Call CoprocessorEnvironment#complete to skip any subsequent chained
* coprocessors
* @param c the environment provided by the region server
* @param append Append object
* @return result to r... | Called before Append Call CoprocessorEnvironment#bypass to skip default actions Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors | preAppend | {
"repo_name": "daidong/DominoHBase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java",
"license": "apache-2.0",
"size": 34195
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.Append",
"org.apache.hadoop.hbase.client.Result"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.Append; import org.apache.hadoop.hbase.client.Result; | import java.io.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,377,319 |
@AfterEach
public void tearDown() throws FileSystemException {
if (manager != null) {
manager.close();
manager = null;
}
} | void function() throws FileSystemException { if (manager != null) { manager.close(); manager = null; } } | /**
* JUnit Fixture: Tear Down the FSM.
*
* @throws FileSystemException for runtime problems
*/ | JUnit Fixture: Tear Down the FSM | tearDown | {
"repo_name": "apache/commons-vfs",
"path": "commons-vfs2/src/test/java/org/apache/commons/vfs2/operations/BasicOperationsTest.java",
"license": "apache-2.0",
"size": 7175
} | [
"org.apache.commons.vfs2.FileSystemException"
] | import org.apache.commons.vfs2.FileSystemException; | import org.apache.commons.vfs2.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,386,410 |
private boolean removeFromHmsParameters(String k) {
org.apache.hadoop.hive.metastore.api.Database msDb = thriftDb_.metastore_db;
Preconditions.checkNotNull(msDb);
if (msDb.getParameters() == null) return false;
return msDb.getParameters().remove(k) != null;
}
public boolean isSystemDb() { return ... | boolean function(String k) { org.apache.hadoop.hive.metastore.api.Database msDb = thriftDb_.metastore_db; Preconditions.checkNotNull(msDb); if (msDb.getParameters() == null) return false; return msDb.getParameters().remove(k) != null; } public boolean isSystemDb() { return isSystemDb_; } | /**
* Updates the hms parameters map by removing the <k,v> pair corresponding to
* input key <k>. Returns true if the parameters map contains a pair <k,v>
* corresponding to input k and it is removed, false otherwise.
*/ | Updates the hms parameters map by removing the pair corresponding to input key . Returns true if the parameters map contains a pair corresponding to input k and it is removed, false otherwise | removeFromHmsParameters | {
"repo_name": "924060929/impala-frontend",
"path": "fe/src/main/java/org/apache/impala/catalog/Db.java",
"license": "apache-2.0",
"size": 17728
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 424,397 |
public Timestamp getCreated();
public static final String COLUMNNAME_CreatedBy = "CreatedBy"; | Timestamp function(); public static final String COLUMNNAME_CreatedBy = STR; | /** Get Created.
* Date this record was created
*/ | Get Created. Date this record was created | getCreated | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/I_AD_User.java",
"license": "gpl-2.0",
"size": 13937
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,101,948 |
public List<Deployment> searchDeployments(String application_id, long start_time, long end_time, String status);
| List<Deployment> function(String application_id, long start_time, long end_time, String status); | /**
* Search deployments.
*
* @param application_id
* the application_id
* @param start_time
* the start_time
* @param end_time
* the end_time
* @param status
* the status
* @return the list
*/ | Search deployments | searchDeployments | {
"repo_name": "CELAR/cloud-is",
"path": "cloud-is-core/dataCollectionModule/src/main/java/eu/celarcloud/cloud_is/dataCollectionModule/common/dtSource/IApplicationMetadata.java",
"license": "apache-2.0",
"size": 3463
} | [
"eu.celarcloud.cloud_is.dataCollectionModule.common.beans.Deployment",
"java.util.List"
] | import eu.celarcloud.cloud_is.dataCollectionModule.common.beans.Deployment; import java.util.List; | import eu.celarcloud.cloud_is.*; import java.util.*; | [
"eu.celarcloud.cloud_is",
"java.util"
] | eu.celarcloud.cloud_is; java.util; | 463,915 |
public void commitIfPrepared(IgniteInternalTx tx, Set<UUID> failedNodeIds) {
assert tx instanceof GridDhtTxLocal || tx instanceof GridDhtTxRemote : tx;
assert !F.isEmpty(tx.transactionNodes()) : tx;
assert tx.nearXidVersion() != null : tx;
GridCacheTxRecoveryFuture fut = new GridCa... | void function(IgniteInternalTx tx, Set<UUID> failedNodeIds) { assert tx instanceof GridDhtTxLocal tx instanceof GridDhtTxRemote : tx; assert !F.isEmpty(tx.transactionNodes()) : tx; assert tx.nearXidVersion() != null : tx; GridCacheTxRecoveryFuture fut = new GridCacheTxRecoveryFuture( cctx, tx, failedNodeIds, tx.transac... | /**
* Commits transaction in case when node started transaction failed, but all related
* transactions were prepared (invalidates transaction if it is not fully prepared).
*
* @param tx Transaction.
* @param failedNodeIds Failed nodes IDs.
*/ | Commits transaction in case when node started transaction failed, but all related transactions were prepared (invalidates transaction if it is not fully prepared) | commitIfPrepared | {
"repo_name": "nivanov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java",
"license": "apache-2.0",
"size": 89685
} | [
"java.util.Set",
"org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryFuture",
"org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal",
"org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxRemote",
"org.apache.ignite.internal.util.typedef.F"
] | import java.util.Set; import org.apache.ignite.internal.processors.cache.distributed.GridCacheTxRecoveryFuture; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal; import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxRemote; import org.apache.ignite.internal.util.ty... | import java.util.*; import org.apache.ignite.internal.processors.cache.distributed.*; import org.apache.ignite.internal.processors.cache.distributed.dht.*; import org.apache.ignite.internal.util.typedef.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 2,381,629 |
public JspServletWrapper getWrapper(String jspUri) {
return jsps.get(jspUri);
} | JspServletWrapper function(String jspUri) { return jsps.get(jspUri); } | /**
* Get an already existing JspServletWrapper.
*
* @param jspUri JSP URI
* @return JspServletWrapper for JSP
*/ | Get an already existing JspServletWrapper | getWrapper | {
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.0/JspRuntimeContext.java",
"license": "mit",
"size": 19299
} | [
"org.apache.jasper.servlet.JspServletWrapper"
] | import org.apache.jasper.servlet.JspServletWrapper; | import org.apache.jasper.servlet.*; | [
"org.apache.jasper"
] | org.apache.jasper; | 1,219,534 |
protected void comma()
throws SyntaxErrorException {
int ch = nextCh();
if ( ch != (int)',' ) {
if ( ch >= (int)' ' && ch <= (int)'~' ) {
throw new SyntaxErrorException( "next character ('" + (char)ch + "') is not a comma" );
} else {
... | void function() throws SyntaxErrorException { int ch = nextCh(); if ( ch != (int)',' ) { if ( ch >= (int)' ' && ch <= (int)'~' ) { throw new SyntaxErrorException( STR + (char)ch + STR ); } else { throw new SyntaxErrorException( STR + fmtHex( ch ) + STR ); } } } | /**
* Consume the next character (which must be a comma).
*
* @throws SyntaxErrorException if the next character is not a comma.
*/ | Consume the next character (which must be a comma) | comma | {
"repo_name": "safedoorpm/Pipestone",
"path": "src/com/obtuse/util/CSVParser.java",
"license": "apache-2.0",
"size": 15448
} | [
"com.obtuse.util.exceptions.SyntaxErrorException"
] | import com.obtuse.util.exceptions.SyntaxErrorException; | import com.obtuse.util.exceptions.*; | [
"com.obtuse.util"
] | com.obtuse.util; | 1,495,897 |
public static ChannelBuffer copiedBuffer(ByteOrder endianness, char[] array, Charset charset) {
return copiedBuffer(endianness, array, 0, array.length, charset);
} | static ChannelBuffer function(ByteOrder endianness, char[] array, Charset charset) { return copiedBuffer(endianness, array, 0, array.length, charset); } | /**
* Creates a new buffer with the specified {@code endianness} whose
* content is the specified {@code array} encoded in the specified
* {@code charset}. The new buffer's {@code readerIndex} and
* {@code writerIndex} are {@code 0} and the length of the encoded string
* respectively.
*/ | Creates a new buffer with the specified endianness whose content is the specified array encoded in the specified charset. The new buffer's readerIndex and writerIndex are 0 and the length of the encoded string respectively | copiedBuffer | {
"repo_name": "ferdiknight/leon",
"path": "demo/src/main/java/com/blueferdi/leon/demo/typeahead/buffer/ChannelBuffers.java",
"license": "lgpl-3.0",
"size": 42046
} | [
"java.nio.ByteOrder",
"java.nio.charset.Charset"
] | import java.nio.ByteOrder; import java.nio.charset.Charset; | import java.nio.*; import java.nio.charset.*; | [
"java.nio"
] | java.nio; | 2,548,121 |
void setLocale(Locale loc); | void setLocale(Locale loc); | /**
* Changes the locale of this response.
*
* @param loc the new locale
*/ | Changes the locale of this response | setLocale | {
"repo_name": "kalikov/lighthouse",
"path": "app/src/main/java/ru/radiomayak/http/HttpResponse.java",
"license": "apache-2.0",
"size": 5174
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 87,959 |
public void listen(View view){
//If the Bluetooth module is off, turn it on. This is possible thanks to android.permission.BLUETOOTH_ADMIN.
//Otherwise we should have asked the user to turn it on via a Dialog.
if (!bluetoothAdapter.isEnabled()){
bluetoothAdapter.enable();
... | void function(View view){ if (!bluetoothAdapter.isEnabled()){ bluetoothAdapter.enable(); turnedOnByApp = true; } receivedText.setText(STR); if (bluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE){ Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); di... | /**
* Method called when clicking on the "Listen" button.
* It enables Bluetooth, makes the phone discoverable and launches the server.
*/ | Method called when clicking on the "Listen" button. It enables Bluetooth, makes the phone discoverable and launches the server | listen | {
"repo_name": "QSchulz/BluetoothCommunicationAndroid-PC",
"path": "Android/app/src/main/java/com/wordpress/tricksandprojects/bluetoothcommunication/Home.java",
"license": "gpl-2.0",
"size": 6575
} | [
"android.bluetooth.BluetoothAdapter",
"android.content.Intent",
"android.view.View",
"android.widget.Toast"
] | import android.bluetooth.BluetoothAdapter; import android.content.Intent; import android.view.View; import android.widget.Toast; | import android.bluetooth.*; import android.content.*; import android.view.*; import android.widget.*; | [
"android.bluetooth",
"android.content",
"android.view",
"android.widget"
] | android.bluetooth; android.content; android.view; android.widget; | 32,974 |
static void configurePartitioner(Job job, List<ImmutableBytesWritable> splitPoints)
throws IOException {
Configuration conf = job.getConfiguration();
// create the partitions file
FileSystem fs = FileSystem.get(conf);
Path partitionsPath = new Path(conf.get("hadoop.tmp.dir"), "partitions_" + UUI... | static void configurePartitioner(Job job, List<ImmutableBytesWritable> splitPoints) throws IOException { Configuration conf = job.getConfiguration(); FileSystem fs = FileSystem.get(conf); Path partitionsPath = new Path(conf.get(STR), STR + UUID.randomUUID()); fs.makeQualified(partitionsPath); writePartitions(conf, part... | /**
* Configure <code>job</code> with a TotalOrderPartitioner, partitioning against
* <code>splitPoints</code>. Cleans up the partitions file after job exists.
*/ | Configure <code>job</code> with a TotalOrderPartitioner, partitioning against <code>splitPoints</code>. Cleans up the partitions file after job exists | configurePartitioner | {
"repo_name": "andrewmains12/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java",
"license": "apache-2.0",
"size": 30845
} | [
"java.io.IOException",
"java.util.List",
"java.util.UUID",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.io.ImmutableBytesWritable",
"org.apache.hadoop.mapreduce.Job",
"org.apache.hadoop.mapreduce.lib.partition.TotalO... | import java.io.IOException; import java.util.List; import java.util.UUID; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapr... | import java.io.*; import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.mapreduce.lib.partition.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 721,362 |
public Img getPointStyleAsImage() {
return getConfiguration().getElements().getPoint().getPointStyleAsImage();
} | Img function() { return getConfiguration().getElements().getPoint().getPointStyleAsImage(); } | /**
* Returns the style of the point as image.
*
* @return the style of the point as image.
*/ | Returns the style of the point as image | getPointStyleAsImage | {
"repo_name": "pepstock-org/Charba",
"path": "src/org/pepstock/charba/client/configuration/Point.java",
"license": "apache-2.0",
"size": 15183
} | [
"org.pepstock.charba.client.dom.elements.Img"
] | import org.pepstock.charba.client.dom.elements.Img; | import org.pepstock.charba.client.dom.elements.*; | [
"org.pepstock.charba"
] | org.pepstock.charba; | 1,089,371 |
public long getCurrentValue() throws IOException {
synchronized (READ_WRITE_LOCK) {
ensureOpen();
//io.force(true); // this takes unreasonable amount of time for some reason - at least on windows with java7
buffer.clear();
io.position(0);
io.read(buffer);
buffer.flip();
return buf... | long function() throws IOException { synchronized (READ_WRITE_LOCK) { ensureOpen(); buffer.clear(); io.position(0); io.read(buffer); buffer.flip(); return buffer.getLong(); } } | /**
* Should only be used for initialization of sequence values.
* Use {@link #getAndSet(int)} for advancing sequences to higher values.
* @return
* @throws IOException
*/ | Should only be used for initialization of sequence values. Use <code>#getAndSet(int)</code> for advancing sequences to higher values | getCurrentValue | {
"repo_name": "CloverETL/CloverETL-Engine",
"path": "cloveretl.sequence/src/org/jetel/sequence/SimpleSequenceSynchronizer.java",
"license": "lgpl-2.1",
"size": 10334
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 711,220 |
public boolean restrict(final String[] roleNames, final Subject subject); | boolean function(final String[] roleNames, final Subject subject); | /**
* Check if the specified subject has all the roles
*
* @param roleNames
* an array of role names
* @param subject
* a subject
* @return true if the user has all the specified roles
*/ | Check if the specified subject has all the roles | restrict | {
"repo_name": "theAgileFactory/app-framework",
"path": "app/framework/security/ISecurityService.java",
"license": "gpl-2.0",
"size": 5438
} | [
"be.objectify.deadbolt.core.models.Subject"
] | import be.objectify.deadbolt.core.models.Subject; | import be.objectify.deadbolt.core.models.*; | [
"be.objectify.deadbolt"
] | be.objectify.deadbolt; | 2,531,588 |
public void setHostCalibrationData(List<HostEnergyCalibrationData> datapoints); | void function(List<HostEnergyCalibrationData> datapoints); | /**
* This sets the host calibration data for this agent.
* @param datapoints The datapoints to use for estimating energy usage.
*/ | This sets the host calibration data for this agent | setHostCalibrationData | {
"repo_name": "TANGO-Project/code-optimiser-plugin",
"path": "bundles/org.jvmmonitor.agent/src/org/jvmmonitor/internal/agent/PowerMXBean.java",
"license": "apache-2.0",
"size": 1418
} | [
"eu.tango.energymodeller.types.energyuser.usage.HostEnergyCalibrationData",
"java.util.List"
] | import eu.tango.energymodeller.types.energyuser.usage.HostEnergyCalibrationData; import java.util.List; | import eu.tango.energymodeller.types.energyuser.usage.*; import java.util.*; | [
"eu.tango.energymodeller",
"java.util"
] | eu.tango.energymodeller; java.util; | 2,483,232 |
public MetricAlertSingleResourceMultipleMetricCriteria withAllOf(List<MetricCriteria> allOf) {
this.allOf = allOf;
return this;
} | MetricAlertSingleResourceMultipleMetricCriteria function(List<MetricCriteria> allOf) { this.allOf = allOf; return this; } | /**
* Set the list of metric criteria for this 'all of' operation.
*
* @param allOf the allOf value to set
* @return the MetricAlertSingleResourceMultipleMetricCriteria object itself.
*/ | Set the list of metric criteria for this 'all of' operation | withAllOf | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/monitor/mgmt-v2018_03_01/src/main/java/com/microsoft/azure/management/monitor/v2018_03_01/MetricAlertSingleResourceMultipleMetricCriteria.java",
"license": "mit",
"size": 1585
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,262,443 |
public String[] readDiscIds() {
String line = getTagText("DISCID");
StringTokenizer st = new StringTokenizer(line, ", ");
List<String> discIds = new ArrayList<String>();
while (st.hasMoreTokens()) {
discIds.add(st.nextToken());
}
return discIds.toArray(new... | String[] function() { String line = getTagText(STR); StringTokenizer st = new StringTokenizer(line, STR); List<String> discIds = new ArrayList<String>(); while (st.hasMoreTokens()) { discIds.add(st.nextToken()); } return discIds.toArray(new String[discIds.size()]); } | /**
* Parses for possibly multiple disc ids to support
* searching for disc ids that link to the same file
*/ | Parses for possibly multiple disc ids to support searching for disc ids that link to the same file | readDiscIds | {
"repo_name": "cpesch/MetaMusic",
"path": "retrieval-tools/src/main/java/slash/metamusic/freedb/CDDBXmcdParser.java",
"license": "gpl-2.0",
"size": 18411
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.StringTokenizer"
] | import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 2,909,578 |
@Test
public void testRequireNonNullNamespace() throws Exception {
AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE);
ValueStateDescriptor<IntValue> kvId = new ValueStateDescriptor<>("id", IntValue.class, new IntValue(-1));
try {
backend.getPartitionedState(null, Voi... | void function() throws Exception { AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE); ValueStateDescriptor<IntValue> kvId = new ValueStateDescriptor<>("id", IntValue.class, new IntValue(-1)); try { backend.getPartitionedState(null, VoidNamespaceSerializer.INSTANCE, kvId); fail(STR)... | /**
* Previously, it was possible to create partitioned state with
* <code>null</code> namespace. This test makes sure that this is
* prohibited now.
*/ | Previously, it was possible to create partitioned state with <code>null</code> namespace. This test makes sure that this is prohibited now | testRequireNonNullNamespace | {
"repo_name": "DieBauer/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java",
"license": "apache-2.0",
"size": 91277
} | [
"org.apache.flink.api.common.state.ValueStateDescriptor",
"org.apache.flink.api.common.typeutils.base.IntSerializer",
"org.apache.flink.types.IntValue",
"org.junit.Assert"
] | import org.apache.flink.api.common.state.ValueStateDescriptor; import org.apache.flink.api.common.typeutils.base.IntSerializer; import org.apache.flink.types.IntValue; import org.junit.Assert; | import org.apache.flink.api.common.state.*; import org.apache.flink.api.common.typeutils.base.*; import org.apache.flink.types.*; import org.junit.*; | [
"org.apache.flink",
"org.junit"
] | org.apache.flink; org.junit; | 2,644,752 |
public MetaProperty<LocalDate> endDate() {
return endDate;
} | MetaProperty<LocalDate> function() { return endDate; } | /**
* The meta-property for the {@code endDate} property.
* @return the meta-property, not null
*/ | The meta-property for the endDate property | endDate | {
"repo_name": "nssales/Strata",
"path": "modules/finance/src/main/java/com/opengamma/strata/finance/rate/OvernightCompoundedRateObservation.java",
"license": "apache-2.0",
"size": 22392
} | [
"java.time.LocalDate",
"org.joda.beans.MetaProperty"
] | import java.time.LocalDate; import org.joda.beans.MetaProperty; | import java.time.*; import org.joda.beans.*; | [
"java.time",
"org.joda.beans"
] | java.time; org.joda.beans; | 146,422 |
public void processPlayerDigging(C07PacketPlayerDigging packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension);
BlockPos blockpos = pa... | void function(C07PacketPlayerDigging packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); BlockPos blockpos = packetIn.getPosition(); this.playerEntity.markPlayerA... | /**
* Processes the player initiating/stopping digging on a particular spot, as well as a player dropping items?. (0:
* initiated, 1: reinitiated, 2? , 3-4 drop item (respectively without or with player control), 5: stopped; x,y,z,
* side clicked on;)
*/ | Processes the player initiating/stopping digging on a particular spot, as well as a player dropping items?. (0: initiated, 1: reinitiated, 2? , 3-4 drop item (respectively without or with player control), 5: stopped; x,y,z, side clicked on;) | processPlayerDigging | {
"repo_name": "tomtomtom09/CampCraft",
"path": "build/tmp/recompileMc/sources/net/minecraft/network/NetHandlerPlayServer.java",
"license": "gpl-3.0",
"size": 64328
} | [
"net.minecraft.block.material.Material",
"net.minecraft.network.play.client.C07PacketPlayerDigging",
"net.minecraft.network.play.server.S23PacketBlockChange",
"net.minecraft.util.BlockPos",
"net.minecraft.world.WorldServer"
] | import net.minecraft.block.material.Material; import net.minecraft.network.play.client.C07PacketPlayerDigging; import net.minecraft.network.play.server.S23PacketBlockChange; import net.minecraft.util.BlockPos; import net.minecraft.world.WorldServer; | import net.minecraft.block.material.*; import net.minecraft.network.play.client.*; import net.minecraft.network.play.server.*; import net.minecraft.util.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.network",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.network; net.minecraft.util; net.minecraft.world; | 1,800,903 |
public static String[] splitIgnoreInQuotes(final String source,
final char splitChar,
final boolean deleteHeadTailQuotes) throws Exception
{
// Trim, replace tabs with spaces so we only need to handle
/... | static String[] function(final String source, final char splitChar, final boolean deleteHeadTailQuotes) throws Exception { final String trimmedSource; if (splitChar != TAB) { trimmedSource = source.replace(TAB, SPACE).trim(); } else { trimmedSource = source; } final String escapedSource = substituteEscapedQuotes(trimme... | /** Split source string into an array of elements separated by the splitting character,
* but ignoring split characters enclosed in quotes.
*
* @param trimmedSource String to be split
* @param splitChar Character used to split the source string, e.g. ',' or ' '
* @param deleteHeadTailQuotes... | Split source string into an array of elements separated by the splitting character, but ignoring split characters enclosed in quotes | splitIgnoreInQuotes | {
"repo_name": "fqqb/yamcs-studio",
"path": "bundles/org.csstudio.ui.util/src/org/csstudio/java/string/StringSplitter.java",
"license": "epl-1.0",
"size": 5023
} | [
"java.util.regex.Pattern"
] | import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 932,190 |
public AVMService getAvmService()
{
if (this.avmService == null)
{
this.avmService = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getAVMService();
}
return this.avmService;
} | AVMService function() { if (this.avmService == null) { this.avmService = Repository.getServiceRegistry( FacesContext.getCurrentInstance()).getAVMService(); } return this.avmService; } | /**
* Get avmService property for this bean
*
* @return avmService property value for this bean
*/ | Get avmService property for this bean | getAvmService | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/web-client/source/java/org/alfresco/web/bean/wcm/FilePickerBean.java",
"license": "lgpl-3.0",
"size": 39604
} | [
"javax.faces.context.FacesContext",
"org.alfresco.service.cmr.avm.AVMService",
"org.alfresco.web.bean.repository.Repository"
] | import javax.faces.context.FacesContext; import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.web.bean.repository.Repository; | import javax.faces.context.*; import org.alfresco.service.cmr.avm.*; import org.alfresco.web.bean.repository.*; | [
"javax.faces",
"org.alfresco.service",
"org.alfresco.web"
] | javax.faces; org.alfresco.service; org.alfresco.web; | 2,757,236 |
// TODO(binfan): make this private and use whitebox to access this method in test
public TTransport getClientTransport(String username, String password, String impersonationUser,
InetSocketAddress serverAddress) throws UnauthenticatedException {
TTransport baseTransport = ThriftUtils.createThriftSocket(s... | TTransport function(String username, String password, String impersonationUser, InetSocketAddress serverAddress) throws UnauthenticatedException { TTransport baseTransport = ThriftUtils.createThriftSocket(serverAddress); try { return new TSaslClientTransport(PlainSaslServerProvider.MECHANISM, impersonationUser, null, n... | /**
* Gets a PLAIN mechanism transport for client side.
*
* @param username User Name of PlainClient
* @param password Password of PlainClient
* @param impersonationUser impersonation user (not used if null)
* @param serverAddress address of the server
* @return Wrapped transport with PLAIN mechani... | Gets a PLAIN mechanism transport for client side | getClientTransport | {
"repo_name": "Reidddddd/alluxio",
"path": "core/common/src/main/java/alluxio/security/authentication/PlainSaslTransportProvider.java",
"license": "apache-2.0",
"size": 5107
} | [
"java.net.InetSocketAddress",
"java.util.HashMap",
"javax.security.sasl.SaslException",
"org.apache.thrift.transport.TSaslClientTransport",
"org.apache.thrift.transport.TTransport"
] | import java.net.InetSocketAddress; import java.util.HashMap; import javax.security.sasl.SaslException; import org.apache.thrift.transport.TSaslClientTransport; import org.apache.thrift.transport.TTransport; | import java.net.*; import java.util.*; import javax.security.sasl.*; import org.apache.thrift.transport.*; | [
"java.net",
"java.util",
"javax.security",
"org.apache.thrift"
] | java.net; java.util; javax.security; org.apache.thrift; | 1,594,236 |
public static void copyFromStreamToBuffer(ByteBuffer out,
DataInputStream in, int length) throws IOException {
if (out.hasArray()) {
in.readFully(out.array(), out.position() + out.arrayOffset(),
length);
skip(out, length);
} else {
for (int i = 0; i < length; ++i) {
o... | static void function(ByteBuffer out, DataInputStream in, int length) throws IOException { if (out.hasArray()) { in.readFully(out.array(), out.position() + out.arrayOffset(), length); skip(out, length); } else { for (int i = 0; i < length; ++i) { out.put(in.readByte()); } } } | /**
* Copy the given number of bytes from the given stream and put it at the
* current position of the given buffer, updating the position in the buffer.
* @param out the buffer to write data to
* @param in the stream to read data from
* @param length the number of bytes to read/write
*/ | Copy the given number of bytes from the given stream and put it at the current position of the given buffer, updating the position in the buffer | copyFromStreamToBuffer | {
"repo_name": "Jackygq1982/hbase_src",
"path": "hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java",
"license": "apache-2.0",
"size": 13495
} | [
"java.io.DataInputStream",
"java.io.IOException",
"java.nio.ByteBuffer"
] | import java.io.DataInputStream; import java.io.IOException; import java.nio.ByteBuffer; | import java.io.*; import java.nio.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 75,230 |
@Test(expected = Exception.class)
public void testGetFileException() throws Exception {
// Null exception must be thrown
factory.getFile(null);
} | @Test(expected = Exception.class) void function() throws Exception { factory.getFile(null); } | /**
* Tests exception handling for getting files
*/ | Tests exception handling for getting files | testGetFileException | {
"repo_name": "venicegeo/pz-jobcommon",
"path": "src/test/java/model/data/FileAccessTest.java",
"license": "apache-2.0",
"size": 3833
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 452,078 |
@ServiceMethod(returns = ReturnType.SINGLE)
public DeleteOperationResultInner delete(String resourceGroupName, String profileName) {
return deleteAsync(resourceGroupName, profileName).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) DeleteOperationResultInner function(String resourceGroupName, String profileName) { return deleteAsync(resourceGroupName, profileName).block(); } | /**
* Deletes a Traffic Manager profile.
*
* @param resourceGroupName The name of the resource group containing the Traffic Manager profile to be deleted.
* @param profileName The name of the Traffic Manager profile to be deleted.
* @throws IllegalArgumentException thrown if parameters fail the... | Deletes a Traffic Manager profile | delete | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-trafficmanager/src/main/java/com/azure/resourcemanager/trafficmanager/implementation/ProfilesClientImpl.java",
"license": "mit",
"size": 57785
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.trafficmanager.fluent.models.DeleteOperationResultInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.trafficmanager.fluent.models.DeleteOperationResultInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.trafficmanager.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 235,459 |
public static boolean isAllowed(String url, String method) throws IOException {
FaceletsAuthorizeTag authorizeTag = new FaceletsAuthorizeTag();
authorizeTag.setUrl(url);
authorizeTag.setMethod(method);
return authorizeTag.authorizeUsingUrlCheck();
} | static boolean function(String url, String method) throws IOException { FaceletsAuthorizeTag authorizeTag = new FaceletsAuthorizeTag(); authorizeTag.setUrl(url); authorizeTag.setMethod(method); return authorizeTag.authorizeUsingUrlCheck(); } | /**
* Returns true if the user is allowed to access the given URL and HTTP
* method combination. The HTTP method is optional and case insensitive.
* @param url to be accessed.
* @param method to be called.
* @return computation if the user is allowed to access the given URL and HTTP method.
* @throws IOExce... | Returns true if the user is allowed to access the given URL and HTTP method combination. The HTTP method is optional and case insensitive | isAllowed | {
"repo_name": "larsgrefer/joinfaces",
"path": "joinfaces-security-taglib/src/main/java/org/joinfaces/security/taglib/FaceletsAuthorizeTagUtils.java",
"license": "apache-2.0",
"size": 4138
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,929,356 |
public void addAccessToClass(org.ontoware.rdfreactor.schema.rdfs.Class value) {
Base.add(this.model, this.getResource(), ACCESS_TO_CLASS, value);
} | void function(org.ontoware.rdfreactor.schema.rdfs.Class value) { Base.add(this.model, this.getResource(), ACCESS_TO_CLASS, value); } | /**
* Adds a value to property AccessToClass from an instance of
* org.ontoware.rdfreactor.schema.rdfs.Class [Generated from RDFReactor
* template rule #add4dynamic]
*/ | Adds a value to property AccessToClass from an instance of org.ontoware.rdfreactor.schema.rdfs.Class [Generated from RDFReactor template rule #add4dynamic] | addAccessToClass | {
"repo_name": "m0ep/master-thesis",
"path": "source/apis/rdf2go/rdf2go-w3-wacl/src/main/java/org/w3/ns/auth/acl/Authorization.java",
"license": "mit",
"size": 78044
} | [
"org.ontoware.rdfreactor.runtime.Base"
] | import org.ontoware.rdfreactor.runtime.Base; | import org.ontoware.rdfreactor.runtime.*; | [
"org.ontoware.rdfreactor"
] | org.ontoware.rdfreactor; | 675,203 |
public void close() throws IOException {
if (in != null) {
try {
in.close();
} finally {
in = null;
}
}
} | void function() throws IOException { if (in != null) { try { in.close(); } finally { in = null; } } } | /**
* Closes the stream and calls <code>in.close()</code>.
* If the stream was already closed, this does nothing.
*
* @throws IOException if thrown by <code>in.close()</code>
*/ | Closes the stream and calls <code>in.close()</code>. If the stream was already closed, this does nothing | close | {
"repo_name": "itsgreco/VirtueRS3",
"path": "src/org/virtue/cache/utility/tukaani/DeltaInputStream.java",
"license": "mit",
"size": 4188
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,726,248 |
public void addAttachment(String name, InputStream content) {
try {
byte[] binaryData = StreamUtils.toByteArray(content);
attachments.put(name, map("content_type", MimeUtil.mostSpecificContentType(binaryData), "data", new String(
Base64.encodeBase64(binaryData))))... | void function(String name, InputStream content) { try { byte[] binaryData = StreamUtils.toByteArray(content); attachments.put(name, map(STR, MimeUtil.mostSpecificContentType(binaryData), "data", new String( Base64.encodeBase64(binaryData)))); } catch (IOException e) { throw new Couch4JException(e); } } | /**
* Add an attachment to the document using the name and the given
* {@link InputStream}.
* <p>
* This method should only be used for "small-ish" attachments.
* <p>
* For larger attachments use the
* {@link Database#saveAttachment(Document, String, InputStream)}.
*
* @par... | Add an attachment to the document using the name and the given <code>InputStream</code>. This method should only be used for "small-ish" attachments. For larger attachments use the <code>Database#saveAttachment(Document, String, InputStream)</code> | addAttachment | {
"repo_name": "lettas/couch4j",
"path": "src/main/java/org/couch4j/api/Document.java",
"license": "mit",
"size": 5784
} | [
"java.io.IOException",
"java.io.InputStream",
"org.apache.commons.codec.binary.Base64",
"org.couch4j.exceptions.Couch4JException",
"org.couch4j.util.CollectionUtils",
"org.couch4j.util.MimeUtil",
"org.couch4j.util.StreamUtils"
] | import java.io.IOException; import java.io.InputStream; import org.apache.commons.codec.binary.Base64; import org.couch4j.exceptions.Couch4JException; import org.couch4j.util.CollectionUtils; import org.couch4j.util.MimeUtil; import org.couch4j.util.StreamUtils; | import java.io.*; import org.apache.commons.codec.binary.*; import org.couch4j.exceptions.*; import org.couch4j.util.*; | [
"java.io",
"org.apache.commons",
"org.couch4j.exceptions",
"org.couch4j.util"
] | java.io; org.apache.commons; org.couch4j.exceptions; org.couch4j.util; | 2,824,188 |
@Override
public double cumulativeProbability(int x) throws MathException {
if (x < 0) {
return 0;
}
if (x == Integer.MAX_VALUE) {
return 1;
}
return Gamma.regularizedGammaQ((double) x + 1, mean, epsilon, maxIterations);
} | double function(int x) throws MathException { if (x < 0) { return 0; } if (x == Integer.MAX_VALUE) { return 1; } return Gamma.regularizedGammaQ((double) x + 1, mean, epsilon, maxIterations); } | /**
* The probability distribution function P(X <= x) for a Poisson
* distribution.
*
* @param x the value at which the PDF is evaluated.
* @return Poisson distribution function evaluated at x
* @throws MathException if the cumulative probability can not be computed
* ... | The probability distribution function P(X <= x) for a Poisson distribution | cumulativeProbability | {
"repo_name": "rbouckaert/YABBY",
"path": "src/yabby/org/apache/commons/math/distribution/PoissonDistributionImpl.java",
"license": "lgpl-3.0",
"size": 9658
} | [
"org.apache.commons.math.MathException",
"org.apache.commons.math.special.Gamma"
] | import org.apache.commons.math.MathException; import org.apache.commons.math.special.Gamma; | import org.apache.commons.math.*; import org.apache.commons.math.special.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,486,486 |
@Override
public Object get(Object key, Object aCallbackArgument, boolean generateCallbacks,
boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient,
EntryEventImpl clientEvent, boolean returnTombstones)
throws TimeoutException, CacheLoaderException {
validateKey(... | Object function(Object key, Object aCallbackArgument, boolean generateCallbacks, boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones) throws TimeoutException, CacheLoaderException { validateKey(key); checkReadiness(); checkForNoAcce... | /**
* override the one in LocalRegion since we don't need to do getDeserialized.
*/ | override the one in LocalRegion since we don't need to do getDeserialized | get | {
"repo_name": "davebarnes97/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java",
"license": "apache-2.0",
"size": 381189
} | [
"org.apache.geode.cache.CacheLoaderException",
"org.apache.geode.cache.TimeoutException",
"org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID"
] | import org.apache.geode.cache.CacheLoaderException; import org.apache.geode.cache.TimeoutException; import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; | import org.apache.geode.cache.*; import org.apache.geode.internal.cache.tier.sockets.*; | [
"org.apache.geode"
] | org.apache.geode; | 1,247,721 |
public String getDefaultsPackageContent() {
return DefaultsPackage.getDefaultsPackageContent(configurationOptions);
} | String function() { return DefaultsPackage.getDefaultsPackageContent(configurationOptions); } | /**
* Returns the defaults package for the default settings.
*/ | Returns the defaults package for the default settings | getDefaultsPackageContent | {
"repo_name": "kamalmarhubi/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java",
"license": "apache-2.0",
"size": 18621
} | [
"com.google.devtools.build.lib.analysis.config.DefaultsPackage"
] | import com.google.devtools.build.lib.analysis.config.DefaultsPackage; | import com.google.devtools.build.lib.analysis.config.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,450,642 |
public List<String> getClassIdsForUserWithRole(
final String username, final Clazz.Role role)
throws DataAccessException {
try {
return getJdbcTemplate().query(
SQL_GET_CLASS_IDS_FOR_USER_WITH_ROLE,
new Object[] { username, role.toString() },
new SingleColumnRowMapper<String>()
);
... | List<String> function( final String username, final Clazz.Role role) throws DataAccessException { try { return getJdbcTemplate().query( SQL_GET_CLASS_IDS_FOR_USER_WITH_ROLE, new Object[] { username, role.toString() }, new SingleColumnRowMapper<String>() ); } catch(org.springframework.dao.DataAccessException e) { throw ... | /**
* Retrieves the list of class identifiers for a user with a given role in
* that class.
*
* @param username The user's username.
*
* @param role The user's class role.
*
* @return The list of class identifiers.
*
* @throws DataAccessException Thrown if there is an error.
*/ | Retrieves the list of class identifiers for a user with a given role in that class | getClassIdsForUserWithRole | {
"repo_name": "HaiJiaoXinHeng/server-1",
"path": "src/org/ohmage/query/impl/UserClassQueries.java",
"license": "apache-2.0",
"size": 14373
} | [
"java.util.List",
"org.ohmage.domain.Clazz",
"org.ohmage.exception.DataAccessException",
"org.springframework.jdbc.core.SingleColumnRowMapper"
] | import java.util.List; import org.ohmage.domain.Clazz; import org.ohmage.exception.DataAccessException; import org.springframework.jdbc.core.SingleColumnRowMapper; | import java.util.*; import org.ohmage.domain.*; import org.ohmage.exception.*; import org.springframework.jdbc.core.*; | [
"java.util",
"org.ohmage.domain",
"org.ohmage.exception",
"org.springframework.jdbc"
] | java.util; org.ohmage.domain; org.ohmage.exception; org.springframework.jdbc; | 134,456 |
public void testContainsAll() {
TreeSet q = populatedSet(SIZE);
TreeSet p = new TreeSet();
for (int i = 0; i < SIZE; ++i) {
assertTrue(q.containsAll(p));
assertFalse(p.containsAll(q));
p.add(new Integer(i));
}
assertTrue(p.containsAll(q));
... | void function() { TreeSet q = populatedSet(SIZE); TreeSet p = new TreeSet(); for (int i = 0; i < SIZE; ++i) { assertTrue(q.containsAll(p)); assertFalse(p.containsAll(q)); p.add(new Integer(i)); } assertTrue(p.containsAll(q)); } | /**
* containsAll(c) is true when c contains a subset of elements
*/ | containsAll(c) is true when c contains a subset of elements | testContainsAll | {
"repo_name": "md-5/jdk10",
"path": "test/jdk/java/util/concurrent/tck/TreeSetTest.java",
"license": "gpl-2.0",
"size": 30637
} | [
"java.util.TreeSet"
] | import java.util.TreeSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,009,332 |
@Test
public void shouldHandleErrorAtEndOfWalk() throws IOException, InterruptedException {
expect(configuration.createPDU(PDU.GETBULK)).andReturn(new PDU());
expect(target.getVersion()).andReturn(SnmpConstants.version2c);
expect(configuration.getMaxRepetitions()).andReturn(1);
... | void function() throws IOException, InterruptedException { expect(configuration.createPDU(PDU.GETBULK)).andReturn(new PDU()); expect(target.getVersion()).andReturn(SnmpConstants.version2c); expect(configuration.getMaxRepetitions()).andReturn(1); expectToGetBulkAndGenerateException(DUMMY_OID1); replayAll(); final WalkRe... | /**
* Should handle error at end of walk.
*
* @throws IOException the io exception
* @throws InterruptedException the interrupted exception
*/ | Should handle error at end of walk | shouldHandleErrorAtEndOfWalk | {
"repo_name": "btisystems/snmp-core",
"path": "src/test/java/com/btisystems/pronx/ems/core/snmp/SnmpSessionTest.java",
"license": "apache-2.0",
"size": 28791
} | [
"java.io.IOException",
"org.easymock.EasyMock",
"org.junit.Assert",
"org.snmp4j.mp.SnmpConstants"
] | import java.io.IOException; import org.easymock.EasyMock; import org.junit.Assert; import org.snmp4j.mp.SnmpConstants; | import java.io.*; import org.easymock.*; import org.junit.*; import org.snmp4j.mp.*; | [
"java.io",
"org.easymock",
"org.junit",
"org.snmp4j.mp"
] | java.io; org.easymock; org.junit; org.snmp4j.mp; | 2,210,288 |
public static void setName(Model model,
org.ontoware.rdf2go.model.node.Resource instanceResource,
java.lang.String value) {
Base.set(model, instanceResource, NAME, value);
} | static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) { Base.set(model, instanceResource, NAME, value); } | /**
* Sets a value of property Name from an instance of java.lang.String First,
* all existing values are removed, then this value is added. Cardinality
* constraints are not checked, but this method exists only for properties
* with no minCardinality or minCardinality == 1.
*
* @param mo... | Sets a value of property Name from an instance of java.lang.String First, all existing values are removed, then this value is added. Cardinality constraints are not checked, but this method exists only for properties with no minCardinality or minCardinality == 1 | setName | {
"repo_name": "m0ep/master-thesis",
"path": "source/apis/rdf2go/rdf2go-foaf/src/main/java/com/xmlns/foaf/Thing.java",
"license": "mit",
"size": 274766
} | [
"org.ontoware.rdf2go.model.Model",
"org.ontoware.rdfreactor.runtime.Base"
] | import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base; | import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*; | [
"org.ontoware.rdf2go",
"org.ontoware.rdfreactor"
] | org.ontoware.rdf2go; org.ontoware.rdfreactor; | 2,809,991 |
boolean updateAddressInfo(SimpleString address, Collection<RoutingType> routingTypes) throws Exception; | boolean updateAddressInfo(SimpleString address, Collection<RoutingType> routingTypes) throws Exception; | /**
* Updates an {@code AddressInfo} on the broker with the specified routing types.
*
* @param address the name of the {@code AddressInfo} to update
* @param routingTypes the routing types to update the {@code AddressInfo} with
* @return {@code true} if the {@code AddressInfo} was updated, {@code f... | Updates an AddressInfo on the broker with the specified routing types | updateAddressInfo | {
"repo_name": "pgfox/activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java",
"license": "apache-2.0",
"size": 17573
} | [
"java.util.Collection",
"org.apache.activemq.artemis.api.core.RoutingType",
"org.apache.activemq.artemis.api.core.SimpleString"
] | import java.util.Collection; import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; | import java.util.*; import org.apache.activemq.artemis.api.core.*; | [
"java.util",
"org.apache.activemq"
] | java.util; org.apache.activemq; | 1,765,856 |
public List<HostRoleCommand> getRequestTasks(long requestId); | List<HostRoleCommand> function(long requestId); | /**
* Given a request id, get all the tasks that belong to this request
*/ | Given a request id, get all the tasks that belong to this request | getRequestTasks | {
"repo_name": "arenadata/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java",
"license": "apache-2.0",
"size": 8089
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,191,963 |
public void onPartitionEvicted(GridDhtLocalPartition part, boolean updateSeq) {
if (!enterBusy())
return;
try {
top.onEvicted(part, updateSeq);
if (cctx.events().isRecordable(EVT_CACHE_REBALANCE_PART_UNLOADED))
cctx.events().addUnloadEvent(part.i... | void function(GridDhtLocalPartition part, boolean updateSeq) { if (!enterBusy()) return; try { top.onEvicted(part, updateSeq); if (cctx.events().isRecordable(EVT_CACHE_REBALANCE_PART_UNLOADED)) cctx.events().addUnloadEvent(part.id()); if (updateSeq) cctx.shared().exchange().scheduleResendPartitions(); } finally { leave... | /**
* Resends partitions on partition evict within configured timeout.
*
* @param part Evicted partition.
* @param updateSeq Update sequence.
*/ | Resends partitions on partition evict within configured timeout | onPartitionEvicted | {
"repo_name": "agoncharuk/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java",
"license": "apache-2.0",
"size": 23372
} | [
"org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition"
] | import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition; | import org.apache.ignite.internal.processors.cache.distributed.dht.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,767,767 |
public static void remove(final Connection connection, final String filename, boolean useLike) {
try {
String query =
"DELETE FROM " + TABLE_NAME + " WHERE FILENAME " +
(useLike ? "LIKE " : "= ") + sqlQuote(filename);
try (Statement statement = connection.createStatement()) {
int rows = statem... | static void function(final Connection connection, final String filename, boolean useLike) { try { String query = STR + TABLE_NAME + STR + (useLike ? STR : STR) + sqlQuote(filename); try (Statement statement = connection.createStatement()) { int rows = statement.executeUpdate(query); LOGGER.trace(STR + TABLE_NAME + STR{... | /**
* Removes an entry or entries based on its FILENAME. If {@code useLike} is
* {@code true}, {@code filename} must be properly escaped.
*
* @see Tables#sqlLikeEscape(String)
*
* @param connection the db connection
* @param filename the filename to remove
* @param useLike {@code true} if {@code LIKE} s... | Removes an entry or entries based on its FILENAME. If useLike is true, filename must be properly escaped | remove | {
"repo_name": "UniversalMediaServer/UniversalMediaServer",
"path": "src/main/java/net/pms/database/MediaTableVideoMetadataActors.java",
"license": "gpl-2.0",
"size": 6500
} | [
"java.sql.Connection",
"java.sql.Statement"
] | import java.sql.Connection; import java.sql.Statement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,645,518 |
protected void changeGeneralLedgerPendingEntriesApprovedStatusCode() {
for (GeneralLedgerPendingEntry glpe : getGeneralLedgerPendingEntries()) {
glpe.setFinancialDocumentApprovedCode(KFSConstants.DocumentStatusCodes.APPROVED);
}
}
| void function() { for (GeneralLedgerPendingEntry glpe : getGeneralLedgerPendingEntries()) { glpe.setFinancialDocumentApprovedCode(KFSConstants.DocumentStatusCodes.APPROVED); } } | /**
* This method iterates over all of the GLPEs for a document and sets their approved status code to APPROVED "A".
*/ | This method iterates over all of the GLPEs for a document and sets their approved status code to APPROVED "A" | changeGeneralLedgerPendingEntriesApprovedStatusCode | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/sys/document/GeneralLedgerPostingDocumentBase.java",
"license": "agpl-3.0",
"size": 9160
} | [
"org.kuali.kfs.sys.KFSConstants",
"org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry"
] | import org.kuali.kfs.sys.KFSConstants; import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry; | import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.businessobject.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 340,731 |
void setHeaders(Map<String, Header> headers); | void setHeaders(Map<String, Header> headers); | /**
* Headers property of an Encoding is a map that allows additional information to be provided as headers
* <p>
* This method sets the headers property of Encoding instance to the passed headers argument.
* </p>
* @param headers a map of name to corresponding header object
*/ | Headers property of an Encoding is a map that allows additional information to be provided as headers This method sets the headers property of Encoding instance to the passed headers argument. | setHeaders | {
"repo_name": "arthurdm/microprofile-open-api",
"path": "api/src/main/java/org/eclipse/microprofile/openapi/models/media/Encoding.java",
"license": "apache-2.0",
"size": 9197
} | [
"java.util.Map",
"org.eclipse.microprofile.openapi.models.headers.Header"
] | import java.util.Map; import org.eclipse.microprofile.openapi.models.headers.Header; | import java.util.*; import org.eclipse.microprofile.openapi.models.headers.*; | [
"java.util",
"org.eclipse.microprofile"
] | java.util; org.eclipse.microprofile; | 1,302,561 |
public void addPages() {
// Create a page, set the title, and the initial model file name.
//
newFileCreationPage = new SoamodelModelWizardNewFileCreationPage("Whatever", selection);
newFileCreationPage.setTitle(SoaModelEditorPlugin.INSTANCE.getString("_UI_SoamodelModelWizard_label"));
newFileCreation... | void function() { newFileCreationPage = new SoamodelModelWizardNewFileCreationPage(STR, selection); newFileCreationPage.setTitle(SoaModelEditorPlugin.INSTANCE.getString(STR)); newFileCreationPage.setDescription(SoaModelEditorPlugin.INSTANCE.getString(STR)); newFileCreationPage.setFileName(SoaModelEditorPlugin.INSTANCE.... | /**
* The framework calls this to create the contents of the wizard.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | The framework calls this to create the contents of the wizard. | addPages | {
"repo_name": "darvasd/gsoaarchitect",
"path": "hu.bme.mit.inf.gs.dsl.editor/src/soamodel/presentation/SoamodelModelWizard.java",
"license": "mit",
"size": 18390
} | [
"org.eclipse.core.resources.IContainer",
"org.eclipse.core.resources.IFolder",
"org.eclipse.core.resources.IProject",
"org.eclipse.core.resources.IResource"
] | import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; | import org.eclipse.core.resources.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 2,712,299 |
public Enumeration listOptions () {
Vector result = new Vector();
result.addElement(new Option(
"\tnumber of clusters. If omitted or -1 specified, then \n"
+ "\tcross validation is used to select the number of clusters.",
"N", 1, "-N <num>"));
result.addElement(new Option(
"\tmax iterations."
... | Enumeration function () { Vector result = new Vector(); result.addElement(new Option( STR + STR, "N", 1, STR)); result.addElement(new Option( STR + STR, "I", 1, STR)); result.addElement(new Option( STR, "V", 0, "-V")); result.addElement(new Option( STR + STR + STR, "M",1,STR)); result.addElement( new Option(STR + STR, ... | /**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/ | Returns an enumeration describing the available options | listOptions | {
"repo_name": "BaldoAgosta/weka-dev",
"path": "src/weka/clusterers/EM_wedo_user_doc.java",
"license": "apache-2.0",
"size": 41563
} | [
"java.util.Enumeration",
"java.util.Vector"
] | import java.util.Enumeration; import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 956,152 |
public static Object createInstance(String userClassName,
ClassLoader classLoader) {
Class<?> theCls;
try {
theCls = Class.forName(userClassName, true, classLoader);
} catch (ClassNotFoundException | NoClassDefFoundError cnfe) {
... | static Object function(String userClassName, ClassLoader classLoader) { Class<?> theCls; try { theCls = Class.forName(userClassName, true, classLoader); } catch (ClassNotFoundException NoClassDefFoundError cnfe) { throw new RuntimeException(STR, cnfe); } Object result; try { Constructor<?> meth = constructorCache.get(t... | /**
* Create an instance of <code>userClassName</code> using provided <code>classLoader</code>.
*
* @param userClassName user class name
* @param classLoader class loader to load the class.
* @return the instance
*/ | Create an instance of <code>userClassName</code> using provided <code>classLoader</code> | createInstance | {
"repo_name": "yahoo/pulsar",
"path": "pulsar-common/src/main/java/org/apache/pulsar/common/util/Reflections.java",
"license": "apache-2.0",
"size": 13015
} | [
"java.lang.reflect.Constructor",
"java.lang.reflect.InvocationTargetException"
] | import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,859,124 |
@SuppressWarnings("unchecked")
public static void addAdvice(Class cls, Advice advice) {
getServiceContext().addAdvice(cls, advice);
} | @SuppressWarnings(STR) static void function(Class cls, Advice advice) { getServiceContext().addAdvice(cls, advice); } | /**
* Adds an AOP advice object around the given Class <code>cls</code>
* <p>
* Advice comes in the form of before or afterReturning methods
*
* @param cls
* @param advice
*/ | Adds an AOP advice object around the given Class <code>cls</code> Advice comes in the form of before or afterReturning methods | addAdvice | {
"repo_name": "preethi29/openmrs-core",
"path": "api/src/main/java/org/openmrs/api/context/Context.java",
"license": "mpl-2.0",
"size": 41482
} | [
"org.aopalliance.aop.Advice"
] | import org.aopalliance.aop.Advice; | import org.aopalliance.aop.*; | [
"org.aopalliance.aop"
] | org.aopalliance.aop; | 2,173,884 |
void purgeHistory() {
java.util.Date cutOff = new java.util.Date(System.currentTimeMillis() -
historyInterval);
List<String> toRemove = new java.util.ArrayList<String>();
for (String key: history.keySet()) {
java.util.Date item = history.get(key);
... | void purgeHistory() { java.util.Date cutOff = new java.util.Date(System.currentTimeMillis() - historyInterval); List<String> toRemove = new java.util.ArrayList<String>(); for (String key: history.keySet()) { java.util.Date item = history.get(key); if (item.before(cutOff)) { toRemove.add(key); } } for (String key: toRem... | /**
* We maintain history of fixed files because a fixed file may appear in
* the list of corrupt files if we loop around too quickly.
* This function removes the old items in the history so that we can
* recognize files that have actually become corrupt since being fixed.
*/ | We maintain history of fixed files because a fixed file may appear in the list of corrupt files if we loop around too quickly. This function removes the old items in the history so that we can recognize files that have actually become corrupt since being fixed | purgeHistory | {
"repo_name": "leonhong/hadoop-20-warehouse",
"path": "src/contrib/raid/src/java/org/apache/hadoop/raid/LocalBlockFixer.java",
"license": "apache-2.0",
"size": 5335
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,035,335 |
private void userCreate(String userId, HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, DatabaseException, NoSuchAlgorithmException, AccessDeniedException {
log.debug("userCreate({}, {}, {})", new Object[] { userId, request, response });
if (WebUtils.getBoolean(... | void function(String userId, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, DatabaseException, NoSuchAlgorithmException, AccessDeniedException { log.debug(STR, new Object[] { userId, request, response }); if (WebUtils.getBoolean(request, STR)) { String reqCsrft = WebUtil... | /**
* New user
*/ | New user | userCreate | {
"repo_name": "papamas/DMS-KANGREG-XI-MANADO",
"path": "src/main/java/com/openkm/servlet/admin/AuthServlet.java",
"license": "gpl-3.0",
"size": 27126
} | [
"com.openkm.core.AccessDeniedException",
"com.openkm.core.Config",
"com.openkm.core.DatabaseException",
"com.openkm.dao.AuthDAO",
"com.openkm.dao.bean.User",
"com.openkm.util.SecureStore",
"com.openkm.util.UserActivity",
"com.openkm.util.WebUtils",
"java.io.IOException",
"java.security.NoSuchAlgor... | import com.openkm.core.AccessDeniedException; import com.openkm.core.Config; import com.openkm.core.DatabaseException; import com.openkm.dao.AuthDAO; import com.openkm.dao.bean.User; import com.openkm.util.SecureStore; import com.openkm.util.UserActivity; import com.openkm.util.WebUtils; import java.io.IOException; imp... | import com.openkm.core.*; import com.openkm.dao.*; import com.openkm.dao.bean.*; import com.openkm.util.*; import java.io.*; import java.security.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; | [
"com.openkm.core",
"com.openkm.dao",
"com.openkm.util",
"java.io",
"java.security",
"java.util",
"javax.servlet"
] | com.openkm.core; com.openkm.dao; com.openkm.util; java.io; java.security; java.util; javax.servlet; | 2,552,365 |
protected SqlNode[] reorder(SqlNode[] operands) {
assert operands.length == order.length;
SqlNode[] newOrder = new SqlNode[operands.length];
for (int i = 0; i < operands.length; i++) {
assert operands[i] != null;
int joyDivision = order[i];
assert newOrder[joyDivision] == n... | SqlNode[] function(SqlNode[] operands) { assert operands.length == order.length; SqlNode[] newOrder = new SqlNode[operands.length]; for (int i = 0; i < operands.length; i++) { assert operands[i] != null; int joyDivision = order[i]; assert newOrder[joyDivision] == null : STR; newOrder[joyDivision] = operands[i]; } retur... | /**
* Uses the data in {@link #order} to reorder a SqlNode[] array.
*
* @param operands Operands
*/ | Uses the data in <code>#order</code> to reorder a SqlNode[] array | reorder | {
"repo_name": "minji-kim/calcite",
"path": "core/src/main/java/org/apache/calcite/sql/SqlJdbcFunctionCall.java",
"license": "apache-2.0",
"size": 25631
} | [
"com.google.common.collect.ImmutableMap",
"java.util.Map",
"org.apache.calcite.sql.fun.SqlStdOperatorTable"
] | import com.google.common.collect.ImmutableMap; import java.util.Map; import org.apache.calcite.sql.fun.SqlStdOperatorTable; | import com.google.common.collect.*; import java.util.*; import org.apache.calcite.sql.fun.*; | [
"com.google.common",
"java.util",
"org.apache.calcite"
] | com.google.common; java.util; org.apache.calcite; | 1,196,574 |
public void removeInviteOnly(Channel chan) {
setMode("-i");
}
| void function(Channel chan) { setMode("-i"); } | /**
* Removes invite only (-i) status from the channel. May require operator
* privileges in the channel
* @param chan The channel to preform the mode change on
*/ | Removes invite only (-i) status from the channel. May require operator privileges in the channel | removeInviteOnly | {
"repo_name": "AnyBot/AnyBot-Lib",
"path": "src/org/pircbotx/output/OutputChannel.java",
"license": "gpl-3.0",
"size": 19720
} | [
"org.pircbotx.Channel"
] | import org.pircbotx.Channel; | import org.pircbotx.*; | [
"org.pircbotx"
] | org.pircbotx; | 1,677,440 |
public Graphics getGraphics()
{
XGraphics2D xg2d = new XGraphics2D(xwindow);
xg2d.setColor(awtComponent.getForeground());
xg2d.setBackground(awtComponent.getBackground());
xg2d.setFont(awtComponent.getFont());
return xg2d;
} | Graphics function() { XGraphics2D xg2d = new XGraphics2D(xwindow); xg2d.setColor(awtComponent.getForeground()); xg2d.setBackground(awtComponent.getBackground()); xg2d.setFont(awtComponent.getFont()); return xg2d; } | /**
* Returns a XGraphics suitable for drawing on this frame.
*
* @return a XGraphics suitable for drawing on this frame
*/ | Returns a XGraphics suitable for drawing on this frame | getGraphics | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/gnu/java/awt/peer/x/XWindowPeer.java",
"license": "gpl-2.0",
"size": 9706
} | [
"java.awt.Graphics"
] | import java.awt.Graphics; | import java.awt.*; | [
"java.awt"
] | java.awt; | 580,200 |
public Verification verify(final String rawString) throws VerificationError {
Base64 decoder = new Base64();
if (StringUtils.isBlank(rawString)) {
throw new VerificationError("token is blank");
}
String[] pieces = rawString.split("\\.");
if (pieces.length != 3) {
... | Verification function(final String rawString) throws VerificationError { Base64 decoder = new Base64(); if (StringUtils.isBlank(rawString)) { throw new VerificationError(STR); } String[] pieces = rawString.split("\\."); if (pieces.length != 3) { throw new VerificationError(STR); } JSONObject header, claims; long expiry... | /**
* Verify this token and return a verification result.
*
* @param rawString The string representation of the token.
* @return The verification result.
* @throws VerificationError if this claim cannot be verified.
*/ | Verify this token and return a verification result | verify | {
"repo_name": "JoeCarlson/intermine",
"path": "intermine/web/main/src/org/intermine/webservice/server/JWTVerifier.java",
"license": "lgpl-2.1",
"size": 11370
} | [
"org.apache.commons.codec.binary.Base64",
"org.apache.commons.lang.StringUtils",
"org.json.JSONException",
"org.json.JSONObject"
] | import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.StringUtils; import org.json.JSONException; import org.json.JSONObject; | import org.apache.commons.codec.binary.*; import org.apache.commons.lang.*; import org.json.*; | [
"org.apache.commons",
"org.json"
] | org.apache.commons; org.json; | 669,982 |
UNBOUNDED() {
@Override
public ImList<Angle> steps(Angle start, Angle stepSize) {
final int stepSizeDegrees = (int) stepSize.toDegrees();
final int numSteps = (stepSizeDegrees == 0) ? 1 : 360 / stepSizeDegrees;
final List<Angle> angles = IntStream.range(... | UNBOUNDED() { ImList<Angle> function(Angle start, Angle stepSize) { final int stepSizeDegrees = (int) stepSize.toDegrees(); final int numSteps = (stepSizeDegrees == 0) ? 1 : 360 / stepSizeDegrees; final List<Angle> angles = IntStream.range(0, numSteps).mapToObj(i -> start.$plus(stepSize.$times(i))).collect(Collectors.t... | /**
* Steps through position angles from the start angle through 360 degrees
* by step size.
*/ | Steps through position angles from the start angle through 360 degrees by step size | steps | {
"repo_name": "spakzad/ocs",
"path": "bundle/edu.gemini.pot/src/main/java/edu/gemini/spModel/telescope/PosAngleConstraint.java",
"license": "bsd-3-clause",
"size": 3474
} | [
"edu.gemini.shared.util.immutable.DefaultImList",
"edu.gemini.shared.util.immutable.ImList",
"edu.gemini.spModel.core.Angle",
"java.util.List",
"java.util.stream.Collectors",
"java.util.stream.IntStream"
] | import edu.gemini.shared.util.immutable.DefaultImList; import edu.gemini.shared.util.immutable.ImList; import edu.gemini.spModel.core.Angle; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; | import edu.gemini.*; import edu.gemini.shared.util.immutable.*; import java.util.*; import java.util.stream.*; | [
"edu.gemini",
"edu.gemini.shared",
"java.util"
] | edu.gemini; edu.gemini.shared; java.util; | 161,113 |
@SuppressWarnings("unchecked")
public List<AdverseEventRecommendedReportQuery> searchAdverseEventRecommendedReports(final AdverseEventRecommendedReportQuery query, int firstrow, int maxrows) {
String queryString = query.getQueryString();
log.debug(">>> " + queryString.toString());
return... | @SuppressWarnings(STR) List<AdverseEventRecommendedReportQuery> function(final AdverseEventRecommendedReportQuery query, int firstrow, int maxrows) { String queryString = query.getQueryString(); log.debug(STR + queryString.toString()); return (List<AdverseEventRecommendedReportQuery>) super.search(query, firstrow, maxr... | /**
* Search for integration logs using query.
*
* @param query The query used to search for integration logs
* @return The list of integration logs.
*/ | Search for integration logs using query | searchAdverseEventRecommendedReports | {
"repo_name": "NCIP/caaers",
"path": "caAERS/software/core/src/main/java/gov/nih/nci/cabig/caaers/dao/AdverseEventRecommendedReportDao.java",
"license": "bsd-3-clause",
"size": 5366
} | [
"gov.nih.nci.cabig.caaers.dao.query.AdverseEventRecommendedReportQuery",
"java.util.List"
] | import gov.nih.nci.cabig.caaers.dao.query.AdverseEventRecommendedReportQuery; import java.util.List; | import gov.nih.nci.cabig.caaers.dao.query.*; import java.util.*; | [
"gov.nih.nci",
"java.util"
] | gov.nih.nci; java.util; | 2,494,916 |
public void setLastDirection(Direction lastDirection) {
this.lastDirection = lastDirection;
} | void function(Direction lastDirection) { this.lastDirection = lastDirection; } | /**
* Set the last direction this mob was facing.
*
* @param lastDirection The direction to set.
*/ | Set the last direction this mob was facing | setLastDirection | {
"repo_name": "Major-/apollo",
"path": "game/src/main/org/apollo/game/model/entity/Mob.java",
"license": "isc",
"size": 13644
} | [
"org.apollo.game.model.Direction"
] | import org.apollo.game.model.Direction; | import org.apollo.game.model.*; | [
"org.apollo.game"
] | org.apollo.game; | 2,541,773 |
public void show()
{
if (mListener == null)
{
throw new NullPointerException(
"Attempting to bind null listener to SlideDayTimePicker");
}
SlideDayTimeDialogFragment dialogFragment =
SlideDayTimeDialogFragment.newInstance(
... | void function() { if (mListener == null) { throw new NullPointerException( STR); } SlideDayTimeDialogFragment dialogFragment = SlideDayTimeDialogFragment.newInstance( mListener, mIsCustomDaysArraySpecified, mCustomDaysArray, mInitialDay, mInitialHour, mInitialMinute, mIsClientSpecified24HourTime, mIs24HourTime, mTheme,... | /**
* Show the dialog to the user. Make sure to set the listener before calling this.
*/ | Show the dialog to the user. Make sure to set the listener before calling this | show | {
"repo_name": "0359xiaodong/SlideDayTimePicker",
"path": "slideDayTimePicker/src/main/java/com/github/jjobes/slidedaytimepicker/SlideDayTimePicker.java",
"license": "apache-2.0",
"size": 10355
} | [
"android.support.v4.app.FragmentManager"
] | import android.support.v4.app.FragmentManager; | import android.support.v4.app.*; | [
"android.support"
] | android.support; | 1,010,564 |
public boolean importData(JComponent c, Transferable t)
{
boolean result = false;
if (isLocalDrag())
{
// Enables visual feedback on the Mac
result = true;
}
else
{
try
{
updateImportCount(t);
if (c instanceof mxGraphComponent)
{
mxGraphComponent graphComponent = (mxGraphC... | boolean function(JComponent c, Transferable t) { boolean result = false; if (isLocalDrag()) { result = true; } else { try { updateImportCount(t); if (c instanceof mxGraphComponent) { mxGraphComponent graphComponent = (mxGraphComponent) c; if (graphComponent.isEnabled() && t.isDataFlavorSupported(mxGraphTransferable.dat... | /**
* Checks if the mxGraphTransferable data flavour is supported and calls
* importGraphTransferable if possible.
*/ | Checks if the mxGraphTransferable data flavour is supported and calls importGraphTransferable if possible | importData | {
"repo_name": "dpisarewski/gka_wise12",
"path": "src/com/mxgraph/swing/handler/mxGraphTransferHandler.java",
"license": "lgpl-2.1",
"size": 10363
} | [
"java.awt.datatransfer.Transferable",
"javax.swing.JComponent"
] | import java.awt.datatransfer.Transferable; import javax.swing.JComponent; | import java.awt.datatransfer.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,377,503 |
public void testTestJavadoc()
throws Exception
{
File testPom =
new File( getBasedir(),
"src/test/resources/unit/test-javadoc-test/test-javadoc-test-plugin-config.xml" );
TestJavadocReport mojo = (TestJavadocReport) lookupMojo( "test-javadoc", test... | void function() throws Exception { File testPom = new File( getBasedir(), STR ); TestJavadocReport mojo = (TestJavadocReport) lookupMojo( STR, testPom ); MojoExecution mojoExec = new MojoExecution( new Plugin(), STR, null ); setVariableValueToObject( mojo, "mojo", mojoExec ); MavenProject currentProject = new MavenProj... | /**
* Test the test-javadoc configuration for the plugin
*
* @throws Exception if any
*/ | Test the test-javadoc configuration for the plugin | testTestJavadoc | {
"repo_name": "mcculls/maven-plugins",
"path": "maven-javadoc-plugin/src/test/java/org/apache/maven/plugins/javadoc/TestJavadocReportTest.java",
"license": "apache-2.0",
"size": 2697
} | [
"java.io.File",
"org.apache.maven.model.Plugin",
"org.apache.maven.plugin.MojoExecution",
"org.apache.maven.plugin.testing.stubs.MavenProjectStub",
"org.apache.maven.project.MavenProject",
"org.codehaus.plexus.util.FileUtils"
] | import java.io.File; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; | import java.io.*; import org.apache.maven.model.*; import org.apache.maven.plugin.*; import org.apache.maven.plugin.testing.stubs.*; import org.apache.maven.project.*; import org.codehaus.plexus.util.*; | [
"java.io",
"org.apache.maven",
"org.codehaus.plexus"
] | java.io; org.apache.maven; org.codehaus.plexus; | 1,256,190 |
public void setVehicleMode(VehicleMode newMode, AbstractCommandListener listener) {
Bundle params = new Bundle();
params.putParcelable(EXTRA_VEHICLE_MODE, newMode);
drone.performAsyncActionOnDroneThread(new Action(ACTION_SET_VEHICLE_MODE, params), listener);
} | void function(VehicleMode newMode, AbstractCommandListener listener) { Bundle params = new Bundle(); params.putParcelable(EXTRA_VEHICLE_MODE, newMode); drone.performAsyncActionOnDroneThread(new Action(ACTION_SET_VEHICLE_MODE, params), listener); } | /**
* Change the vehicle mode for the connected drone.
*
* @param newMode new vehicle mode.
* @param listener Register a callback to receive update of the command execution state.
*/ | Change the vehicle mode for the connected drone | setVehicleMode | {
"repo_name": "offbye/Tower",
"path": "Android/src/com/o3dr/android/client/apis/VehicleApi.java",
"license": "gpl-3.0",
"size": 10448
} | [
"android.os.Bundle",
"com.o3dr.services.android.lib.drone.property.VehicleMode",
"com.o3dr.services.android.lib.model.AbstractCommandListener",
"com.o3dr.services.android.lib.model.action.Action"
] | import android.os.Bundle; import com.o3dr.services.android.lib.drone.property.VehicleMode; import com.o3dr.services.android.lib.model.AbstractCommandListener; import com.o3dr.services.android.lib.model.action.Action; | import android.os.*; import com.o3dr.services.android.lib.drone.property.*; import com.o3dr.services.android.lib.model.*; import com.o3dr.services.android.lib.model.action.*; | [
"android.os",
"com.o3dr.services"
] | android.os; com.o3dr.services; | 1,889,927 |
public V localPeek(K key, CachePeekMode... peekModes); | V function(K key, CachePeekMode... peekModes); | /**
* Peeks at in-memory cached value using default optional peek mode.
* <p>
* This method will not load value from any persistent store or from a remote node.
* <h2 class="header">Transactions</h2>
* This method does not participate in any transactions.
*
* @param key Entry key.
... | Peeks at in-memory cached value using default optional peek mode. This method will not load value from any persistent store or from a remote node. Transactions This method does not participate in any transactions | localPeek | {
"repo_name": "irudyak/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/IgniteCache.java",
"license": "apache-2.0",
"size": 72051
} | [
"org.apache.ignite.cache.CachePeekMode"
] | import org.apache.ignite.cache.CachePeekMode; | import org.apache.ignite.cache.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,861,544 |
void verifyCanDelete(Snippet snippet); | void verifyCanDelete(Snippet snippet); | /**
* Ensures that deleting the given snippet is a valid operation at this
* point in time, depending on the state of this ProcessGroup
*
* @param snippet to delete
*
* @throws IllegalStateException if deleting the Snippet is not valid at
* this time
*/ | Ensures that deleting the given snippet is a valid operation at this point in time, depending on the state of this ProcessGroup | verifyCanDelete | {
"repo_name": "InspurUSA/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java",
"license": "apache-2.0",
"size": 33748
} | [
"org.apache.nifi.controller.Snippet"
] | import org.apache.nifi.controller.Snippet; | import org.apache.nifi.controller.*; | [
"org.apache.nifi"
] | org.apache.nifi; | 2,821,284 |
public void testBug41484() throws Exception {
try {
this.rs = this.stmt.executeQuery("select 1 as abc");
this.rs.next();
this.rs.getString("abc");
this.rs.close();
this.rs.getString("abc");
} catch (SQLException ex) {
... | void function() throws Exception { try { this.rs = this.stmt.executeQuery(STR); this.rs.next(); this.rs.getString("abc"); this.rs.close(); this.rs.getString("abc"); } catch (SQLException ex) { assertEquals(0, ex.getErrorCode()); assertEquals("S1000", ex.getSQLState()); } } | /**
* Bug #41484 Accessing fields by name after the ResultSet is closed throws
* NullPointerException.
*/ | Bug #41484 Accessing fields by name after the ResultSet is closed throws NullPointerException | testBug41484 | {
"repo_name": "hansmeets/bio2rdf-scripts",
"path": "linkedSPLs/LinkedSPLs-update/lib/mysql-connector-java-5.1.33/src/testsuite/regression/ResultSetRegressionTest.java",
"license": "mit",
"size": 182284
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,197,602 |
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String submit = request.getParameter("submit");
// front end validation when save is clicked.
if (submit != null) {
if ((pathName... | ActionErrors function(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); String submit = request.getParameter(STR); if (submit != null) { if ((pathName == null) (pathName.length()<1)) { errors.add(STR, new ActionError(STR)); } } return errors; } | /**
* Validate the properties that have been set from this HTTP request,
* and return an <code>ActionErrors</code> object that encapsulates any
* validation errors that have been found. If no errors are found, return
* <code>null</code> or an <code>ActionErrors</code> object with no
* recorded... | Validate the properties that have been set from this HTTP request, and return an <code>ActionErrors</code> object that encapsulates any validation errors that have been found. If no errors are found, return <code>null</code> or an <code>ActionErrors</code> object with no recorded error messages | validate | {
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-4.1.12-src/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/MemoryRealmForm.java",
"license": "apache-2.0",
"size": 6052
} | [
"javax.servlet.http.HttpServletRequest",
"org.apache.struts.action.ActionError",
"org.apache.struts.action.ActionErrors",
"org.apache.struts.action.ActionMapping"
] | import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMapping; | import javax.servlet.http.*; import org.apache.struts.action.*; | [
"javax.servlet",
"org.apache.struts"
] | javax.servlet; org.apache.struts; | 2,700,407 |
public static String join(Collection c, String left, String right, String separator) {
if (c == null || c.size() == 0) {
return null;
}
StringBuffer sb = new StringBuffer();
boolean firstFlag = true;
for (Iterator it = c.iterator(); it.hasNext();) {
i... | static String function(Collection c, String left, String right, String separator) { if (c == null c.size() == 0) { return null; } StringBuffer sb = new StringBuffer(); boolean firstFlag = true; for (Iterator it = c.iterator(); it.hasNext();) { if (firstFlag) { firstFlag = false; } else if (separator != null) { sb.appen... | /**
* Return a String object join all String object in param c, and add
* param left and param right to every String object on the left side
* and right side, separaing with param separator.
*
* <pre>
* join(["s1", "s2"], "left", "right", ",") = "lefts1right,lefts2right"
* </pre>
... | Return a String object join all String object in param c, and add param left and param right to every String object on the left side and right side, separaing with param separator. <code> join(["s1", "s2"], "left", "right", ",") = "lefts1right,lefts2right" </code> | join | {
"repo_name": "joshLV/uue",
"path": "uue-core/src/main/java/lab/uue/core/util/ExtStringUtils.java",
"license": "apache-2.0",
"size": 27952
} | [
"java.util.Collection",
"java.util.Iterator"
] | import java.util.Collection; import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,768,170 |
@Test
public void testTemplateRunnerWithUploadGraph() throws Exception {
File existingFile = tmpFolder.newFile();
DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
options.setExperiments(Arrays.asList("upload_graph"));
options.setJobName("TestJobName");
... | void function() throws Exception { File existingFile = tmpFolder.newFile(); DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class); options.setExperiments(Arrays.asList(STR)); options.setJobName(STR); options.setGcpCredential(new TestCredential()); options.setPathValidatorClass(NoopP... | /**
* Tests that the {@link DataflowRunner} with {@code --templateLocation} returns normally when the
* runner is successfully run with upload_graph experiment turned on. The result template should
* not contain raw steps and stepsLocation file should be set.
*/ | Tests that the <code>DataflowRunner</code> with --templateLocation returns normally when the runner is successfully run with upload_graph experiment turned on. The result template should not contain raw steps and stepsLocation file should be set | testTemplateRunnerWithUploadGraph | {
"repo_name": "robertwb/incubator-beam",
"path": "runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowRunnerTest.java",
"license": "apache-2.0",
"size": 81813
} | [
"com.fasterxml.jackson.databind.JsonNode",
"com.fasterxml.jackson.databind.ObjectMapper",
"java.io.File",
"java.util.Arrays",
"org.apache.beam.runners.dataflow.options.DataflowPipelineOptions",
"org.apache.beam.sdk.Pipeline",
"org.apache.beam.sdk.extensions.gcp.auth.TestCredential",
"org.apache.beam.s... | import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.util.Arrays; import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions; import org.apache.beam.sdk.Pipeline; import org.apache.beam.sdk.extensions.gcp.auth.TestCredential; i... | import com.fasterxml.jackson.databind.*; import java.io.*; import java.util.*; import org.apache.beam.runners.dataflow.options.*; import org.apache.beam.sdk.*; import org.apache.beam.sdk.extensions.gcp.auth.*; import org.apache.beam.sdk.extensions.gcp.storage.*; import org.apache.beam.sdk.options.*; import org.apache.b... | [
"com.fasterxml.jackson",
"java.io",
"java.util",
"org.apache.beam",
"org.junit"
] | com.fasterxml.jackson; java.io; java.util; org.apache.beam; org.junit; | 2,246,258 |
void delete(ObjectId id); | void delete(ObjectId id); | /**
* Deletes an existing Dashboard instance.
*
* @param id unique identifier of Dashboard to delete
*/ | Deletes an existing Dashboard instance | delete | {
"repo_name": "amitmawkin/Hygieia",
"path": "api/src/main/java/com/capitalone/dashboard/service/DashboardService.java",
"license": "apache-2.0",
"size": 6674
} | [
"org.bson.types.ObjectId"
] | import org.bson.types.ObjectId; | import org.bson.types.*; | [
"org.bson.types"
] | org.bson.types; | 31,997 |
public synchronized void refreshNodes() throws IOException {
String user = UserGroupInformation.getCurrentUser().getShortUserName();
// check access
if (!aclsManager.isMRAdmin(UserGroupInformation.getCurrentUser())) {
AuditLogger.logFailure(user, Constants.REFRESH_NODES,
aclsManager.getAd... | synchronized void function() throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); if (!aclsManager.isMRAdmin(UserGroupInformation.getCurrentUser())) { AuditLogger.logFailure(user, Constants.REFRESH_NODES, aclsManager.getAdminsAcl().toString(), Constants.JOBTRACKER, Constants.UNAU... | /**
* Rereads the config to get hosts and exclude list file names.
* Rereads the files to update the hosts and exclude lists.
*/ | Rereads the config to get hosts and exclude list file names. Rereads the files to update the hosts and exclude lists | refreshNodes | {
"repo_name": "zxqt223/hadoop-ha.1.0.3",
"path": "src/mapred/org/apache/hadoop/mapred/JobTracker.java",
"license": "apache-2.0",
"size": 199505
} | [
"java.io.IOException",
"org.apache.hadoop.mapred.AuditLogger",
"org.apache.hadoop.security.AccessControlException",
"org.apache.hadoop.security.UserGroupInformation"
] | import java.io.IOException; import org.apache.hadoop.mapred.AuditLogger; import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.security.UserGroupInformation; | import java.io.*; import org.apache.hadoop.mapred.*; import org.apache.hadoop.security.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,906,892 |
@Override
protected EventSourcedAggregate<T> doLoadWithLock(String aggregateIdentifier, Long expectedVersion) {
EventSourcedAggregate<T> aggregate = null;
CacheEntry<T> cacheEntry = cache.get(aggregateIdentifier);
if (cacheEntry != null) {
aggregate = cacheEntry.recreateAggre... | EventSourcedAggregate<T> function(String aggregateIdentifier, Long expectedVersion) { EventSourcedAggregate<T> aggregate = null; CacheEntry<T> cacheEntry = cache.get(aggregateIdentifier); if (cacheEntry != null) { aggregate = cacheEntry.recreateAggregate(aggregateModel(), eventStore, snapshotTriggerDefinition); } if (a... | /**
* Perform the actual loading of an aggregate. The necessary locks have been obtained. If the aggregate is
* available in the cache, it is returned from there. Otherwise the underlying persistence logic is called to
* retrieve the aggregate.
*
* @param aggregateIdentifier the identifier of t... | Perform the actual loading of an aggregate. The necessary locks have been obtained. If the aggregate is available in the cache, it is returned from there. Otherwise the underlying persistence logic is called to retrieve the aggregate | doLoadWithLock | {
"repo_name": "bojanv55/AxonFramework",
"path": "core/src/main/java/org/axonframework/eventsourcing/CachingEventSourcingRepository.java",
"license": "apache-2.0",
"size": 8667
} | [
"java.io.Serializable",
"org.axonframework.messaging.unitofwork.CurrentUnitOfWork"
] | import java.io.Serializable; import org.axonframework.messaging.unitofwork.CurrentUnitOfWork; | import java.io.*; import org.axonframework.messaging.unitofwork.*; | [
"java.io",
"org.axonframework.messaging"
] | java.io; org.axonframework.messaging; | 2,172,493 |
AccessPolicy updateAccessPolicy(AccessPolicyDTO accessPolicyDTO); | AccessPolicy updateAccessPolicy(AccessPolicyDTO accessPolicyDTO); | /**
* Updates the specified access policy.
*
* @param accessPolicyDTO The access policy DTO
* @return The access policy transfer object
*/ | Updates the specified access policy | updateAccessPolicy | {
"repo_name": "speddy93/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/AccessPolicyDAO.java",
"license": "apache-2.0",
"size": 3332
} | [
"org.apache.nifi.authorization.AccessPolicy",
"org.apache.nifi.web.api.dto.AccessPolicyDTO"
] | import org.apache.nifi.authorization.AccessPolicy; import org.apache.nifi.web.api.dto.AccessPolicyDTO; | import org.apache.nifi.authorization.*; import org.apache.nifi.web.api.dto.*; | [
"org.apache.nifi"
] | org.apache.nifi; | 1,092,972 |
public synchronized void deleteGroup(String name) throws Exception {
// Check if the group exists
if (name != null && !name.equals("")) {
if (m_groups.containsKey(name)) {
// Remove the group.
m_groups.remove(name);
} else
throw... | synchronized void function(String name) throws Exception { if (name != null && !name.equals(STRGroupFactory:delete Group doesnt exist:STRGroupFactory:delete Invalid user group:" + name); } saveGroups(); } | /**
* Removes the group from the list of groups. Then overwrites to the
* "groups.xml"
*
* @param name a {@link java.lang.String} object.
* @throws java.lang.Exception if any.
*/ | Removes the group from the list of groups. Then overwrites to the "groups.xml" | deleteGroup | {
"repo_name": "rdkgit/opennms",
"path": "opennms-config/src/main/java/org/opennms/netmgt/config/GroupManager.java",
"license": "agpl-3.0",
"size": 26481
} | [
"org.opennms.netmgt.config.groups.Group"
] | import org.opennms.netmgt.config.groups.Group; | import org.opennms.netmgt.config.groups.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 901,866 |
public InetSocketAddress getXferAddress() {
return streamingAddr;
} | InetSocketAddress function() { return streamingAddr; } | /**
* NB: The datanode can perform data transfer on the streaming
* address however clients are given the IPC IP address for data
* transfer, and that may be a different address.
*
* @return socket address for data transfer
*/ | address however clients are given the IPC IP address for data transfer, and that may be a different address | getXferAddress | {
"repo_name": "zhe-thoughts/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java",
"license": "apache-2.0",
"size": 116668
} | [
"java.net.InetSocketAddress"
] | import java.net.InetSocketAddress; | import java.net.*; | [
"java.net"
] | java.net; | 1,699,199 |
@Override
public Context getInitialContext(Hashtable<?,?> env)
throws NamingException
{
AbstractModel model = createRoot();
return new ContextImpl(model, env);
} | Context function(Hashtable<?,?> env) throws NamingException { AbstractModel model = createRoot(); return new ContextImpl(model, env); } | /**
* Returns the initial context for the current thread.
*/ | Returns the initial context for the current thread | getInitialContext | {
"repo_name": "christianchristensen/resin",
"path": "modules/kernel/src/com/caucho/naming/InitialContextFactoryImpl.java",
"license": "gpl-2.0",
"size": 3273
} | [
"java.util.Hashtable",
"javax.naming.Context",
"javax.naming.NamingException"
] | import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingException; | import java.util.*; import javax.naming.*; | [
"java.util",
"javax.naming"
] | java.util; javax.naming; | 2,604,490 |
private static boolean checkStandardUPCEANChecksum(String s) throws FormatException {
int length = s.length();
if (length == 0) {
return false;
}
int sum = 0;
for (int i = length - 2; i >= 0; i -= 2) {
int digit = (int) s.charAt(i) - (int) '0';
if (digit < 0 || digit > ... | static boolean function(String s) throws FormatException { int length = s.length(); if (length == 0) { return false; } int sum = 0; for (int i = length - 2; i >= 0; i -= 2) { int digit = (int) s.charAt(i) - (int) '0'; if (digit < 0 digit > 9) { throw FormatException.getFormatInstance(); } sum += digit; } sum *= 3; for ... | /**
* Computes the UPC/EAN checksum on a string of digits, and reports
* whether the checksum is correct or not.
*
* @param s string of digits to check
* @return true iff string of digits passes the UPC/EAN checksum algorithm
* @throws FormatException if the string does not contain only digits
... | Computes the UPC/EAN checksum on a string of digits, and reports whether the checksum is correct or not | checkStandardUPCEANChecksum | {
"repo_name": "helsinki-city-library/pocketlibrary",
"path": "android/LibraryProject/src/com/google/zxing/oned/UPCEANReader.java",
"license": "agpl-3.0",
"size": 12842
} | [
"com.google.zxing.FormatException"
] | import com.google.zxing.FormatException; | import com.google.zxing.*; | [
"com.google.zxing"
] | com.google.zxing; | 2,586,615 |
void quoteTimeLiteral(
StringBuilder buf,
Time value); | void quoteTimeLiteral( StringBuilder buf, Time value); | /**
* Appends to a buffer a time literal.
*
* <p>For example, in the default dialect,
* <code>quoteStringLiteral(buf, "12:34:56")</code>
* appends <code>TIME '12:34:56'</code>.
*
* @param buf Buffer to append to
* @param value Literal
*/ | Appends to a buffer a time literal. For example, in the default dialect, <code>quoteStringLiteral(buf, "12:34:56")</code> appends <code>TIME '12:34:56'</code> | quoteTimeLiteral | {
"repo_name": "citycloud-bigdata/mondrian",
"path": "src/main/mondrian/spi/Dialect.java",
"license": "epl-1.0",
"size": 40288
} | [
"java.sql.Time"
] | import java.sql.Time; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,223,175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.