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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
protected void addAttributeValuesToSamlAttribute(final String attributeName, final Object attributeValue, final List<XMLObject> attributeList, final QName defaultElementName) { if (attributeValue == null) { LOGGER.debug("Skipping over SAML attribute [{}] since it has no value", attributeName); return; } LOGGER.debug("Attempting to generate SAML attribute [{}] with value(s) [{}]", attributeName, attributeValue); if (attributeValue instanceof Collection<?>) { final Collection<?> c = (Collection<?>) attributeValue; LOGGER.debug("Generating multi-valued SAML attribute [{}] with values [{}]", attributeName, c); c.stream().map(value -> newAttributeValue(value, defaultElementName)).forEach(attributeList::add); } else { LOGGER.debug("Generating SAML attribute [{}] with value [{}]", attributeName, attributeValue); attributeList.add(newAttributeValue(attributeValue, defaultElementName)); } }
void function(final String attributeName, final Object attributeValue, final List<XMLObject> attributeList, final QName defaultElementName) { if (attributeValue == null) { LOGGER.debug(STR, attributeName); return; } LOGGER.debug(STR, attributeName, attributeValue); if (attributeValue instanceof Collection<?>) { final Collection<?> c = (Collection<?>) attributeValue; LOGGER.debug(STR, attributeName, c); c.stream().map(value -> newAttributeValue(value, defaultElementName)).forEach(attributeList::add); } else { LOGGER.debug(STR, attributeName, attributeValue); attributeList.add(newAttributeValue(attributeValue, defaultElementName)); } }
/** * Add attribute values to saml attribute. * * @param attributeName the attribute name * @param attributeValue the attribute value * @param attributeList the attribute list * @param defaultElementName the default element name */
Add attribute values to saml attribute
addAttributeValuesToSamlAttribute
{ "repo_name": "Unicon/cas", "path": "support/cas-server-support-saml/src/main/java/org/apereo/cas/support/saml/util/AbstractSamlObjectBuilder.java", "license": "apache-2.0", "size": 15941 }
[ "java.util.Collection", "java.util.List", "javax.xml.namespace.QName", "org.opensaml.core.xml.XMLObject" ]
import java.util.Collection; import java.util.List; import javax.xml.namespace.QName; import org.opensaml.core.xml.XMLObject;
import java.util.*; import javax.xml.namespace.*; import org.opensaml.core.xml.*;
[ "java.util", "javax.xml", "org.opensaml.core" ]
java.util; javax.xml; org.opensaml.core;
2,912,744
public Map<String, Object> getLocalVariables() { Map<String, Object> ret = new HashMap<String, Object>(); for (int i = 0; i < operation.getMaxLocals(); i++) { if (localVars[i] != null) { ret.put(Integer.valueOf(i).toString(), localVars[i]); } } return ret; }
Map<String, Object> function() { Map<String, Object> ret = new HashMap<String, Object>(); for (int i = 0; i < operation.getMaxLocals(); i++) { if (localVars[i] != null) { ret.put(Integer.valueOf(i).toString(), localVars[i]); } } return ret; }
/** * Returns the local variables map. * * @return the local variables map */
Returns the local variables map
getLocalVariables
{ "repo_name": "valeriocos/jbrex", "path": "org.eclipse.m2m.atl.engine.emfvm/src/org/eclipse/m2m/atl/engine/emfvm/lib/AbstractStackFrame.java", "license": "mit", "size": 4482 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
374,400
public KVectorChain getControlPoints() { final KVectorChain retVal = new KVectorChain(); for (final PolarCP polarCP : controlPoints) { retVal.add(polarCP.getCp()); } return retVal; }
KVectorChain function() { final KVectorChain retVal = new KVectorChain(); for (final PolarCP polarCP : controlPoints) { retVal.add(polarCP.getCp()); } return retVal; }
/** * Returns the control points. The control points may be modified, * but the list itself is only a container. * * @return The control points. */
Returns the control points. The control points may be modified, but the list itself is only a container
getControlPoints
{ "repo_name": "ExplorViz/ExplorViz", "path": "src-external/de/cau/cs/kieler/klay/layered/p5edges/splines/NubSpline.java", "license": "apache-2.0", "size": 43267 }
[ "de.cau.cs.kieler.core.math.KVectorChain" ]
import de.cau.cs.kieler.core.math.KVectorChain;
import de.cau.cs.kieler.core.math.*;
[ "de.cau.cs" ]
de.cau.cs;
474,274
public static <T> List<T> selectList(Collection<T> inputCollection, TypedPredicate<T> predicate) { ArrayList<T> answer = new ArrayList<T>(inputCollection.size()); CollectionUtils.select(inputCollection, predicate, answer); return answer; }
static <T> List<T> function(Collection<T> inputCollection, TypedPredicate<T> predicate) { ArrayList<T> answer = new ArrayList<T>(inputCollection.size()); CollectionUtils.select(inputCollection, predicate, answer); return answer; }
/** * Delegates to {@link CollectionUtils#select(Collection, org.apache.commons.collections.Predicate)}, but will * force the return type to be a List<T>. * * @param inputCollection * @param predicate * @return */
Delegates to <code>CollectionUtils#select(Collection, org.apache.commons.collections.Predicate)</code>, but will force the return type to be a List
selectList
{ "repo_name": "akdasari/SparkCommon", "path": "src/main/java/org/sparkcommerce/common/util/SCCollectionUtils.java", "license": "apache-2.0", "size": 5440 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.List", "org.apache.commons.collections.CollectionUtils" ]
import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.commons.collections.CollectionUtils;
import java.util.*; import org.apache.commons.collections.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
639,946
public static <T> NullExpression<T> nullExpression(Class<T> type) { return new NullExpression<T>(type); }
static <T> NullExpression<T> function(Class<T> type) { return new NullExpression<T>(type); }
/** * Create a null expression for the specified type * * @param type type of expression * @param <T> type of expression * @return null expression */
Create a null expression for the specified type
nullExpression
{ "repo_name": "johnktims/querydsl", "path": "querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java", "license": "apache-2.0", "size": 74346 }
[ "com.querydsl.core.types.NullExpression" ]
import com.querydsl.core.types.NullExpression;
import com.querydsl.core.types.*;
[ "com.querydsl.core" ]
com.querydsl.core;
164,413
List<?> getSelectedPackagesPreference() { return selectedPackagesPreference; }
List<?> getSelectedPackagesPreference() { return selectedPackagesPreference; }
/** * Get the list of selected packages preference. * * @return Returns the list of selected packages preference. */
Get the list of selected packages preference
getSelectedPackagesPreference
{ "repo_name": "rex-xxx/mt6572_x201", "path": "tools/motodev/src/plugins/android/src/com/motorola/studio/android/wizards/monkey/MonkeyConfigurationTab.java", "license": "gpl-2.0", "size": 23468 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,122,617
protected ChoiceSelector create(FormComponent<?> formComponent) { if (formComponent == null) { fail("Trying to select on null component."); return null; } else if (formComponent instanceof RadioGroup || formComponent instanceof AbstractSingleSelectChoice) { return new SingleChoiceSelector(formComponent); } else if (allowMultipleChoice(formComponent)) { return new MultipleChoiceSelector(formComponent); } else { fail("Selecting on the component:'" + formComponent.getPath() + "' is not supported."); return null; } }
ChoiceSelector function(FormComponent<?> formComponent) { if (formComponent == null) { fail(STR); return null; } else if (formComponent instanceof RadioGroup formComponent instanceof AbstractSingleSelectChoice) { return new SingleChoiceSelector(formComponent); } else if (allowMultipleChoice(formComponent)) { return new MultipleChoiceSelector(formComponent); } else { fail(STR + formComponent.getPath() + STR); return null; } }
/** * Creates a <code>ChoiceSelector</code>. * * @param formComponent * a <code>FormComponent</code> * @return ChoiceSelector a <code>ChoiceSelector</code> */
Creates a <code>ChoiceSelector</code>
create
{ "repo_name": "topicusonderwijs/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/util/tester/FormTester.java", "license": "apache-2.0", "size": 26377 }
[ "org.apache.wicket.markup.html.form.AbstractSingleSelectChoice", "org.apache.wicket.markup.html.form.FormComponent", "org.apache.wicket.markup.html.form.RadioGroup" ]
import org.apache.wicket.markup.html.form.AbstractSingleSelectChoice; import org.apache.wicket.markup.html.form.FormComponent; import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.form.*;
[ "org.apache.wicket" ]
org.apache.wicket;
2,693,719
public DeleteIndexRequest timeout(String timeout) { return timeout(TimeValue.parseTimeValue(timeout, null)); }
DeleteIndexRequest function(String timeout) { return timeout(TimeValue.parseTimeValue(timeout, null)); }
/** * Timeout to wait for the index deletion to be acknowledged by current cluster nodes. Defaults * to <tt>10s</tt>. */
Timeout to wait for the index deletion to be acknowledged by current cluster nodes. Defaults to 10s
timeout
{ "repo_name": "dmiszkiewicz/elasticsearch", "path": "src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java", "license": "apache-2.0", "size": 4681 }
[ "org.elasticsearch.common.unit.TimeValue" ]
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.unit.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
2,801,755
void traverseWithScope(Node root, Scope s) { checkState(s.isGlobal() || s.isModuleScope(), s); try { initTraversal(root); curNode = root; pushScope(s); traverseBranch(root, null); popScope(); } catch (Error | Exception unexpectedException) { throwUnexpectedException(unexpectedException); } }
void traverseWithScope(Node root, Scope s) { checkState(s.isGlobal() s.isModuleScope(), s); try { initTraversal(root); curNode = root; pushScope(s); traverseBranch(root, null); popScope(); } catch (Error Exception unexpectedException) { throwUnexpectedException(unexpectedException); } }
/** * Traverses a parse tree recursively with a scope, starting with the given * root. This should only be used in the global scope or module scopes. Otherwise, use * {@link #traverseAtScope}. */
Traverses a parse tree recursively with a scope, starting with the given root. This should only be used in the global scope or module scopes. Otherwise, use <code>#traverseAtScope</code>
traverseWithScope
{ "repo_name": "MatrixFrog/closure-compiler", "path": "src/com/google/javascript/jscomp/NodeTraversal.java", "license": "apache-2.0", "size": 35612 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
550,009
public static WritableDataSet zeros( QDataSet ds ) { return DDataSet.create( DataSetUtil.qubeDims(ds) ); }
static WritableDataSet function( QDataSet ds ) { return DDataSet.create( DataSetUtil.qubeDims(ds) ); }
/** * return a new dataset filled with zeroes that has the same geometry as * the given dataset. * Only supports QUBE datasets. * @param ds * @return a new dataset with filled with zeroes with the same geometry. */
return a new dataset filled with zeroes that has the same geometry as the given dataset. Only supports QUBE datasets
zeros
{ "repo_name": "autoplot/app", "path": "QDataSet/src/org/das2/qds/ops/Ops.java", "license": "gpl-2.0", "size": 492716 }
[ "org.das2.qds.DDataSet", "org.das2.qds.DataSetUtil", "org.das2.qds.QDataSet", "org.das2.qds.WritableDataSet" ]
import org.das2.qds.DDataSet; import org.das2.qds.DataSetUtil; import org.das2.qds.QDataSet; import org.das2.qds.WritableDataSet;
import org.das2.qds.*;
[ "org.das2.qds" ]
org.das2.qds;
524,922
protected boolean compareSchemaStrings(Schema generatedSchema, String controlSchema){ Project p = new SchemaModelProject(); Vector namespaces = generatedSchema.getNamespaceResolver().getNamespaces(); for (int i = 0; i < namespaces.size(); i++) { Namespace next = (Namespace)namespaces.get(i); ((XMLDescriptor) p.getDescriptor(Schema.class)).getNamespaceResolver().put(next.getPrefix(), next.getNamespaceURI()); } XMLContext context = new XMLContext(p); XMLMarshaller marshaller = context.createMarshaller(); StringWriter generatedSchemaWriter = new StringWriter(); marshaller.marshal(generatedSchema, generatedSchemaWriter); return generatedSchemaWriter.toString().equals(controlSchema); }
boolean function(Schema generatedSchema, String controlSchema){ Project p = new SchemaModelProject(); Vector namespaces = generatedSchema.getNamespaceResolver().getNamespaces(); for (int i = 0; i < namespaces.size(); i++) { Namespace next = (Namespace)namespaces.get(i); ((XMLDescriptor) p.getDescriptor(Schema.class)).getNamespaceResolver().put(next.getPrefix(), next.getNamespaceURI()); } XMLContext context = new XMLContext(p); XMLMarshaller marshaller = context.createMarshaller(); StringWriter generatedSchemaWriter = new StringWriter(); marshaller.marshal(generatedSchema, generatedSchemaWriter); return generatedSchemaWriter.toString().equals(controlSchema); }
/** * Compares a schema model Schema (as a string) against a string representation * of an XML schema. * * @param generatedSchema * @param controlSchemaName */
Compares a schema model Schema (as a string) against a string representation of an XML schema
compareSchemaStrings
{ "repo_name": "gameduell/eclipselink.runtime", "path": "moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/oxm/schemamodelgenerator/GenerateSchemaTestCases.java", "license": "epl-1.0", "size": 9310 }
[ "java.io.StringWriter", "java.util.Vector", "org.eclipse.persistence.internal.oxm.Namespace", "org.eclipse.persistence.internal.oxm.schema.SchemaModelProject", "org.eclipse.persistence.internal.oxm.schema.model.Schema", "org.eclipse.persistence.oxm.XMLContext", "org.eclipse.persistence.oxm.XMLDescriptor", "org.eclipse.persistence.oxm.XMLMarshaller", "org.eclipse.persistence.sessions.Project" ]
import java.io.StringWriter; import java.util.Vector; import org.eclipse.persistence.internal.oxm.Namespace; import org.eclipse.persistence.internal.oxm.schema.SchemaModelProject; import org.eclipse.persistence.internal.oxm.schema.model.Schema; import org.eclipse.persistence.oxm.XMLContext; import org.eclipse.persistence.oxm.XMLDescriptor; import org.eclipse.persistence.oxm.XMLMarshaller; import org.eclipse.persistence.sessions.Project;
import java.io.*; import java.util.*; import org.eclipse.persistence.internal.oxm.*; import org.eclipse.persistence.internal.oxm.schema.*; import org.eclipse.persistence.internal.oxm.schema.model.*; import org.eclipse.persistence.oxm.*; import org.eclipse.persistence.sessions.*;
[ "java.io", "java.util", "org.eclipse.persistence" ]
java.io; java.util; org.eclipse.persistence;
802,495
private static JSONOptions convertToJsonOptions(RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples) { try { return new JSONOptions(convertToJsonNode(rowType, tuples), JsonLocation.NA); } catch (IOException e) { throw new DrillRuntimeException("Failure while attempting to encode Values in JSON.", e); } }
static JSONOptions function(RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples) { try { return new JSONOptions(convertToJsonNode(rowType, tuples), JsonLocation.NA); } catch (IOException e) { throw new DrillRuntimeException(STR, e); } }
/** * Converts tuples into json representation taking into account row type. * Example: [['A']] -> [{"EXPR$0":"A"}], [[1]] -> [{"EXPR$0":{"$numberLong":1}}] * * @param rowType row type * @param tuples list of constant values in a row-expression * @return json representation of tuples */
Converts tuples into json representation taking into account row type. Example: [['A']] -> [{"EXPR$0":"A"}], [[1]] -> [{"EXPR$0":{"$numberLong":1}}]
convertToJsonOptions
{ "repo_name": "KulykRoman/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillValuesRelBase.java", "license": "apache-2.0", "size": 9192 }
[ "com.fasterxml.jackson.core.JsonLocation", "com.google.common.collect.ImmutableList", "java.io.IOException", "org.apache.calcite.rel.type.RelDataType", "org.apache.calcite.rex.RexLiteral", "org.apache.drill.common.JSONOptions", "org.apache.drill.common.exceptions.DrillRuntimeException" ]
import com.fasterxml.jackson.core.JsonLocation; import com.google.common.collect.ImmutableList; import java.io.IOException; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rex.RexLiteral; import org.apache.drill.common.JSONOptions; import org.apache.drill.common.exceptions.DrillRuntimeException;
import com.fasterxml.jackson.core.*; import com.google.common.collect.*; import java.io.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.rex.*; import org.apache.drill.common.*; import org.apache.drill.common.exceptions.*;
[ "com.fasterxml.jackson", "com.google.common", "java.io", "org.apache.calcite", "org.apache.drill" ]
com.fasterxml.jackson; com.google.common; java.io; org.apache.calcite; org.apache.drill;
2,587,178
@Nullable T getShardOrNull(int shardId);
@Nullable T getShardOrNull(int shardId);
/** * Returns shard with given id. */
Returns shard with given id
getShardOrNull
{ "repo_name": "jimczi/elasticsearch", "path": "core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java", "license": "apache-2.0", "size": 45794 }
[ "org.elasticsearch.common.Nullable" ]
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
1,808,527
@Nullable public String quoteChars() { return quoteChars; }
@Nullable String function() { return quoteChars; }
/** * Returns the quote characters. * * @return The quote characters. */
Returns the quote characters
quoteChars
{ "repo_name": "samaitra/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/bulkload/BulkLoadCsvFormat.java", "license": "apache-2.0", "size": 5023 }
[ "org.jetbrains.annotations.Nullable" ]
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
2,191,063
@Nullable public Lock tryThreadLock(Uri uri) throws IOException { if (!threadLocksAreAvailable()) { return null; } Semaphore semaphore = getOrCreateSemaphore(uri.toString()); try (SemaphoreResource semaphoreResource = SemaphoreResource.tryAcquire(semaphore)) { if (!semaphoreResource.acquired()) { return null; } return new SemaphoreLockImpl(semaphoreResource.releaseFromTryBlock()); } }
Lock function(Uri uri) throws IOException { if (!threadLocksAreAvailable()) { return null; } Semaphore semaphore = getOrCreateSemaphore(uri.toString()); try (SemaphoreResource semaphoreResource = SemaphoreResource.tryAcquire(semaphore)) { if (!semaphoreResource.acquired()) { return null; } return new SemaphoreLockImpl(semaphoreResource.releaseFromTryBlock()); } }
/** * Attempts to acquire a cross-thread lock on {@code uri}. This does not block, and returns null * if the lock cannot be obtained immediately. */
Attempts to acquire a cross-thread lock on uri. This does not block, and returns null if the lock cannot be obtained immediately
tryThreadLock
{ "repo_name": "google/mobile-data-download", "path": "java/com/google/android/libraries/mobiledatadownload/file/common/LockScope.java", "license": "apache-2.0", "size": 8524 }
[ "android.net.Uri", "java.io.IOException", "java.util.concurrent.Semaphore" ]
import android.net.Uri; import java.io.IOException; import java.util.concurrent.Semaphore;
import android.net.*; import java.io.*; import java.util.concurrent.*;
[ "android.net", "java.io", "java.util" ]
android.net; java.io; java.util;
747,329
public BusinessObjectService getBusinessObjectService() { if (this.businessObjectService == null) { this.businessObjectService = KcServiceLocator.getService(BusinessObjectService.class); } return this.businessObjectService; }
BusinessObjectService function() { if (this.businessObjectService == null) { this.businessObjectService = KcServiceLocator.getService(BusinessObjectService.class); } return this.businessObjectService; }
/** * This method returns an instance of BusinessObjectServe from the KcServiceLocator. * @return BusinessObjectService */
This method returns an instance of BusinessObjectServe from the KcServiceLocator
getBusinessObjectService
{ "repo_name": "kuali/kc", "path": "coeus-impl/src/main/java/org/kuali/kra/protocol/actions/ProtocolActionsKeyValuesBase.java", "license": "agpl-3.0", "size": 4220 }
[ "org.kuali.coeus.sys.framework.service.KcServiceLocator", "org.kuali.rice.krad.service.BusinessObjectService" ]
import org.kuali.coeus.sys.framework.service.KcServiceLocator; import org.kuali.rice.krad.service.BusinessObjectService;
import org.kuali.coeus.sys.framework.service.*; import org.kuali.rice.krad.service.*;
[ "org.kuali.coeus", "org.kuali.rice" ]
org.kuali.coeus; org.kuali.rice;
1,591,871
@Override public void handleEditorDetached() { } /** * Clients override in order to subsequently call {@link #addPropertyDescriptor(com.bc.ceres.binding.PropertyDescriptor)}
void function() { } /** * Clients override in order to subsequently call {@link #addPropertyDescriptor(com.bc.ceres.binding.PropertyDescriptor)}
/** * Does nothing. */
Does nothing
handleEditorDetached
{ "repo_name": "senbox-org/snap-desktop", "path": "snap-ui/src/main/java/org/esa/snap/ui/layer/AbstractLayerConfigurationEditor.java", "license": "gpl-3.0", "size": 5366 }
[ "com.bc.ceres.binding.PropertyDescriptor" ]
import com.bc.ceres.binding.PropertyDescriptor;
import com.bc.ceres.binding.*;
[ "com.bc.ceres" ]
com.bc.ceres;
1,783,054
void onDownstreamFormatChanged(int sourceId, String formatId, int trigger, int mediaTimeMs); } public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT = 3; private static final int STATE_UNPREPARED = 0; private static final int STATE_PREPARED = 1; private static final int STATE_ENABLED = 2; private static final int NO_RESET_PENDING = -1; private final int eventSourceId; private final LoadControl loadControl; private final ChunkSource chunkSource; private final ChunkOperationHolder currentLoadableHolder; private final LinkedList<MediaChunk> mediaChunks; private final List<MediaChunk> readOnlyMediaChunks; private final int bufferSizeContribution; private final boolean frameAccurateSeeking; private final Handler eventHandler; private final EventListener eventListener; private final int minLoadableRetryCount; private int state; private long downstreamPositionUs; private long lastSeekPositionUs; private long pendingResetPositionUs; private long lastPerformedBufferOperation; private boolean pendingDiscontinuity; private Loader loader; private IOException currentLoadableException; private boolean currentLoadableExceptionFatal; private int currentLoadableExceptionCount; private long currentLoadableExceptionTimestamp; private MediaFormat downstreamMediaFormat; private volatile Format downstreamFormat; public ChunkSampleSource(ChunkSource chunkSource, LoadControl loadControl, int bufferSizeContribution, boolean frameAccurateSeeking) { this(chunkSource, loadControl, bufferSizeContribution, frameAccurateSeeking, null, null, 0); } public ChunkSampleSource(ChunkSource chunkSource, LoadControl loadControl, int bufferSizeContribution, boolean frameAccurateSeeking, Handler eventHandler, EventListener eventListener, int eventSourceId) { this(chunkSource, loadControl, bufferSizeContribution, frameAccurateSeeking, eventHandler, eventListener, eventSourceId, DEFAULT_MIN_LOADABLE_RETRY_COUNT); } public ChunkSampleSource(ChunkSource chunkSource, LoadControl loadControl, int bufferSizeContribution, boolean frameAccurateSeeking, Handler eventHandler, EventListener eventListener, int eventSourceId, int minLoadableRetryCount) { this.chunkSource = chunkSource; this.loadControl = loadControl; this.bufferSizeContribution = bufferSizeContribution; this.frameAccurateSeeking = frameAccurateSeeking; this.eventHandler = eventHandler; this.eventListener = eventListener; this.eventSourceId = eventSourceId; this.minLoadableRetryCount = minLoadableRetryCount; currentLoadableHolder = new ChunkOperationHolder(); mediaChunks = new LinkedList<MediaChunk>(); readOnlyMediaChunks = Collections.unmodifiableList(mediaChunks); state = STATE_UNPREPARED; }
void onDownstreamFormatChanged(int sourceId, String formatId, int trigger, int mediaTimeMs); } public static final int DEFAULT_MIN_LOADABLE_RETRY_COUNT = 3; private static final int STATE_UNPREPARED = 0; private static final int STATE_PREPARED = 1; private static final int STATE_ENABLED = 2; private static final int NO_RESET_PENDING = -1; private final int eventSourceId; private final LoadControl loadControl; private final ChunkSource chunkSource; private final ChunkOperationHolder currentLoadableHolder; private final LinkedList<MediaChunk> mediaChunks; private final List<MediaChunk> readOnlyMediaChunks; private final int bufferSizeContribution; private final boolean frameAccurateSeeking; private final Handler eventHandler; private final EventListener eventListener; private final int minLoadableRetryCount; private int state; private long downstreamPositionUs; private long lastSeekPositionUs; private long pendingResetPositionUs; private long lastPerformedBufferOperation; private boolean pendingDiscontinuity; private Loader loader; private IOException currentLoadableException; private boolean currentLoadableExceptionFatal; private int currentLoadableExceptionCount; private long currentLoadableExceptionTimestamp; private MediaFormat downstreamMediaFormat; private volatile Format downstreamFormat; public ChunkSampleSource(ChunkSource chunkSource, LoadControl loadControl, int bufferSizeContribution, boolean frameAccurateSeeking) { this(chunkSource, loadControl, bufferSizeContribution, frameAccurateSeeking, null, null, 0); } public ChunkSampleSource(ChunkSource chunkSource, LoadControl loadControl, int bufferSizeContribution, boolean frameAccurateSeeking, Handler eventHandler, EventListener eventListener, int eventSourceId) { this(chunkSource, loadControl, bufferSizeContribution, frameAccurateSeeking, eventHandler, eventListener, eventSourceId, DEFAULT_MIN_LOADABLE_RETRY_COUNT); } public ChunkSampleSource(ChunkSource chunkSource, LoadControl loadControl, int bufferSizeContribution, boolean frameAccurateSeeking, Handler eventHandler, EventListener eventListener, int eventSourceId, int minLoadableRetryCount) { this.chunkSource = chunkSource; this.loadControl = loadControl; this.bufferSizeContribution = bufferSizeContribution; this.frameAccurateSeeking = frameAccurateSeeking; this.eventHandler = eventHandler; this.eventListener = eventListener; this.eventSourceId = eventSourceId; this.minLoadableRetryCount = minLoadableRetryCount; currentLoadableHolder = new ChunkOperationHolder(); mediaChunks = new LinkedList<MediaChunk>(); readOnlyMediaChunks = Collections.unmodifiableList(mediaChunks); state = STATE_UNPREPARED; }
/** * Invoked when the downstream format changes (i.e. when the format being supplied to the * caller of {@link SampleSource#readData} changes). * * @param sourceId The id of the reporting {@link SampleSource}. * @param formatId The format id. * @param trigger The trigger specified in the corresponding upstream load, as specified by the * {@link ChunkSource}. * @param mediaTimeMs The media time at which the change occurred. */
Invoked when the downstream format changes (i.e. when the format being supplied to the caller of <code>SampleSource#readData</code> changes)
onDownstreamFormatChanged
{ "repo_name": "Octavianus/Close-Loop-Visual-Stimulus-Display-System", "path": "library/src/main/java/com/google/android/exoplayer/chunk/ChunkSampleSource.java", "license": "apache-2.0", "size": 29248 }
[ "android.os.Handler", "com.google.android.exoplayer.LoadControl", "com.google.android.exoplayer.MediaFormat", "com.google.android.exoplayer.upstream.Loader", "java.io.IOException", "java.util.Collections", "java.util.LinkedList", "java.util.List" ]
import android.os.Handler; import com.google.android.exoplayer.LoadControl; import com.google.android.exoplayer.MediaFormat; import com.google.android.exoplayer.upstream.Loader; import java.io.IOException; import java.util.Collections; import java.util.LinkedList; import java.util.List;
import android.os.*; import com.google.android.exoplayer.*; import com.google.android.exoplayer.upstream.*; import java.io.*; import java.util.*;
[ "android.os", "com.google.android", "java.io", "java.util" ]
android.os; com.google.android; java.io; java.util;
2,016,103
public static java.lang.Class<?> getJavaClass(TypeDescriptor $reifiedT) { if ($reifiedT instanceof TypeDescriptor.Intersection) { return (java.lang.Class<?>) getJavaClass(((TypeDescriptor.Intersection)$reifiedT) .toSimpleType(getModuleManager())); } else if ($reifiedT instanceof TypeDescriptor.Union) { return (java.lang.Class<?>) getJavaClass(((TypeDescriptor.Union)$reifiedT) .toSimpleType(getModuleManager())); } if ($reifiedT instanceof TypeDescriptor.Class) { TypeDescriptor.Class klass = (TypeDescriptor.Class) $reifiedT; // this is already erased return (java.lang.Class<?>) klass.getArrayElementClass(); } else if ($reifiedT instanceof TypeDescriptor.Member) { TypeDescriptor.Member member = (TypeDescriptor.Member) $reifiedT; TypeDescriptor m = member.getMember(); if (m instanceof TypeDescriptor.Class) { TypeDescriptor.Member.Class klass = (TypeDescriptor.Class) m; return (java.lang.Class<?>) klass.getKlass(); } } return null; }
static java.lang.Class<?> function(TypeDescriptor $reifiedT) { if ($reifiedT instanceof TypeDescriptor.Intersection) { return (java.lang.Class<?>) getJavaClass(((TypeDescriptor.Intersection)$reifiedT) .toSimpleType(getModuleManager())); } else if ($reifiedT instanceof TypeDescriptor.Union) { return (java.lang.Class<?>) getJavaClass(((TypeDescriptor.Union)$reifiedT) .toSimpleType(getModuleManager())); } if ($reifiedT instanceof TypeDescriptor.Class) { TypeDescriptor.Class klass = (TypeDescriptor.Class) $reifiedT; return (java.lang.Class<?>) klass.getArrayElementClass(); } else if ($reifiedT instanceof TypeDescriptor.Member) { TypeDescriptor.Member member = (TypeDescriptor.Member) $reifiedT; TypeDescriptor m = member.getMember(); if (m instanceof TypeDescriptor.Class) { TypeDescriptor.Member.Class klass = (TypeDescriptor.Class) m; return (java.lang.Class<?>) klass.getKlass(); } } return null; }
/** * Return the java.lang.Class for the given reified type, or null if * the given type cannot be represented as a java.lang.Class. Only * types which simplify to class or interface types can be converted. */
Return the java.lang.Class for the given reified type, or null if the given type cannot be represented as a java.lang.Class. Only types which simplify to class or interface types can be converted
getJavaClass
{ "repo_name": "ceylon/ceylon", "path": "language/runtime/org/eclipse/ceylon/compiler/java/runtime/metamodel/Metamodel.java", "license": "apache-2.0", "size": 123821 }
[ "org.eclipse.ceylon.compiler.java.runtime.model.TypeDescriptor" ]
import org.eclipse.ceylon.compiler.java.runtime.model.TypeDescriptor;
import org.eclipse.ceylon.compiler.java.runtime.model.*;
[ "org.eclipse.ceylon" ]
org.eclipse.ceylon;
535,700
private List<Map<String, String>> filterNonExistingUsers(List<Map<String, String>> subjects) throws InternalErrorException { List<Map<String, String>> existingSubjects = new ArrayList<>(); for (Map<String, String> subject : subjects) { if(isExistingUser(subject)) { existingSubjects.add(subject); } } return existingSubjects; }
List<Map<String, String>> function(List<Map<String, String>> subjects) throws InternalErrorException { List<Map<String, String>> existingSubjects = new ArrayList<>(); for (Map<String, String> subject : subjects) { if(isExistingUser(subject)) { existingSubjects.add(subject); } } return existingSubjects; }
/** * Filters subjects that does not have a corresponding user in Perun by ues REMS * or by additionalueses in format: {extSourceName}|{extSourceClass}|{eppn}|0. * The eppn is used as a 'login'. * * @param subjects subjects that will be filtered * @return List without filtered subjects * @throws InternalErrorException internalError */
Filters subjects that does not have a corresponding user in Perun by ues REMS or by additionalueses in format: {extSourceName}|{extSourceClass}|{eppn}|0. The eppn is used as a 'login'
filterNonExistingUsers
{ "repo_name": "licehammer/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/impl/ExtSourceREMS.java", "license": "bsd-2-clause", "size": 7455 }
[ "cz.metacentrum.perun.core.api.exceptions.InternalErrorException", "java.util.ArrayList", "java.util.List", "java.util.Map" ]
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import java.util.ArrayList; import java.util.List; import java.util.Map;
import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*;
[ "cz.metacentrum.perun", "java.util" ]
cz.metacentrum.perun; java.util;
1,423,026
private void setSubjectClaim(String tenantAwareUserId, UserStoreManager userStore, Map<String, String> attributesMap, String spStandardDialect, AuthenticationContext context) { String subjectURI = context.getSequenceConfig().getApplicationConfig().getSubjectClaimUri(); if (subjectURI != null) { if (attributesMap.get(subjectURI) != null) { context.setProperty(SERVICE_PROVIDER_SUBJECT_CLAIM_VALUE, attributesMap.get(subjectURI)); if (log.isDebugEnabled()) { log.debug("Setting \'ServiceProviderSubjectClaimValue\' property value from " + "attribute map " + attributesMap.get(subjectURI)); } } else { log.debug("Subject claim not found among attributes"); } // if federated case return if (tenantAwareUserId == null || userStore == null) { log.debug("Tenant aware username or user store \'NULL\'. Possibly federated case"); return; } // standard dialect if (spStandardDialect != null) { setSubjectClaimForStandardDialect(tenantAwareUserId, userStore, context, subjectURI); } } }
void function(String tenantAwareUserId, UserStoreManager userStore, Map<String, String> attributesMap, String spStandardDialect, AuthenticationContext context) { String subjectURI = context.getSequenceConfig().getApplicationConfig().getSubjectClaimUri(); if (subjectURI != null) { if (attributesMap.get(subjectURI) != null) { context.setProperty(SERVICE_PROVIDER_SUBJECT_CLAIM_VALUE, attributesMap.get(subjectURI)); if (log.isDebugEnabled()) { log.debug(STR + STR + attributesMap.get(subjectURI)); } } else { log.debug(STR); } if (tenantAwareUserId == null userStore == null) { log.debug(STR); return; } if (spStandardDialect != null) { setSubjectClaimForStandardDialect(tenantAwareUserId, userStore, context, subjectURI); } } }
/** * Set authenticated user's SP Subject Claim URI as a property */
Set authenticated user's SP Subject Claim URI as a property
setSubjectClaim
{ "repo_name": "kasungayan/carbon-identity", "path": "components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/claims/impl/DefaultClaimHandler.java", "license": "apache-2.0", "size": 36580 }
[ "java.util.Map", "org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext", "org.wso2.carbon.user.api.UserStoreManager" ]
import java.util.Map; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.user.api.UserStoreManager;
import java.util.*; import org.wso2.carbon.identity.application.authentication.framework.context.*; import org.wso2.carbon.user.api.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
2,149,182
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<Response<List<String>>> checkMemberObjectsWithResponseAsync( String organizationId, OrganizationCheckMemberObjectsRequestBody body) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (organizationId == null) { return Mono.error(new IllegalArgumentException("Parameter organizationId is required and cannot be null.")); } if (body == null) { return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { body.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.checkMemberObjects(this.client.getEndpoint(), organizationId, body, accept, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<List<String>>> function( String organizationId, OrganizationCheckMemberObjectsRequestBody body) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (organizationId == null) { return Mono.error(new IllegalArgumentException(STR)); } if (body == null) { return Mono.error(new IllegalArgumentException(STR)); } else { body.validate(); } final String accept = STR; return FluxUtil .withContext( context -> service.checkMemberObjects(this.client.getEndpoint(), organizationId, body, accept, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); }
/** * Invoke action checkMemberObjects. * * @param organizationId key: id of organization. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws OdataErrorMainException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String. */
Invoke action checkMemberObjects
checkMemberObjectsWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/OrganizationsClientImpl.java", "license": "mit", "size": 103543 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.authorization.fluent.models.OrganizationCheckMemberObjectsRequestBody", "java.util.List" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.authorization.fluent.models.OrganizationCheckMemberObjectsRequestBody; import java.util.List;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.authorization.fluent.models.*; import java.util.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.util" ]
com.azure.core; com.azure.resourcemanager; java.util;
1,453,816
@Override synchronized public void close() { if (stream != null) { IoUtils.cleanup(stream); stream = null; } }
synchronized void function() { if (stream != null) { IoUtils.cleanup(stream); stream = null; } }
/** * Overrides {@link java.lang.AutoCloseable#close()}. Closes the OS stream. */
Overrides <code>java.lang.AutoCloseable#close()</code>. Closes the OS stream
close
{ "repo_name": "kexianda/commons-crypto", "path": "src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java", "license": "apache-2.0", "size": 4473 }
[ "org.apache.commons.crypto.utils.IoUtils" ]
import org.apache.commons.crypto.utils.IoUtils;
import org.apache.commons.crypto.utils.*;
[ "org.apache.commons" ]
org.apache.commons;
2,321,135
GradingScaleDAO gradingScaleDAO = DAOFactory.getInstance().getGradingScaleDAO(); GradeDAO gradeDAO = DAOFactory.getInstance().getGradeDAO(); String name = jsonRequestContext.getRequest().getParameter("name"); String description = jsonRequestContext.getRequest().getParameter("description"); GradingScale gradingScale = gradingScaleDAO.create(name, description); int rowCount = NumberUtils.createInteger(jsonRequestContext.getRequest().getParameter("gradesTable.rowCount")).intValue(); for (int i = 0; i < rowCount; i++) { String colPrefix = "gradesTable." + i; String gradeName = jsonRequestContext.getRequest().getParameter(colPrefix + ".name"); String gradeQualification = jsonRequestContext.getRequest().getParameter(colPrefix + ".qualification"); Double gradeGPA = NumberUtils.createDouble(jsonRequestContext.getRequest().getParameter(colPrefix + ".GPA")); String gradeDescription = jsonRequestContext.getRequest().getParameter(colPrefix + ".description"); Boolean passingGrade = "1".equals(jsonRequestContext.getRequest().getParameter(colPrefix + ".passingGrade")); gradeDAO.create(gradingScale, gradeName, gradeDescription, passingGrade, gradeGPA, gradeQualification); } String redirectURL = jsonRequestContext.getRequest().getContextPath() + "/settings/editgradingscale.page?gradingScaleId=" + gradingScale.getId(); String refererAnchor = jsonRequestContext.getRefererAnchor(); if (!StringUtils.isBlank(refererAnchor)) redirectURL += "#" + refererAnchor; jsonRequestContext.setRedirectURL(redirectURL); }
GradingScaleDAO gradingScaleDAO = DAOFactory.getInstance().getGradingScaleDAO(); GradeDAO gradeDAO = DAOFactory.getInstance().getGradeDAO(); String name = jsonRequestContext.getRequest().getParameter("name"); String description = jsonRequestContext.getRequest().getParameter(STR); GradingScale gradingScale = gradingScaleDAO.create(name, description); int rowCount = NumberUtils.createInteger(jsonRequestContext.getRequest().getParameter(STR)).intValue(); for (int i = 0; i < rowCount; i++) { String colPrefix = STR + i; String gradeName = jsonRequestContext.getRequest().getParameter(colPrefix + ".name"); String gradeQualification = jsonRequestContext.getRequest().getParameter(colPrefix + STR); Double gradeGPA = NumberUtils.createDouble(jsonRequestContext.getRequest().getParameter(colPrefix + ".GPA")); String gradeDescription = jsonRequestContext.getRequest().getParameter(colPrefix + STR); Boolean passingGrade = "1".equals(jsonRequestContext.getRequest().getParameter(colPrefix + STR)); gradeDAO.create(gradingScale, gradeName, gradeDescription, passingGrade, gradeGPA, gradeQualification); } String redirectURL = jsonRequestContext.getRequest().getContextPath() + STR + gradingScale.getId(); String refererAnchor = jsonRequestContext.getRefererAnchor(); if (!StringUtils.isBlank(refererAnchor)) redirectURL += "#" + refererAnchor; jsonRequestContext.setRedirectURL(redirectURL); }
/** * Processes the request to create a new grading scale. * * @param jsonRequestContext The JSON request context */
Processes the request to create a new grading scale
process
{ "repo_name": "leafsoftinfo/pyramus", "path": "pyramus/src/main/java/fi/pyramus/json/settings/CreateGradingScaleJSONRequestController.java", "license": "gpl-3.0", "size": 2635 }
[ "fi.pyramus.dao.DAOFactory", "fi.pyramus.dao.grading.GradeDAO", "fi.pyramus.dao.grading.GradingScaleDAO", "fi.pyramus.domainmodel.grading.GradingScale", "org.apache.commons.lang.StringUtils", "org.apache.commons.lang.math.NumberUtils" ]
import fi.pyramus.dao.DAOFactory; import fi.pyramus.dao.grading.GradeDAO; import fi.pyramus.dao.grading.GradingScaleDAO; import fi.pyramus.domainmodel.grading.GradingScale; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils;
import fi.pyramus.dao.*; import fi.pyramus.dao.grading.*; import fi.pyramus.domainmodel.grading.*; import org.apache.commons.lang.*; import org.apache.commons.lang.math.*;
[ "fi.pyramus.dao", "fi.pyramus.domainmodel", "org.apache.commons" ]
fi.pyramus.dao; fi.pyramus.domainmodel; org.apache.commons;
247,891
ServiceResponse<Void> put201() throws ErrorException, IOException;
ServiceResponse<Void> put201() throws ErrorException, IOException;
/** * Put true Boolean value in request returns 201. * * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponse} object if successful. */
Put true Boolean value in request returns 201
put201
{ "repo_name": "John-Hart/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/HttpSuccess.java", "license": "mit", "size": 27204 }
[ "com.microsoft.rest.ServiceResponse", "java.io.IOException" ]
import com.microsoft.rest.ServiceResponse; import java.io.IOException;
import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.rest", "java.io" ]
com.microsoft.rest; java.io;
1,416,669
public PactDslJsonArray decimalType(BigDecimal number) { body.put(number); matchers.addRule(rootPath + appendArrayIndex(0), new NumberTypeMatcher(NumberTypeMatcher.NumberType.DECIMAL)); return this; }
PactDslJsonArray function(BigDecimal number) { body.put(number); matchers.addRule(rootPath + appendArrayIndex(0), new NumberTypeMatcher(NumberTypeMatcher.NumberType.DECIMAL)); return this; }
/** * Element that must be a decimalType value * @param number example decimalType value */
Element that must be a decimalType value
decimalType
{ "repo_name": "DiUS/pact-jvm", "path": "consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java", "license": "apache-2.0", "size": 45650 }
[ "au.com.dius.pact.core.model.matchingrules.NumberTypeMatcher", "java.math.BigDecimal" ]
import au.com.dius.pact.core.model.matchingrules.NumberTypeMatcher; import java.math.BigDecimal;
import au.com.dius.pact.core.model.matchingrules.*; import java.math.*;
[ "au.com.dius", "java.math" ]
au.com.dius; java.math;
1,586,156
public long getRegionSizeInBytes(byte[] regionId) { if (sizeMap == null) { return avgRowSizeInBytes*1024*1024; // 1 million rows } else { Long size = sizeMap.get(regionId); if (size == null) { logger.debug("Unknown region:" + Arrays.toString(regionId)); return 0; } else { return size; } } }
long function(byte[] regionId) { if (sizeMap == null) { return avgRowSizeInBytes*1024*1024; } else { Long size = sizeMap.get(regionId); if (size == null) { logger.debug(STR + Arrays.toString(regionId)); return 0; } else { return size; } } }
/** * Returns size of given region in bytes. Returns 0 if region was not found. */
Returns size of given region in bytes. Returns 0 if region was not found
getRegionSizeInBytes
{ "repo_name": "nvoron23/incubator-drill", "path": "contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/TableStatsCalculator.java", "license": "apache-2.0", "size": 6173 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,384,391
public TerminalBridge openConnection(int id) throws IllegalArgumentException, IOException, InterruptedException, Sl4aException { // throw exception if terminal already open if (getConnectedBridge(id) != null) { throw new IllegalArgumentException("Connection already open"); } InterpreterProcess process = mService.getProcess(id); TerminalBridge bridge = new TerminalBridge(this, process, new ProcessTransport(process)); bridge.connect(); WeakReference<TerminalBridge> wr = new WeakReference<TerminalBridge>(bridge); bridges.add(bridge); mHostBridgeMap.put(id, wr); return bridge; }
TerminalBridge function(int id) throws IllegalArgumentException, IOException, InterruptedException, Sl4aException { if (getConnectedBridge(id) != null) { throw new IllegalArgumentException(STR); } InterpreterProcess process = mService.getProcess(id); TerminalBridge bridge = new TerminalBridge(this, process, new ProcessTransport(process)); bridge.connect(); WeakReference<TerminalBridge> wr = new WeakReference<TerminalBridge>(bridge); bridges.add(bridge); mHostBridgeMap.put(id, wr); return bridge; }
/** * Open a new session using the given parameters. * * @throws InterruptedException * @throws Sl4aException */
Open a new session using the given parameters
openConnection
{ "repo_name": "kuri65536/sl4a", "path": "android/ScriptingLayerForAndroid/src/org/connectbot/service/TerminalManager.java", "license": "apache-2.0", "size": 9612 }
[ "com.googlecode.android_scripting.exception.Sl4aException", "com.googlecode.android_scripting.interpreter.InterpreterProcess", "java.io.IOException", "java.lang.ref.WeakReference", "org.connectbot.transport.ProcessTransport" ]
import com.googlecode.android_scripting.exception.Sl4aException; import com.googlecode.android_scripting.interpreter.InterpreterProcess; import java.io.IOException; import java.lang.ref.WeakReference; import org.connectbot.transport.ProcessTransport;
import com.googlecode.android_scripting.exception.*; import com.googlecode.android_scripting.interpreter.*; import java.io.*; import java.lang.ref.*; import org.connectbot.transport.*;
[ "com.googlecode.android_scripting", "java.io", "java.lang", "org.connectbot.transport" ]
com.googlecode.android_scripting; java.io; java.lang; org.connectbot.transport;
160,238
@Override public Instant toInstant() { throw new java.lang.UnsupportedOperationException(); }
Instant function() { throw new java.lang.UnsupportedOperationException(); }
/** * This method always throws an UnsupportedOperationException and should * not be used because SQL {@code Time} values do not have a date * component. * * @exception java.lang.UnsupportedOperationException if this method is invoked */
This method always throws an UnsupportedOperationException and should not be used because SQL Time values do not have a date component
toInstant
{ "repo_name": "isaacl/openjdk-jdk", "path": "src/share/classes/java/sql/Time.java", "license": "gpl-2.0", "size": 9600 }
[ "java.time.Instant" ]
import java.time.Instant;
import java.time.*;
[ "java.time" ]
java.time;
580,552
public int flush() { int total = 0; while (this.outbound.hasData()) { int written; try { written = this.onReadyToWrite(System.currentTimeMillis()); } catch (IOException exc) { written = 0; } if (written == 0) { break; } total += written; } return total; }
int function() { int total = 0; while (this.outbound.hasData()) { int written; try { written = this.onReadyToWrite(System.currentTimeMillis()); } catch (IOException exc) { written = 0; } if (written == 0) { break; } total += written; } return total; }
/** * Writes as many as possible bytes to the socket buffer */
Writes as many as possible bytes to the socket buffer
flush
{ "repo_name": "thaidn/securegram", "path": "android/src/main/java/jawnae/pyronet/PyroClient.java", "license": "gpl-2.0", "size": 14178 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,817,694
LongStream timeStream(); long firstTime(); long lastTime(); long previousTime(); long maxDuration(); default long duration() { return lastTime() - firstTime(); }
LongStream timeStream(); long firstTime(); long lastTime(); long previousTime(); long maxDuration(); default long duration() { return lastTime() - firstTime(); }
/** * Returns actual milliseconds between lastTime() and firstTime(); * @return */
Returns actual milliseconds between lastTime() and firstTime()
duration
{ "repo_name": "tvesalainen/util", "path": "util/src/main/java/org/vesalainen/math/sliding/TimeArray.java", "license": "gpl-3.0", "size": 1988 }
[ "java.util.stream.LongStream" ]
import java.util.stream.LongStream;
import java.util.stream.*;
[ "java.util" ]
java.util;
128,514
@SuppressWarnings("unchecked") public static <UJO extends Ujo> KeyRing<UJO> of(@NotNull final Class<UJO> domainClass) { try { final KeyList result = domainClass.newInstance().readKeys(); return result instanceof KeyRing ? (KeyRing) result : of(domainClass, (Collection) result); } catch (RuntimeException | ReflectiveOperationException e) { throw new IllegalUjormException(e); } }
@SuppressWarnings(STR) static <UJO extends Ujo> KeyRing<UJO> function(@NotNull final Class<UJO> domainClass) { try { final KeyList result = domainClass.newInstance().readKeys(); return result instanceof KeyRing ? (KeyRing) result : of(domainClass, (Collection) result); } catch (RuntimeException ReflectiveOperationException e) { throw new IllegalUjormException(e); } }
/** Returns all direct properties form a domain class * @param domainClass Mandatory domain class */
Returns all direct properties form a domain class
of
{ "repo_name": "pponec/ujorm", "path": "project-m2/ujo-core/src/main/java/org/ujorm/core/KeyRing.java", "license": "apache-2.0", "size": 19733 }
[ "java.util.Collection", "org.jetbrains.annotations.NotNull", "org.ujorm.KeyList", "org.ujorm.Ujo" ]
import java.util.Collection; import org.jetbrains.annotations.NotNull; import org.ujorm.KeyList; import org.ujorm.Ujo;
import java.util.*; import org.jetbrains.annotations.*; import org.ujorm.*;
[ "java.util", "org.jetbrains.annotations", "org.ujorm" ]
java.util; org.jetbrains.annotations; org.ujorm;
2,555,515
if (connection instanceof AutoCloseConnection) { return (AutoCloseConnection) connection; } return new AutoCloseConnection(connection); } private AutoCloseConnection(Connection connection) { super(connection); }
if (connection instanceof AutoCloseConnection) { return (AutoCloseConnection) connection; } return new AutoCloseConnection(connection); } private AutoCloseConnection(Connection connection) { super(connection); }
/** * Returns an {@link AutoCloseable} {@link Connection} from the given {@link Connection} * * @param connection * the Connection * @return the {@link AutoCloseable} {@link Connection} */
Returns an <code>AutoCloseable</code> <code>Connection</code> from the given <code>Connection</code>
from
{ "repo_name": "schlosna/arm-extensions", "path": "src/main/java/com/google/code/arm/sql/AutoCloseConnection.java", "license": "apache-2.0", "size": 7440 }
[ "java.sql.Connection" ]
import java.sql.Connection;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,189,661
public static <V extends UniqueIdentifiable & ExternalBundleIdentifiable> Map<ExternalIdBundle, Collection<V>> getAll( final SourceWithExternalBundle<V> source, final Collection<ExternalIdBundle> bundles, final VersionCorrection versionCorrection) { if (bundles.isEmpty()) { return Collections.emptyMap(); } else if (bundles.size() == 1) { final ExternalIdBundle bundle = bundles.iterator().next(); final Collection<V> result = source.get(bundle, versionCorrection); if (result != null && !result.isEmpty()) { return Collections.<ExternalIdBundle, Collection<V>>singletonMap(bundle, result); } return Collections.emptyMap(); } final PoolExecutor executor = PoolExecutor.instance(); if (executor != null) { return getAllMultiThread(executor, source, bundles, versionCorrection); } return getAllSingleThread(source, bundles, versionCorrection); }
static <V extends UniqueIdentifiable & ExternalBundleIdentifiable> Map<ExternalIdBundle, Collection<V>> function( final SourceWithExternalBundle<V> source, final Collection<ExternalIdBundle> bundles, final VersionCorrection versionCorrection) { if (bundles.isEmpty()) { return Collections.emptyMap(); } else if (bundles.size() == 1) { final ExternalIdBundle bundle = bundles.iterator().next(); final Collection<V> result = source.get(bundle, versionCorrection); if (result != null && !result.isEmpty()) { return Collections.<ExternalIdBundle, Collection<V>>singletonMap(bundle, result); } return Collections.emptyMap(); } final PoolExecutor executor = PoolExecutor.instance(); if (executor != null) { return getAllMultiThread(executor, source, bundles, versionCorrection); } return getAllSingleThread(source, bundles, versionCorrection); }
/** * Gets objects from the source. If there is more than one match for the id bundle then all of the matches * are be returned. * * @param source the source * @param bundles the bundles for which to get the objects * @param versionCorrection the version/correction of the objects * @return the objects * @param <V> the type of the objects */
Gets objects from the source. If there is more than one match for the id bundle then all of the matches are be returned
getAll
{ "repo_name": "McLeodMoores/starling", "path": "projects/core/src/main/java/com/opengamma/core/AbstractSourceWithExternalBundle.java", "license": "apache-2.0", "size": 11935 }
[ "com.opengamma.id.ExternalBundleIdentifiable", "com.opengamma.id.ExternalIdBundle", "com.opengamma.id.UniqueIdentifiable", "com.opengamma.id.VersionCorrection", "com.opengamma.util.PoolExecutor", "java.util.Collection", "java.util.Collections", "java.util.Map" ]
import com.opengamma.id.ExternalBundleIdentifiable; import com.opengamma.id.ExternalIdBundle; import com.opengamma.id.UniqueIdentifiable; import com.opengamma.id.VersionCorrection; import com.opengamma.util.PoolExecutor; import java.util.Collection; import java.util.Collections; import java.util.Map;
import com.opengamma.id.*; import com.opengamma.util.*; import java.util.*;
[ "com.opengamma.id", "com.opengamma.util", "java.util" ]
com.opengamma.id; com.opengamma.util; java.util;
1,828,159
public VariantContext annotateOverlaps(final FeatureContext featureContext, final VariantContext vcToAnnotate) { if ( overlaps.isEmpty() ) { return vcToAnnotate; } VariantContext annotated = vcToAnnotate; final SimpleInterval loc = new SimpleInterval(vcToAnnotate); for ( final Map.Entry<FeatureInput<VariantContext>, String> overlap : overlaps.entrySet() ) { final FeatureInput<VariantContext> fi = overlap.getKey(); final List<VariantContext> vcs = featureContext.getValues(fi, loc.getStart()); annotated = annotateOverlap(vcs, overlap.getValue(), annotated); } return annotated; }
VariantContext function(final FeatureContext featureContext, final VariantContext vcToAnnotate) { if ( overlaps.isEmpty() ) { return vcToAnnotate; } VariantContext annotated = vcToAnnotate; final SimpleInterval loc = new SimpleInterval(vcToAnnotate); for ( final Map.Entry<FeatureInput<VariantContext>, String> overlap : overlaps.entrySet() ) { final FeatureInput<VariantContext> fi = overlap.getKey(); final List<VariantContext> vcs = featureContext.getValues(fi, loc.getStart()); annotated = annotateOverlap(vcs, overlap.getValue(), annotated); } return annotated; }
/** * Add overlap attributes to vcToAnnotate against all overlaps in featureContext * * @see #annotateOverlap(java.util.List, String, htsjdk.variant.variantcontext.VariantContext) * for more information * * @param featureContext non-null featureContext, which we will use to update the rsID of vcToAnnotate * @param vcToAnnotate a variant context to annotate * @return a VariantContext (may be == to vcToAnnotate) with updated overlaps update fields value */
Add overlap attributes to vcToAnnotate against all overlaps in featureContext
annotateOverlaps
{ "repo_name": "magicDGS/gatk", "path": "src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/VariantOverlapAnnotator.java", "license": "bsd-3-clause", "size": 8765 }
[ "java.util.List", "java.util.Map", "org.broadinstitute.hellbender.engine.FeatureContext", "org.broadinstitute.hellbender.engine.FeatureInput", "org.broadinstitute.hellbender.utils.SimpleInterval" ]
import java.util.List; import java.util.Map; import org.broadinstitute.hellbender.engine.FeatureContext; import org.broadinstitute.hellbender.engine.FeatureInput; import org.broadinstitute.hellbender.utils.SimpleInterval;
import java.util.*; import org.broadinstitute.hellbender.engine.*; import org.broadinstitute.hellbender.utils.*;
[ "java.util", "org.broadinstitute.hellbender" ]
java.util; org.broadinstitute.hellbender;
1,800,107
public void addListener(final BreakpointManagerListener listener) { listeners.addListener( Preconditions.checkNotNull(listener, "IE00723: listener argument can not be null")); }
void function(final BreakpointManagerListener listener) { listeners.addListener( Preconditions.checkNotNull(listener, STR)); }
/** * Adds a breakpoint listener that is notified about relevant changes in the breakpoint manager. * * @param listener The listener to add. * * @throws IllegalArgumentException Thrown if the listener argument is null. */
Adds a breakpoint listener that is notified about relevant changes in the breakpoint manager
addListener
{ "repo_name": "guiquanz/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/debug/models/breakpoints/BreakpointManager.java", "license": "apache-2.0", "size": 23668 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.BreakpointManagerListener" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.BreakpointManagerListener;
import com.google.common.base.*; import com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.*;
[ "com.google.common", "com.google.security" ]
com.google.common; com.google.security;
1,246,772
private void removeNodes(List nodes) { TreeImageDisplay parentDisplay; if (getLastSelectedDisplay() == null) parentDisplay = view.getTreeRoot(); else { parentDisplay = getLastSelectedDisplay().getParentDisplay(); } if (parentDisplay == null) parentDisplay = view.getTreeRoot(); setSelectedDisplay(parentDisplay); view.removeNodes(nodes, parentDisplay); }
void function(List nodes) { TreeImageDisplay parentDisplay; if (getLastSelectedDisplay() == null) parentDisplay = view.getTreeRoot(); else { parentDisplay = getLastSelectedDisplay().getParentDisplay(); } if (parentDisplay == null) parentDisplay = view.getTreeRoot(); setSelectedDisplay(parentDisplay); view.removeNodes(nodes, parentDisplay); }
/** * Helper method to remove the collection of the specified nodes. * * @param nodes The collection of node to remove. */
Helper method to remove the collection of the specified nodes
removeNodes
{ "repo_name": "ximenesuk/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java", "license": "gpl-2.0", "size": 78014 }
[ "java.util.List", "org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay" ]
import java.util.List; import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay;
import java.util.*; import org.openmicroscopy.shoola.agents.util.browser.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
2,437,704
public void clearAll () { List<Notification> notifications = getAll(); for (Notification notification : notifications) { notification.clear(); } getNotMgr().cancelAll(); }
void function () { List<Notification> notifications = getAll(); for (Notification notification : notifications) { notification.clear(); } getNotMgr().cancelAll(); }
/** * Clear all local notifications. */
Clear all local notifications
clearAll
{ "repo_name": "sysfolko/sysfolko-de.appplant.cordova.plugin.local-notification-sysfo-fix", "path": "src/android/notification/Manager.java", "license": "apache-2.0", "size": 12408 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,916,251
private static void getBuiltinsForGlslVersionCommon( Map<String, List<FunctionPrototype>> builtinsForVersion, ShadingLanguageVersion shadingLanguageVersion, boolean isWgslCompatible) { { final String name = "abs"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } if (shadingLanguageVersion.supportedAbsInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t); } } } if (!isWgslCompatible) { final String name = "sign"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } if (shadingLanguageVersion.supportedSignInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t); } } } { final String name = "floor"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } if (shadingLanguageVersion.supportedTrunc()) { final String name = "trunc"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } if (shadingLanguageVersion.supportedRound()) { final String name = "round"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } if (shadingLanguageVersion.supportedRoundEven()) { final String name = "roundEven"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } { final String name = "ceil"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } { final String name = "fract"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } { final String name = "mod"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } if (shadingLanguageVersion.supportedModf() && !isWgslCompatible) { { final String name = "modf"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, new QualifiedType(t, Arrays.asList(TypeQualifier.OUT_PARAM))); } } } { final String name = "min"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } if (shadingLanguageVersion.supportedMinInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.INT); if (t != BasicType.INT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } if (shadingLanguageVersion.supportedMinUint()) { for (Type t : ugenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.UINT); if (t != BasicType.UINT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } } { final String name = "max"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } if (shadingLanguageVersion.supportedMaxInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.INT); if (t != BasicType.INT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } if (shadingLanguageVersion.supportedMaxUint()) { for (Type t : ugenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.UINT); if (t != BasicType.UINT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } } { final String name = "clamp"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } if (shadingLanguageVersion.supportedClampInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.INT, BasicType.INT); if (t != BasicType.INT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } } if (shadingLanguageVersion.supportedClampUint()) { for (Type t : ugenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.UINT, BasicType.UINT); if (t != BasicType.UINT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } } } { final String name = "mix"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } if (shadingLanguageVersion.supportedMixFloatBool()) { addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.FLOAT, BasicType.FLOAT, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.VEC2, BasicType.VEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.VEC3, BasicType.VEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.VEC4, BasicType.VEC4, BasicType.BVEC4); } if (shadingLanguageVersion.supportedMixNonfloatBool()) { addBuiltin(builtinsForVersion, name, BasicType.INT, BasicType.INT, BasicType.INT, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.IVEC2, BasicType.IVEC2, BasicType.IVEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.IVEC3, BasicType.IVEC3, BasicType.IVEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.IVEC4, BasicType.IVEC4, BasicType.IVEC4, BasicType.BVEC4); addBuiltin(builtinsForVersion, name, BasicType.UINT, BasicType.UINT, BasicType.UINT, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.UVEC2, BasicType.UVEC2, BasicType.UVEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.UVEC3, BasicType.UVEC3, BasicType.UVEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.UVEC4, BasicType.UVEC4, BasicType.UVEC4, BasicType.BVEC4); addBuiltin(builtinsForVersion, name, BasicType.BOOL, BasicType.BOOL, BasicType.BOOL, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.BVEC2, BasicType.BVEC2, BasicType.BVEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.BVEC3, BasicType.BVEC3, BasicType.BVEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.BVEC4, BasicType.BVEC4, BasicType.BVEC4, BasicType.BVEC4); } } { final String name = "step"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, BasicType.FLOAT, t); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } { final String name = "smoothstep"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, BasicType.FLOAT, BasicType.FLOAT, t); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } } if (shadingLanguageVersion.supportedIsnan()) { final String name = "isnan"; addBuiltin(builtinsForVersion, name, BasicType.BOOL, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.BVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.BVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.BVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedIsinf()) { final String name = "isinf"; addBuiltin(builtinsForVersion, name, BasicType.BOOL, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.BVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.BVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.BVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedFloatBitsToInt()) { final String name = "floatBitsToInt"; addBuiltin(builtinsForVersion, name, BasicType.INT, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.IVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.IVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.IVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedFloatBitsToUint()) { final String name = "floatBitsToUint"; addBuiltin(builtinsForVersion, name, BasicType.UINT, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.UVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.UVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.UVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedIntBitsToFloat()) { final String name = "intBitsToFloat"; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.INT); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.IVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.IVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.IVEC4); } if (shadingLanguageVersion.supportedUintBitsToFloat()) { final String name = "uintBitsToFloat"; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.UINT); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.UVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.UVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.UVEC4); } if (shadingLanguageVersion.supportedFma()) { final String name = "fma"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } if (shadingLanguageVersion.supportedFrexp() && !isWgslCompatible) { { final String name = "frexp"; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.FLOAT, new QualifiedType(BasicType.INT, Arrays.asList(TypeQualifier.OUT_PARAM))); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.VEC2, new QualifiedType(BasicType.IVEC2, Arrays.asList(TypeQualifier.OUT_PARAM))); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.VEC3, new QualifiedType(BasicType.IVEC3, Arrays.asList(TypeQualifier.OUT_PARAM))); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.VEC4, new QualifiedType(BasicType.IVEC4, Arrays.asList(TypeQualifier.OUT_PARAM))); } } if (shadingLanguageVersion.supportedLdexp()) { { final String name = "ldexp"; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.FLOAT, BasicType.INT); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.VEC2, BasicType.IVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.VEC3, BasicType.IVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.VEC4, BasicType.IVEC4); } } }
static void function( Map<String, List<FunctionPrototype>> builtinsForVersion, ShadingLanguageVersion shadingLanguageVersion, boolean isWgslCompatible) { { final String name = "abs"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } if (shadingLanguageVersion.supportedAbsInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t); } } } if (!isWgslCompatible) { final String name = "sign"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } if (shadingLanguageVersion.supportedSignInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t); } } } { final String name = "floor"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } if (shadingLanguageVersion.supportedTrunc()) { final String name = "trunc"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } if (shadingLanguageVersion.supportedRound()) { final String name = "round"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } if (shadingLanguageVersion.supportedRoundEven()) { final String name = STR; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } { final String name = "ceil"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } { final String name = "fract"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t); } } { final String name = "mod"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } if (shadingLanguageVersion.supportedModf() && !isWgslCompatible) { { final String name = "modf"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, new QualifiedType(t, Arrays.asList(TypeQualifier.OUT_PARAM))); } } } { final String name = "min"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } if (shadingLanguageVersion.supportedMinInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.INT); if (t != BasicType.INT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } if (shadingLanguageVersion.supportedMinUint()) { for (Type t : ugenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.UINT); if (t != BasicType.UINT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } } { final String name = "max"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } if (shadingLanguageVersion.supportedMaxInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.INT); if (t != BasicType.INT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } if (shadingLanguageVersion.supportedMaxUint()) { for (Type t : ugenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.UINT); if (t != BasicType.UINT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } } { final String name = "clamp"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.FLOAT, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } if (shadingLanguageVersion.supportedClampInt()) { for (Type t : igenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.INT, BasicType.INT); if (t != BasicType.INT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } } if (shadingLanguageVersion.supportedClampUint()) { for (Type t : ugenType()) { addBuiltin(builtinsForVersion, name, t, t, BasicType.UINT, BasicType.UINT); if (t != BasicType.UINT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } } } { final String name = "mix"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, t, BasicType.FLOAT); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } if (shadingLanguageVersion.supportedMixFloatBool()) { addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.FLOAT, BasicType.FLOAT, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.VEC2, BasicType.VEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.VEC3, BasicType.VEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.VEC4, BasicType.VEC4, BasicType.BVEC4); } if (shadingLanguageVersion.supportedMixNonfloatBool()) { addBuiltin(builtinsForVersion, name, BasicType.INT, BasicType.INT, BasicType.INT, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.IVEC2, BasicType.IVEC2, BasicType.IVEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.IVEC3, BasicType.IVEC3, BasicType.IVEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.IVEC4, BasicType.IVEC4, BasicType.IVEC4, BasicType.BVEC4); addBuiltin(builtinsForVersion, name, BasicType.UINT, BasicType.UINT, BasicType.UINT, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.UVEC2, BasicType.UVEC2, BasicType.UVEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.UVEC3, BasicType.UVEC3, BasicType.UVEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.UVEC4, BasicType.UVEC4, BasicType.UVEC4, BasicType.BVEC4); addBuiltin(builtinsForVersion, name, BasicType.BOOL, BasicType.BOOL, BasicType.BOOL, BasicType.BOOL); addBuiltin(builtinsForVersion, name, BasicType.BVEC2, BasicType.BVEC2, BasicType.BVEC2, BasicType.BVEC2); addBuiltin(builtinsForVersion, name, BasicType.BVEC3, BasicType.BVEC3, BasicType.BVEC3, BasicType.BVEC3); addBuiltin(builtinsForVersion, name, BasicType.BVEC4, BasicType.BVEC4, BasicType.BVEC4, BasicType.BVEC4); } } { final String name = "step"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, BasicType.FLOAT, t); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t); } } } { final String name = STR; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, BasicType.FLOAT, BasicType.FLOAT, t); if (t != BasicType.FLOAT) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } } if (shadingLanguageVersion.supportedIsnan()) { final String name = "isnan"; addBuiltin(builtinsForVersion, name, BasicType.BOOL, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.BVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.BVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.BVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedIsinf()) { final String name = "isinf"; addBuiltin(builtinsForVersion, name, BasicType.BOOL, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.BVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.BVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.BVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedFloatBitsToInt()) { final String name = STR; addBuiltin(builtinsForVersion, name, BasicType.INT, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.IVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.IVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.IVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedFloatBitsToUint()) { final String name = STR; addBuiltin(builtinsForVersion, name, BasicType.UINT, BasicType.FLOAT); addBuiltin(builtinsForVersion, name, BasicType.UVEC2, BasicType.VEC2); addBuiltin(builtinsForVersion, name, BasicType.UVEC3, BasicType.VEC3); addBuiltin(builtinsForVersion, name, BasicType.UVEC4, BasicType.VEC4); } if (shadingLanguageVersion.supportedIntBitsToFloat()) { final String name = STR; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.INT); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.IVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.IVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.IVEC4); } if (shadingLanguageVersion.supportedUintBitsToFloat()) { final String name = STR; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.UINT); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.UVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.UVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.UVEC4); } if (shadingLanguageVersion.supportedFma()) { final String name = "fma"; for (Type t : genType()) { addBuiltin(builtinsForVersion, name, t, t, t, t); } } if (shadingLanguageVersion.supportedFrexp() && !isWgslCompatible) { { final String name = "frexp"; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.FLOAT, new QualifiedType(BasicType.INT, Arrays.asList(TypeQualifier.OUT_PARAM))); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.VEC2, new QualifiedType(BasicType.IVEC2, Arrays.asList(TypeQualifier.OUT_PARAM))); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.VEC3, new QualifiedType(BasicType.IVEC3, Arrays.asList(TypeQualifier.OUT_PARAM))); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.VEC4, new QualifiedType(BasicType.IVEC4, Arrays.asList(TypeQualifier.OUT_PARAM))); } } if (shadingLanguageVersion.supportedLdexp()) { { final String name = "ldexp"; addBuiltin(builtinsForVersion, name, BasicType.FLOAT, BasicType.FLOAT, BasicType.INT); addBuiltin(builtinsForVersion, name, BasicType.VEC2, BasicType.VEC2, BasicType.IVEC2); addBuiltin(builtinsForVersion, name, BasicType.VEC3, BasicType.VEC3, BasicType.IVEC3); addBuiltin(builtinsForVersion, name, BasicType.VEC4, BasicType.VEC4, BasicType.IVEC4); } } }
/** * Helper function to register built-in function prototypes for Common Functions, * as specified in section 8.3 of the GLSL 4.6 and ESSL 3.2 specifications. * * @param builtinsForVersion the list of builtins to add prototypes to * @param shadingLanguageVersion the version of GLSL in use * @param isWgslCompatible determines whether to restrict to builtins that WGSL also supports */
Helper function to register built-in function prototypes for Common Functions, as specified in section 8.3 of the GLSL 4.6 and ESSL 3.2 specifications
getBuiltinsForGlslVersionCommon
{ "repo_name": "google/graphicsfuzz", "path": "ast/src/main/java/com/graphicsfuzz/common/typing/TyperHelper.java", "license": "apache-2.0", "size": 58902 }
[ "com.graphicsfuzz.common.ast.decl.FunctionPrototype", "com.graphicsfuzz.common.ast.type.BasicType", "com.graphicsfuzz.common.ast.type.QualifiedType", "com.graphicsfuzz.common.ast.type.Type", "com.graphicsfuzz.common.ast.type.TypeQualifier", "com.graphicsfuzz.common.glslversion.ShadingLanguageVersion", "java.util.Arrays", "java.util.List", "java.util.Map" ]
import com.graphicsfuzz.common.ast.decl.FunctionPrototype; import com.graphicsfuzz.common.ast.type.BasicType; import com.graphicsfuzz.common.ast.type.QualifiedType; import com.graphicsfuzz.common.ast.type.Type; import com.graphicsfuzz.common.ast.type.TypeQualifier; import com.graphicsfuzz.common.glslversion.ShadingLanguageVersion; import java.util.Arrays; import java.util.List; import java.util.Map;
import com.graphicsfuzz.common.ast.decl.*; import com.graphicsfuzz.common.ast.type.*; import com.graphicsfuzz.common.glslversion.*; import java.util.*;
[ "com.graphicsfuzz.common", "java.util" ]
com.graphicsfuzz.common; java.util;
148,452
default <S extends SocketAddress> S getLocalAddress(Class<S> type) { final SocketAddress localAddress = getLocalAddress(); return type.isInstance(localAddress) ? type.cast(localAddress) : null; }
default <S extends SocketAddress> S getLocalAddress(Class<S> type) { final SocketAddress localAddress = getLocalAddress(); return type.isInstance(localAddress) ? type.cast(localAddress) : null; }
/** * Get the local address of this connection, cast to a specific type, if any. If there is an address but it * cannot be cast to the given type, {@code null} is returned. * * @param type the address type class * @param <S> the address type * @return the local address of this connection, or {@code null} if there is no local address or the address is * of the wrong type */
Get the local address of this connection, cast to a specific type, if any. If there is an address but it cannot be cast to the given type, null is returned
getLocalAddress
{ "repo_name": "dpospisil/jboss-remoting", "path": "src/main/java/org/jboss/remoting3/Connection.java", "license": "lgpl-2.1", "size": 3850 }
[ "java.net.SocketAddress" ]
import java.net.SocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
2,312,127
void enterDims(@NotNull Java8Parser.DimsContext ctx);
void enterDims(@NotNull Java8Parser.DimsContext ctx);
/** * Enter a parse tree produced by {@link Java8Parser#dims}. * * @param ctx the parse tree */
Enter a parse tree produced by <code>Java8Parser#dims</code>
enterDims
{ "repo_name": "BigDaddy-Germany/WHOAMI", "path": "WHOAMI/src/de/aima13/whoami/modules/syntaxcheck/languages/antlrgen/Java8Listener.java", "license": "mit", "size": 97945 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
100,368
public static byte[] encrypt(byte[] data, SecretKey key, String cipherName) { return encrypt(data, key, null, cipherName); }
static byte[] function(byte[] data, SecretKey key, String cipherName) { return encrypt(data, key, null, cipherName); }
/** * Encrypt message with specified secret key and cipher name. * * @param data specified message data in byte array * @param key specified secret key * @param cipherName specified cipher name * @return cipher message in byte array */
Encrypt message with specified secret key and cipher name
encrypt
{ "repo_name": "baidubce/bce-sdk-java", "path": "src/main/java/com/baidubce/services/iothisk/device/crypto/AesEncrypt.java", "license": "apache-2.0", "size": 5820 }
[ "javax.crypto.SecretKey" ]
import javax.crypto.SecretKey;
import javax.crypto.*;
[ "javax.crypto" ]
javax.crypto;
1,643,399
@WebMethod(operationName = "GetFacturasAutorizadas") @WebResult(name = "Facturas") public List<Comprobante> getFacturasAutorizadas(@WebParam(name = "Identificacion") String identificacion) throws GenericException { return consultasService.getFacturasAutorizadas(identificacion); }
@WebMethod(operationName = STR) @WebResult(name = STR) List<Comprobante> function(@WebParam(name = STR) String identificacion) throws GenericException { return consultasService.getFacturasAutorizadas(identificacion); }
/** * Retorna las facturas autorizadas de un cliente * * @param identificacion * @return * @throws GenericException */
Retorna las facturas autorizadas de un cliente
getFacturasAutorizadas
{ "repo_name": "diego10j/produquimic", "path": "produquimic/produquimic-war/src/java/webservice/ceo/ServicioOffline.java", "license": "apache-2.0", "size": 7019 }
[ "java.util.List", "javax.jws.WebMethod", "javax.jws.WebParam", "javax.jws.WebResult" ]
import java.util.List; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult;
import java.util.*; import javax.jws.*;
[ "java.util", "javax.jws" ]
java.util; javax.jws;
984,344
private void reset() { if (mVelocityTracker != null) { mVelocityTracker.recycle(); } mVelocityTracker = null; mDownX = 0; mDownY = 0; mCurrentView = null; mSwipingView = null; mCurrentPosition = AdapterView.INVALID_POSITION; mSwiping = false; mCanDismissCurrent = false; }
void function() { if (mVelocityTracker != null) { mVelocityTracker.recycle(); } mVelocityTracker = null; mDownX = 0; mDownY = 0; mCurrentView = null; mSwipingView = null; mCurrentPosition = AdapterView.INVALID_POSITION; mSwiping = false; mCanDismissCurrent = false; }
/** * Resets the fields to the initial values, ready to start over. */
Resets the fields to the initial values, ready to start over
reset
{ "repo_name": "MichaelArchangel/ArchangelKit", "path": "listViewAnimation/src/main/java/com/nhaarman/listviewanimations/itemmanipulation/swipedismiss/SwipeTouchListener.java", "license": "mit", "size": 22783 }
[ "android.widget.AdapterView" ]
import android.widget.AdapterView;
import android.widget.*;
[ "android.widget" ]
android.widget;
161,420
Future<Void> splitRegionAsync(byte[] regionName, byte[] splitPoint) throws IOException;
Future<Void> splitRegionAsync(byte[] regionName, byte[] splitPoint) throws IOException;
/** * Split an individual region. Asynchronous operation. * @param regionName region to split * @param splitPoint the explicit position to split on * @throws IOException if a remote or network exception occurs */
Split an individual region. Asynchronous operation
splitRegionAsync
{ "repo_name": "ChinmaySKulkarni/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java", "license": "apache-2.0", "size": 101053 }
[ "java.io.IOException", "java.util.concurrent.Future" ]
import java.io.IOException; import java.util.concurrent.Future;
import java.io.*; import java.util.concurrent.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,553,329
public String formatForCurrency(KualiDecimal amount);
String function(KualiDecimal amount);
/** * Returns a proper String Value. Also returns proper value for currency (USD) * * @param string * @return */
Returns a proper String Value. Also returns proper value for currency (USD)
formatForCurrency
{ "repo_name": "ua-eas/kfs-devops-automation-fork", "path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/service/ContractsGrantsBillingUtilityService.java", "license": "agpl-3.0", "size": 2655 }
[ "org.kuali.rice.core.api.util.type.KualiDecimal" ]
import org.kuali.rice.core.api.util.type.KualiDecimal;
import org.kuali.rice.core.api.util.type.*;
[ "org.kuali.rice" ]
org.kuali.rice;
34,599
@Test @Restriction(UiRestriction.RESTRICTION_TYPE_TABLET) @MediumTest @Feature({"Navigation"}) public void testNavigateBackAndForwardButtons() throws Exception { final String[] urls = { mTestServer.getURL("/chrome/test/data/android/navigate/one.html"), mTestServer.getURL("/chrome/test/data/android/navigate/two.html"), mTestServer.getURL("/chrome/test/data/android/navigate/three.html") }; for (String url : urls) { navigateAndObserve(url); } final int repeats = 3; for (int i = 0; i < repeats; i++) { TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.back_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, "URL mismatch after pressing back button for the 1st time in repetition" + "%d.", i), urls[1], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.back_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, "URL mismatch after pressing back button for the 2nd time in repetition" + "%d.", i), urls[0], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.forward_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, "URL mismatch after pressing fwd button for the 1st time in repetition" + "%d.", i), urls[1], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.forward_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, "URL mismatch after pressing fwd button for the 2nd time in repetition" + "%d.", i), urls[2], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); } }
@Restriction(UiRestriction.RESTRICTION_TYPE_TABLET) @Feature({STR}) void function() throws Exception { final String[] urls = { mTestServer.getURL(STR), mTestServer.getURL(STR), mTestServer.getURL(STR) }; for (String url : urls) { navigateAndObserve(url); } final int repeats = 3; for (int i = 0; i < repeats; i++) { TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.back_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, STR + "%d.", i), urls[1], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.back_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, STR + "%d.", i), urls[0], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.forward_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, STR + "%d.", i), urls[1], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); TouchCommon.singleClickView( mActivityTestRule.getActivity().findViewById(R.id.forward_button)); UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); Assert.assertEquals( String.format(Locale.US, STR + "%d.", i), urls[2], ChromeTabUtils.getUrlStringOnUiThread( mActivityTestRule.getActivity().getActivityTab())); } }
/** * Test back and forward buttons. */
Test back and forward buttons
testNavigateBackAndForwardButtons
{ "repo_name": "chromium/chromium", "path": "chrome/android/javatests/src/org/chromium/chrome/browser/NavigateTest.java", "license": "bsd-3-clause", "size": 28980 }
[ "android.support.test.InstrumentationRegistry", "java.util.Locale", "org.chromium.base.test.util.Feature", "org.chromium.base.test.util.Restriction", "org.chromium.chrome.test.util.ChromeTabUtils", "org.chromium.content_public.browser.test.util.TouchCommon", "org.chromium.content_public.browser.test.util.UiUtils", "org.chromium.ui.test.util.UiRestriction", "org.junit.Assert" ]
import android.support.test.InstrumentationRegistry; import java.util.Locale; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.content_public.browser.test.util.TouchCommon; import org.chromium.content_public.browser.test.util.UiUtils; import org.chromium.ui.test.util.UiRestriction; import org.junit.Assert;
import android.support.test.*; import java.util.*; import org.chromium.base.test.util.*; import org.chromium.chrome.test.util.*; import org.chromium.content_public.browser.test.util.*; import org.chromium.ui.test.util.*; import org.junit.*;
[ "android.support", "java.util", "org.chromium.base", "org.chromium.chrome", "org.chromium.content_public", "org.chromium.ui", "org.junit" ]
android.support; java.util; org.chromium.base; org.chromium.chrome; org.chromium.content_public; org.chromium.ui; org.junit;
1,770,973
public ResponseXPathExpectations xpath(String xpathExpression) { return ResponseMatchers.xpath(xpathExpression); }
ResponseXPathExpectations function(String xpathExpression) { return ResponseMatchers.xpath(xpathExpression); }
/** * Expects the given XPath expression to (not) exist or be evaluated to a value. * * @param xpathExpression the XPath expression * @return the XPath expectations, to be further configured */
Expects the given XPath expression to (not) exist or be evaluated to a value
xpath
{ "repo_name": "lukas-krecan/smock", "path": "common/src/main/java/net/javacrumbs/smock/common/server/AbstractCommonWebServiceServerTest.java", "license": "apache-2.0", "size": 7310 }
[ "org.springframework.ws.test.server.ResponseMatchers", "org.springframework.ws.test.server.ResponseXPathExpectations" ]
import org.springframework.ws.test.server.ResponseMatchers; import org.springframework.ws.test.server.ResponseXPathExpectations;
import org.springframework.ws.test.server.*;
[ "org.springframework.ws" ]
org.springframework.ws;
1,536,326
public String convert(Object value, Locale locale, String pattern) { LocaleConverter converter = lookup(String.class, locale); return converter.convert(String.class, value, pattern); }
String function(Object value, Locale locale, String pattern) { LocaleConverter converter = lookup(String.class, locale); return converter.convert(String.class, value, pattern); }
/** * Convert the specified locale-sensitive value into a String * using the paticular convertion pattern. * * @param value The Value to be converted * @param locale The locale * @param pattern The convertion pattern * @return the converted value * * @throws org.apache.commons.beanutils.ConversionException if thrown by an * underlying Converter */
Convert the specified locale-sensitive value into a String using the paticular convertion pattern
convert
{ "repo_name": "77ilogin/training", "path": "src/main/java/org/apache/commons/beanutils/locale/LocaleConvertUtilsBean.java", "license": "apache-2.0", "size": 20488 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,167,858
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String plotterName = (String) value; // display selected variant of the icon if the cell is selected // or in a hover state Icon icon; if (ListHoverHelper.index(list) == index) { icon = getIcon(plotterName, true); } else { icon = getIcon(plotterName, isSelected); } // update panel and label depending on cell state label.setIcon(icon); label.setText(plotterName); if (isSelected) { this.setBorder(this.hoverBorder); this.setBackground(this.hoverBackground); this.label.setFont(this.hoverFont); } else { this.setBorder(this.defaultrBorder); // since the same panel and label is used for all cells, we // have to 'reset' the styles to their default values this.setBackground(this.defaultBackground); this.label.setFont(this.defaultFont); } this.requestFocusInWindow(); return this; }
Component function(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String plotterName = (String) value; Icon icon; if (ListHoverHelper.index(list) == index) { icon = getIcon(plotterName, true); } else { icon = getIcon(plotterName, isSelected); } label.setIcon(icon); label.setText(plotterName); if (isSelected) { this.setBorder(this.hoverBorder); this.setBackground(this.hoverBackground); this.label.setFont(this.hoverFont); } else { this.setBorder(this.defaultrBorder); this.setBackground(this.defaultBackground); this.label.setFont(this.defaultFont); } this.requestFocusInWindow(); return this; }
/** * Updates panel and label for the given cell. */
Updates panel and label for the given cell
getListCellRendererComponent
{ "repo_name": "transwarpio/rapidminer", "path": "rapidMiner/rapidminer-studio-core/src/main/java/com/rapidminer/gui/plotter/PlotterChooser.java", "license": "gpl-3.0", "size": 10600 }
[ "com.rapidminer.gui.tools.ListHoverHelper", "java.awt.Component", "javax.swing.Icon", "javax.swing.JList" ]
import com.rapidminer.gui.tools.ListHoverHelper; import java.awt.Component; import javax.swing.Icon; import javax.swing.JList;
import com.rapidminer.gui.tools.*; import java.awt.*; import javax.swing.*;
[ "com.rapidminer.gui", "java.awt", "javax.swing" ]
com.rapidminer.gui; java.awt; javax.swing;
2,579,771
public long numberOf(Operation op) { return statsByOperation.getOrDefault(op, EMPTY).get(); }
long function(Operation op) { return statsByOperation.getOrDefault(op, EMPTY).get(); }
/** * Get the number of {@link #accept(SourceRecord) added} records that had the given {@link Operation}. * * @param op the operation for which the record count is to be returned * @return the count; never negative */
Get the number of <code>#accept(SourceRecord) added</code> records that had the given <code>Operation</code>
numberOf
{ "repo_name": "DuncanSands/debezium", "path": "debezium-core/src/test/java/io/debezium/data/SourceRecordStats.java", "license": "apache-2.0", "size": 3457 }
[ "io.debezium.data.Envelope" ]
import io.debezium.data.Envelope;
import io.debezium.data.*;
[ "io.debezium.data" ]
io.debezium.data;
880,184
private void setButtonsForDown() { if (!isEmpty()) { getView().findViewById(R.id.fdKeepInSync).setEnabled(true); // hides the progress bar getView().findViewById(R.id.fdProgressBlock).setVisibility(View.GONE); TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText); progressText.setVisibility(View.GONE); } }
void function() { if (!isEmpty()) { getView().findViewById(R.id.fdKeepInSync).setEnabled(true); getView().findViewById(R.id.fdProgressBlock).setVisibility(View.GONE); TextView progressText = (TextView)getView().findViewById(R.id.fdProgressText); progressText.setVisibility(View.GONE); } }
/** * Enables or disables buttons for a file locally available */
Enables or disables buttons for a file locally available
setButtonsForDown
{ "repo_name": "duke8804/android", "path": "src/com/owncloud/android/ui/fragment/FileDetailFragment.java", "license": "gpl-2.0", "size": 20958 }
[ "android.view.View", "android.widget.TextView" ]
import android.view.View; import android.widget.TextView;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,347,894
public static void copy(Reader input, OutputStream output, String encoding) throws IOException { Writer out = new OutputStreamWriter(output, encoding); copy(input, out); out.flush(); }
static void function(Reader input, OutputStream output, String encoding) throws IOException { Writer out = new OutputStreamWriter(output, encoding); copy(input, out); out.flush(); }
/** * Copies reader to output stream using buffer and specified encoding. */
Copies reader to output stream using buffer and specified encoding
copy
{ "repo_name": "wjw465150/jodd", "path": "jodd-core/src/main/java/jodd/io/StreamUtil.java", "license": "bsd-2-clause", "size": 11753 }
[ "java.io.IOException", "java.io.OutputStream", "java.io.OutputStreamWriter", "java.io.Reader", "java.io.Writer" ]
import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
2,578,881
private boolean notifyOnSelectNavigationPreference( @NonNull final NavigationPreference navigationPreference) { return callback == null || callback.onSelectNavigationPreference(navigationPreference); }
boolean function( @NonNull final NavigationPreference navigationPreference) { return callback == null callback.onSelectNavigationPreference(navigationPreference); }
/** * Notifies the callback, that a navigation preference is about to be selected. * * @param navigationPreference * The navigation preference, which is about to be selected, as an instance of the class * {@link NavigationPreference}. The navigation preference may not be null * @return True, if the navigation preference should be selected, false otherise */
Notifies the callback, that a navigation preference is about to be selected
notifyOnSelectNavigationPreference
{ "repo_name": "michael-rapp/AndroidPreferenceActivity", "path": "library/src/main/java/de/mrapp/android/preference/activity/adapter/NavigationPreferenceAdapter.java", "license": "apache-2.0", "size": 20458 }
[ "androidx.annotation.NonNull", "de.mrapp.android.preference.activity.NavigationPreference" ]
import androidx.annotation.NonNull; import de.mrapp.android.preference.activity.NavigationPreference;
import androidx.annotation.*; import de.mrapp.android.preference.activity.*;
[ "androidx.annotation", "de.mrapp.android" ]
androidx.annotation; de.mrapp.android;
288,882
public void testElementAdded() { Object res = Model.getCoreFactory().createElementResidence(); helper.addElementResidence(elem, res); Model.getPump().flushModelEvents(); assertTrue(list.getSize() == 1); assertTrue(list.getElementAt(0) == res); }
void function() { Object res = Model.getCoreFactory().createElementResidence(); helper.addElementResidence(elem, res); Model.getPump().flushModelEvents(); assertTrue(list.getSize() == 1); assertTrue(list.getElementAt(0) == res); }
/** * Test addElementResidence(). */
Test addElementResidence()
testElementAdded
{ "repo_name": "carvalhomb/tsmells", "path": "sample/argouml/argouml/org/argouml/uml/ui/foundation/core/TestUMLModelElementElementResidenceListModel.java", "license": "gpl-2.0", "size": 4225 }
[ "org.argouml.model.Model" ]
import org.argouml.model.Model;
import org.argouml.model.*;
[ "org.argouml.model" ]
org.argouml.model;
2,342,230
public Transporter scrollableCursorCurrentIndex(Transporter remoteScrollableCursor) { return handleByMode(); }
Transporter function(Transporter remoteScrollableCursor) { return handleByMode(); }
/** * Retrieves the current row index number */
Retrieves the current row index number
scrollableCursorCurrentIndex
{ "repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs", "path": "foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/remote/suncorba/CORBARemoteSessionControllerDispatcherForTestingExceptions.java", "license": "epl-1.0", "size": 15143 }
[ "org.eclipse.persistence.internal.sessions.remote.Transporter" ]
import org.eclipse.persistence.internal.sessions.remote.Transporter;
import org.eclipse.persistence.internal.sessions.remote.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,424,682
public NationData getNationInfo(String name, NationData.Shards... shards) throws RateLimitReachedException, UnknownNationException, IOException, XmlPullParserException;
NationData function(String name, NationData.Shards... shards) throws RateLimitReachedException, UnknownNationException, IOException, XmlPullParserException;
/** * Fetches information on a nation * @param name the nation id * @param shards the shards to request * @return a NationData object with nation info * @throws com.limewoodMedia.nsapi.exceptions.RateLimitReachedException if the rate limit was reached (but not exceeded) * @throws com.limewoodMedia.nsapi.exceptions.UnknownNationException if the nation could not be found */
Fetches information on a nation
getNationInfo
{ "repo_name": "Limewood/NSDroid", "path": "nsapi/src/main/java/com/limewoodMedia/nsapi/INSAPI.java", "license": "apache-2.0", "size": 5055 }
[ "java.io.IOException", "org.xmlpull.v1.XmlPullParserException" ]
import java.io.IOException; import org.xmlpull.v1.XmlPullParserException;
import java.io.*; import org.xmlpull.v1.*;
[ "java.io", "org.xmlpull.v1" ]
java.io; org.xmlpull.v1;
547,481
m_StdOut = stdout; m_ID = "" + process.hashCode(); if (m_StdOut) m_Reader = new BufferedReader(new InputStreamReader(process.getInputStream())); else m_Reader = new BufferedReader(new InputStreamReader(process.getErrorStream())); }
m_StdOut = stdout; m_ID = "" + process.hashCode(); if (m_StdOut) m_Reader = new BufferedReader(new InputStreamReader(process.getInputStream())); else m_Reader = new BufferedReader(new InputStreamReader(process.getErrorStream())); }
/** * Initializes the printer. * * @param stdout whether to use stdout or stderr * @param process the process to monitor */
Initializes the printer
initialize
{ "repo_name": "automenta/adams-core", "path": "src/main/java/adams/core/management/AbstractOutputPrinter.java", "license": "gpl-3.0", "size": 3095 }
[ "java.io.BufferedReader", "java.io.InputStreamReader" ]
import java.io.BufferedReader; import java.io.InputStreamReader;
import java.io.*;
[ "java.io" ]
java.io;
946,636
IpAddress addPublicIp(String virtualMachineId);
IpAddress addPublicIp(String virtualMachineId);
/** * Adds a public ip to the virtual machine. * * @param virtualMachineId the unique identifier for the virtual machine. * @return the assigned ip address as string (mandatory). * @throws NullPointerException if the virtualMachineId is null * @throws IllegalArgumentException if the virtualMachineId is empty. * @todo define format of the address. */
Adds a public ip to the virtual machine
addPublicIp
{ "repo_name": "cloudiator/sword", "path": "core/src/main/java/de/uniulm/omi/cloudiator/sword/extensions/PublicIpExtension.java", "license": "apache-2.0", "size": 1861 }
[ "de.uniulm.omi.cloudiator.sword.domain.IpAddress" ]
import de.uniulm.omi.cloudiator.sword.domain.IpAddress;
import de.uniulm.omi.cloudiator.sword.domain.*;
[ "de.uniulm.omi" ]
de.uniulm.omi;
1,466,224
private static String formatPixelsSize(Map details) { UnitsLength unit = null; Length x = (Length) details.get(PIXEL_SIZE_X); Length y = (Length) details.get(PIXEL_SIZE_Y); Length z = (Length) details.get(PIXEL_SIZE_Z); Double dx = null, dy = null, dz = null; NumberFormat nf = new DecimalFormat("0.00"); try { x = UIUtilities.transformSize(x); unit = x.getUnit(); dx = x.getValue(); } catch (Exception e) { } try { if (unit == null) { y = UIUtilities.transformSize(y); dy = y.getValue(); unit = y.getUnit(); } else { y = new LengthI(y, unit); dy = y.getValue(); } } catch (Exception e) { } try { if (unit == null) { z = UIUtilities.transformSize(z); dz = z.getValue(); unit = z.getUnit(); } else { z = new LengthI(z, unit); dz = z.getValue(); } } catch (Exception e) { } String label = "<b>Pixels Size ("; String value = ""; if (dx != null && dx.doubleValue() > 0) { value += nf.format(dx); label += "X"; } if (dy != null && dy.doubleValue() > 0) { if (value.length() == 0) value += nf.format(dy); else value +="x"+nf.format(dy); label += "Y"; } if (dz != null && dz.doubleValue() > 0) { if (value.length() == 0) value += nf.format(dz); else value +="x"+nf.format(dz); label += "Z"; } label += ") "; if (value.length() == 0) return null; if (unit == null) unit = UnitsLength.MICROMETER; return label+LengthI.lookupSymbol(unit)+": </b>"+value; }
static String function(Map details) { UnitsLength unit = null; Length x = (Length) details.get(PIXEL_SIZE_X); Length y = (Length) details.get(PIXEL_SIZE_Y); Length z = (Length) details.get(PIXEL_SIZE_Z); Double dx = null, dy = null, dz = null; NumberFormat nf = new DecimalFormat("0.00"); try { x = UIUtilities.transformSize(x); unit = x.getUnit(); dx = x.getValue(); } catch (Exception e) { } try { if (unit == null) { y = UIUtilities.transformSize(y); dy = y.getValue(); unit = y.getUnit(); } else { y = new LengthI(y, unit); dy = y.getValue(); } } catch (Exception e) { } try { if (unit == null) { z = UIUtilities.transformSize(z); dz = z.getValue(); unit = z.getUnit(); } else { z = new LengthI(z, unit); dz = z.getValue(); } } catch (Exception e) { } String label = STR; String value = STRXSTRxSTRYSTRxSTRZSTR) STR: </b>"+value; }
/** * Returns the pixels size as a string. * * @param details The map to convert. * @return See above. */
Returns the pixels size as a string
formatPixelsSize
{ "repo_name": "simleo/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/EditorUtil.java", "license": "gpl-2.0", "size": 91320 }
[ "java.text.DecimalFormat", "java.text.NumberFormat", "java.util.Map", "org.openmicroscopy.shoola.util.ui.UIUtilities" ]
import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Map; import org.openmicroscopy.shoola.util.ui.UIUtilities;
import java.text.*; import java.util.*; import org.openmicroscopy.shoola.util.ui.*;
[ "java.text", "java.util", "org.openmicroscopy.shoola" ]
java.text; java.util; org.openmicroscopy.shoola;
240,345
@BeforeGroups("2checkusers_android") private void checkIfUserLogged() throws InterruptedException, FileNotFoundException, YamlException{ super.checkIfUserLoggedAndHomeServerSetUpAndroid(appiumFactory.getAndroidDriver1(), riotUserADisplayName, Constant.DEFAULT_USERPWD); super.checkIfUserLoggedAndHomeServerSetUpAndroid(appiumFactory.getAndroidDriver2(), riotUserBDisplayName, Constant.DEFAULT_USERPWD); }
@BeforeGroups(STR) void function() throws InterruptedException, FileNotFoundException, YamlException{ super.checkIfUserLoggedAndHomeServerSetUpAndroid(appiumFactory.getAndroidDriver1(), riotUserADisplayName, Constant.DEFAULT_USERPWD); super.checkIfUserLoggedAndHomeServerSetUpAndroid(appiumFactory.getAndroidDriver2(), riotUserBDisplayName, Constant.DEFAULT_USERPWD); }
/** * Log the good user if not.</br> Secure the test. * @param myDriver * @param username * @param pwd * @throws InterruptedException * @throws YamlException * @throws FileNotFoundException */
Log the good user if not. Secure the test
checkIfUserLogged
{ "repo_name": "vector-im/riot-automated-tests", "path": "VectorMobileTests/src/test/java/mobilestests_android/RiotAdminAndModerationTests.java", "license": "apache-2.0", "size": 22011 }
[ "com.esotericsoftware.yamlbeans.YamlException", "java.io.FileNotFoundException", "org.testng.annotations.BeforeGroups" ]
import com.esotericsoftware.yamlbeans.YamlException; import java.io.FileNotFoundException; import org.testng.annotations.BeforeGroups;
import com.esotericsoftware.yamlbeans.*; import java.io.*; import org.testng.annotations.*;
[ "com.esotericsoftware.yamlbeans", "java.io", "org.testng.annotations" ]
com.esotericsoftware.yamlbeans; java.io; org.testng.annotations;
2,451,368
public Observable<String> watchManyObservable(List<String> keys) { io.vertx.rx.java.ObservableFuture<String> handler = io.vertx.rx.java.RxHelper.observableFuture(); watchMany(keys, handler.toHandler()); return handler; }
Observable<String> function(List<String> keys) { io.vertx.rx.java.ObservableFuture<String> handler = io.vertx.rx.java.RxHelper.observableFuture(); watchMany(keys, handler.toHandler()); return handler; }
/** * Watch the given keys to determine execution of the MULTI/EXEC block * @param keys List of keys to watch * @return */
Watch the given keys to determine execution of the MULTI/EXEC block
watchManyObservable
{ "repo_name": "brianjcj/vertx-redis-client", "path": "src/main/generated/io/vertx/rxjava/redis/RedisTransaction.java", "license": "apache-2.0", "size": 184983 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
638,707
@Override public CompletableFuture<LogSegmentMetadata> setLogSegmentActive(LogSegmentMetadata segment) { final LogSegmentMetadata newSegment = segment.mutator() .setTruncationStatus(LogSegmentMetadata.TruncationStatus.ACTIVE) .build(); return addNewSegmentAndDeleteOldSegment(newSegment, segment); }
CompletableFuture<LogSegmentMetadata> function(LogSegmentMetadata segment) { final LogSegmentMetadata newSegment = segment.mutator() .setTruncationStatus(LogSegmentMetadata.TruncationStatus.ACTIVE) .build(); return addNewSegmentAndDeleteOldSegment(newSegment, segment); }
/** * Change the truncation status of a <i>log segment</i> to be active. * * @param segment log segment to change truncation status to active. * @return new log segment */
Change the truncation status of a log segment to be active
setLogSegmentActive
{ "repo_name": "sijie/incubator-distributedlog", "path": "distributedlog-core/src/main/java/org/apache/distributedlog/metadata/LogSegmentMetadataStoreUpdater.java", "license": "apache-2.0", "size": 8055 }
[ "java.util.concurrent.CompletableFuture", "org.apache.distributedlog.LogSegmentMetadata" ]
import java.util.concurrent.CompletableFuture; import org.apache.distributedlog.LogSegmentMetadata;
import java.util.concurrent.*; import org.apache.distributedlog.*;
[ "java.util", "org.apache.distributedlog" ]
java.util; org.apache.distributedlog;
1,199,087
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner> beginUpdateMongoDBDatabaseThroughput( String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context);
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<ThroughputSettingsGetResultsInner>, ThroughputSettingsGetResultsInner> beginUpdateMongoDBDatabaseThroughput( String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context);
/** * Update RUs per second of the an Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB * database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an Azure Cosmos DB resource throughput. */
Update RUs per second of the an Azure Cosmos DB MongoDB database
beginUpdateMongoDBDatabaseThroughput
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java", "license": "mit", "size": 104176 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner", "com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.cosmos.fluent.models.*; import com.azure.resourcemanager.cosmos.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,805,565
public void draw(float[] mvpMatrix, FloatBuffer vertexBuffer, int firstVertex, int vertexCount, int coordsPerVertex, int vertexStride, float[] texMatrix, FloatBuffer texBuffer, int textureId, int texStride) { GlUtil.checkGlError("draw start"); // Select the program. GLES20.glUseProgram(mProgramHandle); GlUtil.checkGlError("glUseProgram"); // Set the texture. GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(mTextureTarget, textureId); // Copy the model / view / projection matrix over. GLES20.glUniformMatrix4fv(muMVPMatrixLoc, 1, false, mvpMatrix, 0); GlUtil.checkGlError("glUniformMatrix4fv"); // Copy the texture transformation matrix over. GLES20.glUniformMatrix4fv(muTexMatrixLoc, 1, false, texMatrix, 0); GlUtil.checkGlError("glUniformMatrix4fv"); // Enable the "aPosition" vertex attribute. GLES20.glEnableVertexAttribArray(maPositionLoc); GlUtil.checkGlError("glEnableVertexAttribArray"); // Connect vertexBuffer to "aPosition". GLES20.glVertexAttribPointer(maPositionLoc, coordsPerVertex, GLES20.GL_FLOAT, false, vertexStride, vertexBuffer); GlUtil.checkGlError("glVertexAttribPointer"); // Enable the "aTextureCoord" vertex attribute. GLES20.glEnableVertexAttribArray(maTextureCoordLoc); GlUtil.checkGlError("glEnableVertexAttribArray"); // Connect texBuffer to "aTextureCoord". GLES20.glVertexAttribPointer(maTextureCoordLoc, 2, GLES20.GL_FLOAT, false, texStride, texBuffer); GlUtil.checkGlError("glVertexAttribPointer"); // Populate the convolution kernel, if present. if (muKernelLoc >= 0) { GLES20.glUniform1fv(muKernelLoc, KERNEL_SIZE, mKernel, 0); GLES20.glUniform2fv(muTexOffsetLoc, KERNEL_SIZE, mTexOffset, 0); GLES20.glUniform1f(muColorAdjustLoc, mColorAdjust); } // Draw the rect. GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, firstVertex, vertexCount); GlUtil.checkGlError("glDrawArrays"); // Done -- disable vertex array, texture, and program. GLES20.glDisableVertexAttribArray(maPositionLoc); GLES20.glDisableVertexAttribArray(maTextureCoordLoc); GLES20.glBindTexture(mTextureTarget, 0); GLES20.glUseProgram(0); }
void function(float[] mvpMatrix, FloatBuffer vertexBuffer, int firstVertex, int vertexCount, int coordsPerVertex, int vertexStride, float[] texMatrix, FloatBuffer texBuffer, int textureId, int texStride) { GlUtil.checkGlError(STR); GLES20.glUseProgram(mProgramHandle); GlUtil.checkGlError(STR); GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(mTextureTarget, textureId); GLES20.glUniformMatrix4fv(muMVPMatrixLoc, 1, false, mvpMatrix, 0); GlUtil.checkGlError(STR); GLES20.glUniformMatrix4fv(muTexMatrixLoc, 1, false, texMatrix, 0); GlUtil.checkGlError(STR); GLES20.glEnableVertexAttribArray(maPositionLoc); GlUtil.checkGlError(STR); GLES20.glVertexAttribPointer(maPositionLoc, coordsPerVertex, GLES20.GL_FLOAT, false, vertexStride, vertexBuffer); GlUtil.checkGlError(STR); GLES20.glEnableVertexAttribArray(maTextureCoordLoc); GlUtil.checkGlError(STR); GLES20.glVertexAttribPointer(maTextureCoordLoc, 2, GLES20.GL_FLOAT, false, texStride, texBuffer); GlUtil.checkGlError(STR); if (muKernelLoc >= 0) { GLES20.glUniform1fv(muKernelLoc, KERNEL_SIZE, mKernel, 0); GLES20.glUniform2fv(muTexOffsetLoc, KERNEL_SIZE, mTexOffset, 0); GLES20.glUniform1f(muColorAdjustLoc, mColorAdjust); } GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, firstVertex, vertexCount); GlUtil.checkGlError(STR); GLES20.glDisableVertexAttribArray(maPositionLoc); GLES20.glDisableVertexAttribArray(maTextureCoordLoc); GLES20.glBindTexture(mTextureTarget, 0); GLES20.glUseProgram(0); }
/** * Issues the draw call. Does the full setup on every call. * * @param mvpMatrix The 4x4 projection matrix. * @param vertexBuffer Buffer with vertex position data. * @param firstVertex Index of first vertex to use in vertexBuffer. * @param vertexCount Number of vertices in vertexBuffer. * @param coordsPerVertex The number of coordinates per vertex (e.g. x,y is 2). * @param vertexStride Width, in bytes, of the position data for each vertex (often * vertexCount * sizeof(float)). * @param texMatrix A 4x4 transformation matrix for texture coords. (Primarily intended * for use with SurfaceTexture.) * @param texBuffer Buffer with vertex texture data. * @param texStride Width, in bytes, of the texture data for each vertex. */
Issues the draw call. Does the full setup on every call
draw
{ "repo_name": "pili-engineering/PLDroidShortVideo", "path": "ShortVideoUIDemo/faceunity/src/main/java/com/faceunity/gles/Texture2dProgram.java", "license": "apache-2.0", "size": 14872 }
[ "com.faceunity.gles.core.GlUtil", "java.nio.FloatBuffer" ]
import com.faceunity.gles.core.GlUtil; import java.nio.FloatBuffer;
import com.faceunity.gles.core.*; import java.nio.*;
[ "com.faceunity.gles", "java.nio" ]
com.faceunity.gles; java.nio;
696,464
public OPhysicalPosition getPhysicalPosition(final long iPosition, final OPhysicalPosition iPPosition) { return map.get(iPosition); }
OPhysicalPosition function(final long iPosition, final OPhysicalPosition iPPosition) { return map.get(iPosition); }
/** * Fill and return the PhysicalPosition object received as parameter with the physical position of logical record iPosition */
Fill and return the PhysicalPosition object received as parameter with the physical position of logical record iPosition
getPhysicalPosition
{ "repo_name": "Spaceghost/OrientDB", "path": "core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OClusterLogical.java", "license": "apache-2.0", "size": 7954 }
[ "com.orientechnologies.orient.core.storage.OPhysicalPosition" ]
import com.orientechnologies.orient.core.storage.OPhysicalPosition;
import com.orientechnologies.orient.core.storage.*;
[ "com.orientechnologies.orient" ]
com.orientechnologies.orient;
2,247,583
private void implTestTwice(ECPoint[] p) { assertPointsEqual("Twice incorrect", p[3], p[0].twice()); assertPointsEqual("Add same point incorrect", p[3], p[0].add(p[0])); }
void function(ECPoint[] p) { assertPointsEqual(STR, p[3], p[0].twice()); assertPointsEqual(STR, p[3], p[0].add(p[0])); }
/** * Tests <code>ECPoint.twice()</code> against literature values. * * @param p * The array of literature values. */
Tests <code>ECPoint.twice()</code> against literature values
implTestTwice
{ "repo_name": "onessimofalconi/bc-java", "path": "core/src/test/java/org/bouncycastle/math/ec/test/ECPointTest.java", "license": "mit", "size": 17921 }
[ "org.bouncycastle.math.ec.ECPoint" ]
import org.bouncycastle.math.ec.ECPoint;
import org.bouncycastle.math.ec.*;
[ "org.bouncycastle.math" ]
org.bouncycastle.math;
848,595
protected File getTemporaryFile(String uri, XWikiContext context) { Matcher matcher = URI_PATTERN.matcher(uri); File result = null; if (matcher.find()) { List<String> pathSegments = new ArrayList<String>(); // Add all the path segments. pathSegments.add("temp"); // temp/module pathSegments.add(withMinimalURLEncoding(matcher.group(3))); // temp/module/wiki pathSegments.add(encodeURLPathSegment(context.getWikiId())); // temp/module/wiki/space pathSegments.add(withMinimalURLEncoding(matcher.group(1))); // temp/module/wiki/space/page pathSegments.add(withMinimalURLEncoding(matcher.group(2))); // Save the path prefix before adding the file path to be able to check if the file path tries to get out of // the parent folder (e.g. using '/../'). String prefix = StringUtils.join(pathSegments, PATH_SEPARATOR); // temp/module/wiki/space/page/path/to/file.tmp for (String filePathSegment : matcher.group(4).split(PATH_SEPARATOR)) { pathSegments.add(withMinimalURLEncoding(filePathSegment)); } String path = URI.create(StringUtils.join(pathSegments, PATH_SEPARATOR)).normalize().toString(); if (path.startsWith(prefix)) { result = new File(this.environment.getTemporaryDirectory(), path); result = result.exists() ? result : null; } } return result; }
File function(String uri, XWikiContext context) { Matcher matcher = URI_PATTERN.matcher(uri); File result = null; if (matcher.find()) { List<String> pathSegments = new ArrayList<String>(); pathSegments.add("temp"); pathSegments.add(withMinimalURLEncoding(matcher.group(3))); pathSegments.add(encodeURLPathSegment(context.getWikiId())); pathSegments.add(withMinimalURLEncoding(matcher.group(1))); pathSegments.add(withMinimalURLEncoding(matcher.group(2))); String prefix = StringUtils.join(pathSegments, PATH_SEPARATOR); for (String filePathSegment : matcher.group(4).split(PATH_SEPARATOR)) { pathSegments.add(withMinimalURLEncoding(filePathSegment)); } String path = URI.create(StringUtils.join(pathSegments, PATH_SEPARATOR)).normalize().toString(); if (path.startsWith(prefix)) { result = new File(this.environment.getTemporaryDirectory(), path); result = result.exists() ? result : null; } } return result; }
/** * Returns the temporary file corresponding to the specified URI. * * @param uri request URI. * @param context xwiki context. * @return temporary file corresponding to the specified URI or null if no such file can be located. */
Returns the temporary file corresponding to the specified URI
getTemporaryFile
{ "repo_name": "pbondoer/xwiki-platform", "path": "xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/TempResourceAction.java", "license": "lgpl-2.1", "size": 8506 }
[ "com.xpn.xwiki.XWikiContext", "java.io.File", "java.net.URI", "java.util.ArrayList", "java.util.List", "java.util.regex.Matcher", "org.apache.commons.lang3.StringUtils" ]
import com.xpn.xwiki.XWikiContext; import java.io.File; import java.net.URI; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import org.apache.commons.lang3.StringUtils;
import com.xpn.xwiki.*; import java.io.*; import java.net.*; import java.util.*; import java.util.regex.*; import org.apache.commons.lang3.*;
[ "com.xpn.xwiki", "java.io", "java.net", "java.util", "org.apache.commons" ]
com.xpn.xwiki; java.io; java.net; java.util; org.apache.commons;
2,496,583
@Nonnull public static <T> LongBinding mapToLongThenReduce(@Nonnull final ObservableSet<T> items, @Nullable final Long defaultValue, @Nonnull final ObservableValue<Function<? super T, Long>> mapper, @Nonnull final ObservableValue<BinaryOperator<Long>> reducer) { requireNonNull(reducer, ERROR_REDUCER_NULL); requireNonNull(mapper, ERROR_MAPPER_NULL); return createLongBinding(() -> { BinaryOperator<Long> reducerValue = reducer.getValue(); requireNonNull(reducerValue, ERROR_REDUCER_NULL); final Function<? super T, Long> mapperValue = mapper.getValue(); requireNonNull(mapperValue, ERROR_MAPPER_NULL); return items.stream().map(mapperValue).reduce(reducerValue).orElse(defaultValue); }, items, reducer, mapper); }
static <T> LongBinding function(@Nonnull final ObservableSet<T> items, @Nullable final Long defaultValue, @Nonnull final ObservableValue<Function<? super T, Long>> mapper, @Nonnull final ObservableValue<BinaryOperator<Long>> reducer) { requireNonNull(reducer, ERROR_REDUCER_NULL); requireNonNull(mapper, ERROR_MAPPER_NULL); return createLongBinding(() -> { BinaryOperator<Long> reducerValue = reducer.getValue(); requireNonNull(reducerValue, ERROR_REDUCER_NULL); final Function<? super T, Long> mapperValue = mapper.getValue(); requireNonNull(mapperValue, ERROR_MAPPER_NULL); return items.stream().map(mapperValue).reduce(reducerValue).orElse(defaultValue); }, items, reducer, mapper); }
/** * Returns a long binding whose value is the reduction of all elements in the set. The mapper function is applied to each element before reduction. * * @param items the observable set of elements. * @param defaultValue the value to be returned if there is no value present, may be null. * @param mapper a non-interfering, stateless function to apply to each element. * @param reducer an associative, non-interfering, stateless function for combining two values. * * @return a long binding */
Returns a long binding whose value is the reduction of all elements in the set. The mapper function is applied to each element before reduction
mapToLongThenReduce
{ "repo_name": "griffon/griffon", "path": "subprojects/griffon-javafx/src/main/java/griffon/javafx/beans/binding/ReducingBindings.java", "license": "apache-2.0", "size": 249342 }
[ "java.util.Objects", "java.util.function.BinaryOperator", "java.util.function.Function" ]
import java.util.Objects; import java.util.function.BinaryOperator; import java.util.function.Function;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
509,757
public ToolbarClickButton applyTo( ToolbarClickButton button, ToolbarClickButton.Listener listener) { applyToDisplay(button); if (listener != null) { button.setListener(listener); } return button; }
ToolbarClickButton function( ToolbarClickButton button, ToolbarClickButton.Listener listener) { applyToDisplay(button); if (listener != null) { button.setListener(listener); } return button; }
/** * Applies the builder state to a click button. * * @return the configured click button */
Applies the builder state to a click button
applyTo
{ "repo_name": "wisebaldone/incubator-wave", "path": "wave/src/main/java/org/waveprotocol/wave/client/widget/toolbar/ToolbarButtonViewBuilder.java", "license": "apache-2.0", "size": 4401 }
[ "org.waveprotocol.wave.client.widget.toolbar.buttons.ToolbarClickButton" ]
import org.waveprotocol.wave.client.widget.toolbar.buttons.ToolbarClickButton;
import org.waveprotocol.wave.client.widget.toolbar.buttons.*;
[ "org.waveprotocol.wave" ]
org.waveprotocol.wave;
1,681,407
protected void updateRefnameForAuthority(DocumentWrapper<DocumentModel> wrapDoc, String schemaName) throws Exception { DocumentModel docModel = wrapDoc.getWrappedObject(); RefName.Authority authority = (Authority) getRefName(getServiceContext(), docModel); String refName = authority.toString(); docModel.setProperty(schemaName, AuthorityJAXBSchema.REF_NAME, refName); }
void function(DocumentWrapper<DocumentModel> wrapDoc, String schemaName) throws Exception { DocumentModel docModel = wrapDoc.getWrappedObject(); RefName.Authority authority = (Authority) getRefName(getServiceContext(), docModel); String refName = authority.toString(); docModel.setProperty(schemaName, AuthorityJAXBSchema.REF_NAME, refName); }
/** * Generate a refName for the authority from the short identifier * and display name. * * All refNames for authorities are generated. If a client supplies * a refName, it will be overwritten during create (per this method) * or discarded during update (per filterReadOnlyPropertiesForPart). * * @see #filterReadOnlyPropertiesForPart(Map<String, Object>, org.collectionspace.services.common.service.ObjectPartType) * */
Generate a refName for the authority from the short identifier and display name. All refNames for authorities are generated. If a client supplies a refName, it will be overwritten during create (per this method) or discarded during update (per filterReadOnlyPropertiesForPart)
updateRefnameForAuthority
{ "repo_name": "cherryhill/collectionspace-services", "path": "services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java", "license": "apache-2.0", "size": 8713 }
[ "org.collectionspace.services.common.api.RefName", "org.collectionspace.services.common.document.DocumentWrapper", "org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema", "org.nuxeo.ecm.core.api.DocumentModel" ]
import org.collectionspace.services.common.api.RefName; import org.collectionspace.services.common.document.DocumentWrapper; import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema; import org.nuxeo.ecm.core.api.DocumentModel;
import org.collectionspace.services.common.api.*; import org.collectionspace.services.common.document.*; import org.collectionspace.services.common.vocabulary.*; import org.nuxeo.ecm.core.api.*;
[ "org.collectionspace.services", "org.nuxeo.ecm" ]
org.collectionspace.services; org.nuxeo.ecm;
1,441,171
protected MultiItemTypeAdapter startAnim(Animator anim, int index) { anim.setDuration(mDuration).start(); anim.setInterpolator(mInterpolatorDecelerated); return this; }
MultiItemTypeAdapter function(Animator anim, int index) { anim.setDuration(mDuration).start(); anim.setInterpolator(mInterpolatorDecelerated); return this; }
/** * set anim to start when loading * * @param anim * @param index */
set anim to start when loading
startAnim
{ "repo_name": "kaxi4it/EasyRecyclerViewAdapter", "path": "lib/src/main/java/com/guyj/MultiItemTypeAdapter.java", "license": "apache-2.0", "size": 10934 }
[ "android.animation.Animator" ]
import android.animation.Animator;
import android.animation.*;
[ "android.animation" ]
android.animation;
2,240,876
@Test public void testFullAccess() throws Exception { final String name = this.getUniqueName(); final String roleA = name + "-A"; // assign names to 4 vms... final String[] requiredRoles = {roleA}; Set requiredRolesSet = new HashSet(); for (int i = 0; i < requiredRoles.length; i++) { requiredRolesSet.add(InternalRole.getRole(requiredRoles[i])); } assertEquals(requiredRoles.length, requiredRolesSet.size()); // connect controller to system... Properties config = new Properties(); config.setProperty(ROLES, ""); getSystem(config); getCache(); // create region in controller... MembershipAttributes ra = new MembershipAttributes(requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true); RegionAttributes attr = fac.create(); Region region = createRootRegion(name, attr); // wait for memberTimeout to expire waitForMemberTimeout();
void function() throws Exception { final String name = this.getUniqueName(); final String roleA = name + "-A"; final String[] requiredRoles = {roleA}; Set requiredRolesSet = new HashSet(); for (int i = 0; i < requiredRoles.length; i++) { requiredRolesSet.add(InternalRole.getRole(requiredRoles[i])); } assertEquals(requiredRoles.length, requiredRolesSet.size()); Properties config = new Properties(); config.setProperty(ROLES, ""); getSystem(config); getCache(); MembershipAttributes ra = new MembershipAttributes(requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true); RegionAttributes attr = fac.create(); Region region = createRootRegion(name, attr); waitForMemberTimeout();
/** * Tests affect of FULL_ACCESS on region operations. */
Tests affect of FULL_ACCESS on region operations
testFullAccess
{ "repo_name": "davebarnes97/geode", "path": "geode-core/src/distributedTest/java/org/apache/geode/cache30/RegionReliabilityTestCase.java", "license": "apache-2.0", "size": 49263 }
[ "java.util.HashSet", "java.util.Properties", "java.util.Set", "org.apache.geode.cache.AttributesFactory", "org.apache.geode.cache.LossAction", "org.apache.geode.cache.MembershipAttributes", "org.apache.geode.cache.Region", "org.apache.geode.cache.RegionAttributes", "org.apache.geode.cache.ResumptionAction", "org.apache.geode.distributed.internal.membership.InternalRole", "org.junit.Assert" ]
import java.util.HashSet; import java.util.Properties; import java.util.Set; import org.apache.geode.cache.AttributesFactory; import org.apache.geode.cache.LossAction; import org.apache.geode.cache.MembershipAttributes; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionAttributes; import org.apache.geode.cache.ResumptionAction; import org.apache.geode.distributed.internal.membership.InternalRole; import org.junit.Assert;
import java.util.*; import org.apache.geode.cache.*; import org.apache.geode.distributed.internal.membership.*; import org.junit.*;
[ "java.util", "org.apache.geode", "org.junit" ]
java.util; org.apache.geode; org.junit;
2,346,358
private double iterate (Instances inst, boolean report) throws Exception { int i; double llkold = 0.0; double llk = 0.0; if (report) { EM_Report(inst); } boolean ok = false; int seed = getSeed(); int restartCount = 0; while (!ok) { try { for (i = 0; i < m_max_iterations; i++) { llkold = llk; llk = E(inst, true); if (report) { System.out.println("Loglikely: " + llk); } if (i > 0) { if ((llk - llkold) < 1e-6) { break; } } M(inst); } ok = true; } catch (Exception ex) { // System.err.println("Restarting after training failure"); ex.printStackTrace(); seed++; restartCount++; m_rr = new Random(seed); for (int z = 0; z < 10; z++) { m_rr.nextDouble(); m_rr.nextInt(); } if (restartCount > 5) { // System.err.println("Reducing the number of clusters"); m_num_clusters--; restartCount = 0; } EM_Init(m_theInstances); } } if (report) { EM_Report(inst); } return llk; }
double function (Instances inst, boolean report) throws Exception { int i; double llkold = 0.0; double llk = 0.0; if (report) { EM_Report(inst); } boolean ok = false; int seed = getSeed(); int restartCount = 0; while (!ok) { try { for (i = 0; i < m_max_iterations; i++) { llkold = llk; llk = E(inst, true); if (report) { System.out.println(STR + llk); } if (i > 0) { if ((llk - llkold) < 1e-6) { break; } } M(inst); } ok = true; } catch (Exception ex) { ex.printStackTrace(); seed++; restartCount++; m_rr = new Random(seed); for (int z = 0; z < 10; z++) { m_rr.nextDouble(); m_rr.nextInt(); } if (restartCount > 5) { m_num_clusters--; restartCount = 0; } EM_Init(m_theInstances); } } if (report) { EM_Report(inst); } return llk; }
/** * iterates the E and M steps until the log likelihood of the data * converges. * * @param inst the training instances. * @param report be verbose. * @return the log likelihood of the data * @throws Exception if something goes wrong */
iterates the E and M steps until the log likelihood of the data converges
iterate
{ "repo_name": "BaldoAgosta/weka-dev", "path": "src/weka/clusterers/EM_wedo_user_doc.java", "license": "apache-2.0", "size": 41563 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
956,156
public static void saveRoi(String fileName, Roi roi) { if (roi == null) { saveRoi(fileName, (List<Point2d>) null); return; } FloatPolygon fp; fp = roi.getFloatPolygon(); // save common part saveRoi(fileName, ConvertLists.fromPolygon2List(fp)); } /** * Calculates width and height of bounding box for shape defined as List of {@link Point2d}
static void function(String fileName, Roi roi) { if (roi == null) { saveRoi(fileName, (List<Point2d>) null); return; } FloatPolygon fp; fp = roi.getFloatPolygon(); saveRoi(fileName, ConvertLists.fromPolygon2List(fp)); } /** * Calculates width and height of bounding box for shape defined as List of {@link Point2d}
/** * Save ROI as image. * * @param fileName fileName * @param roi roi */
Save ROI as image
saveRoi
{ "repo_name": "baniuk/ImageJTestSuite", "path": "src/main/java/com/github/baniuk/ImageJTestSuite/datatoimage/RoiSaver.java", "license": "mit", "size": 3141 }
[ "com.github.baniuk.ImageJTestSuite", "java.util.List", "org.scijava.vecmath.Point2d" ]
import com.github.baniuk.ImageJTestSuite; import java.util.List; import org.scijava.vecmath.Point2d;
import com.github.baniuk.*; import java.util.*; import org.scijava.vecmath.*;
[ "com.github.baniuk", "java.util", "org.scijava.vecmath" ]
com.github.baniuk; java.util; org.scijava.vecmath;
2,408,798
request.setAttribute("requestUrlWithParameters", HttpServletRequestUtils.constructRequestUrlWithParameters(request)); return true; }
request.setAttribute(STR, HttpServletRequestUtils.constructRequestUrlWithParameters(request)); return true; }
/** * Adds a client request url string (with parameters) to the request * as a variable named 'requestUrlWithParameters'. */
Adds a client request url string (with parameters) to the request as a variable named 'requestUrlWithParameters'
preHandle
{ "repo_name": "CeON/saos", "path": "saos-webapp/src/main/java/pl/edu/icm/saos/webapp/common/RequestURLInterceptor.java", "license": "gpl-3.0", "size": 968 }
[ "pl.edu.icm.saos.common.http.HttpServletRequestUtils" ]
import pl.edu.icm.saos.common.http.HttpServletRequestUtils;
import pl.edu.icm.saos.common.http.*;
[ "pl.edu.icm" ]
pl.edu.icm;
1,513,814
@SuppressWarnings("unchecked") public void setValue(@NotNull final Ujo bo, @Nullable Object value) { final Key key = super.getKey(); if (isForeignKey() && value !=null && !(value instanceof OrmUjo)) { value = new ForeignKey(value); } key.setValue(bo, value); }
@SuppressWarnings(STR) void function(@NotNull final Ujo bo, @Nullable Object value) { final Key key = super.getKey(); if (isForeignKey() && value !=null && !(value instanceof OrmUjo)) { value = new ForeignKey(value); } key.setValue(bo, value); }
/** Returns a key value from a table * @param ujo Related Ujo object * @param value A value to assign. */
Returns a key value from a table
setValue
{ "repo_name": "pponec/ujorm", "path": "project-m2/ujo-orm/src/main/java/org/ujorm/orm/metaModel/MetaColumn.java", "license": "apache-2.0", "size": 21340 }
[ "org.jetbrains.annotations.NotNull", "org.jetbrains.annotations.Nullable", "org.ujorm.Key", "org.ujorm.Ujo", "org.ujorm.orm.ForeignKey", "org.ujorm.orm.OrmUjo" ]
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.ujorm.Key; import org.ujorm.Ujo; import org.ujorm.orm.ForeignKey; import org.ujorm.orm.OrmUjo;
import org.jetbrains.annotations.*; import org.ujorm.*; import org.ujorm.orm.*;
[ "org.jetbrains.annotations", "org.ujorm", "org.ujorm.orm" ]
org.jetbrains.annotations; org.ujorm; org.ujorm.orm;
353,709
@Parameters public static Collection<Object[]> getTestParameters() { final Collection<Object[]> params = new ArrayList<>(); final ThresholdExpiredCRLRevocationPolicy zeroThresholdPolicy = new ThresholdExpiredCRLRevocationPolicy(); zeroThresholdPolicy.setThreshold(0); // Test case #1 // Valid certificate on valid CRL data params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource("userCA-valid.crl"), }), zeroThresholdPolicy, new String[] {"user-valid.crt"}, null, }); // Test case #2 // Revoked certificate on valid CRL data params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource("userCA-valid.crl"), new ClassPathResource("intermediateCA-valid.crl"), new ClassPathResource("rootCA-valid.crl"), }), zeroThresholdPolicy, new String[] {"user-revoked.crt", "userCA.crt", "intermediateCA.crt", "rootCA.crt" }, new RevokedCertificateException(new Date(), new BigInteger("1")), }); // Test case #3 // Valid certificate on expired CRL data for head cert params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource("userCA-expired.crl"), new ClassPathResource("intermediateCA-valid.crl"), new ClassPathResource("rootCA-valid.crl"), }), zeroThresholdPolicy, new String[] {"user-valid.crt", "userCA.crt", "intermediateCA.crt", "rootCA.crt" }, new ExpiredCRLException("test", new Date()), }); // Test case #4 // Valid certificate on expired CRL data for intermediate cert params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource("userCA-valid.crl"), new ClassPathResource("intermediateCA-expired.crl"), new ClassPathResource("rootCA-valid.crl"), }), zeroThresholdPolicy, new String[] {"user-valid.crt", "userCA.crt", "intermediateCA.crt", "rootCA.crt" }, new ExpiredCRLException("test", new Date()), }); // Test case #5 // Valid certificate on expired CRL data with custom expiration // policy to always allow expired CRL data params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource("userCA-expired.crl"), }), new RevocationPolicy<X509CRL>() { @Override public void apply(final X509CRL crl) {}
static Collection<Object[]> function() { final Collection<Object[]> params = new ArrayList<>(); final ThresholdExpiredCRLRevocationPolicy zeroThresholdPolicy = new ThresholdExpiredCRLRevocationPolicy(); zeroThresholdPolicy.setThreshold(0); params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource(STR), }), zeroThresholdPolicy, new String[] {STR}, null, }); params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource(STR), new ClassPathResource(STR), new ClassPathResource(STR), }), zeroThresholdPolicy, new String[] {STR, STR, STR, STR }, new RevokedCertificateException(new Date(), new BigInteger("1")), }); params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource(STR), new ClassPathResource(STR), new ClassPathResource(STR), }), zeroThresholdPolicy, new String[] {STR, STR, STR, STR }, new ExpiredCRLException("test", new Date()), }); params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource(STR), new ClassPathResource(STR), new ClassPathResource(STR), }), zeroThresholdPolicy, new String[] {STR, STR, STR, STR }, new ExpiredCRLException("test", new Date()), }); params.add(new Object[] { new ResourceCRLRevocationChecker(new ClassPathResource[] { new ClassPathResource(STR), }), new RevocationPolicy<X509CRL>() { public void apply(final X509CRL crl) {}
/** * Gets the unit test parameters. * * @return Test parameter data. */
Gets the unit test parameters
getTestParameters
{ "repo_name": "lcssos/cas-server", "path": "cas-server-support-x509/src/test/java/org/jasig/cas/adaptors/x509/authentication/handler/support/ResourceCRLRevocationCheckerTests.java", "license": "apache-2.0", "size": 6000 }
[ "java.math.BigInteger", "java.util.ArrayList", "java.util.Collection", "java.util.Date", "org.springframework.core.io.ClassPathResource" ]
import java.math.BigInteger; import java.util.ArrayList; import java.util.Collection; import java.util.Date; import org.springframework.core.io.ClassPathResource;
import java.math.*; import java.util.*; import org.springframework.core.io.*;
[ "java.math", "java.util", "org.springframework.core" ]
java.math; java.util; org.springframework.core;
2,009,443
private static BigInteger[] getPrimeaddition(BigInteger lb) { //Declaring an array to store the number on which Goldbachs conjecture is being run // and its respective prime numbers BigInteger[] primeVals = new BigInteger[2]; //finds the next probable prime after 2, since 2 is also a prime number //but is even so calculations regarding 2 are excluded BigInteger bigPrime1 = (new BigInteger("2")).nextProbablePrime(); //setting the next prime number value to 0 BigInteger bigPrime2 = new BigInteger("0"); //run the loop finding all prime numbers until they are //smaller than the number on which Goldbachs conjecture is being run while(bigPrime1.compareTo(lb) == -1){ //if the first prime number has been found if(bigPrime1.isProbablePrime(1)){ //find the second number with respect to the first prime number bigPrime2 = lb.subtract(bigPrime1); //checks if the second number found is prime or not if(bigPrime2.isProbablePrime(100)){ primeVals[0] = bigPrime1; primeVals[1] = bigPrime2; //if both the prime numbers are found, then break the loop break; } } //if the current prime number does not satisfy the Goldbachs conjecture then find the next prime number // smaller than the number on which Goldbachs conjecture is being tested bigPrime1 = bigPrime1.nextProbablePrime(); } //return the array with the desired values, i.e. the number, the small prime and the large prime number return primeVals; }
static BigInteger[] function(BigInteger lb) { BigInteger[] primeVals = new BigInteger[2]; BigInteger bigPrime1 = (new BigInteger("2")).nextProbablePrime(); BigInteger bigPrime2 = new BigInteger("0"); while(bigPrime1.compareTo(lb) == -1){ if(bigPrime1.isProbablePrime(1)){ bigPrime2 = lb.subtract(bigPrime1); if(bigPrime2.isProbablePrime(100)){ primeVals[0] = bigPrime1; primeVals[1] = bigPrime2; break; } } bigPrime1 = bigPrime1.nextProbablePrime(); } return primeVals; }
/** * The given method takes in the even number and finds 2 prime number whose addition * provides the input number. This satisfies the Goldbachs conjecture. * * @param lb : taken in the BigInteger over which Goldbachs conjecture has to run * @return : Returns an array with the even number over which Goldbachs conjecture has been run * with small prime and big prime in the array indexes 1 and 2 */
The given method takes in the even number and finds 2 prime number whose addition provides the input number. This satisfies the Goldbachs conjecture
getPrimeaddition
{ "repo_name": "utkarshbh/Goldbachconjecture", "path": "src/GoldbachSeq.java", "license": "gpl-2.0", "size": 8267 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
2,647,913
@WebResult ( header = true, name = "resultOfAddingEvents" ) String addEvents(String infoSetId, Event[] assertions, @WebParam (header = true, name="contributorId") String contributorId) throws ServiceException;
@WebResult ( header = true, name = STR ) String addEvents(String infoSetId, Event[] assertions, @WebParam (header = true, name=STR) String contributorId) throws ServiceException;
/** * Adds a bunch of events to an infoset. * * @param infoSetId The id of the infoset to which to add the events. * @param assertions The events that are to be added to the infoset. * @param contributorId The if of the contributor adding the events to the infoset. * @return Some message. * @throws ServiceException If the events couldn't be added to the infoset. */
Adds a bunch of events to an infoset
addEvents
{ "repo_name": "nabilzhang/enunciate", "path": "idl/src/test/samples/com/webcohesion/enunciate/samples/idl/genealogy/services/SourceService.java", "license": "apache-2.0", "size": 3257 }
[ "com.webcohesion.enunciate.samples.idl.genealogy.data.Event", "javax.jws.WebParam", "javax.jws.WebResult" ]
import com.webcohesion.enunciate.samples.idl.genealogy.data.Event; import javax.jws.WebParam; import javax.jws.WebResult;
import com.webcohesion.enunciate.samples.idl.genealogy.data.*; import javax.jws.*;
[ "com.webcohesion.enunciate", "javax.jws" ]
com.webcohesion.enunciate; javax.jws;
436,033
@RequestMapping(value = { CMC.A_ROLEPLAY_PHASE_CREATE }, method = RequestMethod.GET) public String createPhaseGet(@PathVariable Long roleplayId, @PathVariable Long phaseId, Model model) { Phase phase = new Phase().getModelObject(Phase.class, phaseId); model.addAttribute("phase", phase); model.addAttribute("authorCreatePhaseFormBean", new AuthorCreatePhaseFormBean(phase)); model.addAttribute("phasesForThisRoleplay", new Phase().getAllForRoleplay(roleplayId)); return "authoring/phase/createPhase.jsp"; }
@RequestMapping(value = { CMC.A_ROLEPLAY_PHASE_CREATE }, method = RequestMethod.GET) String function(@PathVariable Long roleplayId, @PathVariable Long phaseId, Model model) { Phase phase = new Phase().getModelObject(Phase.class, phaseId); model.addAttribute("phase", phase); model.addAttribute(STR, new AuthorCreatePhaseFormBean(phase)); model.addAttribute(STR, new Phase().getAllForRoleplay(roleplayId)); return STR; }
/** * Gets the create Phase page. * * @param model * Model to hold objects for the view. * @return path to JSP. */
Gets the create Phase page
createPhaseGet
{ "repo_name": "skipcole/SeaChangePlatform", "path": "src/main/java/com/seachangesimulations/platform/controllers/AuthorController.java", "license": "mit", "size": 24261 }
[ "com.seachangesimulations.platform.domain.Phase", "com.seachangesimulations.platform.mvc.formbeans.author.AuthorCreatePhaseFormBean", "org.springframework.ui.Model", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import com.seachangesimulations.platform.domain.Phase; import com.seachangesimulations.platform.mvc.formbeans.author.AuthorCreatePhaseFormBean; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import com.seachangesimulations.platform.domain.*; import com.seachangesimulations.platform.mvc.formbeans.author.*; import org.springframework.ui.*; import org.springframework.web.bind.annotation.*;
[ "com.seachangesimulations.platform", "org.springframework.ui", "org.springframework.web" ]
com.seachangesimulations.platform; org.springframework.ui; org.springframework.web;
156,801
@Nullable public List<Integer> collectSrcLinesForUntouchedFile(@NotNull final File classFile, @NotNull final CoverageSuitesBundle suite) { final VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(classFile); if (virtualFile != null) { return collectSrcLinesForUntouchedFile(virtualFile, suite); } return null; }
List<Integer> function(@NotNull final File classFile, @NotNull final CoverageSuitesBundle suite) { final VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(classFile); if (virtualFile != null) { return collectSrcLinesForUntouchedFile(virtualFile, suite); } return null; }
/** * Collect code lines if untouched file should be included in coverage information. These lines will be marked as uncovered. * * @param suite * @return List (probably empty) of code lines or null if all lines should be marked as uncovered */
Collect code lines if untouched file should be included in coverage information. These lines will be marked as uncovered
collectSrcLinesForUntouchedFile
{ "repo_name": "semonte/intellij-community", "path": "plugins/coverage-common/src/com/intellij/coverage/CoverageEngine.java", "license": "apache-2.0", "size": 16475 }
[ "com.intellij.openapi.vfs.LocalFileSystem", "com.intellij.openapi.vfs.VirtualFile", "java.io.File", "java.util.List", "org.jetbrains.annotations.NotNull" ]
import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import java.io.File; import java.util.List; import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.vfs.*; import java.io.*; import java.util.*; import org.jetbrains.annotations.*;
[ "com.intellij.openapi", "java.io", "java.util", "org.jetbrains.annotations" ]
com.intellij.openapi; java.io; java.util; org.jetbrains.annotations;
2,875,398
Set<T> getServices();
Set<T> getServices();
/** * Get a set of registered services. * * @return the registered services */
Get a set of registered services
getServices
{ "repo_name": "apache/servicemix4-nmr", "path": "nmr/api/src/main/java/org/apache/servicemix/nmr/api/service/ServiceRegistry.java", "license": "apache-2.0", "size": 1966 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,530,745
@ServiceMethod(returns = ReturnType.SINGLE) public OpenidConnectProviderContractInner createOrUpdate( String resourceGroupName, String serviceName, String opid, OpenidConnectProviderContractInner parameters) { final String ifMatch = null; return createOrUpdateAsync(resourceGroupName, serviceName, opid, parameters, ifMatch).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) OpenidConnectProviderContractInner function( String resourceGroupName, String serviceName, String opid, OpenidConnectProviderContractInner parameters) { final String ifMatch = null; return createOrUpdateAsync(resourceGroupName, serviceName, opid, parameters, ifMatch).block(); }
/** * Creates or updates the OpenID Connect Provider. * * @param resourceGroupName The name of the resource group. * @param serviceName The name of the API Management service. * @param opid Identifier of the OpenID Connect Provider. * @param parameters Create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return openId Connect Provider details. */
Creates or updates the OpenID Connect Provider
createOrUpdate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersClientImpl.java", "license": "mit", "size": 80530 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.apimanagement.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,761,474
@Test public void betweenPredicate() throws CQLException { assertFilter("ATTR1 BETWEEN 10 AND 20", PropertyIsBetween.class); }
void function() throws CQLException { assertFilter(STR, PropertyIsBetween.class); }
/** * Between predicate sample * * @see ECQLBetweenPredicateTest */
Between predicate sample
betweenPredicate
{ "repo_name": "geotools/geotools", "path": "modules/library/cql/src/test/java/org/geotools/filter/text/ecql/ECQLTest.java", "license": "lgpl-2.1", "size": 15072 }
[ "org.geotools.filter.text.cql2.CQLException", "org.opengis.filter.PropertyIsBetween" ]
import org.geotools.filter.text.cql2.CQLException; import org.opengis.filter.PropertyIsBetween;
import org.geotools.filter.text.cql2.*; import org.opengis.filter.*;
[ "org.geotools.filter", "org.opengis.filter" ]
org.geotools.filter; org.opengis.filter;
541,952
private List<List<Atom>> populateColoursByAtomicNumberAndMass(List<Atom> atomList) { List<List<Atom>> groupsByColour = new ArrayList<List<Atom>>(); Atom previousAtom = null; List<Atom> atomsOfThisColour = new ArrayList<Atom>(); int atomsSeen = 0; for (Atom atom : atomList) { if (previousAtom != null && compareAtomicNumberThenAtomicMass(previousAtom, atom) != 0){ for (Atom atomOfthisColour : atomsOfThisColour) { mappingToColour.put(atomOfthisColour, atomsSeen); } groupsByColour.add(atomsOfThisColour); atomsOfThisColour = new ArrayList<Atom>(); } previousAtom = atom; atomsOfThisColour.add(atom); atomsSeen++; } if (!atomsOfThisColour.isEmpty()){ for (Atom atomOfThisColour : atomsOfThisColour) { mappingToColour.put(atomOfThisColour, atomsSeen); } groupsByColour.add(atomsOfThisColour); } return groupsByColour; }
List<List<Atom>> function(List<Atom> atomList) { List<List<Atom>> groupsByColour = new ArrayList<List<Atom>>(); Atom previousAtom = null; List<Atom> atomsOfThisColour = new ArrayList<Atom>(); int atomsSeen = 0; for (Atom atom : atomList) { if (previousAtom != null && compareAtomicNumberThenAtomicMass(previousAtom, atom) != 0){ for (Atom atomOfthisColour : atomsOfThisColour) { mappingToColour.put(atomOfthisColour, atomsSeen); } groupsByColour.add(atomsOfThisColour); atomsOfThisColour = new ArrayList<Atom>(); } previousAtom = atom; atomsOfThisColour.add(atom); atomsSeen++; } if (!atomsOfThisColour.isEmpty()){ for (Atom atomOfThisColour : atomsOfThisColour) { mappingToColour.put(atomOfThisColour, atomsSeen); } groupsByColour.add(atomsOfThisColour); } return groupsByColour; }
/** * Takes a list of atoms sorted by atomic number/mass * and populates the mappingToColour map * @param atomList * @return */
Takes a list of atoms sorted by atomic number/mass and populates the mappingToColour map
populateColoursByAtomicNumberAndMass
{ "repo_name": "metamolecular/opsin", "path": "opsin-core/src/main/java/uk/ac/cam/ch/wwmm/opsin/StereoAnalyser.java", "license": "artistic-2.0", "size": 22287 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,601,256
public boolean validateEmailAddress(String emailAddress) { boolean valid = true; //perform the validation against email address if (StringUtils.isNotBlank(emailAddress)) { EmailAddressValidationPattern emailAddressPattern = new EmailAddressValidationPattern(); if (!emailAddressPattern.matches(emailAddress)) { return false; } } return valid; }
boolean function(String emailAddress) { boolean valid = true; if (StringUtils.isNotBlank(emailAddress)) { EmailAddressValidationPattern emailAddressPattern = new EmailAddressValidationPattern(); if (!emailAddressPattern.matches(emailAddress)) { return false; } } return valid; }
/** * validate the email Address against the email address pattern * * @param emailAddress * @return true if email Address follows the pattern else return false. */
validate the email Address against the email address pattern
validateEmailAddress
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/document/validation/impl/PurchasingAccountsPayableProcessVendorValidation.java", "license": "apache-2.0", "size": 2528 }
[ "org.apache.commons.lang.StringUtils", "org.kuali.rice.kns.datadictionary.validation.fieldlevel.EmailAddressValidationPattern" ]
import org.apache.commons.lang.StringUtils; import org.kuali.rice.kns.datadictionary.validation.fieldlevel.EmailAddressValidationPattern;
import org.apache.commons.lang.*; import org.kuali.rice.kns.datadictionary.validation.fieldlevel.*;
[ "org.apache.commons", "org.kuali.rice" ]
org.apache.commons; org.kuali.rice;
2,610,567
protected InputStream getResponseStream() { return responseStream; }
InputStream function() { return responseStream; }
/** * Returns a stream from which the body of the current response may be read. * If the method has not yet been executed, if <code>responseBodyConsumed</code> * has been called, or if the stream returned by a previous call has been closed, * <code>null</code> will be returned. * * @return the current response stream */
Returns a stream from which the body of the current response may be read. If the method has not yet been executed, if <code>responseBodyConsumed</code> has been called, or if the stream returned by a previous call has been closed, <code>null</code> will be returned
getResponseStream
{ "repo_name": "UjuE/zaproxy", "path": "src/org/apache/commons/httpclient/HttpMethodBase.java", "license": "apache-2.0", "size": 98508 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,576,321
public ProvisionAction getProvisionAction() { return this.provisionAction; }
ProvisionAction function() { return this.provisionAction; }
/** * Gets the provision action associated with this component. * * @return the provision action for this component, which * may be null if the default action is to be used */
Gets the provision action associated with this component
getProvisionAction
{ "repo_name": "alexryndin/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/topology/Component.java", "license": "apache-2.0", "size": 1655 }
[ "org.apache.ambari.server.controller.internal.ProvisionAction" ]
import org.apache.ambari.server.controller.internal.ProvisionAction;
import org.apache.ambari.server.controller.internal.*;
[ "org.apache.ambari" ]
org.apache.ambari;
131,917
void process(FileIngestTask task) throws InterruptedException { try { if (!this.isCancelled()) { FileIngestPipeline pipeline = this.fileIngestPipelinesQueue.take(); if (!pipeline.isEmpty()) { AbstractFile file = task.getFile(); synchronized (this.fileIngestProgressLock) { ++this.processedFiles; if (this.runInteractively) { if (this.processedFiles <= this.estimatedFilesToProcess) { this.fileIngestProgress.progress(file.getName(), (int) this.processedFiles); } else { this.fileIngestProgress.progress(file.getName(), (int) this.estimatedFilesToProcess); } this.filesInProgress.add(file.getName()); } } List<IngestModuleError> errors = new ArrayList<>(); errors.addAll(pipeline.process(task)); if (!errors.isEmpty()) { logIngestModuleErrors(errors); } if (this.runInteractively && !this.cancelled) { synchronized (this.fileIngestProgressLock) { this.filesInProgress.remove(file.getName()); if (this.filesInProgress.size() > 0) { this.fileIngestProgress.progress(this.filesInProgress.get(0)); } else { this.fileIngestProgress.progress(""); } } } } this.fileIngestPipelinesQueue.put(pipeline); } } finally { DataSourceIngestJob.taskScheduler.notifyTaskCompleted(task); this.checkForStageCompleted(); } }
void process(FileIngestTask task) throws InterruptedException { try { if (!this.isCancelled()) { FileIngestPipeline pipeline = this.fileIngestPipelinesQueue.take(); if (!pipeline.isEmpty()) { AbstractFile file = task.getFile(); synchronized (this.fileIngestProgressLock) { ++this.processedFiles; if (this.runInteractively) { if (this.processedFiles <= this.estimatedFilesToProcess) { this.fileIngestProgress.progress(file.getName(), (int) this.processedFiles); } else { this.fileIngestProgress.progress(file.getName(), (int) this.estimatedFilesToProcess); } this.filesInProgress.add(file.getName()); } } List<IngestModuleError> errors = new ArrayList<>(); errors.addAll(pipeline.process(task)); if (!errors.isEmpty()) { logIngestModuleErrors(errors); } if (this.runInteractively && !this.cancelled) { synchronized (this.fileIngestProgressLock) { this.filesInProgress.remove(file.getName()); if (this.filesInProgress.size() > 0) { this.fileIngestProgress.progress(this.filesInProgress.get(0)); } else { this.fileIngestProgress.progress(""); } } } } this.fileIngestPipelinesQueue.put(pipeline); } } finally { DataSourceIngestJob.taskScheduler.notifyTaskCompleted(task); this.checkForStageCompleted(); } }
/** * Passes a file from the data source for this job through the file level * ingest pipeline. * * @param task A file ingest task. * * @throws InterruptedException if the thread executing this code is * interrupted while blocked on taking from or * putting to the file ingest pipelines * collection. */
Passes a file from the data source for this job through the file level ingest pipeline
process
{ "repo_name": "maxrp/autopsy", "path": "Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java", "license": "apache-2.0", "size": 47363 }
[ "java.util.ArrayList", "java.util.List", "org.sleuthkit.datamodel.AbstractFile" ]
import java.util.ArrayList; import java.util.List; import org.sleuthkit.datamodel.AbstractFile;
import java.util.*; import org.sleuthkit.datamodel.*;
[ "java.util", "org.sleuthkit.datamodel" ]
java.util; org.sleuthkit.datamodel;
27,284
private void logAndAppend(String lifecycleEvent) { Log.d(TAG, "Lifecycle Event: " + lifecycleEvent); mLifecycleDisplay.append(lifecycleEvent + "\n"); }
void function(String lifecycleEvent) { Log.d(TAG, STR + lifecycleEvent); mLifecycleDisplay.append(lifecycleEvent + "\n"); }
/** * Logs to the console and appends the lifecycle method name to the TextView so that you can * view the series of method callbacks that are called both from the app and from within * Android Studio's Logcat. * * @param lifecycleEvent The name of the event to be logged. */
Logs to the console and appends the lifecycle method name to the TextView so that you can view the series of method callbacks that are called both from the app and from within Android Studio's Logcat
logAndAppend
{ "repo_name": "achiwhane/ud851-Exercises", "path": "Lesson05a-Android-Lifecycle/T05a.02-Exercise-PersistData/app/src/main/java/com/example/android/lifecycle/MainActivity.java", "license": "apache-2.0", "size": 6628 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,353,871
public int getId() { if( cp != null ) { return cp.getId(); } return -1; } } // TODO: FINISH scene3d, extLst class GrpSpPr implements OOXMLElement { private static final Logger log = LoggerFactory.getLogger( GrpSpPr.class ); private static final long serialVersionUID = 7464871024304781512L; private Xfrm xf = null; private String bwmode = null; private FillGroup fill = null; private EffectPropsGroup effect = null; public GrpSpPr( Xfrm xf, String bwmode, FillGroup fill, EffectPropsGroup effect ) { this.xf = xf; this.bwmode = bwmode; this.fill = fill; this.effect = effect; } public GrpSpPr( GrpSpPr g ) { xf = g.xf; bwmode = g.bwmode; fill = g.fill; effect = g.effect; }
int function() { if( cp != null ) { return cp.getId(); } return -1; } } class GrpSpPr implements OOXMLElement { private static final Logger log = LoggerFactory.getLogger( GrpSpPr.class ); private static final long serialVersionUID = 7464871024304781512L; private Xfrm xf = null; private String bwmode = null; private FillGroup fill = null; private EffectPropsGroup effect = null; public GrpSpPr( Xfrm xf, String bwmode, FillGroup fill, EffectPropsGroup effect ) { this.xf = xf; this.bwmode = bwmode; this.fill = fill; this.effect = effect; } public GrpSpPr( GrpSpPr g ) { xf = g.xf; bwmode = g.bwmode; fill = g.fill; effect = g.effect; }
/** * return the cNvPr id for this element * * @return */
return the cNvPr id for this element
getId
{ "repo_name": "Maxels88/openxls", "path": "src/main/java/org/openxls/formats/OOXML/GrpSp.java", "license": "gpl-3.0", "size": 21798 }
[ "org.slf4j.Logger", "org.slf4j.LoggerFactory" ]
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import org.slf4j.*;
[ "org.slf4j" ]
org.slf4j;
881,257
@VisibleForTesting static void deleteRMStateStore(Configuration conf) throws Exception { RMStateStore rmStore = RMStateStoreFactory.getStore(conf); rmStore.setResourceManager(new ResourceManager()); rmStore.init(conf); rmStore.start(); try { LOG.info("Deleting ResourceManager state store..."); rmStore.deleteStore(); LOG.info("State store deleted"); } finally { rmStore.stop(); } }
static void deleteRMStateStore(Configuration conf) throws Exception { RMStateStore rmStore = RMStateStoreFactory.getStore(conf); rmStore.setResourceManager(new ResourceManager()); rmStore.init(conf); rmStore.start(); try { LOG.info(STR); rmStore.deleteStore(); LOG.info(STR); } finally { rmStore.stop(); } }
/** * Deletes the RMStateStore * * @param conf * @throws Exception */
Deletes the RMStateStore
deleteRMStateStore
{ "repo_name": "lukmajercak/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java", "license": "apache-2.0", "size": 64696 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore", "org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStoreFactory" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore; import org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStoreFactory;
import org.apache.hadoop.conf.*; import org.apache.hadoop.yarn.server.resourcemanager.recovery.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,458,417
public void rootResourceNotFound() throws WebApplicationException, RequestHandledException { if (this.noRootResClHandler != null) { this.noRootResClHandler.handle(Request.getCurrent(), org.restlet.Response.getCurrent()); throw new RequestHandledException(); } throw new WebApplicationException(Status.NOT_FOUND); }
void function() throws WebApplicationException, RequestHandledException { if (this.noRootResClHandler != null) { this.noRootResClHandler.handle(Request.getCurrent(), org.restlet.Response.getCurrent()); throw new RequestHandledException(); } throw new WebApplicationException(Status.NOT_FOUND); }
/** * Handles the case, if no root resource class was found. If a Restlet to * handle this case was given (see {@link #setNoRootResClHandler(Restlet)}), * it is called. Otherwise a {@link WebApplicationException} with status 404 * is thrown (see JAX-RS specification, section 3.7.2, item 1d) * * @throws WebApplicationException * @throws RequestHandledException */
Handles the case, if no root resource class was found. If a Restlet to handle this case was given (see <code>#setNoRootResClHandler(Restlet)</code>), it is called. Otherwise a <code>WebApplicationException</code> with status 404 is thrown (see JAX-RS specification, section 3.7.2, item 1d)
rootResourceNotFound
{ "repo_name": "theanuradha/debrief", "path": "org.mwc.asset.comms/docs/restlet_src/org.restlet.ext.jaxrs/org/restlet/ext/jaxrs/internal/util/ExceptionHandler.java", "license": "epl-1.0", "size": 17585 }
[ "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.Response", "org.restlet.Request", "org.restlet.ext.jaxrs.internal.exceptions.RequestHandledException" ]
import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import org.restlet.Request; import org.restlet.ext.jaxrs.internal.exceptions.RequestHandledException;
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.restlet.*; import org.restlet.ext.jaxrs.internal.exceptions.*;
[ "javax.ws", "org.restlet", "org.restlet.ext" ]
javax.ws; org.restlet; org.restlet.ext;
1,821,439
Object query(String sql, Object[] args, ResultSetExtractor rse) throws DataAccessException;
Object query(String sql, Object[] args, ResultSetExtractor rse) throws DataAccessException;
/** * Query given SQL to create a prepared statement from SQL and a list * of arguments to bind to the query, reading the ResultSet with a * ResultSetExtractor. * @param sql SQL query to execute * @param args arguments to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type); * may also contain {@link SqlParameterValue} objects which indicate not * only the argument value but also the SQL type and optionally the scale * @param rse object that will extract results * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if the query fails */
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, reading the ResultSet with a ResultSetExtractor
query
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/jdbc/core/JdbcOperations.java", "license": "unlicense", "size": 47160 }
[ "org.springframework.dao.DataAccessException" ]
import org.springframework.dao.DataAccessException;
import org.springframework.dao.*;
[ "org.springframework.dao" ]
org.springframework.dao;
2,489,716
public void addNote( NotePadMeta ni ) { notes.add( ni ); changedNotes = true; }
void function( NotePadMeta ni ) { notes.add( ni ); changedNotes = true; }
/** * Add a new note. Also marks that the notes have changed. * * @param ni The note to be added. */
Add a new note. Also marks that the notes have changed
addNote
{ "repo_name": "ViswesvarSekar/pentaho-kettle", "path": "engine/src/org/pentaho/di/base/AbstractMeta.java", "license": "apache-2.0", "size": 51635 }
[ "org.pentaho.di.core.NotePadMeta" ]
import org.pentaho.di.core.NotePadMeta;
import org.pentaho.di.core.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,648,869
public final ImmutableList<E> toSortedList(Comparator<? super E> comparator) { return Ordering.from(comparator).immutableSortedCopy(iterable); }
final ImmutableList<E> function(Comparator<? super E> comparator) { return Ordering.from(comparator).immutableSortedCopy(iterable); }
/** * Returns an {@code ImmutableList} containing all of the elements from this {@code Sequence} in * the order specified by {@code comparator}. To produce an {@code ImmutableList} sorted by its * natural ordering, use {@code toSortedList(Ordering.natural())}. * @param comparator the function by which to sort list elements * @return the immutable list * @since 14.0 (since 13.0 as {@code toSortedImmutableList()}). */
Returns an ImmutableList containing all of the elements from this Sequence in the order specified by comparator. To produce an ImmutableList sorted by its natural ordering, use toSortedList(Ordering.natural())
toSortedList
{ "repo_name": "immutables/miscellaneous", "path": "sequence/src/org/immutables/sequence/Sequence.java", "license": "apache-2.0", "size": 21792 }
[ "com.google.common.collect.ImmutableList", "com.google.common.collect.Ordering", "java.util.Comparator" ]
import com.google.common.collect.ImmutableList; import com.google.common.collect.Ordering; import java.util.Comparator;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
2,905,439
FileLock tryLock() throws IOException { boolean deletionHookAdded = false; File lockF = new File(root, STORAGE_FILE_LOCK); if (!lockF.exists()) { lockF.deleteOnExit(); deletionHookAdded = true; } RandomAccessFile file = new RandomAccessFile(lockF, "rws"); String jvmName = ManagementFactory.getRuntimeMXBean().getName(); FileLock res = null; try { res = file.getChannel().tryLock(); file.write(jvmName.getBytes(Charsets.UTF_8)); LOG.info("Lock on " + lockF + " acquired by nodename " + jvmName); } catch (OverlappingFileLockException oe) { LOG.error("It appears that another namenode " + file.readLine() + " has already locked the storage directory"); file.close(); return null; } catch (IOException e) { LOG.error("Failed to acquire lock on " + lockF + ". If this storage directory is mounted via NFS, " + "ensure that the appropriate nfs lock services are running.", e); file.close(); throw e; } if (res != null && !deletionHookAdded) { // If the file existed prior to our startup, we didn't // call deleteOnExit above. But since we successfully locked // the dir, we can take care of cleaning it up. lockF.deleteOnExit(); } return res; }
FileLock tryLock() throws IOException { boolean deletionHookAdded = false; File lockF = new File(root, STORAGE_FILE_LOCK); if (!lockF.exists()) { lockF.deleteOnExit(); deletionHookAdded = true; } RandomAccessFile file = new RandomAccessFile(lockF, "rws"); String jvmName = ManagementFactory.getRuntimeMXBean().getName(); FileLock res = null; try { res = file.getChannel().tryLock(); file.write(jvmName.getBytes(Charsets.UTF_8)); LOG.info(STR + lockF + STR + jvmName); } catch (OverlappingFileLockException oe) { LOG.error(STR + file.readLine() + STR); file.close(); return null; } catch (IOException e) { LOG.error(STR + lockF + STR + STR, e); file.close(); throw e; } if (res != null && !deletionHookAdded) { lockF.deleteOnExit(); } return res; }
/** * Attempts to acquire an exclusive lock on the storage. * * @return A lock object representing the newly-acquired lock or * <code>null</code> if storage is already locked. * @throws IOException * if locking fails. */
Attempts to acquire an exclusive lock on the storage
tryLock
{ "repo_name": "robzor92/hops", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java", "license": "apache-2.0", "size": 38180 }
[ "com.google.common.base.Charsets", "java.io.File", "java.io.IOException", "java.io.RandomAccessFile", "java.lang.management.ManagementFactory", "java.nio.channels.FileLock", "java.nio.channels.OverlappingFileLockException" ]
import com.google.common.base.Charsets; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.lang.management.ManagementFactory; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException;
import com.google.common.base.*; import java.io.*; import java.lang.management.*; import java.nio.channels.*;
[ "com.google.common", "java.io", "java.lang", "java.nio" ]
com.google.common; java.io; java.lang; java.nio;
1,221,081
@SuppressWarnings("unchecked") @Test public void getContainsClobs_works_when_there_are_no_clobs() { @NotNull final List<Attribute<DecoratedString>> attributes = new ArrayList<Attribute<DecoratedString>>(); @NotNull final String name = "name"; @NotNull final String comment = "comment2"; @NotNull final List<Attribute<String>> primaryKey = new ArrayList<Attribute<String>>(0); @NotNull final List<ForeignKey<String>> foreignKeys = new ArrayList<ForeignKey<String>>(0); @Nullable final Table<String, Attribute<String>, List<Attribute<String>>> parentTable = null; @Nullable final Attribute<String> staticAttribute = null; final boolean voDecorated = false; final boolean isRelationship = false; @NotNull final Table<String, Attribute<String>, List<Attribute<String>>> table = new TableValueObject( name, comment, primaryKey, new ArrayList<Attribute<String>>(0), // not used in this test foreignKeys, parentTable, staticAttribute, voDecorated, isRelationship); @NotNull final Attribute<DecoratedString> attribute = EasyMock.createNiceMock(Attribute.class); EasyMock.expect(attribute.getTypeId()).andReturn(Types.CLOB); EasyMock.replay(attribute); attributes.add(attribute); @NotNull final MetadataManager metadataManager = EasyMock.createNiceMock(MetadataManager.class); @NotNull final DecoratorFactory decoratorFactory = CachingDecoratorFactory.getInstance(); @NotNull final CustomSqlProvider customSqlProvider = EasyMock.createNiceMock(CustomSqlProvider.class); @NotNull final TableDecorator tableDecorator = new CachingTableDecorator(table, metadataManager, decoratorFactory, customSqlProvider); @NotNull final AbstractTableListDecorator<Attribute<DecoratedString>> instance = createInstance(attributes, tableDecorator, metadataManager, customSqlProvider, decoratorFactory); Assert.assertTrue(instance.getContainsClobs()); EasyMock.verify(attribute); }
@SuppressWarnings(STR) void function() { @NotNull final List<Attribute<DecoratedString>> attributes = new ArrayList<Attribute<DecoratedString>>(); @NotNull final String name = "name"; @NotNull final String comment = STR; @NotNull final List<Attribute<String>> primaryKey = new ArrayList<Attribute<String>>(0); @NotNull final List<ForeignKey<String>> foreignKeys = new ArrayList<ForeignKey<String>>(0); @Nullable final Table<String, Attribute<String>, List<Attribute<String>>> parentTable = null; @Nullable final Attribute<String> staticAttribute = null; final boolean voDecorated = false; final boolean isRelationship = false; @NotNull final Table<String, Attribute<String>, List<Attribute<String>>> table = new TableValueObject( name, comment, primaryKey, new ArrayList<Attribute<String>>(0), foreignKeys, parentTable, staticAttribute, voDecorated, isRelationship); @NotNull final Attribute<DecoratedString> attribute = EasyMock.createNiceMock(Attribute.class); EasyMock.expect(attribute.getTypeId()).andReturn(Types.CLOB); EasyMock.replay(attribute); attributes.add(attribute); @NotNull final MetadataManager metadataManager = EasyMock.createNiceMock(MetadataManager.class); @NotNull final DecoratorFactory decoratorFactory = CachingDecoratorFactory.getInstance(); @NotNull final CustomSqlProvider customSqlProvider = EasyMock.createNiceMock(CustomSqlProvider.class); @NotNull final TableDecorator tableDecorator = new CachingTableDecorator(table, metadataManager, decoratorFactory, customSqlProvider); @NotNull final AbstractTableListDecorator<Attribute<DecoratedString>> instance = createInstance(attributes, tableDecorator, metadataManager, customSqlProvider, decoratorFactory); Assert.assertTrue(instance.getContainsClobs()); EasyMock.verify(attribute); }
/** * Checks whether getContainsClobs() detects any Clob * attribute, when there is none. */
Checks whether getContainsClobs() detects any Clob attribute, when there is none
getContainsClobs_works_when_there_are_no_clobs
{ "repo_name": "rydnr/queryj-rt", "path": "queryj-core/src/test/java/org/acmsl/queryj/metadata/AbstractTableListDecoratorTest.java", "license": "gpl-2.0", "size": 13941 }
[ "java.sql.Types", "java.util.ArrayList", "java.util.List", "org.acmsl.queryj.customsql.CustomSqlProvider", "org.acmsl.queryj.metadata.vo.Attribute", "org.acmsl.queryj.metadata.vo.ForeignKey", "org.acmsl.queryj.metadata.vo.Table", "org.acmsl.queryj.metadata.vo.TableValueObject", "org.easymock.EasyMock", "org.jetbrains.annotations.NotNull", "org.jetbrains.annotations.Nullable", "org.junit.Assert" ]
import java.sql.Types; import java.util.ArrayList; import java.util.List; import org.acmsl.queryj.customsql.CustomSqlProvider; import org.acmsl.queryj.metadata.vo.Attribute; import org.acmsl.queryj.metadata.vo.ForeignKey; import org.acmsl.queryj.metadata.vo.Table; import org.acmsl.queryj.metadata.vo.TableValueObject; import org.easymock.EasyMock; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.junit.Assert;
import java.sql.*; import java.util.*; import org.acmsl.queryj.customsql.*; import org.acmsl.queryj.metadata.vo.*; import org.easymock.*; import org.jetbrains.annotations.*; import org.junit.*;
[ "java.sql", "java.util", "org.acmsl.queryj", "org.easymock", "org.jetbrains.annotations", "org.junit" ]
java.sql; java.util; org.acmsl.queryj; org.easymock; org.jetbrains.annotations; org.junit;
1,826,031
private boolean isConstraintAnnotation(AnnotationMirror annotationMirror) { return isConstraintAnnotation( annotationMirror.getAnnotationType().asElement() ); } /** * Checks, whether the given annotation mirror represents the {@code @Constraint}
boolean function(AnnotationMirror annotationMirror) { return isConstraintAnnotation( annotationMirror.getAnnotationType().asElement() ); } /** * Checks, whether the given annotation mirror represents the {@code @Constraint}
/** * Checks, whether the given annotation mirror represents a constraint * annotation or not. That's the case, if the given mirror is annotated with * the {@code @Constraint} meta-annotation (which is only allowed at * annotation declarations). * * @param annotationMirror The annotation mirror of interest. * * @return True, if the given mirror represents a constraint annotation * type, false otherwise. */
Checks, whether the given annotation mirror represents a constraint annotation or not. That's the case, if the given mirror is annotated with the @Constraint meta-annotation (which is only allowed at annotation declarations)
isConstraintAnnotation
{ "repo_name": "jmartisk/hibernate-validator", "path": "annotation-processor/src/main/java/org/hibernate/validator/ap/util/ConstraintHelper.java", "license": "apache-2.0", "size": 26495 }
[ "javax.lang.model.element.AnnotationMirror" ]
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.*;
[ "javax.lang" ]
javax.lang;
2,102,228