method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
protected StateValues checkExpressionLabel(Model model, ExpressionLabel expr) throws PrismException
{
LabelList ll;
int i;
// treat special cases
if (expr.getName().equals("deadlock")) {
int numStates = model.getNumStates();
BitSet bs = new BitSet(numStates);
for (i = 0; i < numStates; i++) {
... | StateValues function(Model model, ExpressionLabel expr) throws PrismException { LabelList ll; int i; if (expr.getName().equals(STR)) { int numStates = model.getNumStates(); BitSet bs = new BitSet(numStates); for (i = 0; i < numStates; i++) { bs.set(i, model.isDeadlockState(i)); } return StateValues.createFromBitSet(bs,... | /**
* Model check a label.
*/ | Model check a label | checkExpressionLabel | {
"repo_name": "bharathk005/prism-4.2.1-src-teaser-patch",
"path": "src/explicit/StateModelChecker.java",
"license": "gpl-2.0",
"size": 38728
} | [
"java.util.BitSet"
] | import java.util.BitSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,461,889 |
private void createFile() {
if (mDriveServiceHelper != null) {
Log.d(TAG, "Creating a file.");
mDriveServiceHelper.createFile()
.addOnSuccessListener(fileId -> readFile(fileId))
.addOnFailureListener(exception ->
Lo... | void function() { if (mDriveServiceHelper != null) { Log.d(TAG, STR); mDriveServiceHelper.createFile() .addOnSuccessListener(fileId -> readFile(fileId)) .addOnFailureListener(exception -> Log.e(TAG, STR, exception)); } } | /**
* Creates a new file via the Drive REST API.
*/ | Creates a new file via the Drive REST API | createFile | {
"repo_name": "gsuitedevs/android-samples",
"path": "drive/deprecation/app/src/main/java/com/google/android/gms/drive/sample/driveapimigration/MainActivity.java",
"license": "apache-2.0",
"size": 10865
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 1,359,680 |
private PDPConfig parsePDPConfig(Node root) throws ParsingException {
ArrayList attrModules = new ArrayList();
HashSet policyModules = new HashSet();
ArrayList rsrcModules = new ArrayList();
// go through all elements of the pdp, loading the specified modules
NodeList childr... | PDPConfig function(Node root) throws ParsingException { ArrayList attrModules = new ArrayList(); HashSet policyModules = new HashSet(); ArrayList rsrcModules = new ArrayList(); NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); String name = DOMHelp... | /**
* Private helper that handles the pdp elements.
*/ | Private helper that handles the pdp elements | parsePDPConfig | {
"repo_name": "wso2/balana",
"path": "modules/balana-core/src/main/java/org/wso2/balana/ConfigurationStore.java",
"license": "apache-2.0",
"size": 39309
} | [
"java.util.ArrayList",
"java.util.HashSet",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList",
"org.wso2.balana.finder.AttributeFinder",
"org.wso2.balana.finder.PolicyFinder",
"org.wso2.balana.finder.ResourceFinder"
] | import java.util.ArrayList; import java.util.HashSet; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.wso2.balana.finder.AttributeFinder; import org.wso2.balana.finder.PolicyFinder; import org.wso2.balana.finder.ResourceFinder; | import java.util.*; import org.w3c.dom.*; import org.wso2.balana.finder.*; | [
"java.util",
"org.w3c.dom",
"org.wso2.balana"
] | java.util; org.w3c.dom; org.wso2.balana; | 1,381,742 |
public static List<NodePropertyDescriptor> getGlobalNodePropertyDescriptors() {
List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>();
Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class);
for (NodeProperty... | static List<NodePropertyDescriptor> function() { List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>(); Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class); for (NodePropertyDescriptor npd : list) { if (npd.isApplicableAsGlobal()) { ... | /**
* Returns those node properties which can be configured as global node properties.
*
* @since 1.520
*/ | Returns those node properties which can be configured as global node properties | getGlobalNodePropertyDescriptors | {
"repo_name": "lilyJi/jenkins",
"path": "core/src/main/java/hudson/Functions.java",
"license": "mit",
"size": 74776
} | [
"hudson.model.Describable",
"hudson.model.Descriptor",
"hudson.slaves.NodeProperty",
"hudson.slaves.NodePropertyDescriptor",
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] | import hudson.model.Describable; import hudson.model.Descriptor; import hudson.slaves.NodeProperty; import hudson.slaves.NodePropertyDescriptor; import java.util.ArrayList; import java.util.Collection; import java.util.List; | import hudson.model.*; import hudson.slaves.*; import java.util.*; | [
"hudson.model",
"hudson.slaves",
"java.util"
] | hudson.model; hudson.slaves; java.util; | 2,678,359 |
@Scheduled(cron = "0 0 0 * * *")
public void removeExpiredRemembered() {
removeExpired(ticketRepository.findByCreatedDateBeforeAndRemembered(
DateTime.now().minusHours(configurationService.getConfiguration().getLongTimeout()), true));
} | @Scheduled(cron = STR) void function() { removeExpired(ticketRepository.findByCreatedDateBeforeAndRemembered( DateTime.now().minusHours(configurationService.getConfiguration().getLongTimeout()), true)); } | /**
* Remembered tickets have to be removed once expired.
* This is scheduled to get fired everyday, at midnight.
*/ | Remembered tickets have to be removed once expired. This is scheduled to get fired everyday, at midnight | removeExpiredRemembered | {
"repo_name": "kazoompa/agate",
"path": "agate-core/src/main/java/org/obiba/agate/service/TicketService.java",
"license": "gpl-3.0",
"size": 7763
} | [
"org.joda.time.DateTime",
"org.springframework.scheduling.annotation.Scheduled"
] | import org.joda.time.DateTime; import org.springframework.scheduling.annotation.Scheduled; | import org.joda.time.*; import org.springframework.scheduling.annotation.*; | [
"org.joda.time",
"org.springframework.scheduling"
] | org.joda.time; org.springframework.scheduling; | 1,945,829 |
byte [] encodedBytes = Component.parseURI(uriEncoded);
if (KeyProfile.KEY_NAME_COMPONENT_MARKER.isMarker(encodedBytes)) {
return new PublisherPublicKeyDigest(KeyProfile.getKeyIDFromNameComponent(encodedBytes));
}
// No marker
return new PublisherPublicKeyDigest(encodedBytes);
}
| byte [] encodedBytes = Component.parseURI(uriEncoded); if (KeyProfile.KEY_NAME_COMPONENT_MARKER.isMarker(encodedBytes)) { return new PublisherPublicKeyDigest(KeyProfile.getKeyIDFromNameComponent(encodedBytes)); } return new PublisherPublicKeyDigest(encodedBytes); } | /**
* Parses a URI-encoded key ID, with an optional keyid: command marker.
* @throws URISyntaxException
* @throws Component.DotDot
*/ | Parses a URI-encoded key ID, with an optional keyid: command marker | fromURIEncoded | {
"repo_name": "gujianxiao/gatewayForMulticom",
"path": "javasrc/src/main/org/ndnx/ndn/protocol/PublisherPublicKeyDigest.java",
"license": "lgpl-2.1",
"size": 8888
} | [
"org.ndnx.ndn.profiles.security.KeyProfile"
] | import org.ndnx.ndn.profiles.security.KeyProfile; | import org.ndnx.ndn.profiles.security.*; | [
"org.ndnx.ndn"
] | org.ndnx.ndn; | 2,679,735 |
Map<K, V> entriesOnlyOnLeft(); | Map<K, V> entriesOnlyOnLeft(); | /**
* Returns an unmodifiable map containing the entries from the left map whose
* keys are not present in the right map.
*/ | Returns an unmodifiable map containing the entries from the left map whose keys are not present in the right map | entriesOnlyOnLeft | {
"repo_name": "biddyweb/checker-framework",
"path": "checker/jdk/nullness/src/com/google/common/collect/MapDifference.java",
"license": "gpl-2.0",
"size": 3389
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,240,396 |
private T makeKey(byte[] data) {
int len = _us.length();
int dlen = data.length;
if (dlen > len + 1 ||
(dlen == len + 1 && data[0] != 0))
throw new IllegalArgumentException("bad length " + dlen + " > " + len);
T rv;
try {
rv = (T) _us.getCl... | T function(byte[] data) { int len = _us.length(); int dlen = data.length; if (dlen > len + 1 (dlen == len + 1 && data[0] != 0)) throw new IllegalArgumentException(STR + dlen + STR + len); T rv; try { rv = (T) _us.getClass().newInstance(); } catch (Exception e) { _log.error("fail", e); throw new RuntimeException(e); } i... | /**
* Make a new SimpleDataStrucure from the data
* @param data size <= SDS length, else throws IAE
* Can be 1 bigger if top byte is zero
*/ | Make a new SimpleDataStrucure from the data | makeKey | {
"repo_name": "NoYouShutup/CryptMeme",
"path": "CryptMeme/core/java/src/net/i2p/kademlia/KBucketSet.java",
"license": "mit",
"size": 27128
} | [
"java.math.BigInteger",
"java.util.Map",
"net.i2p.data.SimpleDataStructure",
"net.i2p.util.LHMCache"
] | import java.math.BigInteger; import java.util.Map; import net.i2p.data.SimpleDataStructure; import net.i2p.util.LHMCache; | import java.math.*; import java.util.*; import net.i2p.data.*; import net.i2p.util.*; | [
"java.math",
"java.util",
"net.i2p.data",
"net.i2p.util"
] | java.math; java.util; net.i2p.data; net.i2p.util; | 640,301 |
public void setRuntimeServices(RuntimeServices rs)
{
this.rs = rs;
// Get the regular expression pattern.
matchRegExp = StringUtils.nullTrim(rs.getConfiguration().getString(getMatchAttribute()));
if (org.apache.commons.lang3.StringUtils.isEmpty(matchRegExp))
{
... | void function(RuntimeServices rs) { this.rs = rs; matchRegExp = StringUtils.nullTrim(rs.getConfiguration().getString(getMatchAttribute())); if (org.apache.commons.lang3.StringUtils.isEmpty(matchRegExp)) { matchRegExp = null; } if (matchRegExp != null) { try { STRInvalid regular expression 'STR'. No escaping will be per... | /**
* Called automatically when event cartridge is initialized.
*
* @param rs instance of RuntimeServices
*/ | Called automatically when event cartridge is initialized | setRuntimeServices | {
"repo_name": "diydyq/velocity-engine",
"path": "velocity-engine-core/src/main/java/org/apache/velocity/app/event/implement/EscapeReference.java",
"license": "apache-2.0",
"size": 4851
} | [
"org.apache.velocity.runtime.RuntimeServices",
"org.apache.velocity.util.StringUtils"
] | import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.util.StringUtils; | import org.apache.velocity.runtime.*; import org.apache.velocity.util.*; | [
"org.apache.velocity"
] | org.apache.velocity; | 1,166,392 |
public static void find2Methods(Class clazz, String superMethod,
String thisMethod, int index,
String desc, java.lang.reflect.Method[] methods)
{
methods[index + 1] = thisMethod == null ? null
... | static void function(Class clazz, String superMethod, String thisMethod, int index, String desc, java.lang.reflect.Method[] methods) { methods[index + 1] = thisMethod == null ? null : findMethod(clazz, thisMethod, desc); methods[index] = findSuperClassMethod(clazz, superMethod, desc); } /** * Finds two methods specifie... | /**
* Finds two methods specified by the parameters and stores them
* into the given array.
*
* @throws RuntimeException if the methods are not found.
* @see io.github.proxyhotswap.javassist.util.proxy.ProxyFactory
*/ | Finds two methods specified by the parameters and stores them into the given array | find2Methods | {
"repo_name": "erkieh/proxyhotswap",
"path": "src/main/java/io/github/proxyhotswap/javassist/util/proxy/RuntimeSupport.java",
"license": "gpl-2.0",
"size": 9224
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,856,355 |
@Nullable
public PsiFileSystemItem resolveIncludedFile(@NotNull final FileIncludeInfo info, @NotNull final PsiFile context) {
return null;
} | PsiFileSystemItem function(@NotNull final FileIncludeInfo info, @NotNull final PsiFile context) { return null; } | /**
* If all providers return <code>null</code> then <code>FileIncludeInfo</code> is resolved in a standard way using <code>FileReferenceSet</code>
*/ | If all providers return <code>null</code> then <code>FileIncludeInfo</code> is resolved in a standard way using <code>FileReferenceSet</code> | resolveIncludedFile | {
"repo_name": "akosyakov/intellij-community",
"path": "platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeProvider.java",
"license": "apache-2.0",
"size": 2018
} | [
"com.intellij.psi.PsiFile",
"com.intellij.psi.PsiFileSystemItem",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.psi.PsiFile; import com.intellij.psi.PsiFileSystemItem; import org.jetbrains.annotations.NotNull; | import com.intellij.psi.*; import org.jetbrains.annotations.*; | [
"com.intellij.psi",
"org.jetbrains.annotations"
] | com.intellij.psi; org.jetbrains.annotations; | 1,914,275 |
public Cookie setCookie(String name, String value, Dt timeTolive, String cookieDomain) {
if (freshCookies==null) freshCookies = new ArrayMap();
freshCookies.put(name, value);
String p = request.getProtocol();
String ph = getRequestProtocolHost();
String sameSite = "None";
// HACK avoid sameSite on local ... | Cookie function(String name, String value, Dt timeTolive, String cookieDomain) { if (freshCookies==null) freshCookies = new ArrayMap(); freshCookies.put(name, value); String p = request.getProtocol(); String ph = getRequestProtocolHost(); String sameSite = "None"; if ( ! request.isSecure() && ph.startsWith(STRcookieSTR... | /**
* Uses path=/ Call {@link WebUtils2#addCookie(HttpServletResponse, String, Object, Dt, String)} for more options.
*
* @param cookieDomain .mysite.com means cookies will work across mysite.com, abc.mysite.com and www.mysite.com
* @return
* @see WebUtils2#addCookie(HttpServletResponse, String, Object, Dt... | Uses path=/ Call <code>WebUtils2#addCookie(HttpServletResponse, String, Object, Dt, String)</code> for more options | setCookie | {
"repo_name": "sodash/open-code",
"path": "winterwell.web/src/com/winterwell/web/app/WebRequest.java",
"license": "mit",
"size": 39762
} | [
"com.winterwell.utils.containers.ArrayMap",
"com.winterwell.utils.time.Dt",
"com.winterwell.utils.web.WebUtils2",
"javax.servlet.http.Cookie"
] | import com.winterwell.utils.containers.ArrayMap; import com.winterwell.utils.time.Dt; import com.winterwell.utils.web.WebUtils2; import javax.servlet.http.Cookie; | import com.winterwell.utils.containers.*; import com.winterwell.utils.time.*; import com.winterwell.utils.web.*; import javax.servlet.http.*; | [
"com.winterwell.utils",
"javax.servlet"
] | com.winterwell.utils; javax.servlet; | 1,573,504 |
public UserEvaluationPermissions getUserPermissionsForEvaluation(UserInfo userInfo, String evalId)
throws NotFoundException, DatastoreException; | UserEvaluationPermissions function(UserInfo userInfo, String evalId) throws NotFoundException, DatastoreException; | /**
* Gets the user permissions for an evaluation.
*/ | Gets the user permissions for an evaluation | getUserPermissionsForEvaluation | {
"repo_name": "Sage-Bionetworks/Synapse-Repository-Services",
"path": "services/repository-managers/src/main/java/org/sagebionetworks/repo/manager/evaluation/EvaluationPermissionsManager.java",
"license": "apache-2.0",
"size": 3085
} | [
"org.sagebionetworks.evaluation.model.UserEvaluationPermissions",
"org.sagebionetworks.repo.model.DatastoreException",
"org.sagebionetworks.repo.model.UserInfo",
"org.sagebionetworks.repo.web.NotFoundException"
] | import org.sagebionetworks.evaluation.model.UserEvaluationPermissions; import org.sagebionetworks.repo.model.DatastoreException; import org.sagebionetworks.repo.model.UserInfo; import org.sagebionetworks.repo.web.NotFoundException; | import org.sagebionetworks.evaluation.model.*; import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.web.*; | [
"org.sagebionetworks.evaluation",
"org.sagebionetworks.repo"
] | org.sagebionetworks.evaluation; org.sagebionetworks.repo; | 460,155 |
@Message(id = 242, value = "Illegal lock type %s on %s for component %s")
IllegalStateException failToObtainLockIllegalType(LockType lockType, Method method, SingletonComponent lockableComponent); | @Message(id = 242, value = STR) IllegalStateException failToObtainLockIllegalType(LockType lockType, Method method, SingletonComponent lockableComponent); | /**
* Creates an exception indicating Illegal lock type for component
*
* @return a {@link IllegalStateException} for the error.
*/ | Creates an exception indicating Illegal lock type for component | failToObtainLockIllegalType | {
"repo_name": "golovnin/wildfly",
"path": "ejb3/src/main/java/org/jboss/as/ejb3/logging/EjbLogger.java",
"license": "lgpl-2.1",
"size": 147179
} | [
"java.lang.reflect.Method",
"javax.ejb.LockType",
"org.jboss.as.ejb3.component.singleton.SingletonComponent",
"org.jboss.logging.annotations.Message"
] | import java.lang.reflect.Method; import javax.ejb.LockType; import org.jboss.as.ejb3.component.singleton.SingletonComponent; import org.jboss.logging.annotations.Message; | import java.lang.reflect.*; import javax.ejb.*; import org.jboss.as.ejb3.component.singleton.*; import org.jboss.logging.annotations.*; | [
"java.lang",
"javax.ejb",
"org.jboss.as",
"org.jboss.logging"
] | java.lang; javax.ejb; org.jboss.as; org.jboss.logging; | 1,150,623 |
@Generated
@Selector("setVideoProvider:")
public native void setVideoProvider(NSItemProvider value); | @Selector(STR) native void function(NSItemProvider value); | /**
* An item provider which will return data corresponding to a representative
* video for the URL that AVFoundation can play.
*/ | An item provider which will return data corresponding to a representative video for the URL that AVFoundation can play | setVideoProvider | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/linkpresentation/LPLinkMetadata.java",
"license": "apache-2.0",
"size": 8262
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,529,881 |
public Rectangle2D getTransformedPrimitiveBounds(AffineTransform txf) {
if (source == null)
return null;
AffineTransform t = txf;
if (transform != null) {
t = new AffineTransform(txf);
t.concatenate(transform);
}
return source.getTransfor... | Rectangle2D function(AffineTransform txf) { if (source == null) return null; AffineTransform t = txf; if (transform != null) { t = new AffineTransform(txf); t.concatenate(transform); } return source.getTransformedPrimitiveBounds(t); } | /**
* Returns the bounds of this node's primitivePaint after applying
* the input transform (if any), concatenated with this node's
* transform (if any).
*
* @param txf the affine transform with which this node's transform should
* be concatenated. Should not be null. */ | Returns the bounds of this node's primitivePaint after applying the input transform (if any), concatenated with this node's transform (if any) | getTransformedPrimitiveBounds | {
"repo_name": "sflyphotobooks/crp-batik",
"path": "sources/org/apache/batik/gvt/ProxyGraphicsNode.java",
"license": "apache-2.0",
"size": 4832
} | [
"java.awt.geom.AffineTransform",
"java.awt.geom.Rectangle2D"
] | import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 582,311 |
public void testBinaryConversionForUserDefinedType() throws Exception {
xsdHelper.define(getSchema(getSchemaNameForUserDefinedType()));
FileInputStream inputStream = new FileInputStream(getControlFileName());
XMLDocument document = xmlHelper.load(inputStream, null, null);
byte[] by... | void function() throws Exception { xsdHelper.define(getSchema(getSchemaNameForUserDefinedType())); FileInputStream inputStream = new FileInputStream(getControlFileName()); XMLDocument document = xmlHelper.load(inputStream, null, null); byte[] bytesFromDocument = (byte[]) document.getRootObject().get("value"); String co... | /**
* Test to make sure that the when the XML doc is loaded, that the
* String in the document is interpreted properly as HexBinary.
*
* i.e. if "48656C6C6F20576F726C6421" is converted to a byte[]
* using hexBinary conversion, a String created with the resulting
* byte[] should read "Hello... | Test to make sure that the when the XML doc is loaded, that the String in the document is interpreted properly as HexBinary. i.e. if "48656C6C6F20576F726C6421" is converted to a byte[] using hexBinary conversion, a String created with the resulting byte[] should read "Hello World!" | testBinaryConversionForUserDefinedType | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "sdo/eclipselink.sdo.test/src/org/eclipse/persistence/testing/sdo/helper/xmlhelper/datatype/SDOXMLHelperDatatypeHexTestCases.java",
"license": "epl-1.0",
"size": 3600
} | [
"java.io.FileInputStream"
] | import java.io.FileInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,764,012 |
private void validateEmrClusterDefinition(Integer expectedEmrClusterDefinitionId, String expectedNamespace, String expectedEmrClusterDefinitionName,
EmrClusterDefinition expectedEmrClusterConfiguration, EmrClusterDefinitionInformation actualEmrClusterDefinition)
{
assertNotNull(actualEmrClusterD... | void function(Integer expectedEmrClusterDefinitionId, String expectedNamespace, String expectedEmrClusterDefinitionName, EmrClusterDefinition expectedEmrClusterConfiguration, EmrClusterDefinitionInformation actualEmrClusterDefinition) { assertNotNull(actualEmrClusterDefinition); if (expectedEmrClusterDefinitionId != nu... | /**
* Validates EMR cluster definition contents against specified arguments.
*
* @param expectedEmrClusterDefinitionId the expected EMR cluster definition ID
* @param expectedNamespace the expected namespace
* @param expectedEmrClusterDefinitionName the expected EMR cluster definition name
... | Validates EMR cluster definition contents against specified arguments | validateEmrClusterDefinition | {
"repo_name": "seoj/herd",
"path": "herd-code/herd-rest/src/test/java/org/finra/herd/rest/EmrClusterDefinitionRestControllerTest.java",
"license": "apache-2.0",
"size": 67688
} | [
"org.finra.herd.model.api.xml.EmrClusterDefinition",
"org.finra.herd.model.api.xml.EmrClusterDefinitionInformation",
"org.junit.Assert"
] | import org.finra.herd.model.api.xml.EmrClusterDefinition; import org.finra.herd.model.api.xml.EmrClusterDefinitionInformation; import org.junit.Assert; | import org.finra.herd.model.api.xml.*; import org.junit.*; | [
"org.finra.herd",
"org.junit"
] | org.finra.herd; org.junit; | 1,736,679 |
@Test
public void testControl() throws Exception {
PreferencesFormBackingObject fbo = new PreferencesFormBackingObject();
fbo.setMeetingLength("30");
fbo.setAllowDoubleLength(true);
fbo.setLocation("My Office");
fbo.setNoteboard("My noteboard text.");
fbo.setTitlePrefix("Meeting title");
Errors errors... | void function() throws Exception { PreferencesFormBackingObject fbo = new PreferencesFormBackingObject(); fbo.setMeetingLength("30"); fbo.setAllowDoubleLength(true); fbo.setLocation(STR); fbo.setNoteboard(STR); fbo.setTitlePrefix(STR); Errors errors = new BindException(fbo, STR); validator.validate(fbo, errors); Assert... | /**
* Test valid input, assert no errors.
*
* @throws Exception
*/ | Test valid input, assert no errors | testControl | {
"repo_name": "Jasig/sched-assist",
"path": "sched-assist-war/src/test/java/org/jasig/schedassist/web/owner/preferences/PreferencesFormBackingObjectValidatorTest.java",
"license": "apache-2.0",
"size": 8267
} | [
"org.junit.Assert",
"org.springframework.validation.BindException",
"org.springframework.validation.Errors"
] | import org.junit.Assert; import org.springframework.validation.BindException; import org.springframework.validation.Errors; | import org.junit.*; import org.springframework.validation.*; | [
"org.junit",
"org.springframework.validation"
] | org.junit; org.springframework.validation; | 774,461 |
private void traceLevelExpressions(
RexNode[] exprs,
int[] exprLevels,
int[] levelTypeOrdinals,
int levelCount) {
StringWriter traceMsg = new StringWriter();
PrintWriter traceWriter = new PrintWriter(traceMsg);
traceWriter.println("FarragoAutoCalcRule result expressions for: ");
... | void function( RexNode[] exprs, int[] exprLevels, int[] levelTypeOrdinals, int levelCount) { StringWriter traceMsg = new StringWriter(); PrintWriter traceWriter = new PrintWriter(traceMsg); traceWriter.println(STR); traceWriter.println(program.toString()); for (int level = 0; level < levelCount; level++) { traceWriter.... | /**
* Traces the given array of level expression lists at the finer level.
*
* @param exprs Array expressions
* @param exprLevels For each expression, the ordinal of its level
* @param levelTypeOrdinals For each level, the ordinal of its type in
* the {@link... | Traces the given array of level expression lists at the finer level | traceLevelExpressions | {
"repo_name": "yeongwei/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/rel/rules/CalcRelSplitter.java",
"license": "apache-2.0",
"size": 33952
} | [
"java.io.PrintWriter",
"java.io.StringWriter",
"org.apache.calcite.rex.RexNode"
] | import java.io.PrintWriter; import java.io.StringWriter; import org.apache.calcite.rex.RexNode; | import java.io.*; import org.apache.calcite.rex.*; | [
"java.io",
"org.apache.calcite"
] | java.io; org.apache.calcite; | 852,896 |
public static void write(CharSequence data, OutputStream output)
throws IOException {
if (data != null) {
write(data.toString(), output);
}
}
| static void function(CharSequence data, OutputStream output) throws IOException { if (data != null) { write(data.toString(), output); } } | /**
* Writes chars from a <code>CharSequence</code> to bytes on an
* <code>OutputStream</code> using the default character encoding of the
* platform.
* <p>
* This method uses {@link String#getBytes()}.
*
* @param data the <code>CharSequence</code> to write, null ignored
... | Writes chars from a <code>CharSequence</code> to bytes on an <code>OutputStream</code> using the default character encoding of the platform. This method uses <code>String#getBytes()</code> | write | {
"repo_name": "rytina/dukecon_appsgenerator",
"path": "org.apache.commons.io/source-bundle/org/apache/commons/io/IOUtils.java",
"license": "epl-1.0",
"size": 62217
} | [
"java.io.IOException",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 531,395 |
public String getSrcDirectory() {
return getMavenBaseDir() + File.separator + "src";
} | String function() { return getMavenBaseDir() + File.separator + "src"; } | /**
* This will give you the <code>src</code> folder.
*
* @return The string
*/ | This will give you the <code>src</code> folder | getSrcDirectory | {
"repo_name": "khmarbaise/sapm-test",
"path": "src/test/java/com/soebes/subversion/sapm/TestBase.java",
"license": "apache-2.0",
"size": 3491
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,391,691 |
public static <TSource> double average(Enumerable<TSource> source,
DoubleFunction1<TSource> selector) {
return sum(source, selector) / longCount(source);
} | static <TSource> double function(Enumerable<TSource> source, DoubleFunction1<TSource> selector) { return sum(source, selector) / longCount(source); } | /**
* Computes the average of a sequence of Double
* values that are obtained by invoking a transform function on
* each element of the input sequence.
*/ | Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence | average | {
"repo_name": "googleinterns/calcite",
"path": "linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java",
"license": "apache-2.0",
"size": 146861
} | [
"org.apache.calcite.linq4j.function.DoubleFunction1"
] | import org.apache.calcite.linq4j.function.DoubleFunction1; | import org.apache.calcite.linq4j.function.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 444,490 |
public File getFile(MavenBuild build) throws IOException {
File f = new File(new File(new File(new File(build.getArtifactsDir(), groupId), artifactId), version), canonicalName);
if(!f.exists())
throw new IOException("Archived artifact is missing: "+f);
return f;
} | File function(MavenBuild build) throws IOException { File f = new File(new File(new File(new File(build.getArtifactsDir(), groupId), artifactId), version), canonicalName); if(!f.exists()) throw new IOException(STR+f); return f; } | /**
* Obtains the {@link File} representing the archived artifact.
*/ | Obtains the <code>File</code> representing the archived artifact | getFile | {
"repo_name": "iterate/coding-dojo",
"path": "2011-04-26-refactoring_hudson/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifact.java",
"license": "apache-2.0",
"size": 12701
} | [
"hudson.maven.MavenBuild",
"java.io.File",
"java.io.IOException"
] | import hudson.maven.MavenBuild; import java.io.File; import java.io.IOException; | import hudson.maven.*; import java.io.*; | [
"hudson.maven",
"java.io"
] | hudson.maven; java.io; | 1,792,728 |
public ServiceFuture<List<ClusterPrincipalAssignmentInner>> listAsync(String resourceGroupName, String clusterName, final ServiceCallback<List<ClusterPrincipalAssignmentInner>> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback)... | ServiceFuture<List<ClusterPrincipalAssignmentInner>> function(String resourceGroupName, String clusterName, final ServiceCallback<List<ClusterPrincipalAssignmentInner>> serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); } | /**
* Lists all Kusto cluster principalAssignments.
*
* @param resourceGroupName The name of the resource group containing the Kusto cluster.
* @param clusterName The name of the Kusto cluster.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* ... | Lists all Kusto cluster principalAssignments | listAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/kusto/mgmt-v2019_11_09/src/main/java/com/microsoft/azure/management/kusto/v2019_11_09/implementation/ClusterPrincipalAssignmentsInner.java",
"license": "mit",
"size": 46333
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture",
"java.util.List"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.List; | import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.rest",
"java.util"
] | com.microsoft.rest; java.util; | 2,549,837 |
RoleReplyInfo extractOFRoleReply(OFRoleReply rrmsg)
throws SwitchStateException; | RoleReplyInfo extractOFRoleReply(OFRoleReply rrmsg) throws SwitchStateException; | /**
* Extract the role information from an OF1.3 Role Reply Message.
* @param rrmsg role reply message
* @return RoleReplyInfo object
* @throws SwitchStateException If unknown role encountered
*/ | Extract the role information from an OF1.3 Role Reply Message | extractOFRoleReply | {
"repo_name": "sonu283304/onos",
"path": "protocols/openflow/api/src/main/java/org/onosproject/openflow/controller/driver/RoleHandler.java",
"license": "apache-2.0",
"size": 4475
} | [
"org.projectfloodlight.openflow.protocol.OFRoleReply"
] | import org.projectfloodlight.openflow.protocol.OFRoleReply; | import org.projectfloodlight.openflow.protocol.*; | [
"org.projectfloodlight.openflow"
] | org.projectfloodlight.openflow; | 2,807,224 |
@Override
public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() {
Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap =
aggregateUserAccumulators();
return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap);
} | StringifiedAccumulatorResult[] function() { Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); } | /**
* Returns the a stringified version of the user-defined accumulators.
*
* @return an Array containing the StringifiedAccumulatorResult objects
*/ | Returns the a stringified version of the user-defined accumulators | getAccumulatorResultsStringified | {
"repo_name": "aljoscha/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java",
"license": "apache-2.0",
"size": 62192
} | [
"java.util.Map",
"org.apache.flink.api.common.accumulators.Accumulator",
"org.apache.flink.runtime.accumulators.StringifiedAccumulatorResult",
"org.apache.flink.util.OptionalFailure"
] | import java.util.Map; import org.apache.flink.api.common.accumulators.Accumulator; import org.apache.flink.runtime.accumulators.StringifiedAccumulatorResult; import org.apache.flink.util.OptionalFailure; | import java.util.*; import org.apache.flink.api.common.accumulators.*; import org.apache.flink.runtime.accumulators.*; import org.apache.flink.util.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 2,898,739 |
private static Integer getIntegerProperty(Dictionary<?, ?> properties,
String propertyName) {
Integer value = null;
try {
String s = (String) properties.get(propertyName);
value = isNullOrEmpty(s) ? value : Integer.parseInt(s.trim... | static Integer function(Dictionary<?, ?> properties, String propertyName) { Integer value = null; try { String s = (String) properties.get(propertyName); value = isNullOrEmpty(s) ? value : Integer.parseInt(s.trim()); } catch (NumberFormatException ClassCastException e) { value = null; } return value; } | /**
* Get Integer property from the propertyName
* Return null if propertyName is not found.
*
* @param properties properties to be looked up
* @param propertyName the name of the property to look up
* @return value when the propertyName is defined or return null
*/ | Get Integer property from the propertyName Return null if propertyName is not found | getIntegerProperty | {
"repo_name": "CNlukai/onos-gerrit-test",
"path": "apps/fwd/src/main/java/org/onosproject/fwd/ReactiveForwarding.java",
"license": "apache-2.0",
"size": 26382
} | [
"com.google.common.base.Strings",
"java.util.Dictionary"
] | import com.google.common.base.Strings; import java.util.Dictionary; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 2,397,854 |
default Network importData(ReadOnlyDataSource dataSource, NetworkFactory networkFactory, Properties parameters, Reporter reporter) {
return importData(dataSource, networkFactory, parameters);
} | default Network importData(ReadOnlyDataSource dataSource, NetworkFactory networkFactory, Properties parameters, Reporter reporter) { return importData(dataSource, networkFactory, parameters); } | /**
* Create a model.
*
* @param dataSource data source
* @param networkFactory network factory
* @param parameters some properties to configure the import
* @param reporter the reporter used for functional logs
* @return the model
*/ | Create a model | importData | {
"repo_name": "powsybl/powsybl-core",
"path": "iidm/iidm-converter-api/src/main/java/com/powsybl/iidm/import_/Importer.java",
"license": "mpl-2.0",
"size": 3347
} | [
"com.powsybl.commons.datasource.ReadOnlyDataSource",
"com.powsybl.commons.reporter.Reporter",
"com.powsybl.iidm.network.Network",
"com.powsybl.iidm.network.NetworkFactory",
"java.util.Properties"
] | import com.powsybl.commons.datasource.ReadOnlyDataSource; import com.powsybl.commons.reporter.Reporter; import com.powsybl.iidm.network.Network; import com.powsybl.iidm.network.NetworkFactory; import java.util.Properties; | import com.powsybl.commons.datasource.*; import com.powsybl.commons.reporter.*; import com.powsybl.iidm.network.*; import java.util.*; | [
"com.powsybl.commons",
"com.powsybl.iidm",
"java.util"
] | com.powsybl.commons; com.powsybl.iidm; java.util; | 69,699 |
private List<LayerGroup> hasChildren(List<LayerGroup> layersGroups)
{
for (LayerGroup layerGroup : layersGroups)
{
layerGroup = this.hasChildren(layerGroup);
}
return layersGroups;
}
| List<LayerGroup> function(List<LayerGroup> layersGroups) { for (LayerGroup layerGroup : layersGroups) { layerGroup = this.hasChildren(layerGroup); } return layersGroups; } | /**
* Verifica se os grupos de acesso de uma lista de grupos de acessos tem filhos
* @param accessGroups
* @param published
* @return
*/ | Verifica se os grupos de acesso de uma lista de grupos de acessos tem filhos | hasChildren | {
"repo_name": "eitsopensource/geocab",
"path": "solution/src/main/java/br/com/geocab/domain/service/LayerGroupService.java",
"license": "gpl-2.0",
"size": 42389
} | [
"br.com.geocab.domain.entity.layer.LayerGroup",
"java.util.List"
] | import br.com.geocab.domain.entity.layer.LayerGroup; import java.util.List; | import br.com.geocab.domain.entity.layer.*; import java.util.*; | [
"br.com.geocab",
"java.util"
] | br.com.geocab; java.util; | 1,933,140 |
@Test
public void testAddUser() {
final int firstId = 123;
boolean result = instance.addUser(new User(firstId));
boolean expResult = true;
assertEquals(expResult, result);
} | void function() { final int firstId = 123; boolean result = instance.addUser(new User(firstId)); boolean expResult = true; assertEquals(expResult, result); } | /**
* Test of addUser method.
*/ | Test of addUser method | testAddUser | {
"repo_name": "CkimiHoK/JavaFromZeroToJunior",
"path": "javalearning/Chapter7/src/test/java/ru/aveselov/lesson3/userstorage/UserStorageTest.java",
"license": "apache-2.0",
"size": 4561
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 739,386 |
private CodePattern buildCodePattern_ONE_VS_ONE(Attribute classLabel) {
int numberOfClasses = classLabel.getMapping().size();
int numberOfCombinations = (numberOfClasses * (numberOfClasses -1)) / 2;
String[] classIndexMap = new String[numberOfClasses];
CodePattern cP = new CodePattern(numberOfClasses, n... | CodePattern function(Attribute classLabel) { int numberOfClasses = classLabel.getMapping().size(); int numberOfCombinations = (numberOfClasses * (numberOfClasses -1)) / 2; String[] classIndexMap = new String[numberOfClasses]; CodePattern cP = new CodePattern(numberOfClasses, numberOfCombinations); modelNames.clear(); f... | /**
* Builds a code pattern according to the "1 against 1" classification scheme.
*/ | Builds a code pattern according to the "1 against 1" classification scheme | buildCodePattern_ONE_VS_ONE | {
"repo_name": "ntj/ComplexRapidMiner",
"path": "src/com/rapidminer/operator/learner/meta/Binary2MultiClassLearner.java",
"license": "gpl-2.0",
"size": 14591
} | [
"com.rapidminer.example.Attribute"
] | import com.rapidminer.example.Attribute; | import com.rapidminer.example.*; | [
"com.rapidminer.example"
] | com.rapidminer.example; | 239,948 |
public SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst) throws SSLException {
return wrap(new ByteBuffer[] { src }, 0, 1, dst);
} | SSLEngineResult function(ByteBuffer src, ByteBuffer dst) throws SSLException { return wrap(new ByteBuffer[] { src }, 0, 1, dst); } | /**
* Encodes the outgoing application data buffer into the network data
* buffer. If a handshake has not been started yet, it will automatically be
* started.
*
* @param src
* the source buffers of outgoing application data.
* @param dst
* the destination b... | Encodes the outgoing application data buffer into the network data buffer. If a handshake has not been started yet, it will automatically be started | wrap | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "libcore/luni/src/main/java/javax/net/ssl/SSLEngine.java",
"license": "gpl-3.0",
"size": 36770
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,878,868 |
private String getSigningTenantDomain(OAuthAppDO oAuthAppDO) {
boolean isJWTSignedWithSPKey = OAuthServerConfiguration.getInstance().isJWTSignedWithSPKey();
String signingTenantDomain;
if (isJWTSignedWithSPKey) {
// Tenant domain of the SP.
signingTenantDomain = get... | String function(OAuthAppDO oAuthAppDO) { boolean isJWTSignedWithSPKey = OAuthServerConfiguration.getInstance().isJWTSignedWithSPKey(); String signingTenantDomain; if (isJWTSignedWithSPKey) { signingTenantDomain = getTenanatDomain(oAuthAppDO); } else { signingTenantDomain = oAuthAppDO.getUser().getTenantDomain(); } retu... | /**
* Returns signing tenant domain.
*
* @param oAuthAppDO
* @return
*/ | Returns signing tenant domain | getSigningTenantDomain | {
"repo_name": "IsuraD/identity-inbound-auth-oauth",
"path": "components/org.wso2.carbon.identity.oidc.session/src/main/java/org/wso2/carbon/identity/oidc/session/backchannellogout/DefaultLogoutTokenBuilder.java",
"license": "apache-2.0",
"size": 15043
} | [
"org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration",
"org.wso2.carbon.identity.oauth.dao.OAuthAppDO"
] | import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration; import org.wso2.carbon.identity.oauth.dao.OAuthAppDO; | import org.wso2.carbon.identity.oauth.config.*; import org.wso2.carbon.identity.oauth.dao.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 1,853,561 |
QiitaResponse<List<Comment>> getComments(String itemId) throws QiitaException; | QiitaResponse<List<Comment>> getComments(String itemId) throws QiitaException; | /**
* Returns the comments which are attached to the item in descending order of creation time.
* Can be used even with unauthenticated.
*
* @param itemId the target item identifier
* @return the comments which are attached to the item
* @throws QiitaException if arguments are incorrect or... | Returns the comments which are attached to the item in descending order of creation time. Can be used even with unauthenticated | getComments | {
"repo_name": "Yuiki/Qiita4Jv2",
"path": "src/main/java/jp/yuiki/dev/qiita4jv2/resources/CommentsResources.java",
"license": "mit",
"size": 2202
} | [
"java.util.List",
"jp.yuiki.dev.qiita4jv2.QiitaException",
"jp.yuiki.dev.qiita4jv2.QiitaResponse",
"jp.yuiki.dev.qiita4jv2.enitity.Comment"
] | import java.util.List; import jp.yuiki.dev.qiita4jv2.QiitaException; import jp.yuiki.dev.qiita4jv2.QiitaResponse; import jp.yuiki.dev.qiita4jv2.enitity.Comment; | import java.util.*; import jp.yuiki.dev.qiita4jv2.*; import jp.yuiki.dev.qiita4jv2.enitity.*; | [
"java.util",
"jp.yuiki.dev"
] | java.util; jp.yuiki.dev; | 2,911,620 |
public static String getFiles() {
StringBuilder sb = new StringBuilder();
for (File f : fileList) {
try {
sb.append(f.getCanonicalPath());
sb.append(";");
} catch(IOException ex) {
ErrorManager.logError("Unable to find canonical path for '" + f.toString() + "' when saving recent documents");
... | static String function() { StringBuilder sb = new StringBuilder(); for (File f : fileList) { try { sb.append(f.getCanonicalPath()); sb.append(";"); } catch(IOException ex) { ErrorManager.logError(STR + f.toString() + STR); } } if (sb.length() > 0) sb.delete(sb.length() - 1, sb.length()); return sb.toString(); } | /**
* Get the files as a string.
* @return Duh
*/ | Get the files as a string | getFiles | {
"repo_name": "jpverkamp/wombat-ide",
"path": "ide/src/wombat/util/files/RecentDocumentManager.java",
"license": "bsd-3-clause",
"size": 3708
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,190,455 |
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
... | Observable<ServiceResponse<Void>> function(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (routeTableName == null) { throw new IllegalArgumentException(STR); } if (routeName == null) { throw new IllegalArgumentException... | /**
* Deletes the specified route from a route table.
*
* @param resourceGroupName The name of the resource group.
* @param routeTableName The name of the route table.
* @param routeName The name of the route.
* @throws IllegalArgumentException thrown if parameters fail the validation
... | Deletes the specified route from a route table | beginDeleteWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/network/v2020_06_01/implementation/RoutesInner.java",
"license": "mit",
"size": 43032
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,305,936 |
private Object _evaluateLeftContainsRight(Object element, String lvalue,
String rvalue) {
if (element instanceof List) {
return evaluateLeftContainsRight((List) element, lvalue, rvalue);
} else {
return evaluateLeftContainsRight((StructuredContent) element, lvalue... | Object function(Object element, String lvalue, String rvalue) { if (element instanceof List) { return evaluateLeftContainsRight((List) element, lvalue, rvalue); } else { return evaluateLeftContainsRight((StructuredContent) element, lvalue, rvalue); } } | /**
* This internal method simply makes a type safe call the the proper
* abstract method based on the type of element passed.
*
* @param element either a StructuredContent or List object.
* @param lvalue lvalue of predicate expression
* @param rvalue rvalue of predicate expression
* ... | This internal method simply makes a type safe call the the proper abstract method based on the type of element passed | _evaluateLeftContainsRight | {
"repo_name": "JrmyDev/CodenameOne",
"path": "CodenameOne/src/com/codename1/processing/AbstractEvaluator.java",
"license": "gpl-2.0",
"size": 19710
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,362,648 |
RemoteVersion getRemoteVersion(Version version) throws RemoteException; | RemoteVersion getRemoteVersion(Version version) throws RemoteException; | /**
* Returns a remote adapter for the given local version.
*
* @param version local version
* @return remote version adapter
* @throws RemoteException on RMI errors
*/ | Returns a remote adapter for the given local version | getRemoteVersion | {
"repo_name": "apache/jackrabbit",
"path": "jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/RemoteAdapterFactory.java",
"license": "apache-2.0",
"size": 17504
} | [
"java.rmi.RemoteException",
"javax.jcr.version.Version",
"org.apache.jackrabbit.rmi.remote.RemoteVersion"
] | import java.rmi.RemoteException; import javax.jcr.version.Version; import org.apache.jackrabbit.rmi.remote.RemoteVersion; | import java.rmi.*; import javax.jcr.version.*; import org.apache.jackrabbit.rmi.remote.*; | [
"java.rmi",
"javax.jcr",
"org.apache.jackrabbit"
] | java.rmi; javax.jcr; org.apache.jackrabbit; | 1,491,757 |
@Test
public void testLazyUnionNested() throws Throwable {
for(int i = 2; i < EXTENDED_LEVEL_THRESHOLD; i++ ){
testNestedinArrayAtLevelExtended(i, ObjectInspector.Category.UNION);
}
} | void function() throws Throwable { for(int i = 2; i < EXTENDED_LEVEL_THRESHOLD; i++ ){ testNestedinArrayAtLevelExtended(i, ObjectInspector.Category.UNION); } } | /**
* Test the LazyUnion class with multiple levels of nesting
*/ | Test the LazyUnion class with multiple levels of nesting | testLazyUnionNested | {
"repo_name": "vineetgarg02/hive",
"path": "serde/src/test/org/apache/hadoop/hive/serde2/lazy/TestLazyArrayMapStruct.java",
"license": "apache-2.0",
"size": 31812
} | [
"org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector"
] | import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; | import org.apache.hadoop.hive.serde2.objectinspector.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,528,773 |
@Test
public void testResourcesForDeltaIteration() throws Exception{
ResourceSpec resource1 = ResourceSpec.newBuilder().setCpuCores(0.1).setHeapMemoryInMB(100).build();
ResourceSpec resource2 = ResourceSpec.newBuilder().setCpuCores(0.2).setHeapMemoryInMB(200).build();
ResourceSpec resource3 = ResourceSpec.new... | void function() throws Exception{ ResourceSpec resource1 = ResourceSpec.newBuilder().setCpuCores(0.1).setHeapMemoryInMB(100).build(); ResourceSpec resource2 = ResourceSpec.newBuilder().setCpuCores(0.2).setHeapMemoryInMB(200).build(); ResourceSpec resource3 = ResourceSpec.newBuilder().setCpuCores(0.3).setHeapMemoryInMB(... | /**
* Verifies that the resources are set onto each job vertex correctly when generating job graph
* which covers the delta iteration case
*/ | Verifies that the resources are set onto each job vertex correctly when generating job graph which covers the delta iteration case | testResourcesForDeltaIteration | {
"repo_name": "ueshin/apache-flink",
"path": "flink-optimizer/src/test/java/org/apache/flink/optimizer/plantranslate/JobGraphGeneratorTest.java",
"license": "apache-2.0",
"size": 12536
} | [
"java.lang.reflect.Method",
"org.apache.flink.api.common.operators.ResourceSpec",
"org.apache.flink.api.java.operators.DataSink",
"org.apache.flink.api.java.operators.DeltaIteration",
"org.apache.flink.api.java.operators.Operator"
] | import java.lang.reflect.Method; import org.apache.flink.api.common.operators.ResourceSpec; import org.apache.flink.api.java.operators.DataSink; import org.apache.flink.api.java.operators.DeltaIteration; import org.apache.flink.api.java.operators.Operator; | import java.lang.reflect.*; import org.apache.flink.api.common.operators.*; import org.apache.flink.api.java.operators.*; | [
"java.lang",
"org.apache.flink"
] | java.lang; org.apache.flink; | 734,975 |
public void testDefaultExecutor() {
CompletableFuture<Integer> f = new CompletableFuture<>();
Executor e = f.defaultExecutor();
Executor c = ForkJoinPool.commonPool();
if (ForkJoinPool.getCommonPoolParallelism() > 1)
assertSame(e, c);
else
assertNotSam... | void function() { CompletableFuture<Integer> f = new CompletableFuture<>(); Executor e = f.defaultExecutor(); Executor c = ForkJoinPool.commonPool(); if (ForkJoinPool.getCommonPoolParallelism() > 1) assertSame(e, c); else assertNotSame(e, c); } | /**
* defaultExecutor by default returns the commonPool if
* it supports more than one thread.
*/ | defaultExecutor by default returns the commonPool if it supports more than one thread | testDefaultExecutor | {
"repo_name": "FauxFaux/jdk9-jdk",
"path": "test/java/util/concurrent/tck/CompletableFutureTest.java",
"license": "gpl-2.0",
"size": 175854
} | [
"java.util.concurrent.CompletableFuture",
"java.util.concurrent.Executor",
"java.util.concurrent.ForkJoinPool"
] | import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.concurrent.ForkJoinPool; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 563,715 |
public void registerAll(MetricRegistry metricRegistry, String prefix) {
metricRegistry.register(MetricRegistry.name(prefix, QUEUE_SIZE), this.queueSizeGauge);
metricRegistry.register(MetricRegistry.name(prefix, FILL_RATIO), this.fillRatioGauge);
metricRegistry.register(MetricRegistry.name(prefix, ... | void function(MetricRegistry metricRegistry, String prefix) { metricRegistry.register(MetricRegistry.name(prefix, QUEUE_SIZE), this.queueSizeGauge); metricRegistry.register(MetricRegistry.name(prefix, FILL_RATIO), this.fillRatioGauge); metricRegistry.register(MetricRegistry.name(prefix, PUT_ATTEMPT_RATE), this.putsRate... | /**
* Register all statistics as {@link com.codahale.metrics.Metric}s with a
* {@link com.codahale.metrics.MetricRegistry}.
*
* @param metricRegistry the {@link com.codahale.metrics.MetricRegistry} to register with
* @param prefix metric name prefix
*/ | Register all statistics as <code>com.codahale.metrics.Metric</code>s with a <code>com.codahale.metrics.MetricRegistry</code> | registerAll | {
"repo_name": "PaytmLabs/gobblin",
"path": "gobblin-runtime/src/main/java/gobblin/runtime/BoundedBlockingRecordQueue.java",
"license": "apache-2.0",
"size": 9671
} | [
"com.codahale.metrics.MetricRegistry"
] | import com.codahale.metrics.MetricRegistry; | import com.codahale.metrics.*; | [
"com.codahale.metrics"
] | com.codahale.metrics; | 1,632,958 |
public Timestamp getCreated();
public static final String COLUMNNAME_CreatedBy = "CreatedBy"; | Timestamp function(); public static final String COLUMNNAME_CreatedBy = STR; | /** Get Created.
* Date this record was created
*/ | Get Created. Date this record was created | getCreated | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/I_M_DistributionRun.java",
"license": "gpl-2.0",
"size": 6193
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,684,894 |
public static Charset getDefaultSystemCharset() {
Charset charset = null;
try {
charset = Charset.forName(System.getProperty(FILE_ENCODING_PROPERTY));
} catch (Exception e) {
// Null is OK here.
}
return charset;
} | static Charset function() { Charset charset = null; try { charset = Charset.forName(System.getProperty(FILE_ENCODING_PROPERTY)); } catch (Exception e) { } return charset; } | /**
* Retrieve the default charset of the system.
*
* @return the default <code>Charset</code>.
*/ | Retrieve the default charset of the system | getDefaultSystemCharset | {
"repo_name": "jexp/idea2",
"path": "platform/platform-api/src/com/intellij/openapi/vfs/CharsetToolkit.java",
"license": "apache-2.0",
"size": 17059
} | [
"java.nio.charset.Charset"
] | import java.nio.charset.Charset; | import java.nio.charset.*; | [
"java.nio"
] | java.nio; | 195,541 |
public void decodeXML(Element element) throws InvalidLLRPMessageException; | void function(Element element) throws InvalidLLRPMessageException; | /**
* decode parameter from xml.
* @param element to be decoded
*/ | decode parameter from xml | decodeXML | {
"repo_name": "mksmbrtsh/LLRPexplorer",
"path": "src/org/llrp/ltk/generated/interfaces/AirProtocolEPCMemorySelector.java",
"license": "apache-2.0",
"size": 1795
} | [
"org.jdom2.Element",
"org.llrp.ltk.exceptions.InvalidLLRPMessageException"
] | import org.jdom2.Element; import org.llrp.ltk.exceptions.InvalidLLRPMessageException; | import org.jdom2.*; import org.llrp.ltk.exceptions.*; | [
"org.jdom2",
"org.llrp.ltk"
] | org.jdom2; org.llrp.ltk; | 768,821 |
public void testManagerSkipsIndicesWithUpToDateMappings() {
SystemIndices systemIndices = new SystemIndices(Map.of("MyIndex", FEATURE));
SystemIndexManager manager = new SystemIndexManager(systemIndices, client);
assertThat(manager.getUpgradeStatus(markShardsAvailable(createClusterState()),... | void function() { SystemIndices systemIndices = new SystemIndices(Map.of(STR, FEATURE)); SystemIndexManager manager = new SystemIndexManager(systemIndices, client); assertThat(manager.getUpgradeStatus(markShardsAvailable(createClusterState()), DESCRIPTOR), equalTo(UpgradeStatus.UP_TO_DATE)); } | /**
* Check that the manager won't try to upgrade indices where their mappings are already up-to-date.
*/ | Check that the manager won't try to upgrade indices where their mappings are already up-to-date | testManagerSkipsIndicesWithUpToDateMappings | {
"repo_name": "jmluy/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/indices/SystemIndexManagerTests.java",
"license": "apache-2.0",
"size": 18713
} | [
"java.util.Map",
"org.elasticsearch.indices.SystemIndexManager",
"org.hamcrest.Matchers"
] | import java.util.Map; import org.elasticsearch.indices.SystemIndexManager; import org.hamcrest.Matchers; | import java.util.*; import org.elasticsearch.indices.*; import org.hamcrest.*; | [
"java.util",
"org.elasticsearch.indices",
"org.hamcrest"
] | java.util; org.elasticsearch.indices; org.hamcrest; | 1,951,423 |
@Override
public void freeSlot(SlotID slotId, AllocationID allocationId) {
checkInit();
LOG.debug("Freeing slot {}.", slotId);
slotTracker.notifyFree(slotId);
checkResourceRequirements();
}
// -----------------------------------------------------------------------------... | void function(SlotID slotId, AllocationID allocationId) { checkInit(); LOG.debug(STR, slotId); slotTracker.notifyFree(slotId); checkResourceRequirements(); } | /**
* Free the given slot from the given allocation. If the slot is still allocated by the given
* allocation id, then the slot will be marked as free and will be subject to new slot requests.
*
* @param slotId identifying the slot to free
* @param allocationId with which the slot is presumably... | Free the given slot from the given allocation. If the slot is still allocated by the given allocation id, then the slot will be marked as free and will be subject to new slot requests | freeSlot | {
"repo_name": "kl0u/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/DeclarativeSlotManager.java",
"license": "apache-2.0",
"size": 31638
} | [
"org.apache.flink.runtime.clusterframework.types.AllocationID",
"org.apache.flink.runtime.clusterframework.types.SlotID"
] | import org.apache.flink.runtime.clusterframework.types.AllocationID; import org.apache.flink.runtime.clusterframework.types.SlotID; | import org.apache.flink.runtime.clusterframework.types.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,228,734 |
private void prepareInitialStack(float[] inputs, int inputOffset) {
this.stack = new Stack<>();
for (int i = inputOffset; i < inputs.length; i++) {
this.stack.push((double) inputs[i]);
}
}
| void function(float[] inputs, int inputOffset) { this.stack = new Stack<>(); for (int i = inputOffset; i < inputs.length; i++) { this.stack.push((double) inputs[i]); } } | /*************************************************************************
* Put all input values on the initial stack.
* All values are pushed as Double because we calculate internally with double.
* @param inputs
* @param inputOffset
************************************************************************/ | Put all input values on the initial stack. All values are pushed as Double because we calculate internally with double | prepareInitialStack | {
"repo_name": "oswetto/LoboEvolution",
"path": "LoboPDF/src/main/java/org/loboevolution/pdfview/function/FunctionType4.java",
"license": "gpl-3.0",
"size": 4474
} | [
"java.util.Stack"
] | import java.util.Stack; | import java.util.*; | [
"java.util"
] | java.util; | 1,880,516 |
private void doTest() {
final PsiFile file = myFixture.configureByFile(getTestName(true) + '.' + CommandLineFileType.EXTENSION);
Assert.assertSame("Bad file type!", CommandLineFile.class, file.getClass());
final CommandLineFile commandLineFile = (CommandLineFile)file;
commandLineFile.setCommands(Comma... | void function() { final PsiFile file = myFixture.configureByFile(getTestName(true) + '.' + CommandLineFileType.EXTENSION); Assert.assertSame(STR, CommandLineFile.class, file.getClass()); final CommandLineFile commandLineFile = (CommandLineFile)file; commandLineFile.setCommands(CommandTestTools.createCommands()); myFixt... | /**
* Enables inspection on testName.cmdline and checks it.
*/ | Enables inspection on testName.cmdline and checks it | doTest | {
"repo_name": "jwren/intellij-community",
"path": "python/testSrc/com/jetbrains/commandInterface/commandLine/CommandLineInspectionTest.java",
"license": "apache-2.0",
"size": 2070
} | [
"com.intellij.psi.PsiFile",
"com.jetbrains.commandInterface.commandLine.psi.CommandLineFile",
"org.junit.Assert"
] | import com.intellij.psi.PsiFile; import com.jetbrains.commandInterface.commandLine.psi.CommandLineFile; import org.junit.Assert; | import com.intellij.psi.*; import com.jetbrains.*; import org.junit.*; | [
"com.intellij.psi",
"com.jetbrains",
"org.junit"
] | com.intellij.psi; com.jetbrains; org.junit; | 1,237,681 |
public static String hashAs(String toHash, HashingType hashType) throws IOException
{
hashLog.finest("Hashing string " + toHash + " as " + hashType.getHashType());
try(BufferedInputStream sread = new BufferedInputStream(new ByteArrayInputStream(toHash.getBytes("UTF-8"))))
{
return hashAs(sread, hashType... | static String function(String toHash, HashingType hashType) throws IOException { hashLog.finest(STR + toHash + STR + hashType.getHashType()); try(BufferedInputStream sread = new BufferedInputStream(new ByteArrayInputStream(toHash.getBytes("UTF-8")))) { return hashAs(sread, hashType); } } | /**
* Hashes a string as a string of hexadecimal values via the specified hashing
* algorithm.
* @param toHash The string to hash
* @param hashType The type of algorithm to apply to the string
* @return The string as it is hashed by the specified hashing algorithm; if
* hashing fails, return nul... | Hashes a string as a string of hexadecimal values via the specified hashing algorithm | hashAs | {
"repo_name": "CenturionFox/asapi-java",
"path": "src/com/attributestudios/api/util/crypto/HashUtils.java",
"license": "gpl-2.0",
"size": 6299
} | [
"java.io.BufferedInputStream",
"java.io.ByteArrayInputStream",
"java.io.IOException"
] | import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,894,110 |
public int getMetaFromState(IBlockState state)
{
int i = 0;
i = i | ((EnumFacing)state.getValue(FACING)).getIndex();
if (((Boolean)state.getValue(EXTENDED)).booleanValue())
{
i |= 8;
}
return i;
} | int function(IBlockState state) { int i = 0; i = i ((EnumFacing)state.getValue(FACING)).getIndex(); if (((Boolean)state.getValue(EXTENDED)).booleanValue()) { i = 8; } return i; } | /**
* Convert the BlockState into the correct metadata value
*/ | Convert the BlockState into the correct metadata value | getMetaFromState | {
"repo_name": "TorchPowered/CraftBloom",
"path": "src/net/minecraft/block/BlockPistonBase.java",
"license": "mit",
"size": 17498
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.EnumFacing"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing; | import net.minecraft.block.state.*; import net.minecraft.util.*; | [
"net.minecraft.block",
"net.minecraft.util"
] | net.minecraft.block; net.minecraft.util; | 246,562 |
public static PublicKey generatePublicKey(String encodedPublicKey) {
try {
byte[] decodedKey = Base64.decode(encodedPublicKey);
KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM);
return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey));
... | static PublicKey function(String encodedPublicKey) { try { byte[] decodedKey = Base64.decode(encodedPublicKey); KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM); return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey)); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e... | /**
* Generates a PublicKey instance from a string containing the
* Base64-encoded public key.
*
* @param encodedPublicKey Base64-encoded public key
* @throws IllegalArgumentException if encodedPublicKey is invalid
*/ | Generates a PublicKey instance from a string containing the Base64-encoded public key | generatePublicKey | {
"repo_name": "0359xiaodong/turbo-editor",
"path": "libraries/sharedCode/src/main/java/sharedcode/turboeditor/iab/utils/Security.java",
"license": "gpl-3.0",
"size": 5118
} | [
"android.util.Log",
"java.security.KeyFactory",
"java.security.NoSuchAlgorithmException",
"java.security.PublicKey",
"java.security.spec.InvalidKeySpecException",
"java.security.spec.X509EncodedKeySpec"
] | import android.util.Log; import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; | import android.util.*; import java.security.*; import java.security.spec.*; | [
"android.util",
"java.security"
] | android.util; java.security; | 2,795,296 |
@Deprecated
String render(
SoyTemplateInfo templateInfo, @Nullable SoyRecord data, @Nullable SoyMsgBundle msgBundle); | String render( SoyTemplateInfo templateInfo, @Nullable SoyRecord data, @Nullable SoyMsgBundle msgBundle); | /**
* Renders a template.
*
* @param templateInfo Info for the template to render.
* @param data The data to call the template with. Can be null if the template has no parameters.
* @param msgBundle The bundle of translated messages, or null to use the messages from the
* Soy source.
* @return ... | Renders a template | render | {
"repo_name": "iacdingping/closure-templates",
"path": "java/src/com/google/template/soy/tofu/SoyTofu.java",
"license": "apache-2.0",
"size": 11258
} | [
"com.google.template.soy.data.SoyRecord",
"com.google.template.soy.msgs.SoyMsgBundle",
"com.google.template.soy.parseinfo.SoyTemplateInfo",
"javax.annotation.Nullable"
] | import com.google.template.soy.data.SoyRecord; import com.google.template.soy.msgs.SoyMsgBundle; import com.google.template.soy.parseinfo.SoyTemplateInfo; import javax.annotation.Nullable; | import com.google.template.soy.data.*; import com.google.template.soy.msgs.*; import com.google.template.soy.parseinfo.*; import javax.annotation.*; | [
"com.google.template",
"javax.annotation"
] | com.google.template; javax.annotation; | 2,687,473 |
protected void createFixture() throws Exception {
//Start of user code createFixture
System.out.println("create fixture:"+getQuallifiedContractName());
SolidityContractDetails compiledContract = getCompiledContract("/mix/combine.json");
CompletableFuture<EthAddress> address = ethereum.publishContract(compile... | void function() throws Exception { System.out.println(STR+getQuallifiedContractName()); SolidityContractDetails compiledContract = getCompiledContract(STR); CompletableFuture<EthAddress> address = ethereum.publishContract(compiledContract, sender); fixtureAddress = address.get(); setFixture(ethereum.createContractProxy... | /**
* Create a new fixture by deploying the contract source.
* @throws Exception
*/ | Create a new fixture by deploying the contract source | createFixture | {
"repo_name": "KuekenPartei/party-contracts",
"path": "src/test/java/de/kueken/ethereum/party/party/ConferenceTest.java",
"license": "gpl-3.0",
"size": 3112
} | [
"java.util.concurrent.CompletableFuture",
"org.adridadou.ethereum.propeller.solidity.SolidityContractDetails",
"org.adridadou.ethereum.propeller.values.EthAddress"
] | import java.util.concurrent.CompletableFuture; import org.adridadou.ethereum.propeller.solidity.SolidityContractDetails; import org.adridadou.ethereum.propeller.values.EthAddress; | import java.util.concurrent.*; import org.adridadou.ethereum.propeller.solidity.*; import org.adridadou.ethereum.propeller.values.*; | [
"java.util",
"org.adridadou.ethereum"
] | java.util; org.adridadou.ethereum; | 2,647,948 |
public HFileArchiveManager disableHFileBackup(byte[] table) throws KeeperException {
disable(this.zooKeeper, table);
return this;
} | HFileArchiveManager function(byte[] table) throws KeeperException { disable(this.zooKeeper, table); return this; } | /**
* Stop retaining HFiles for the given table in the archive. HFiles will be cleaned up on the next
* pass of the {@link org.apache.hadoop.hbase.master.cleaner.HFileCleaner}, if the HFiles are retained by another
* cleaner.
* @param table name of the table for which to disable hfile retention.
* @retur... | Stop retaining HFiles for the given table in the archive. HFiles will be cleaned up on the next pass of the <code>org.apache.hadoop.hbase.master.cleaner.HFileCleaner</code>, if the HFiles are retained by another cleaner | disableHFileBackup | {
"repo_name": "ultratendency/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/HFileArchiveManager.java",
"license": "apache-2.0",
"size": 6571
} | [
"org.apache.zookeeper.KeeperException"
] | import org.apache.zookeeper.KeeperException; | import org.apache.zookeeper.*; | [
"org.apache.zookeeper"
] | org.apache.zookeeper; | 1,828,697 |
EAttribute getTFServoConfiguration_Velocity(); | EAttribute getTFServoConfiguration_Velocity(); | /**
* Returns the meta object for the attribute '{@link org.openhab.binding.tinkerforge.internal.model.TFServoConfiguration#getVelocity <em>Velocity</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Velocity</em>'.
* @see org.openhab.binding.tinker... | Returns the meta object for the attribute '<code>org.openhab.binding.tinkerforge.internal.model.TFServoConfiguration#getVelocity Velocity</code>'. | getTFServoConfiguration_Velocity | {
"repo_name": "gregfinley/openhab",
"path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java",
"license": "epl-1.0",
"size": 665067
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 64,028 |
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
} | Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } | /**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/ | Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods | applyToAllUnaryMethods | {
"repo_name": "googleads/google-ads-java",
"path": "google-ads-stubs-v9/src/main/java/com/google/ads/googleads/v9/services/stub/BillingSetupServiceStubSettings.java",
"license": "apache-2.0",
"size": 12620
} | [
"com.google.api.core.ApiFunction",
"com.google.api.gax.rpc.UnaryCallSettings"
] | import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings; | import com.google.api.core.*; import com.google.api.gax.rpc.*; | [
"com.google.api"
] | com.google.api; | 188,580 |
@Test
public void testInsert9() throws Exception {
Mapper1 mapper = factory.createMapper(Mapper1.class);
Article article1 = new Article();
article1.setId(456);
article1.setSubject("Modello");
article1.setYear(2008);
execute("ALTER SEQUENCE ids RESTART WITH 9854"... | void function() throws Exception { Mapper1 mapper = factory.createMapper(Mapper1.class); Article article1 = new Article(); article1.setId(456); article1.setSubject(STR); article1.setYear(2008); execute(STR); mapper.insertArticle9(article1); Assert.assertEquals(9854, article1.getId()); Article article2 = mapper.getArtic... | /**
* Test retrieving generated keys via JDBC and returning it via property.
*/ | Test retrieving generated keys via JDBC and returning it via property | testInsert9 | {
"repo_name": "idubrov/nanorm",
"path": "src/test/java/com/google/code/nanorm/test/updates/TestSimpleUpdates.java",
"license": "apache-2.0",
"size": 12483
} | [
"com.google.code.nanorm.test.beans.Article",
"org.junit.Assert"
] | import com.google.code.nanorm.test.beans.Article; import org.junit.Assert; | import com.google.code.nanorm.test.beans.*; import org.junit.*; | [
"com.google.code",
"org.junit"
] | com.google.code; org.junit; | 2,497,700 |
else if (ident.equals("horizontalStack"))
{
layout = new mxStackLayout(graph, true)
{
public mxRectangle getContainerSize()
{
return graphComponent.getLayoutAreaSize();
}
};
}
else if (ident.equals("circleLayout"))
{
layout = new mxCircleLayout(graph);
}
}
... | else if (ident.equals(STR)) { layout = new mxStackLayout(graph, true) { mxRectangle function() { return graphComponent.getLayoutAreaSize(); } }; } else if (ident.equals(STR)) { layout = new mxCircleLayout(graph); } } return layout; } | /**
* Overrides the empty implementation to return the size of the
* graph control.
*/ | Overrides the empty implementation to return the size of the graph control | getContainerSize | {
"repo_name": "alect/Puzzledice",
"path": "Tools/PuzzleMapEditor/src/com/mxgraph/examples/swing/editor/BasicGraphEditor.java",
"license": "mit",
"size": 19768
} | [
"com.mxgraph.layout.mxCircleLayout",
"com.mxgraph.layout.mxStackLayout"
] | import com.mxgraph.layout.mxCircleLayout; import com.mxgraph.layout.mxStackLayout; | import com.mxgraph.layout.*; | [
"com.mxgraph.layout"
] | com.mxgraph.layout; | 1,978,053 |
public static void testFakeQuery() throws OpenRDFException, IOException {
Repository repo = new SailRepository(new MemoryStore());
repo.initialize();
System.out.println("Load ontology");
URL ontology = new URL(
"file:///C:/Users/heegt/Desktop/Personal/CS7900 Web 3.0/Project/Ontology/crime-event-on... | static void function() throws OpenRDFException, IOException { Repository repo = new SailRepository(new MemoryStore()); repo.initialize(); System.out.println(STR); URL ontology = new URL( STRCreate fake eventsSTRQuery all thefts...STRQuery worst crime...STRQuery:STRResult:"); results = WorstCrimeQuery.executeQuery(repo)... | /**
* Test executing fake queries.
*
* @throws OpenRDFException
* @throws IOException
*/ | Test executing fake queries | testFakeQuery | {
"repo_name": "timheeg/crime-event-web",
"path": "src/demo/RepoTest.java",
"license": "mit",
"size": 4020
} | [
"java.io.IOException",
"org.openrdf.OpenRDFException",
"org.openrdf.repository.Repository",
"org.openrdf.repository.sail.SailRepository",
"org.openrdf.sail.memory.MemoryStore"
] | import java.io.IOException; import org.openrdf.OpenRDFException; import org.openrdf.repository.Repository; import org.openrdf.repository.sail.SailRepository; import org.openrdf.sail.memory.MemoryStore; | import java.io.*; import org.openrdf.*; import org.openrdf.repository.*; import org.openrdf.repository.sail.*; import org.openrdf.sail.memory.*; | [
"java.io",
"org.openrdf",
"org.openrdf.repository",
"org.openrdf.sail"
] | java.io; org.openrdf; org.openrdf.repository; org.openrdf.sail; | 1,197,617 |
public static ValueBuilder outBody() {
return Builder.outBody();
} | static ValueBuilder function() { return Builder.outBody(); } | /**
* Returns a predicate and value builder for the outbound body on an
* exchange
*/ | Returns a predicate and value builder for the outbound body on an exchange | outBody | {
"repo_name": "shuliangtao/apache-camel-2.13.0-src",
"path": "components/camel-test/src/main/java/org/apache/camel/test/junit4/TestSupport.java",
"license": "apache-2.0",
"size": 19853
} | [
"org.apache.camel.builder.Builder",
"org.apache.camel.builder.ValueBuilder"
] | import org.apache.camel.builder.Builder; import org.apache.camel.builder.ValueBuilder; | import org.apache.camel.builder.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,178,965 |
private void updateRandomSampleOfNRecords(final ResultSet rs,
final Map<Integer, String> rows,
final Set<Integer> updatedRows,
final int k)
throws SQLException
{
... | void function(final ResultSet rs, final Map<Integer, String> rows, final Set<Integer> updatedRows, final int k) throws SQLException { List sampledKeys = createRandomSample(rows, k); println(STR + sampledKeys); ResultSetMetaData meta = rs.getMetaData(); for (Iterator i = sampledKeys.iterator(); i.hasNext();) { Integer k... | /**
* Update a random sample of n records in the resultset
* @param rs result set to be updated
* @param rows map of rows, will also be updated
* @param updatedRows set of being updated (position in RS)
* @param k number of records to be updated
*/ | Update a random sample of n records in the resultset | updateRandomSampleOfNRecords | {
"repo_name": "trejkaz/derby",
"path": "java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java",
"license": "apache-2.0",
"size": 22609
} | [
"java.sql.ResultSet",
"java.sql.ResultSetMetaData",
"java.sql.SQLException",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"java.util.Set"
] | import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 95,284 |
void postCall(HttpRequest request, HttpResponseStatus status, HandlerInfo handlerInfo); | void postCall(HttpRequest request, HttpResponseStatus status, HandlerInfo handlerInfo); | /**
* postCall is run after a handler method call is made. If any of the postCalls throw and exception then the
* remaining postCalls will still be called. If the handler method was not called then postCall hooks will not be
* called.
*
* @param request HttpRequest being processed.
* @... | postCall is run after a handler method call is made. If any of the postCalls throw and exception then the remaining postCalls will still be called. If the handler method was not called then postCall hooks will not be called | postCall | {
"repo_name": "kasunbg/product-mss",
"path": "carbon-mss/components/org.wso2.carbon.mss/src/main/java/org/wso2/carbon/mss/internal/router/HandlerHook.java",
"license": "apache-2.0",
"size": 2251
} | [
"io.netty.handler.codec.http.HttpRequest",
"io.netty.handler.codec.http.HttpResponseStatus"
] | import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.HttpResponseStatus; | import io.netty.handler.codec.http.*; | [
"io.netty.handler"
] | io.netty.handler; | 2,688,800 |
public final Process exec(String... args) throws IOException {
checkState(!Objects.equals(cwd, DEV_NULL));
checkArgument(args.length > 0, "args");
return runtime.exec(args, env, cwd);
} | final Process function(String... args) throws IOException { checkState(!Objects.equals(cwd, DEV_NULL)); checkArgument(args.length > 0, "args"); return runtime.exec(args, env, cwd); } | /**
* Runs specified system command and arguments within the GPG testing environment.
*
* @see Runtime#exec(String[])
*/ | Runs specified system command and arguments within the GPG testing environment | exec | {
"repo_name": "google/nomulus",
"path": "core/src/test/java/google/registry/testing/GpgSystemCommandExtension.java",
"license": "apache-2.0",
"size": 5185
} | [
"com.google.common.base.Preconditions",
"java.io.IOException",
"java.util.Objects"
] | import com.google.common.base.Preconditions; import java.io.IOException; import java.util.Objects; | import com.google.common.base.*; import java.io.*; import java.util.*; | [
"com.google.common",
"java.io",
"java.util"
] | com.google.common; java.io; java.util; | 1,025,220 |
public IpAccessControlListMapping create(Map<String, String> params) throws TwilioRestException; | IpAccessControlListMapping function(Map<String, String> params) throws TwilioRestException; | /**
* Creates the ip access control list mapping
*
* @param params the params map
* @return the ip access control list mapping
* @throws TwilioRestException
*/ | Creates the ip access control list mapping | create | {
"repo_name": "Forestvap/Twilio-Project",
"path": "twilio-java/src/main/java/com/twilio/sdk/resource/factory/sip/IpAccessControlListMappingFactory.java",
"license": "mit",
"size": 1110
} | [
"com.twilio.sdk.TwilioRestException",
"com.twilio.sdk.resource.instance.sip.IpAccessControlListMapping",
"java.util.Map"
] | import com.twilio.sdk.TwilioRestException; import com.twilio.sdk.resource.instance.sip.IpAccessControlListMapping; import java.util.Map; | import com.twilio.sdk.*; import com.twilio.sdk.resource.instance.sip.*; import java.util.*; | [
"com.twilio.sdk",
"java.util"
] | com.twilio.sdk; java.util; | 2,075,762 |
@Override
public void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry) {
explicitEntry.setTransactionLedgerEntryDescription(buildTransactionLedgerEntryDescriptionUsingRefOriginAndRefDocNumber(postable));
// C... | void function(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry) { explicitEntry.setTransactionLedgerEntryDescription(buildTransactionLedgerEntryDescriptionUsingRefOriginAndRefDocNumber(postable)); explicitEntry.setReferenceFinancialDocumentNumber(null); explicitEntry.setReferenceF... | /**
* Customizes a GLPE by setting financial document number, financial system origination code and document type code to null
*
* @param transactionalDocument submitted accounting document
* @param accountingLine accounting line in document
* @param explicitEntry general ledger pending e... | Customizes a GLPE by setting financial document number, financial system origination code and document type code to null | customizeExplicitGeneralLedgerPendingEntry | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/fp/document/GeneralErrorCorrectionDocument.java",
"license": "agpl-3.0",
"size": 7840
} | [
"org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry",
"org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail"
] | import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry; import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail; | import org.kuali.kfs.sys.businessobject.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,520,737 |
void undeployArtifact(ProductInstance product, String artifactName, Task task, String callback); | void undeployArtifact(ProductInstance product, String artifactName, Task task, String callback); | /**
* Undeploy an artefact in the product
*
* @param productInstance
* the installed product to configure
* @param artifact
* the artefact to be undeploy.
* @param task
* the task which contains the information about the async execution
* @p... | Undeploy an artefact in the product | undeployArtifact | {
"repo_name": "hmunfru/fiware-sdc",
"path": "core/src/main/java/com/telefonica/euro_iaas/sdc/manager/async/ArtifactAsyncManager.java",
"license": "apache-2.0",
"size": 2159
} | [
"com.telefonica.euro_iaas.sdc.model.ProductInstance",
"com.telefonica.euro_iaas.sdc.model.Task"
] | import com.telefonica.euro_iaas.sdc.model.ProductInstance; import com.telefonica.euro_iaas.sdc.model.Task; | import com.telefonica.euro_iaas.sdc.model.*; | [
"com.telefonica.euro_iaas"
] | com.telefonica.euro_iaas; | 2,610,670 |
KeyRange subRange(KeyRange useRange, Object singleKey)
throws DatabaseException, KeyRangeException {
return useRange.subRange(makeRangeKey(singleKey));
} | KeyRange subRange(KeyRange useRange, Object singleKey) throws DatabaseException, KeyRangeException { return useRange.subRange(makeRangeKey(singleKey)); } | /**
* Intersects the given key and the current range.
*/ | Intersects the given key and the current range | subRange | {
"repo_name": "bjorndm/prebake",
"path": "code/third_party/bdb/src/com/sleepycat/collections/DataView.java",
"license": "apache-2.0",
"size": 23518
} | [
"com.sleepycat.je.DatabaseException",
"com.sleepycat.util.keyrange.KeyRange",
"com.sleepycat.util.keyrange.KeyRangeException"
] | import com.sleepycat.je.DatabaseException; import com.sleepycat.util.keyrange.KeyRange; import com.sleepycat.util.keyrange.KeyRangeException; | import com.sleepycat.je.*; import com.sleepycat.util.keyrange.*; | [
"com.sleepycat.je",
"com.sleepycat.util"
] | com.sleepycat.je; com.sleepycat.util; | 774,229 |
public void setEncoding(String encoding) {
if (ECIUtil.getECIForEncoding(encoding) < 0) {
throw new IllegalArgumentException("Not a valid encoding: " + encoding);
}
this.encoding = encoding;
} | void function(String encoding) { if (ECIUtil.getECIForEncoding(encoding) < 0) { throw new IllegalArgumentException(STR + encoding); } this.encoding = encoding; } | /**
* Sets the message encoding. The value must conform to one of Java's encodings and
* have a mapping in the ECI registry.
* @param encoding the message encoding
*/ | Sets the message encoding. The value must conform to one of Java's encodings and have a mapping in the ECI registry | setEncoding | {
"repo_name": "mbhk/barcode4j",
"path": "barcode4j-light/src/main/java/org/krysalis/barcode4j/impl/pdf417/PDF417Bean.java",
"license": "apache-2.0",
"size": 9417
} | [
"org.krysalis.barcode4j.tools.ECIUtil"
] | import org.krysalis.barcode4j.tools.ECIUtil; | import org.krysalis.barcode4j.tools.*; | [
"org.krysalis.barcode4j"
] | org.krysalis.barcode4j; | 1,275,966 |
public RunAsType<ServletType<T>> getOrCreateRunAs()
{
Node node = childNode.getOrCreate("run-as");
RunAsType<ServletType<T>> runAs = new RunAsTypeImpl<ServletType<T>>(this, "run-as", childNode, node);
return runAs;
} | RunAsType<ServletType<T>> function() { Node node = childNode.getOrCreate(STR); RunAsType<ServletType<T>> runAs = new RunAsTypeImpl<ServletType<T>>(this, STR, childNode, node); return runAs; } | /**
* If not already created, a new <code>run-as</code> element with the given value will be created.
* Otherwise, the existing <code>run-as</code> element will be returned.
* @return a new or existing instance of <code>RunAsType<ServletType<T>></code>
*/ | If not already created, a new <code>run-as</code> element with the given value will be created. Otherwise, the existing <code>run-as</code> element will be returned | getOrCreateRunAs | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/webcommon31/ServletTypeImpl.java",
"license": "epl-1.0",
"size": 23086
} | [
"org.jboss.shrinkwrap.descriptor.api.javaee7.RunAsType",
"org.jboss.shrinkwrap.descriptor.api.webcommon31.ServletType",
"org.jboss.shrinkwrap.descriptor.impl.javaee7.RunAsTypeImpl",
"org.jboss.shrinkwrap.descriptor.spi.node.Node"
] | import org.jboss.shrinkwrap.descriptor.api.javaee7.RunAsType; import org.jboss.shrinkwrap.descriptor.api.webcommon31.ServletType; import org.jboss.shrinkwrap.descriptor.impl.javaee7.RunAsTypeImpl; import org.jboss.shrinkwrap.descriptor.spi.node.Node; | import org.jboss.shrinkwrap.descriptor.api.javaee7.*; import org.jboss.shrinkwrap.descriptor.api.webcommon31.*; import org.jboss.shrinkwrap.descriptor.impl.javaee7.*; import org.jboss.shrinkwrap.descriptor.spi.node.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 2,200,642 |
private void storeRegistrationId(Context context, String regId) {
final SharedPreferences prefs = getPushyPreferences(context);
int appVersion = getAppVersion(context);
Log.i(TAG, "Saving regId on app version " + appVersion);
SharedPreferences.Editor editor = prefs.edit();
ed... | void function(Context context, String regId) { final SharedPreferences prefs = getPushyPreferences(context); int appVersion = getAppVersion(context); Log.i(TAG, STR + appVersion); SharedPreferences.Editor editor = prefs.edit(); editor.putString(PROPERTY_REG_ID, regId); editor.putInt(PROPERTY_APP_VERSION, appVersion); e... | /**
* Stores the registration ID and app versionCode in the application's
* {@code SharedPreferences}.
*
* @param context application's context.
* @param regId registration ID
*/ | Stores the registration ID and app versionCode in the application's SharedPreferences | storeRegistrationId | {
"repo_name": "scionoftech/PushyNotification",
"path": "PushyNotification/app/src/main/java/com/scionoftech/pushynotification/PushyClientManager.java",
"license": "mit",
"size": 5358
} | [
"android.content.Context",
"android.content.SharedPreferences",
"android.util.Log"
] | import android.content.Context; import android.content.SharedPreferences; import android.util.Log; | import android.content.*; import android.util.*; | [
"android.content",
"android.util"
] | android.content; android.util; | 1,620,034 |
public synchronized void registerClient(
String index,
String hostName,
int port,
AsyncMethodCallback<Void> resultHandler) {
System.out.println("Connecting to streaming client " + hostName + ":"
+ port);
if (!SuggestionIndex.indexExist... | synchronized void function( String index, String hostName, int port, AsyncMethodCallback<Void> resultHandler) { System.out.println(STR + hostName + ":" + port); if (!SuggestionIndex.indexExists(index)) { resultHandler .onError(new IndexUnknownException( STR + index + STR)); return; } final String hostAndPortKey = hostN... | /**
* Registers a new client to receive a statistics stream if the index exits
*
* @param index
* Index of the statistics to be sent
* @param hostName
* Hostname of the client
* @param port
* Port number at which the StreamingServer at the client... | Registers a new client to receive a statistics stream if the index exits | registerClient | {
"repo_name": "Completionary/completionProxy",
"path": "src/main/java/de/completionary/proxy/analytics/StatisticsStreamDispatcher.java",
"license": "gpl-2.0",
"size": 10924
} | [
"de.completionary.proxy.elasticsearch.SuggestionIndex",
"de.completionary.proxy.thrift.clients.StreamingClientServiceClient",
"de.completionary.proxy.thrift.services.exceptions.IndexUnknownException",
"java.io.IOException",
"org.apache.thrift.async.AsyncMethodCallback",
"org.apache.thrift.async.TAsyncClie... | import de.completionary.proxy.elasticsearch.SuggestionIndex; import de.completionary.proxy.thrift.clients.StreamingClientServiceClient; import de.completionary.proxy.thrift.services.exceptions.IndexUnknownException; import java.io.IOException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift... | import de.completionary.proxy.elasticsearch.*; import de.completionary.proxy.thrift.clients.*; import de.completionary.proxy.thrift.services.exceptions.*; import java.io.*; import org.apache.thrift.async.*; import org.apache.thrift.protocol.*; import org.apache.thrift.transport.*; | [
"de.completionary.proxy",
"java.io",
"org.apache.thrift"
] | de.completionary.proxy; java.io; org.apache.thrift; | 1,100,481 |
public List getHandlers(final int insn) {
return handlers[insn];
}
| List function(final int insn) { return handlers[insn]; } | /**
* Returns the exception handlers for the given instruction.
*
* @param insn the index of an instruction of the last recently analyzed
* method.
* @return a list of {@link TryCatchBlockNode} objects.
*/ | Returns the exception handlers for the given instruction | getHandlers | {
"repo_name": "geekcheng/aviator",
"path": "src/main/java/com/googlecode/aviator/asm/tree/analysis/Analyzer.java",
"license": "lgpl-3.0",
"size": 21199
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,017,564 |
public void testFloat_NaN() {
final ValueTypesTestServiceAsync service = getServiceAsync();
delayTestFinishForRpc();
setTask(new AsyncTask<Void, Void, Void>() {
| void function() { final ValueTypesTestServiceAsync service = getServiceAsync(); delayTestFinishForRpc(); setTask(new AsyncTask<Void, Void, Void>() { | /**
* Validate that NaNs (not-a-number, such as 0/0) propagate properly via
* RPC.
*/ | Validate that NaNs (not-a-number, such as 0/0) propagate properly via RPC | testFloat_NaN | {
"repo_name": "jcricket/gwt-syncproxy",
"path": "SPAAppTest/tests/src/com/google/gwt/user/client/rpc/ValueTypesTest.java",
"license": "apache-2.0",
"size": 27397
} | [
"android.os.AsyncTask"
] | import android.os.AsyncTask; | import android.os.*; | [
"android.os"
] | android.os; | 327,383 |
public XStream getXStream() {
return PersistenceManager.getPersistenceManager().getXStream();
}
| XStream function() { return PersistenceManager.getPersistenceManager().getXStream(); } | /**
* Gets the xstream instance.
* @return The xstream instance.
*/ | Gets the xstream instance | getXStream | {
"repo_name": "MinedroidFTW/DualCraft",
"path": "org/server/classic/persistence/SavedGameManager.java",
"license": "gpl-3.0",
"size": 2624
} | [
"com.thoughtworks.xstream.XStream"
] | import com.thoughtworks.xstream.XStream; | import com.thoughtworks.xstream.*; | [
"com.thoughtworks.xstream"
] | com.thoughtworks.xstream; | 2,292,076 |
private void jsonize() {
ByteBufferInputStream bbis = new ByteBufferInputStream();
try {
fta.reset(frame.getBuffer());
int last = fta.getTupleCount();
String result;
for (int tIndex = 0; tIndex < last; tIndex++) {
int start = fta.getTup... | void function() { ByteBufferInputStream bbis = new ByteBufferInputStream(); try { fta.reset(frame.getBuffer()); int last = fta.getTupleCount(); String result; for (int tIndex = 0; tIndex < last; tIndex++) { int start = fta.getTupleStartOffset(tIndex); int length = fta.getTupleEndOffset(tIndex) - start; bbis.setByteBuff... | /**
* Converts result into a String JSON.
*/ | Converts result into a String JSON | jsonize | {
"repo_name": "Nullification/asterixdb-spark-connector",
"path": "src/main/java/org/apache/asterix/connector/result/AsterixClient.java",
"license": "apache-2.0",
"size": 5036
} | [
"java.io.IOException",
"org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream"
] | import java.io.IOException; import org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream; | import java.io.*; import org.apache.hyracks.dataflow.common.comm.util.*; | [
"java.io",
"org.apache.hyracks"
] | java.io; org.apache.hyracks; | 2,473,286 |
@Test
public void testUnmanagedRunAfterBoth() throws Exception {
AtomicInteger count = new AtomicInteger();
LinkedBlockingQueue<Object> results = new LinkedBlockingQueue<Object>();
final Runnable runnable = () -> {
System.out.println("> run #" + count.incrementAndGet() + " f... | void function() throws Exception { AtomicInteger count = new AtomicInteger(); LinkedBlockingQueue<Object> results = new LinkedBlockingQueue<Object>(); final Runnable runnable = () -> { System.out.println(STR + count.incrementAndGet() + STR); results.add(Thread.currentThread().getName()); System.out.println(STR); }; Com... | /**
* Supply unmanaged CompletableFuture.runAfterBoth with a managed CompletableFuture and see if it can notice
* when the managed CompletableFuture completes.
*/ | Supply unmanaged CompletableFuture.runAfterBoth with a managed CompletableFuture and see if it can notice when the managed CompletableFuture completes | testUnmanagedRunAfterBoth | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.concurrent.mp_fat/test-applications/MPConcurrentApp/src/concurrent/mp/fat/web/MPConcurrentTestServlet.java",
"license": "epl-1.0",
"size": 277091
} | [
"java.util.concurrent.CompletableFuture",
"java.util.concurrent.LinkedBlockingQueue",
"java.util.concurrent.TimeUnit",
"java.util.concurrent.atomic.AtomicInteger",
"org.junit.Assert"
] | import java.util.concurrent.CompletableFuture; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.junit.Assert; | import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,023,570 |
public static void setSizeByBackgroudImage(ViewGroup parent) {
measureView(parent);
ViewGroup.LayoutParams lp = (ViewGroup.LayoutParams) parent.getLayoutParams();
lp.width = parent.getMeasuredWidth();
lp.height = parent.getMeasuredHeight();
parent.setLayoutParams(lp);
} | static void function(ViewGroup parent) { measureView(parent); ViewGroup.LayoutParams lp = (ViewGroup.LayoutParams) parent.getLayoutParams(); lp.width = parent.getMeasuredWidth(); lp.height = parent.getMeasuredHeight(); parent.setLayoutParams(lp); } | /**
* Set the size of ViewGroup by backgroud image resource.
* @param parent
*/ | Set the size of ViewGroup by backgroud image resource | setSizeByBackgroudImage | {
"repo_name": "yinglovezhuzhu/FlowWindow",
"path": "FlowWindow/src/com/xiaoying/flowwindow/ViewUtil.java",
"license": "apache-2.0",
"size": 2843
} | [
"android.view.ViewGroup"
] | import android.view.ViewGroup; | import android.view.*; | [
"android.view"
] | android.view; | 430,988 |
public Paint getUpPaint() {
return this.upPaint;
}
| Paint function() { return this.upPaint; } | /**
* Returns the paint used to fill candles when the price moves up from open
* to close.
*
* @return The paint (possibly <code>null</code>).
*
* @see #setUpPaint(Paint)
*/ | Returns the paint used to fill candles when the price moves up from open to close | getUpPaint | {
"repo_name": "integrated/jfreechart",
"path": "source/org/jfree/chart/renderer/xy/CandlestickRenderer.java",
"license": "lgpl-2.1",
"size": 35075
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,568,493 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<PollResult<NetworkInterfaceTapConfigurationInner>, NetworkInterfaceTapConfigurationInner>
beginCreateOrUpdateAsync(
String resourceGroupName,
String networkInterfaceName,
String tapConfigura... | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<NetworkInterfaceTapConfigurationInner>, NetworkInterfaceTapConfigurationInner> function( String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters)... | /**
* Creates or updates a Tap configuration in the specified NetworkInterface.
*
* @param resourceGroupName The name of the resource group.
* @param networkInterfaceName The name of the network interface.
* @param tapConfigurationName The name of the tap configuration.
* @param tapConfigu... | Creates or updates a Tap configuration in the specified NetworkInterface | beginCreateOrUpdateAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceTapConfigurationsClientImpl.java",
"license": "mit",
"size": 61110
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.PollerFlux",
"com.azure.resourcemanager.network.fluent.models.NetworkInterfaceTapConfigurationInner",
"java... | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.network.fluent.models.NetworkInterfaceTapConfigurati... | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*; import java.nio.*; | [
"com.azure.core",
"com.azure.resourcemanager",
"java.nio"
] | com.azure.core; com.azure.resourcemanager; java.nio; | 1,020,427 |
private static void logAndPrintError (PrintStream newStderr,
String message, Throwable ex) {
Log.e(TAG, message, ex);
if (newStderr != null) {
newStderr.println(message + (ex == null ? "" : ex));
}
} | static void function (PrintStream newStderr, String message, Throwable ex) { Log.e(TAG, message, ex); if (newStderr != null) { newStderr.println(message + (ex == null ? "" : ex)); } } | /**
* Logs an error message and prints it to the specified stream, if
* provided
*
* @param newStderr null-ok; a standard error stream
* @param message non-null; error message
* @param ex null-ok an exception
*/ | Logs an error message and prints it to the specified stream, if provided | logAndPrintError | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/internal/os/ZygoteConnection.java",
"license": "gpl-3.0",
"size": 32549
} | [
"android.util.Log",
"java.io.PrintStream"
] | import android.util.Log; import java.io.PrintStream; | import android.util.*; import java.io.*; | [
"android.util",
"java.io"
] | android.util; java.io; | 499,520 |
public void classDocSnippet() {
PagedFluxBase<Integer, PagedResponse<Integer>> pagedFluxBase = createAnInstance();
// BEGIN: com.azure.core.http.rest.pagedfluxbase.items
pagedFluxBase
.log()
.subscribe(item -> System.out.println("Processing item with value: " + item),... | void function() { PagedFluxBase<Integer, PagedResponse<Integer>> pagedFluxBase = createAnInstance(); pagedFluxBase .log() .subscribe(item -> System.out.println(STR + item), error -> System.err.println(STR + error), () -> System.out.println(STR)); pagedFluxBase .byPage() .log() .subscribe(page -> System.out.printf(STR, ... | /**
* Code snippets for showing usage of {@link PagedFluxBase} in class docs
*/ | Code snippets for showing usage of <code>PagedFluxBase</code> in class docs | classDocSnippet | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/core/azure-core/src/samples/java/com/azure/core/http/rest/PagedFluxBaseJavaDocCodeSnippets.java",
"license": "mit",
"size": 9099
} | [
"java.util.stream.Collectors"
] | import java.util.stream.Collectors; | import java.util.stream.*; | [
"java.util"
] | java.util; | 1,145,347 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<VirtualNetworkLinkInner>, VirtualNetworkLinkInner> beginCreateOrUpdate(
String resourceGroupName,
String privateZoneName,
String virtualNetworkLinkName,
VirtualNetworkLinkInner parameters,
S... | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<VirtualNetworkLinkInner>, VirtualNetworkLinkInner> beginCreateOrUpdate( String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch); | /**
* Creates or updates a virtual network link to the specified Private DNS zone.
*
* @param resourceGroupName The name of the resource group.
* @param privateZoneName The name of the Private DNS zone (without a terminating dot).
* @param virtualNetworkLinkName The name of the virtual network ... | Creates or updates a virtual network link to the specified Private DNS zone | beginCreateOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-privatedns/src/main/java/com/azure/resourcemanager/privatedns/fluent/VirtualNetworkLinksClient.java",
"license": "mit",
"size": 44224
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.privatedns.fluent.models.VirtualNetworkLinkInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.privatedns.fluent.models.VirtualNetworkLinkInner; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.privatedns.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 308,768 |
public synchronized void rejectDrop() {
if (dropStatus != STATUS_WAIT) {
throw new InvalidDnDOperationException("invalid rejectDrop()");
}
dropStatus = STATUS_REJECT;
currentDA = DnDConstants.ACTION_NONE;
dropComplete(false);
} | synchronized void function() { if (dropStatus != STATUS_WAIT) { throw new InvalidDnDOperationException(STR); } dropStatus = STATUS_REJECT; currentDA = DnDConstants.ACTION_NONE; dropComplete(false); } | /**
* reject Drop
*/ | reject Drop | rejectDrop | {
"repo_name": "lambdalab-mirror/jdk7u-jdk",
"path": "src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java",
"license": "gpl-2.0",
"size": 29674
} | [
"java.awt.dnd.DnDConstants",
"java.awt.dnd.InvalidDnDOperationException"
] | import java.awt.dnd.DnDConstants; import java.awt.dnd.InvalidDnDOperationException; | import java.awt.dnd.*; | [
"java.awt"
] | java.awt; | 985,700 |
public void write(File file, CSVWriteProc proc) {
writeAndClose(writer(file), proc);
}
| void function(File file, CSVWriteProc proc) { writeAndClose(writer(file), proc); } | /**
* Write CSV using the supplied {@link CSVWriteProc}.
*
* @param file
* CSV file
* @param proc
* the {@link CSVWriteProc} to use for CSV writing
*/ | Write CSV using the supplied <code>CSVWriteProc</code> | write | {
"repo_name": "kongch/OpenCSV-3.0",
"path": "OpenCSV/src/au/com/bytecode/opencsv/CSV.java",
"license": "apache-2.0",
"size": 18888
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 476,472 |
public boolean isDeterministicUpgradeRequired(Script.ScriptType outputScriptType) {
keyChainGroupLock.lock();
try {
long keyRotationTimeSecs = vKeyRotationTimestamp;
return keyChainGroup.isDeterministicUpgradeRequired(outputScriptType, keyRotationTimeSecs);
} finally ... | boolean function(Script.ScriptType outputScriptType) { keyChainGroupLock.lock(); try { long keyRotationTimeSecs = vKeyRotationTimestamp; return keyChainGroup.isDeterministicUpgradeRequired(outputScriptType, keyRotationTimeSecs); } finally { keyChainGroupLock.unlock(); } } | /**
* Returns true if the wallet contains random keys and no HD chains, in which case you should call
* {@link #upgradeToDeterministic(ScriptType, KeyParameter)} before attempting to do anything
* that would require a new address or key.
*/ | Returns true if the wallet contains random keys and no HD chains, in which case you should call <code>#upgradeToDeterministic(ScriptType, KeyParameter)</code> before attempting to do anything that would require a new address or key | isDeterministicUpgradeRequired | {
"repo_name": "bitcoinj/bitcoinj",
"path": "core/src/main/java/org/bitcoinj/wallet/Wallet.java",
"license": "apache-2.0",
"size": 267304
} | [
"org.bitcoinj.script.Script"
] | import org.bitcoinj.script.Script; | import org.bitcoinj.script.*; | [
"org.bitcoinj.script"
] | org.bitcoinj.script; | 2,791,118 |
@Override
public void printStackTrace(PrintWriter out) {
printStackTrace(out, true, true, true);
} | void function(PrintWriter out) { printStackTrace(out, true, true, true); } | /**
* Overrides {@link Throwable#printStackTrace(PrintWriter)} so that it will include the FTL stack trace.
*/ | Overrides <code>Throwable#printStackTrace(PrintWriter)</code> so that it will include the FTL stack trace | printStackTrace | {
"repo_name": "apache/incubator-freemarker",
"path": "src/main/java/freemarker/template/TemplateException.java",
"license": "apache-2.0",
"size": 24846
} | [
"java.io.PrintWriter"
] | import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 234,654 |
public void deleteVolumes(Volume[] volumes) {
AmazonEC2Client client = factory.getAmazonEC2Client();
deleteVolumes(client, volumes);
} | void function(Volume[] volumes) { AmazonEC2Client client = factory.getAmazonEC2Client(); deleteVolumes(client, volumes); } | /**
* Deletes the given set of volumes.
*
* @param volumes
* Volumes to delete
*/ | Deletes the given set of volumes | deleteVolumes | {
"repo_name": "deleidos/digitaledge-platform",
"path": "commons-cloud/src/main/java/com/deleidos/rtws/commons/cloud/platform/aws/SimpleAwsServiceImpl.java",
"license": "apache-2.0",
"size": 90799
} | [
"com.amazonaws.services.ec2.AmazonEC2Client",
"com.deleidos.rtws.commons.cloud.beans.Volume"
] | import com.amazonaws.services.ec2.AmazonEC2Client; import com.deleidos.rtws.commons.cloud.beans.Volume; | import com.amazonaws.services.ec2.*; import com.deleidos.rtws.commons.cloud.beans.*; | [
"com.amazonaws.services",
"com.deleidos.rtws"
] | com.amazonaws.services; com.deleidos.rtws; | 360,231 |
public T caseGreaterThan(GreaterThan object) {
return null;
} | T function(GreaterThan object) { return null; } | /**
* Returns the result of interpreting the object as an instance of '<em>Greater Than</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of in... | Returns the result of interpreting the object as an instance of 'Greater Than'. This implementation returns null; returning a non-null result will terminate the switch. | caseGreaterThan | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/finiteIntRanges/util/FiniteIntRangesSwitch.java",
"license": "epl-1.0",
"size": 15284
} | [
"fr.lip6.move.pnml.symmetricnet.finiteIntRanges.GreaterThan"
] | import fr.lip6.move.pnml.symmetricnet.finiteIntRanges.GreaterThan; | import fr.lip6.move.pnml.symmetricnet.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 1,695,905 |
public void setRollFrequencyDatesExceptionReportWriterService(ReportWriterService rollFrequencyDatesExceptionReportWriterService) {
this.rollFrequencyDatesExceptionReportWriterService = rollFrequencyDatesExceptionReportWriterService;
}
| void function(ReportWriterService rollFrequencyDatesExceptionReportWriterService) { this.rollFrequencyDatesExceptionReportWriterService = rollFrequencyDatesExceptionReportWriterService; } | /**
* Sets the rollFrequencyDatesExceptionReportWriterService attribute value.
*
* @param rollFrequencyDatesExceptionReportWriterService The rollFrequencyDatesExceptionReportWriterService to set.
*/ | Sets the rollFrequencyDatesExceptionReportWriterService attribute value | setRollFrequencyDatesExceptionReportWriterService | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/endow/batch/service/impl/RollFrequencyDatesServiceImpl.java",
"license": "agpl-3.0",
"size": 19718
} | [
"org.kuali.kfs.sys.service.ReportWriterService"
] | import org.kuali.kfs.sys.service.ReportWriterService; | import org.kuali.kfs.sys.service.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,397,595 |
public Set<String> getClassNames() {
return new LinkedHashSet<>(super.getAttributeValueSet());
} | Set<String> function() { return new LinkedHashSet<>(super.getAttributeValueSet()); } | /**
* NB:- every time it returns a <code>new LinkedHashSet</code> object and
* changes to this set object will not have any affect on this
* <code>ClassAttribute</code> object.
*
* @return the set of class names it contained.
* @since 2.1.9
* @author WFF
*/ | changes to this set object will not have any affect on this <code>ClassAttribute</code> object | getClassNames | {
"repo_name": "webfirmframework/wff",
"path": "wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/attribute/global/ClassAttribute.java",
"license": "apache-2.0",
"size": 4792
} | [
"java.util.LinkedHashSet",
"java.util.Set"
] | import java.util.LinkedHashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,903,500 |
@Test
public void testGetDevicesOf() {
Set<DeviceId> deviceIds = ImmutableSet.of(deviceId1, deviceId2, deviceId3);
expect(mockService.getDevicesOf(anyObject())).andReturn(deviceIds).anyTimes();
replay(mockService);
final WebTarget wt = target();
final String response = w... | void function() { Set<DeviceId> deviceIds = ImmutableSet.of(deviceId1, deviceId2, deviceId3); expect(mockService.getDevicesOf(anyObject())).andReturn(deviceIds).anyTimes(); replay(mockService); final WebTarget wt = target(); final String response = wt.path(STR + deviceId1.toString() + STR).request().get(String.class); ... | /**
* Tests the result of the REST API GET when there are active devices.
*/ | Tests the result of the REST API GET when there are active devices | testGetDevicesOf | {
"repo_name": "sdnwiselab/onos",
"path": "web/api/src/test/java/org/onosproject/rest/resources/MastershipResourceTest.java",
"license": "apache-2.0",
"size": 13291
} | [
"com.eclipsesource.json.Json",
"com.eclipsesource.json.JsonArray",
"com.eclipsesource.json.JsonObject",
"com.google.common.collect.ImmutableSet",
"java.util.Set",
"javax.ws.rs.client.WebTarget",
"org.easymock.EasyMock",
"org.hamcrest.Matchers",
"org.junit.Assert",
"org.onosproject.net.DeviceId"
] | import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObject; import com.google.common.collect.ImmutableSet; import java.util.Set; import javax.ws.rs.client.WebTarget; import org.easymock.EasyMock; import org.hamcrest.Matchers; import org.junit.Assert; import org... | import com.eclipsesource.json.*; import com.google.common.collect.*; import java.util.*; import javax.ws.rs.client.*; import org.easymock.*; import org.hamcrest.*; import org.junit.*; import org.onosproject.net.*; | [
"com.eclipsesource.json",
"com.google.common",
"java.util",
"javax.ws",
"org.easymock",
"org.hamcrest",
"org.junit",
"org.onosproject.net"
] | com.eclipsesource.json; com.google.common; java.util; javax.ws; org.easymock; org.hamcrest; org.junit; org.onosproject.net; | 1,099,587 |
protected HttpRequest startPart() throws IOException {
if (!multipart) {
multipart = true;
contentType(CONTENT_TYPE_MULTIPART).openOutput();
output.write("--" + BOUNDARY + CRLF);
} else
output.write(CRLF + "--" + BOUNDARY + CRLF);
return this;
} | HttpRequest function() throws IOException { if (!multipart) { multipart = true; contentType(CONTENT_TYPE_MULTIPART).openOutput(); output.write("--" + BOUNDARY + CRLF); } else output.write(CRLF + "--" + BOUNDARY + CRLF); return this; } | /**
* Start part of a multipart
*
* @return this request
* @throws IOException
*/ | Start part of a multipart | startPart | {
"repo_name": "enricodeleo/cordova-HTTP",
"path": "src/android/com/synconset/CordovaHTTP/HttpRequest.java",
"license": "mit",
"size": 91482
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,453,660 |
public GuacamoleConfiguration getConfiguration(); | GuacamoleConfiguration function(); | /**
* Returns the GuacamoleConfiguration associated with this Connection. Note
* that because configurations may contain sensitive information, some data
* in this configuration may be omitted or tokenized.
*
* @return The GuacamoleConfiguration associated with this Connection.
*/ | Returns the GuacamoleConfiguration associated with this Connection. Note that because configurations may contain sensitive information, some data in this configuration may be omitted or tokenized | getConfiguration | {
"repo_name": "mike-jumper/incubator-guacamole-client",
"path": "guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connection.java",
"license": "apache-2.0",
"size": 6778
} | [
"org.apache.guacamole.protocol.GuacamoleConfiguration"
] | import org.apache.guacamole.protocol.GuacamoleConfiguration; | import org.apache.guacamole.protocol.*; | [
"org.apache.guacamole"
] | org.apache.guacamole; | 2,768,072 |
public static Collection<DistributionLocatorId> asDistributionLocatorIds(Collection<Locator> locators) throws UnknownHostException {
if (locators.isEmpty()) {
return Collections.emptyList();
}
Collection<DistributionLocatorId> locatorIds = new ArrayList<DistributionLocatorId>();
for (Locator loc... | static Collection<DistributionLocatorId> function(Collection<Locator> locators) throws UnknownHostException { if (locators.isEmpty()) { return Collections.emptyList(); } Collection<DistributionLocatorId> locatorIds = new ArrayList<DistributionLocatorId>(); for (Locator locator : locators) { DistributionLocatorId locato... | /**
* Converts a collection of {@link Locator} instances to a collection of
* DistributionLocatorId instances. Note this will use {@link
* SocketCreator#getLocalHost()} as the host for DistributionLocatorId.
* This is because all instances of Locator are local only.
*
* @param locators collection of... | Converts a collection of <code>Locator</code> instances to a collection of DistributionLocatorId instances. Note this will use <code>SocketCreator#getLocalHost()</code> as the host for DistributionLocatorId. This is because all instances of Locator are local only | asDistributionLocatorIds | {
"repo_name": "ameybarve15/incubator-geode",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/admin/remote/DistributionLocatorId.java",
"license": "apache-2.0",
"size": 12638
} | [
"com.gemstone.gemfire.distributed.Locator",
"com.gemstone.gemfire.internal.SocketCreator",
"java.net.UnknownHostException",
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections"
] | import com.gemstone.gemfire.distributed.Locator; import com.gemstone.gemfire.internal.SocketCreator; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; | import com.gemstone.gemfire.distributed.*; import com.gemstone.gemfire.internal.*; import java.net.*; import java.util.*; | [
"com.gemstone.gemfire",
"java.net",
"java.util"
] | com.gemstone.gemfire; java.net; java.util; | 2,375,561 |
private void createAttributesCache() {
final String METHODNAME = "createAttributesCache";
if (iAttrsCacheEnabled) {
if (FactoryManager.getCacheUtil().isCacheAvailable()) {
iAttrsCache = FactoryManager.getCacheUtil().initialize("AttributesCache", iAttrsCacheSize, iAttrsCa... | void function() { final String METHODNAME = STR; if (iAttrsCacheEnabled) { if (FactoryManager.getCacheUtil().isCacheAvailable()) { iAttrsCache = FactoryManager.getCacheUtil().initialize(STR, iAttrsCacheSize, iAttrsCacheSize, iAttrsCacheTimeOut); if (iAttrsCache != null) { if (tc.isDebugEnabled()) { StringBuilder strBuf... | /**
* Method to create the attributes cache, if configured.
*/ | Method to create the attributes cache, if configured | createAttributesCache | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java",
"license": "epl-1.0",
"size": 112030
} | [
"com.ibm.websphere.ras.Tr",
"com.ibm.ws.security.wim.FactoryManager"
] | import com.ibm.websphere.ras.Tr; import com.ibm.ws.security.wim.FactoryManager; | import com.ibm.websphere.ras.*; import com.ibm.ws.security.wim.*; | [
"com.ibm.websphere",
"com.ibm.ws"
] | com.ibm.websphere; com.ibm.ws; | 2,462,831 |
public void doEdit(RunData data, Context context)
{
SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid());
String id = data.getParameters().getString("id");
state.removeAttribute("user");
state.removeAttribute("newuser");
// get the user
try
{
... | void function(RunData data, Context context) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); String id = data.getParameters().getString("id"); state.removeAttribute("user"); state.removeAttribute(STR); try { UserEdit user = UserDirectoryService.editUser(id)... | /**
* doEdit called when "eventSubmit_doEdit" is in the request parameters to edit a user
*/ | doEdit called when "eventSubmit_doEdit" is in the request parameters to edit a user | doEdit | {
"repo_name": "eemirtekin/Sakai-10.6-TR",
"path": "user/user-tool/tool/src/java/org/sakaiproject/user/tool/UsersAction.java",
"license": "apache-2.0",
"size": 56071
} | [
"org.sakaiproject.cheftool.Context",
"org.sakaiproject.cheftool.JetspeedRunData",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.event.api.SessionState",
"org.sakaiproject.user.api.UserEdit",
"org.sakaiproject.user.api.UserLockedException",
"org.sakaiproject.user.api.UserNotDefinedException",
... | import org.sakaiproject.cheftool.Context; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.user.api.UserEdit; import org.sakaiproject.user.api.UserLockedException; import org.sakaiproject.user.api.UserNotD... | import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; import org.sakaiproject.user.api.*; import org.sakaiproject.user.cover.*; | [
"org.sakaiproject.cheftool",
"org.sakaiproject.event",
"org.sakaiproject.user"
] | org.sakaiproject.cheftool; org.sakaiproject.event; org.sakaiproject.user; | 1,042,912 |
@Test
public void testRuleOrdering() throws GraphException {
final List<GraphPolicyRule> rulesOrdered = ImmutableList.of(
newRule("P:Project{i}", "P:{r}"),
newRule("P:Project{r}", "P:{o}"),
newRule("P:Project{o}", "P:{a}"));
int rightCount... | void function() throws GraphException { final List<GraphPolicyRule> rulesOrdered = ImmutableList.of( newRule(STR, "P:{r}"), newRule(STR, "P:{o}"), newRule(STR, "P:{a}")); int rightCount = 0; int wrongCount = 0; for (final List<GraphPolicyRule> rulesShuffle : Collections2.permutations(rulesOrdered)) { final GraphPolicy ... | /**
* Check that the ordering of policy rules is properly respected.
* @throws GraphException unexpected
*/ | Check that the ordering of policy rules is properly respected | testRuleOrdering | {
"repo_name": "knabar/openmicroscopy",
"path": "components/server/test/ome/services/graphs/GraphPolicyRuleTest.java",
"license": "gpl-2.0",
"size": 54291
} | [
"com.google.common.collect.Collections2",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableMap",
"com.google.common.collect.ImmutableSet",
"java.util.List",
"java.util.Set",
"org.testng.Assert"
] | import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.util.List; import java.util.Set; import org.testng.Assert; | import com.google.common.collect.*; import java.util.*; import org.testng.*; | [
"com.google.common",
"java.util",
"org.testng"
] | com.google.common; java.util; org.testng; | 1,234,071 |
@Test(expected=OperationNotSupportedException.class)
public void testSendMulticastDataAsyncFromRemoteDevices() throws TimeoutException, XBeeException {
// Return that the XBee device is remote when asked.
Mockito.when(zigBeeDevice.isRemote()).thenReturn(true);
zigBeeDevice.sendMulticastDataAsync(XBEE_16BIT... | @Test(expected=OperationNotSupportedException.class) void function() throws TimeoutException, XBeeException { Mockito.when(zigBeeDevice.isRemote()).thenReturn(true); zigBeeDevice.sendMulticastDataAsync(XBEE_16BIT_ADDRESS, SOURCE_ENDPOINT, DESTINATION_ENDPOINT, CLUSTER_ID, PROFILE_ID, DATA.getBytes()); } | /**
* Test method for {@link com.digi.xbee.api.ZigBeeDevice#sendMulticastDataAsync(XBee16BitAddress, int, int, int, int, byte[])}.
*
* <p>Verify that multicast data async cannot be sent if the sender is a remote XBee device.</p>
*
* @throws XBeeException
* @throws TimeoutException
*/ | Test method for <code>com.digi.xbee.api.ZigBeeDevice#sendMulticastDataAsync(XBee16BitAddress, int, int, int, int, byte[])</code>. Verify that multicast data async cannot be sent if the sender is a remote XBee device | testSendMulticastDataAsyncFromRemoteDevices | {
"repo_name": "brucetsao/XBeeJavaLibrary",
"path": "library/src/test/java/com/digi/xbee/api/SendMulticastDataAsyncTest.java",
"license": "mpl-2.0",
"size": 14288
} | [
"com.digi.xbee.api.exceptions.OperationNotSupportedException",
"com.digi.xbee.api.exceptions.TimeoutException",
"com.digi.xbee.api.exceptions.XBeeException",
"org.junit.Test",
"org.mockito.Mockito"
] | import com.digi.xbee.api.exceptions.OperationNotSupportedException; import com.digi.xbee.api.exceptions.TimeoutException; import com.digi.xbee.api.exceptions.XBeeException; import org.junit.Test; import org.mockito.Mockito; | import com.digi.xbee.api.exceptions.*; import org.junit.*; import org.mockito.*; | [
"com.digi.xbee",
"org.junit",
"org.mockito"
] | com.digi.xbee; org.junit; org.mockito; | 600,237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.