method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public IV addTerm(Value value);
IV function(Value value);
/** * Add a term into the term:id index and the id:term index, returning the * assigned term identifier (non-batch API). * <p> * Note: This method delegates to the batch API, but it is extremely * inefficient for scale-out as it does one RMI per request! * * @param value * The term. * * @return The assigned internal value. */
Add a term into the term:id index and the id:term index, returning the assigned term identifier (non-batch API). Note: This method delegates to the batch API, but it is extremely inefficient for scale-out as it does one RMI per request
addTerm
{ "repo_name": "smalyshev/blazegraph", "path": "bigdata-rdf/src/java/com/bigdata/rdf/store/IRawTripleStore.java", "license": "gpl-2.0", "size": 11815 }
[ "org.openrdf.model.Value" ]
import org.openrdf.model.Value;
import org.openrdf.model.*;
[ "org.openrdf.model" ]
org.openrdf.model;
1,838,121
public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final MetadataResolverAdapter metadataAdapter, final String entityId, final RegisteredService registeredService) { final EntityDescriptor entityDescriptor = metadataAdapter.getEntityDescriptorForEntityId(entityId); return locateMetadataUserInterfaceForEntityId(entityDescriptor, entityId, registeredService); }
static SamlMetadataUIInfo function(final MetadataResolverAdapter metadataAdapter, final String entityId, final RegisteredService registeredService) { final EntityDescriptor entityDescriptor = metadataAdapter.getEntityDescriptorForEntityId(entityId); return locateMetadataUserInterfaceForEntityId(entityDescriptor, entityId, registeredService); }
/** * Locate MDUI for entity id simple metadata ui info. * * @param metadataAdapter the metadata adapter * @param entityId the entity id * @param registeredService the registered service * @return the simple metadata ui info */
Locate MDUI for entity id simple metadata ui info
locateMetadataUserInterfaceForEntityId
{ "repo_name": "mrluo735/cas-5.1.0", "path": "support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java", "license": "apache-2.0", "size": 4498 }
[ "org.apereo.cas.services.RegisteredService", "org.opensaml.saml.saml2.metadata.EntityDescriptor" ]
import org.apereo.cas.services.RegisteredService; import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.apereo.cas.services.*; import org.opensaml.saml.saml2.metadata.*;
[ "org.apereo.cas", "org.opensaml.saml" ]
org.apereo.cas; org.opensaml.saml;
760,323
public static ExpressionRoleMapping parse(String name, BytesReference source, XContentType xContentType) throws IOException { final NamedXContentRegistry registry = NamedXContentRegistry.EMPTY; try (InputStream stream = source.streamInput(); XContentParser parser = xContentType.xContent() .createParser(registry, LoggingDeprecationHandler.INSTANCE, stream)) { return parse(name, parser); } }
static ExpressionRoleMapping function(String name, BytesReference source, XContentType xContentType) throws IOException { final NamedXContentRegistry registry = NamedXContentRegistry.EMPTY; try (InputStream stream = source.streamInput(); XContentParser parser = xContentType.xContent() .createParser(registry, LoggingDeprecationHandler.INSTANCE, stream)) { return parse(name, parser); } }
/** * Parse an {@link ExpressionRoleMapping} from the provided <em>XContent</em> */
Parse an <code>ExpressionRoleMapping</code> from the provided XContent
parse
{ "repo_name": "gingerwizard/elasticsearch", "path": "x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/support/mapper/ExpressionRoleMapping.java", "license": "apache-2.0", "size": 13056 }
[ "java.io.IOException", "java.io.InputStream", "org.elasticsearch.common.bytes.BytesReference", "org.elasticsearch.common.xcontent.LoggingDeprecationHandler", "org.elasticsearch.common.xcontent.NamedXContentRegistry", "org.elasticsearch.common.xcontent.XContentParser", "org.elasticsearch.common.xcontent.XContentType" ]
import java.io.IOException; import java.io.InputStream; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType;
import java.io.*; import org.elasticsearch.common.bytes.*; import org.elasticsearch.common.xcontent.*;
[ "java.io", "org.elasticsearch.common" ]
java.io; org.elasticsearch.common;
837,769
public void onSort(MenuItem item) { }
void function(MenuItem item) { }
/** * This method is declared in the menu. */
This method is declared in the menu
onSort
{ "repo_name": "luoqii/ApkLauncher_legacy", "path": "sample/ApiDemos/src/com/example/android/apis/view/VideoPlayerActivity.java", "license": "apache-2.0", "size": 9952 }
[ "android.view.MenuItem" ]
import android.view.MenuItem;
import android.view.*;
[ "android.view" ]
android.view;
1,837,614
@ServiceMethod(returns = ReturnType.SINGLE) void restart(String resourceGroupName, String hostGroupName, String hostname);
@ServiceMethod(returns = ReturnType.SINGLE) void restart(String resourceGroupName, String hostGroupName, String hostname);
/** * Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is * running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource * Health Center in the Azure Portal. Please refer to * https://docs.microsoft.com/en-us/azure/service-health/resource-health-overview for more details. * * @param resourceGroupName The name of the resource group. * @param hostGroupName The name of the dedicated host group. * @param hostname The name of the dedicated host. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.compute.models.ApiErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */
Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and is running. To determine the health of VMs deployed on the dedicated host after the restart check the Resource Health Center in the Azure Portal. Please refer to HREF for more details
restart
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java", "license": "mit", "size": 36147 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.*;
[ "com.azure.core" ]
com.azure.core;
1,914,470
public ConfigurableApplicationContext context() { return this.context; }
ConfigurableApplicationContext function() { return this.context; }
/** * Accessor for the current application context. * @return the current application context (or null if not yet running) */
Accessor for the current application context
context
{ "repo_name": "minmay/spring-boot", "path": "spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java", "license": "apache-2.0", "size": 17333 }
[ "org.springframework.context.ConfigurableApplicationContext" ]
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.*;
[ "org.springframework.context" ]
org.springframework.context;
1,081,386
void mergeFrom(@NotNull GitPushRepoResult repoResult) { for (Map.Entry<GitBranch, GitPushBranchResult> entry : repoResult.myBranchResults.entrySet()) { GitBranch branch = entry.getKey(); GitPushBranchResult branchResult = entry.getValue(); if (!myBranchResults.containsKey(branch)) { // otherwise current result is preferred myBranchResults.put(branch, branchResult); } } }
void mergeFrom(@NotNull GitPushRepoResult repoResult) { for (Map.Entry<GitBranch, GitPushBranchResult> entry : repoResult.myBranchResults.entrySet()) { GitBranch branch = entry.getKey(); GitPushBranchResult branchResult = entry.getValue(); if (!myBranchResults.containsKey(branch)) { myBranchResults.put(branch, branchResult); } } }
/** * Merges the given results to this result. * In the case of conflict (i.e. different results for a branch), current result is preferred over the previous one. */
Merges the given results to this result. In the case of conflict (i.e. different results for a branch), current result is preferred over the previous one
mergeFrom
{ "repo_name": "IllusionRom-deprecated/android_platform_tools_idea", "path": "plugins/git4idea/src/git4idea/push/GitPushRepoResult.java", "license": "apache-2.0", "size": 5195 }
[ "java.util.Map", "org.jetbrains.annotations.NotNull" ]
import java.util.Map; import org.jetbrains.annotations.NotNull;
import java.util.*; import org.jetbrains.annotations.*;
[ "java.util", "org.jetbrains.annotations" ]
java.util; org.jetbrains.annotations;
819,060
public void remove(String className) { checkEmpty(className, EMPTY_STRING_MSG); String internalTableName = TABLE_PREFIX + className; checkHasTable(className, "Cannot remove class because it is not in this Realm: " + className); Table table = getTable(className); if (table.hasPrimaryKey()) { table.setPrimaryKey(null); } transaction.removeTable(internalTableName); }
void function(String className) { checkEmpty(className, EMPTY_STRING_MSG); String internalTableName = TABLE_PREFIX + className; checkHasTable(className, STR + className); Table table = getTable(className); if (table.hasPrimaryKey()) { table.setPrimaryKey(null); } transaction.removeTable(internalTableName); }
/** * Removes a class from the Realm. All data will be removed. Removing a class while other classes point * to it will throw an {@link IllegalStateException}. Remove those classes or fields first. * * @param className name of the class to remove. */
Removes a class from the Realm. All data will be removed. Removing a class while other classes point to it will throw an <code>IllegalStateException</code>. Remove those classes or fields first
remove
{ "repo_name": "ShikaSD/realm-java", "path": "realm/realm-library/src/main/java/io/realm/RealmSchema.java", "license": "apache-2.0", "size": 11077 }
[ "io.realm.internal.Table" ]
import io.realm.internal.Table;
import io.realm.internal.*;
[ "io.realm.internal" ]
io.realm.internal;
660,066
public List<Anecdote> getAnecdotes() { return mAnecdotes; }
List<Anecdote> function() { return mAnecdotes; }
/** * Return the list of anecdotes already loaded by the service * * @return list of anecdote */
Return the list of anecdotes already loaded by the service
getAnecdotes
{ "repo_name": "HugoGresse/Anecdote", "path": "app/src/main/java/io/gresse/hugo/anecdote/anecdote/service/AnecdoteService.java", "license": "apache-2.0", "size": 4444 }
[ "io.gresse.hugo.anecdote.anecdote.model.Anecdote", "java.util.List" ]
import io.gresse.hugo.anecdote.anecdote.model.Anecdote; import java.util.List;
import io.gresse.hugo.anecdote.anecdote.model.*; import java.util.*;
[ "io.gresse.hugo", "java.util" ]
io.gresse.hugo; java.util;
110,270
public boolean setValue(InternalContextAdapter context, Object value) throws MethodInvocationException { if (jjtGetNumChildren() == 0) { context.put(rootString, value); return true; } Object result = getVariableValue(context, rootString); if (result == null) { String msg = "reference set is not a valid reference at " + Log.formatFileString(uberInfo); log.error(msg); return false; } for (int i = 0; i < numChildren - 1; i++) { result = jjtGetChild(i).execute(result, context); if (result == null) { if (strictRef) { String name = jjtGetChild(i+1).getFirstToken().image; throw new MethodInvocationException("Attempted to access '" + name + "' on a null value", null, name, uberInfo.getTemplateName(), jjtGetChild(i+1).getLine(), jjtGetChild(i+1).getColumn()); } String msg = "reference set is not a valid reference at " + Log.formatFileString(uberInfo); log.error(msg); return false; } } if (astIndex != null) { // If astIndex is not null then we are actually setting an index reference, // something of the form $foo[1] =, or in general any reference that ends with // the brackets. This means that we need to call a more general method // of the form set(Integer, <something>), or put(Object, <something), where // the first parameter is the index value and the second is the LHS of the set. Object argument = astIndex.jjtGetChild(0).value(context); // If negative, turn -1 into (size - 1) argument = ASTIndex.adjMinusIndexArg(argument, result, context, astIndex); Object [] params = {argument, value}; Class[] paramClasses = {params[0] == null ? null : params[0].getClass(), params[1] == null ? null : params[1].getClass()}; String methodName = "set"; VelMethod method = ClassUtils.getMethod(methodName, params, paramClasses, result, context, astIndex, false); if (method == null) { // If we can't find a 'set' method, lets try 'put', This warrents a little // investigation performance wise... if the user is using the hash // form $foo["blaa"], then it may be expensive to first try and fail on 'set' // then go to 'put'? The problem is that getMethod will try the cache, then // perform introspection on 'result' for 'set' methodName = "put"; method = ClassUtils.getMethod(methodName, params, paramClasses, result, context, astIndex, false); } if (method == null) { // couldn't find set or put method, so bail if (strictRef) { throw new VelocityException( "Found neither a 'set' or 'put' method with param types '(" + printClass(paramClasses[0]) + "," + printClass(paramClasses[1]) + ")' on class '" + result.getClass().getName() + "' at " + Log.formatFileString(astIndex)); } return false; } try { method.invoke(result, params); } catch(RuntimeException e) { // Kludge since invoke throws Exception, pass up Runtimes throw e; } catch(Exception e) { throw new MethodInvocationException( "Exception calling method '" + methodName + "(" + printClass(paramClasses[0]) + "," + printClass(paramClasses[1]) + ")' in " + result.getClass(), e.getCause(), identifier, astIndex.getTemplateName(), astIndex.getLine(), astIndex.getColumn()); } return true; } try { VelPropertySet vs = rsvc.getUberspect().getPropertySet(result, identifier, value, uberInfo); if (vs == null) { if (strictRef) { throw new MethodInvocationException("Object '" + result.getClass().getName() + "' does not contain property '" + identifier + "'", null, identifier, uberInfo.getTemplateName(), uberInfo.getLine(), uberInfo.getColumn()); } else { return false; } } vs.invoke(result, value); } catch(InvocationTargetException ite) { throw new MethodInvocationException( "ASTReference : Invocation of method '" + identifier + "' in " + result.getClass() + " threw exception " + ite.getTargetException().toString(), ite.getTargetException(), identifier, getTemplateName(), this.getLine(), this.getColumn()); } catch( RuntimeException e ) { throw e; } catch(Exception e) { String msg = "ASTReference setValue() : exception : " + e + " template at " + Log.formatFileString(uberInfo); log.error(msg, e); throw new VelocityException(msg, e); } return true; }
boolean function(InternalContextAdapter context, Object value) throws MethodInvocationException { if (jjtGetNumChildren() == 0) { context.put(rootString, value); return true; } Object result = getVariableValue(context, rootString); if (result == null) { String msg = STR + Log.formatFileString(uberInfo); log.error(msg); return false; } for (int i = 0; i < numChildren - 1; i++) { result = jjtGetChild(i).execute(result, context); if (result == null) { if (strictRef) { String name = jjtGetChild(i+1).getFirstToken().image; throw new MethodInvocationException(STR + name + STR, null, name, uberInfo.getTemplateName(), jjtGetChild(i+1).getLine(), jjtGetChild(i+1).getColumn()); } String msg = STR + Log.formatFileString(uberInfo); log.error(msg); return false; } } if (astIndex != null) { Object argument = astIndex.jjtGetChild(0).value(context); argument = ASTIndex.adjMinusIndexArg(argument, result, context, astIndex); Object [] params = {argument, value}; Class[] paramClasses = {params[0] == null ? null : params[0].getClass(), params[1] == null ? null : params[1].getClass()}; String methodName = "set"; VelMethod method = ClassUtils.getMethod(methodName, params, paramClasses, result, context, astIndex, false); if (method == null) { methodName = "put"; method = ClassUtils.getMethod(methodName, params, paramClasses, result, context, astIndex, false); } if (method == null) { if (strictRef) { throw new VelocityException( STR + printClass(paramClasses[0]) + "," + printClass(paramClasses[1]) + STR + result.getClass().getName() + STR + Log.formatFileString(astIndex)); } return false; } try { method.invoke(result, params); } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new MethodInvocationException( STR + methodName + "(" + printClass(paramClasses[0]) + "," + printClass(paramClasses[1]) + STR + result.getClass(), e.getCause(), identifier, astIndex.getTemplateName(), astIndex.getLine(), astIndex.getColumn()); } return true; } try { VelPropertySet vs = rsvc.getUberspect().getPropertySet(result, identifier, value, uberInfo); if (vs == null) { if (strictRef) { throw new MethodInvocationException(STR + result.getClass().getName() + STR + identifier + "'", null, identifier, uberInfo.getTemplateName(), uberInfo.getLine(), uberInfo.getColumn()); } else { return false; } } vs.invoke(result, value); } catch(InvocationTargetException ite) { throw new MethodInvocationException( STR + identifier + STR + result.getClass() + STR + ite.getTargetException().toString(), ite.getTargetException(), identifier, getTemplateName(), this.getLine(), this.getColumn()); } catch( RuntimeException e ) { throw e; } catch(Exception e) { String msg = STR + e + STR + Log.formatFileString(uberInfo); log.error(msg, e); throw new VelocityException(msg, e); } return true; }
/** * Sets the value of a complex reference (something like $foo.bar) * Currently used by ASTSetReference() * * @see ASTSetDirective * * @param context context object containing this reference * @param value Object to set as value * @return true if successful, false otherwise * @throws MethodInvocationException */
Sets the value of a complex reference (something like $foo.bar) Currently used by ASTSetReference()
setValue
{ "repo_name": "VISTALL/apache.velocity-engine", "path": "velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTReference.java", "license": "apache-2.0", "size": 34664 }
[ "java.lang.reflect.InvocationTargetException", "org.apache.velocity.context.InternalContextAdapter", "org.apache.velocity.exception.MethodInvocationException", "org.apache.velocity.exception.VelocityException", "org.apache.velocity.runtime.log.Log", "org.apache.velocity.util.ClassUtils", "org.apache.velocity.util.introspection.VelMethod", "org.apache.velocity.util.introspection.VelPropertySet" ]
import java.lang.reflect.InvocationTargetException; import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.exception.VelocityException; import org.apache.velocity.runtime.log.Log; import org.apache.velocity.util.ClassUtils; import org.apache.velocity.util.introspection.VelMethod; import org.apache.velocity.util.introspection.VelPropertySet;
import java.lang.reflect.*; import org.apache.velocity.context.*; import org.apache.velocity.exception.*; import org.apache.velocity.runtime.log.*; import org.apache.velocity.util.*; import org.apache.velocity.util.introspection.*;
[ "java.lang", "org.apache.velocity" ]
java.lang; org.apache.velocity;
241,413
protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new WebpageItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack();
void function() { adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new WebpageItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); BasicCommandStack commandStack = new BasicCommandStack();
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This sets up the editing domain for the model editor.
initializeEditingDomain
{ "repo_name": "hosny1993/vogella", "path": "de.vogella.emf.webpage.model.editor/src/de/vogella/emf/webpage/model/webpage/presentation/WebpageEditor.java", "license": "epl-1.0", "size": 55492 }
[ "de.vogella.emf.webpage.model.webpage.provider.WebpageItemProviderAdapterFactory", "org.eclipse.emf.common.command.BasicCommandStack", "org.eclipse.emf.edit.provider.ComposedAdapterFactory", "org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory", "org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory" ]
import de.vogella.emf.webpage.model.webpage.provider.WebpageItemProviderAdapterFactory; import org.eclipse.emf.common.command.BasicCommandStack; import org.eclipse.emf.edit.provider.ComposedAdapterFactory; import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import de.vogella.emf.webpage.model.webpage.provider.*; import org.eclipse.emf.common.command.*; import org.eclipse.emf.edit.provider.*; import org.eclipse.emf.edit.provider.resource.*;
[ "de.vogella.emf", "org.eclipse.emf" ]
de.vogella.emf; org.eclipse.emf;
1,188,292
public void onGpsStatusChanged(GpsStatus status, int satsInView, int satsUsed, Iterable<GpsSatellite> sats) { if (satsUsed == 0) { Location location = providerLocations.get(LocationManager.GPS_PROVIDER); if (location != null) markLocationAsStale(location); applyLocationProviderStyle(this.getContext(), LocationManager.GPS_PROVIDER, LOCATION_PROVIDER_GRAY); } }
void function(GpsStatus status, int satsInView, int satsUsed, Iterable<GpsSatellite> sats) { if (satsUsed == 0) { Location location = providerLocations.get(LocationManager.GPS_PROVIDER); if (location != null) markLocationAsStale(location); applyLocationProviderStyle(this.getContext(), LocationManager.GPS_PROVIDER, LOCATION_PROVIDER_GRAY); } }
/** * Called by {@link MainActivity} when the status of the GPS changes. Updates GPS display. */
Called by <code>MainActivity</code> when the status of the GPS changes. Updates GPS display
onGpsStatusChanged
{ "repo_name": "andree182/satstat", "path": "src/com/vonglasow/michael/satstat/MapSectionFragment.java", "license": "gpl-3.0", "size": 26374 }
[ "android.location.GpsSatellite", "android.location.GpsStatus", "android.location.Location", "android.location.LocationManager" ]
import android.location.GpsSatellite; import android.location.GpsStatus; import android.location.Location; import android.location.LocationManager;
import android.location.*;
[ "android.location" ]
android.location;
2,003,594
public boolean writeTo(ByteBuffer dst) { if (!headerComplete) { if (dst.remaining() < HEADER_SIZE) { return false; } dst.put(VERSION); dst.putChar(flags); dst.putInt(partitionId); size = totalSize(); dst.putInt(size); headerComplete = true; } return writeValue(dst); }
boolean function(ByteBuffer dst) { if (!headerComplete) { if (dst.remaining() < HEADER_SIZE) { return false; } dst.put(VERSION); dst.putChar(flags); dst.putInt(partitionId); size = totalSize(); dst.putInt(size); headerComplete = true; } return writeValue(dst); }
/** * Writes the packet data to the supplied {@code ByteBuffer}, up to the buffer's limit. If it returns {@code false}, * it should be called again to write the remaining data. * @param dst the destination byte buffer * @return {@code true} if all the packet's data is now written out; {@code false} otherwise. */
Writes the packet data to the supplied ByteBuffer, up to the buffer's limit. If it returns false, it should be called again to write the remaining data
writeTo
{ "repo_name": "emrahkocaman/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/nio/Packet.java", "license": "apache-2.0", "size": 14765 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
787,312
public Optional<String> getBqOpt() { return getAnnotationStringOpt("BQ"); }
Optional<String> function() { return getAnnotationStringOpt("BQ"); }
/** * Return an optional Type=Z value for the reserved key <code>BQ</code> * as a string. * * @return an optional Type=Z value for the reserved key <code>BQ</code> * as a string */
Return an optional Type=Z value for the reserved key <code>BQ</code> as a string
getBqOpt
{ "repo_name": "heuermh/dishevelled-bio", "path": "alignment/src/main/java/org/dishevelled/bio/alignment/sam/SamRecord.java", "license": "lgpl-3.0", "size": 61001 }
[ "java.util.Optional" ]
import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
2,145,442
Cursor c = db.query(false, USER_TABLE, null, "id_user=?", new String[] { id }, null, null, null, null); return getUserFromCursor(c); }
Cursor c = db.query(false, USER_TABLE, null, STR, new String[] { id }, null, null, null, null); return getUserFromCursor(c); }
/** * Find a user by his id * @param id * @return user */
Find a user by his id
findUserById
{ "repo_name": "Anparejo/DAM", "path": "MathGame/src/com/project/mathgame/model/UserDAO.java", "license": "gpl-2.0", "size": 4880 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
2,745,923
@Test(groups="his.lab.test" ,dependsOnMethods={"addNewLabTestRequestTestCase","addSpecimenInfoTestCase","getSpecimenByRequestIDTestCase", "getSpecimenIDByRequestIDTestCase"}) public void getAllSpecimenTypeTestCase() throws IOException { ArrayList<String> resArrayList = getHTTPResponse( properties.getProperty(TestCaseConstants.URL_APPEND_GET_ALL_SPECIMEN_TYPES), TestCaseConstants.HTTP_GET, null); Assert.assertEquals(Integer.parseInt(resArrayList.get(1)),SUCCESS_STATUS_CODE ); }
@Test(groups=STR ,dependsOnMethods={STR,STR,STR, STR}) void function() throws IOException { ArrayList<String> resArrayList = getHTTPResponse( properties.getProperty(TestCaseConstants.URL_APPEND_GET_ALL_SPECIMEN_TYPES), TestCaseConstants.HTTP_GET, null); Assert.assertEquals(Integer.parseInt(resArrayList.get(1)),SUCCESS_STATUS_CODE ); }
/** * This is get all speciment type Specimen Test Case. * * @throws IOException * Signals that an I/O exception of some sort has occurred. This * class is the general class of exceptions produced by failed * or interrupted I/O operations. * @throws JSONException * Exception throws when process Json */
This is get all speciment type Specimen Test Case
getAllSpecimenTypeTestCase
{ "repo_name": "SLIIT-FacultyOfComputing/Digital-Pulz-for-Hospitals", "path": "HIS_Latest_Project_29-07-2016/TestCases/HIS/src/LabTestRequestTestCase.java", "license": "apache-2.0", "size": 11592 }
[ "java.io.IOException", "java.util.ArrayList", "org.testng.Assert", "org.testng.annotations.Test" ]
import java.io.IOException; import java.util.ArrayList; import org.testng.Assert; import org.testng.annotations.Test;
import java.io.*; import java.util.*; import org.testng.*; import org.testng.annotations.*;
[ "java.io", "java.util", "org.testng", "org.testng.annotations" ]
java.io; java.util; org.testng; org.testng.annotations;
691,739
void setBodyWidget( final Widget w );
void setBodyWidget( final Widget w );
/** * Set the Widget to display in the body panel of the generic Wizard * @param w */
Set the Widget to display in the body panel of the generic Wizard
setBodyWidget
{ "repo_name": "wmedvede/uberfire-extensions", "path": "uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardView.java", "license": "apache-2.0", "size": 2183 }
[ "com.google.gwt.user.client.ui.Widget" ]
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
2,705,317
@GwtIncompatible("To be supported") CacheBuilder<K, V> lenientParsing() { strictParsing = false; return this; }
@GwtIncompatible(STR) CacheBuilder<K, V> lenientParsing() { strictParsing = false; return this; }
/** * Enables lenient parsing. Useful for tests and spec parsing. */
Enables lenient parsing. Useful for tests and spec parsing
lenientParsing
{ "repo_name": "eoneil1942/voltdb-4.7fix", "path": "third_party/java/src/com/google_voltpatches/common/cache/CacheBuilder.java", "license": "agpl-3.0", "size": 38141 }
[ "com.google_voltpatches.common.annotations.GwtIncompatible" ]
import com.google_voltpatches.common.annotations.GwtIncompatible;
import com.google_voltpatches.common.annotations.*;
[ "com.google_voltpatches.common" ]
com.google_voltpatches.common;
2,838,432
public void setSectionPaint(Comparable key, Paint paint) { // null argument check delegated... this.sectionPaintMap.put(key, paint); notifyListeners(new PlotChangeEvent(this)); }
void function(Comparable key, Paint paint) { this.sectionPaintMap.put(key, paint); notifyListeners(new PlotChangeEvent(this)); }
/** * Sets the paint associated with the specified key, and sends a * {@link PlotChangeEvent} to all registered listeners. * * @param key the key (<code>null</code> not permitted). * @param paint the paint. * * @throws IllegalArgumentException if <code>key</code> is * <code>null</code>. * * @see #getSectionPaint(Comparable) * * @since 1.0.3 */
Sets the paint associated with the specified key, and sends a <code>PlotChangeEvent</code> to all registered listeners
setSectionPaint
{ "repo_name": "ibestvina/multithread-centiscape", "path": "CentiScaPe2.1/src/main/java/org/jfree/chart/plot/PiePlot.java", "license": "mit", "size": 116475 }
[ "java.awt.Paint", "org.jfree.chart.event.PlotChangeEvent" ]
import java.awt.Paint; import org.jfree.chart.event.PlotChangeEvent;
import java.awt.*; import org.jfree.chart.event.*;
[ "java.awt", "org.jfree.chart" ]
java.awt; org.jfree.chart;
982,035
@Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); // After draw child, we do the following things: // +1, Draw the center rectangle. // +2, Draw the shadows on the top and bottom. // drawCenterRect(canvas); // drawShadows(canvas); }
void function(Canvas canvas) { super.dispatchDraw(canvas); }
/** * Called by draw to draw the child views. This may be overridden by derived classes to gain * control just before its children are drawn (but after its own view has been drawn). */
Called by draw to draw the child views. This may be overridden by derived classes to gain control just before its children are drawn (but after its own view has been drawn)
dispatchDraw
{ "repo_name": "liangchenhe55/konkeWatch", "path": "mobile/src/main/java/cc/chenhe/konke/watch/ui/wheel/WheelView.java", "license": "gpl-2.0", "size": 4854 }
[ "android.graphics.Canvas" ]
import android.graphics.Canvas;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
816,147
private Object joinTransaction(EntityManager em) { boolean newTx = false; UserTransaction ut = null; if (isJTA) { try { em.joinTransaction(); } catch (TransactionRequiredException e) { ut = findUserTransaction(); try { if( ut != null && ut.getStatus() == Status.STATUS_NO_TRANSACTION ) { ut.begin(); newTx = true; // since new transaction was started em must join it em.joinTransaction(); } } catch(Exception ex) { throw new IllegalStateException("Unable to find or open a transaction: " + ex.getMessage(), ex); } if (!newTx) { // rethrow TransactionRequiredException if UserTransaction was not found or started throw e; } } if( newTx ) { return ut; } } // else { // EntityTransaction tx = em.getTransaction(); // if( ! tx.isActive() ) { // tx.begin(); // return tx; // } // } return null; }
Object function(EntityManager em) { boolean newTx = false; UserTransaction ut = null; if (isJTA) { try { em.joinTransaction(); } catch (TransactionRequiredException e) { ut = findUserTransaction(); try { if( ut != null && ut.getStatus() == Status.STATUS_NO_TRANSACTION ) { ut.begin(); newTx = true; em.joinTransaction(); } } catch(Exception ex) { throw new IllegalStateException(STR + ex.getMessage(), ex); } if (!newTx) { throw e; } } if( newTx ) { return ut; } } return null; }
/** * This method opens a new transaction, if none is currently running, and joins the entity manager/persistence context * to that transaction. * @param em The entity manager we're using. * @return {@link UserTransaction} If we've started a new transaction, then we return it so that it can be closed. * @throws NotSupportedException * @throws SystemException * @throws Exception if something goes wrong. */
This method opens a new transaction, if none is currently running, and joins the entity manager/persistence context to that transaction
joinTransaction
{ "repo_name": "mrietveld/jbpm", "path": "jbpm-audit/src/main/java/org/jbpm/process/audit/JPAWorkingMemoryDbLogger.java", "license": "apache-2.0", "size": 12028 }
[ "javax.persistence.EntityManager", "javax.persistence.TransactionRequiredException", "javax.transaction.Status", "javax.transaction.UserTransaction" ]
import javax.persistence.EntityManager; import javax.persistence.TransactionRequiredException; import javax.transaction.Status; import javax.transaction.UserTransaction;
import javax.persistence.*; import javax.transaction.*;
[ "javax.persistence", "javax.transaction" ]
javax.persistence; javax.transaction;
501,408
private void initializeInternalCacheNames() { FileSystemConfiguration[] igfsCfgs = ctx.grid().configuration().getFileSystemConfiguration(); if (igfsCfgs != null) { for (FileSystemConfiguration igfsCfg : igfsCfgs) { internalCaches.add(igfsCfg.getMetaCacheConfiguration().getName()); internalCaches.add(igfsCfg.getDataCacheConfiguration().getName()); } } if (IgniteComponentType.HADOOP.inClassPath()) internalCaches.add(CU.SYS_CACHE_HADOOP_MR); }
void function() { FileSystemConfiguration[] igfsCfgs = ctx.grid().configuration().getFileSystemConfiguration(); if (igfsCfgs != null) { for (FileSystemConfiguration igfsCfg : igfsCfgs) { internalCaches.add(igfsCfg.getMetaCacheConfiguration().getName()); internalCaches.add(igfsCfg.getDataCacheConfiguration().getName()); } } if (IgniteComponentType.HADOOP.inClassPath()) internalCaches.add(CU.SYS_CACHE_HADOOP_MR); }
/** * Initialize internal cache names */
Initialize internal cache names
initializeInternalCacheNames
{ "repo_name": "endian675/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java", "license": "apache-2.0", "size": 172471 }
[ "org.apache.ignite.configuration.FileSystemConfiguration", "org.apache.ignite.internal.IgniteComponentType" ]
import org.apache.ignite.configuration.FileSystemConfiguration; import org.apache.ignite.internal.IgniteComponentType;
import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
177,688
public Element addMarkerRect(double x1, double width) { return svgp.svgRect(x1, 0, width, plotheight); }
Element function(double x1, double width) { return svgp.svgRect(x1, 0, width, plotheight); }
/** * Create a rectangle as marker (Marker higher than plot!) * * @param x1 X-Value for the marker * @param width Width of an entry * @return SVG-Element svg-rectangle */
Create a rectangle as marker (Marker higher than plot!)
addMarkerRect
{ "repo_name": "elki-project/elki", "path": "addons/batikvis/src/main/java/elki/visualization/visualizers/optics/OPTICSPlotSelectionVisualization.java", "license": "agpl-3.0", "size": 11204 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
2,094,948
public LexicalHandler getLexicalHandler() { return lexhandler; }
LexicalHandler function() { return lexhandler; }
/** * Get a SAX2 {@link org.xml.sax.ext.LexicalHandler} for the output. * * @return A <code>LexicalHandler</code>, or null. */
Get a SAX2 <code>org.xml.sax.ext.LexicalHandler</code> for the output
getLexicalHandler
{ "repo_name": "AlexBrowneP/xerces-for-android", "path": "src/mf/javax/xml/transform/sax/SAXResult.java", "license": "apache-2.0", "size": 5363 }
[ "org.xml.sax.ext.LexicalHandler" ]
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.ext.*;
[ "org.xml.sax" ]
org.xml.sax;
2,705,439
private String executeScriptGetValueRequest(String openCpuSessionKey) throws IOException { URI scriptGetValueResponseUri = getScriptGetValueResponseUri(openCpuSessionKey); HttpGet httpGet = new HttpGet(scriptGetValueResponseUri); String responseValue; try (CloseableHttpResponse response = httpClient.execute(httpGet)) { int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 200 && statusCode < 300) { HttpEntity entity = response.getEntity(); responseValue = EntityUtils.toString(entity); EntityUtils.consume(entity); } else { throw new ClientProtocolException(format("Unexpected response status: %d", statusCode)); } } return responseValue; }
String function(String openCpuSessionKey) throws IOException { URI scriptGetValueResponseUri = getScriptGetValueResponseUri(openCpuSessionKey); HttpGet httpGet = new HttpGet(scriptGetValueResponseUri); String responseValue; try (CloseableHttpResponse response = httpClient.execute(httpGet)) { int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 200 && statusCode < 300) { HttpEntity entity = response.getEntity(); responseValue = EntityUtils.toString(entity); EntityUtils.consume(entity); } else { throw new ClientProtocolException(format(STR, statusCode)); } } return responseValue; }
/** * Retrieve and return R script STDOUT response using OpenCPU * * @param openCpuSessionKey OpenCPU session key * @return R script STDOUT * @throws IOException if error occured during script response retrieval */
Retrieve and return R script STDOUT response using OpenCPU
executeScriptGetValueRequest
{ "repo_name": "ChaoPang/molgenis", "path": "molgenis-r/src/main/java/org/molgenis/r/RScriptExecutor.java", "license": "lgpl-3.0", "size": 7979 }
[ "java.io.IOException", "org.apache.http.HttpEntity", "org.apache.http.client.ClientProtocolException", "org.apache.http.client.methods.CloseableHttpResponse", "org.apache.http.client.methods.HttpGet", "org.apache.http.util.EntityUtils" ]
import java.io.IOException; import org.apache.http.HttpEntity; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.util.EntityUtils;
import java.io.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.http.util.*;
[ "java.io", "org.apache.http" ]
java.io; org.apache.http;
483,873
public static synchronized void reload() throws IOException, MarshalException, ValidationException { init(); getInstance().update(); }
static synchronized void function() throws IOException, MarshalException, ValidationException { init(); getInstance().update(); }
/** * Reload the config from the default config file * * @exception java.io.IOException * Thrown if the specified config file cannot be read/loaded * @exception org.exolab.castor.xml.MarshalException * Thrown if the file does not conform to the schema. * @exception org.exolab.castor.xml.ValidationException * Thrown if the contents do not match the required schema. * @throws java.io.IOException if any. * @throws org.exolab.castor.xml.MarshalException if any. * @throws org.exolab.castor.xml.ValidationException if any. */
Reload the config from the default config file
reload
{ "repo_name": "tdefilip/opennms", "path": "integrations/opennms-map-provisioning-adapter/src/main/java/org/opennms/netmgt/config/MapsAdapterConfigFactory.java", "license": "agpl-3.0", "size": 8172 }
[ "java.io.IOException", "org.exolab.castor.xml.MarshalException", "org.exolab.castor.xml.ValidationException" ]
import java.io.IOException; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException;
import java.io.*; import org.exolab.castor.xml.*;
[ "java.io", "org.exolab.castor" ]
java.io; org.exolab.castor;
1,385,157
public void logSummary( StepInterface si ) { log .logBasic( si.getStepname(), BaseMessages .getString( PKG, "Trans.Log.FinishedProcessing", String.valueOf( si.getLinesInput() ), String.valueOf( si .getLinesOutput() ), String.valueOf( si.getLinesRead() ) ) + BaseMessages.getString( PKG, "Trans.Log.FinishedProcessing2", String.valueOf( si.getLinesWritten() ), String.valueOf( si .getLinesUpdated() ), String.valueOf( si.getErrors() ) ) ); }
void function( StepInterface si ) { log .logBasic( si.getStepname(), BaseMessages .getString( PKG, STR, String.valueOf( si.getLinesInput() ), String.valueOf( si .getLinesOutput() ), String.valueOf( si.getLinesRead() ) ) + BaseMessages.getString( PKG, STR, String.valueOf( si.getLinesWritten() ), String.valueOf( si .getLinesUpdated() ), String.valueOf( si.getErrors() ) ) ); }
/** * Logs a summary message for the specified step. * * @param si * the step interface */
Logs a summary message for the specified step
logSummary
{ "repo_name": "EcoleKeine/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 194675 }
[ "org.pentaho.di.i18n.BaseMessages", "org.pentaho.di.trans.step.StepInterface" ]
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.i18n.*; import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,891,831
public ServiceFuture<DomainOwnershipIdentifierInner> createOrUpdateOwnershipIdentifierAsync(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier, final ServiceCallback<DomainOwnershipIdentifierInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier), serviceCallback); }
ServiceFuture<DomainOwnershipIdentifierInner> function(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier, final ServiceCallback<DomainOwnershipIdentifierInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier), serviceCallback); }
/** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * Creates an ownership identifier for a domain or updates identifier details for an existing identifer. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param domainName Name of domain. * @param name Name of identifier. * @param domainOwnershipIdentifier A JSON representation of the domain ownership properties. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Creates an ownership identifier for a domain or updates identifier details for an existing identifer. Creates an ownership identifier for a domain or updates identifier details for an existing identifer
createOrUpdateOwnershipIdentifierAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/appservice/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java", "license": "mit", "size": 139463 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,340,432
public long sleep(long time) { final long start = System.currentTimeMillis(); try { Thread.sleep(time); } catch (InterruptedException e) { this.commonCore.report(MessageType.EXCEPTION, "Sleep interrupted"); return time - (System.currentTimeMillis() - start); } return 0; }
long function(long time) { final long start = System.currentTimeMillis(); try { Thread.sleep(time); } catch (InterruptedException e) { this.commonCore.report(MessageType.EXCEPTION, STR); return time - (System.currentTimeMillis() - start); } return 0; }
/** * Puts the current thread to sleep for some time, without the need for any try/catch block. * * @param time The time to sleep. * @return A value of <code>0</code> if the sleep was successful, or else the amount * of milliseconds which we woke up too early. */
Puts the current thread to sleep for some time, without the need for any try/catch block
sleep
{ "repo_name": "ubicity-devs/jcores", "path": "src/main/java/net/jcores/jre/cores/commons/CommonSys.java", "license": "agpl-3.0", "size": 7828 }
[ "net.jcores.jre.options.MessageType" ]
import net.jcores.jre.options.MessageType;
import net.jcores.jre.options.*;
[ "net.jcores.jre" ]
net.jcores.jre;
1,806,231
protected void setupTest() throws IOException { UnderFileSystem ufs = UnderFileSystem.Factory.createForRoot(); String underfsAddress = Configuration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS); // Deletes the ufs dir for this test from to avoid permission problems UnderFileSystemUtils.deleteDirIfExists(ufs, underfsAddress); // Creates ufs dir. This must be called before starting UFS with UnderFileSystemCluster.get(). UnderFileSystemUtils.mkdirIfNotExists(ufs, underfsAddress); // Creates storage dirs for worker int numLevel = Configuration.getInt(PropertyKey.WORKER_TIERED_STORE_LEVELS); for (int level = 0; level < numLevel; level++) { PropertyKey tierLevelDirPath = PropertyKey.Template.WORKER_TIERED_STORE_LEVEL_DIRS_PATH.format(level); String[] dirPaths = Configuration.get(tierLevelDirPath).split(","); for (String dirPath : dirPaths) { FileUtils.createDir(dirPath); } } // Formats the journal Format.format(Format.Mode.MASTER); }
void function() throws IOException { UnderFileSystem ufs = UnderFileSystem.Factory.createForRoot(); String underfsAddress = Configuration.get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS); UnderFileSystemUtils.deleteDirIfExists(ufs, underfsAddress); UnderFileSystemUtils.mkdirIfNotExists(ufs, underfsAddress); int numLevel = Configuration.getInt(PropertyKey.WORKER_TIERED_STORE_LEVELS); for (int level = 0; level < numLevel; level++) { PropertyKey tierLevelDirPath = PropertyKey.Template.WORKER_TIERED_STORE_LEVEL_DIRS_PATH.format(level); String[] dirPaths = Configuration.get(tierLevelDirPath).split(","); for (String dirPath : dirPaths) { FileUtils.createDir(dirPath); } } Format.format(Format.Mode.MASTER); }
/** * Sets up corresponding directories for tests. */
Sets up corresponding directories for tests
setupTest
{ "repo_name": "aaudiber/alluxio", "path": "minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java", "license": "apache-2.0", "size": 9716 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,838,225
public static Map<String, String> getLatestPartSpec(Map<String, String> partSpec, String partCol) { Map<String, String> latestSpec = new HashMap<String, String>(); latestSpec.putAll(partSpec); latestSpec.put(partCol, LATEST_PARTITION_VALUE); return latestSpec; }
static Map<String, String> function(Map<String, String> partSpec, String partCol) { Map<String, String> latestSpec = new HashMap<String, String>(); latestSpec.putAll(partSpec); latestSpec.put(partCol, LATEST_PARTITION_VALUE); return latestSpec; }
/** * Get the partition spec for latest partition * * @param The * partition column for latest spec * * @return latest partition spec as Map from String to String */
Get the partition spec for latest partition
getLatestPartSpec
{ "repo_name": "rajubairishetti/lens", "path": "lens-cube/src/main/java/org/apache/lens/cube/metadata/StorageConstants.java", "license": "apache-2.0", "size": 2214 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,775,105
EAttribute getSayTeamMessage_UserTeam();
EAttribute getSayTeamMessage_UserTeam();
/** * Returns the meta object for the attribute '{@link MessagesModel.SayTeamMessage#getUserTeam <em>User Team</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>User Team</em>'. * @see MessagesModel.SayTeamMessage#getUserTeam() * @see #getSayTeamMessage() * @generated */
Returns the meta object for the attribute '<code>MessagesModel.SayTeamMessage#getUserTeam User Team</code>'.
getSayTeamMessage_UserTeam
{ "repo_name": "Hu3bl/statsbot", "path": "statsbot-parent/statsbot-module.messages.model/src/main/java/MessagesModel/ModelPackage.java", "license": "mit", "size": 147130 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
773,151
List<ProjectionSeed> result = new ArrayList<ProjectionSeed>(); ExternalProjectionColumns ann = clazz.getAnnotation(ExternalProjectionColumns.class); if ((ann != null) && ClassDescriptor.isInRequiredGroup(requiredGroups, ann.groups())) { ExternalProjectionColumn[] pcs = ann.value(); if (StringUtils.isEmpty(ann.fieldName())) { throw new IllegalArgumentException( "ProjectionColumns annotation on class level must have fieldName set"); } for (int j = 0; j < pcs.length; j++) { ExternalProjectionColumn epc = pcs[j]; if (ClassDescriptor.isInRequiredGroup(requiredGroups, epc.groups())) { result.add(new ProjectionSeed(ann.clazz().getSimpleName(), ann.fieldName(), epc.columnName(), epc.property(), epc.aggregate())); } } } // field by field PropertyDescriptor[] pds = PropertyUtils.getPropertyDescriptors(clazz); String entityClazz = clazz.getSimpleName(); String entityAlias = StringUtils.uncapitalize(entityClazz); for (int i = 0; i < pds.length; i++) { Method m = pds[i].getReadMethod(); ProjectionColumn project = m.getAnnotation(ProjectionColumn.class); if ((project != null) && ClassDescriptor.isInRequiredGroup(requiredGroups, project.groups())) { result.add(processAnnotation(entityClazz, entityAlias, pds[i].getName(), project)); } ProjectionColumns projects = m.getAnnotation(ProjectionColumns.class); // ignore fieldName on annotation, instead assume the property name if ((projects != null) && ClassDescriptor.isInRequiredGroup(requiredGroups, projects.groups())) { ProjectionColumn[] pcs = projects.value(); for (int j = 0; j < pcs.length; j++) { result.add(processAnnotation(entityClazz, entityAlias, pds[i].getName(), pcs[j])); } } } return result; }
List<ProjectionSeed> result = new ArrayList<ProjectionSeed>(); ExternalProjectionColumns ann = clazz.getAnnotation(ExternalProjectionColumns.class); if ((ann != null) && ClassDescriptor.isInRequiredGroup(requiredGroups, ann.groups())) { ExternalProjectionColumn[] pcs = ann.value(); if (StringUtils.isEmpty(ann.fieldName())) { throw new IllegalArgumentException( STR); } for (int j = 0; j < pcs.length; j++) { ExternalProjectionColumn epc = pcs[j]; if (ClassDescriptor.isInRequiredGroup(requiredGroups, epc.groups())) { result.add(new ProjectionSeed(ann.clazz().getSimpleName(), ann.fieldName(), epc.columnName(), epc.property(), epc.aggregate())); } } } PropertyDescriptor[] pds = PropertyUtils.getPropertyDescriptors(clazz); String entityClazz = clazz.getSimpleName(); String entityAlias = StringUtils.uncapitalize(entityClazz); for (int i = 0; i < pds.length; i++) { Method m = pds[i].getReadMethod(); ProjectionColumn project = m.getAnnotation(ProjectionColumn.class); if ((project != null) && ClassDescriptor.isInRequiredGroup(requiredGroups, project.groups())) { result.add(processAnnotation(entityClazz, entityAlias, pds[i].getName(), project)); } ProjectionColumns projects = m.getAnnotation(ProjectionColumns.class); if ((projects != null) && ClassDescriptor.isInRequiredGroup(requiredGroups, projects.groups())) { ProjectionColumn[] pcs = projects.value(); for (int j = 0; j < pcs.length; j++) { result.add(processAnnotation(entityClazz, entityAlias, pds[i].getName(), pcs[j])); } } } return result; }
/** * JAVADOC Method Level Comments * * @param clazz JAVADOC. * @return JAVADOC. */
JAVADOC Method Level Comments
getProjections
{ "repo_name": "cucina/opencucina", "path": "search/src/main/java/org/cucina/search/model/ProjectionSeed.java", "license": "apache-2.0", "size": 5297 }
[ "java.beans.PropertyDescriptor", "java.lang.reflect.Method", "java.util.ArrayList", "java.util.List", "org.apache.commons.beanutils.PropertyUtils", "org.apache.commons.lang3.StringUtils", "org.cucina.core.model.projection.ExternalProjectionColumn", "org.cucina.core.model.projection.ExternalProjectionColumns", "org.cucina.core.model.projection.ProjectionColumn", "org.cucina.core.model.projection.ProjectionColumns", "org.cucina.core.utils.ClassDescriptor" ]
import java.beans.PropertyDescriptor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.lang3.StringUtils; import org.cucina.core.model.projection.ExternalProjectionColumn; import org.cucina.core.model.projection.ExternalProjectionColumns; import org.cucina.core.model.projection.ProjectionColumn; import org.cucina.core.model.projection.ProjectionColumns; import org.cucina.core.utils.ClassDescriptor;
import java.beans.*; import java.lang.reflect.*; import java.util.*; import org.apache.commons.beanutils.*; import org.apache.commons.lang3.*; import org.cucina.core.model.projection.*; import org.cucina.core.utils.*;
[ "java.beans", "java.lang", "java.util", "org.apache.commons", "org.cucina.core" ]
java.beans; java.lang; java.util; org.apache.commons; org.cucina.core;
2,460,239
synchronized int getNumberOfFiles() throws DatabaseException { assert cachePopulated; return fileSummaryMap.size(); }
synchronized int getNumberOfFiles() throws DatabaseException { assert cachePopulated; return fileSummaryMap.size(); }
/** * Returns the number of files in the profile. */
Returns the number of files in the profile
getNumberOfFiles
{ "repo_name": "ckaestne/CIDE", "path": "CIDE_Samples/cide_samples/Berkeley DB JE/src/com/sleepycat/je/cleaner/UtilizationProfile.java", "license": "gpl-3.0", "size": 47270 }
[ "com.sleepycat.je.DatabaseException" ]
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
1,466,419
protected JButton createDecreaseButton(int orientation) { if (orientation == NORTH) { this.decreaseButton = new JButton(new ImageIcon(getClass().getResource("up.png"))); } else { this.decreaseButton = new JButton(new ImageIcon(getClass().getResource("left.png"))); } this.decreaseButton.setBorder(null); // decreaseButton = new IScrollBarUI(orientation, scrollBarWidth, // freeStanding); return this.decreaseButton; }
JButton function(int orientation) { if (orientation == NORTH) { this.decreaseButton = new JButton(new ImageIcon(getClass().getResource(STR))); } else { this.decreaseButton = new JButton(new ImageIcon(getClass().getResource(STR))); } this.decreaseButton.setBorder(null); return this.decreaseButton; }
/** * Creates the decrease button of the scrollbar. * * @param orientation The button's orientation. * @return The created button. */
Creates the decrease button of the scrollbar
createDecreaseButton
{ "repo_name": "eric-lemesre/OpenConcerto", "path": "OpenConcerto/src/org/openconcerto/laf/IScrollBarUI.java", "license": "gpl-3.0", "size": 9544 }
[ "javax.swing.ImageIcon", "javax.swing.JButton" ]
import javax.swing.ImageIcon; import javax.swing.JButton;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,223,490
public static String eventTypeGet(Long eventID, Context context) { String events = WriteRead.read(ADVERSEINFOFILE, context); String eventType = ""; try { JSONArray jsonarray = new JSONArray(events); for (int i = 0; i < jsonarray.length(); i++) { JSONObject jsonobject = jsonarray.getJSONObject(i); if (jsonobject.getString("id").equals("" + eventID)) { final String name = jsonobject.getString("name"); eventType = name; break; } } } catch (JSONException e) { System.out.print("unsuccessful"); } return eventType; }
static String function(Long eventID, Context context) { String events = WriteRead.read(ADVERSEINFOFILE, context); String eventType = STRidSTRSTRnameSTRunsuccessful"); } return eventType; }
/** * reads event information from file saved on device * @param eventID * @param context * @return */
reads event information from file saved on device
eventTypeGet
{ "repo_name": "thandile/msf_communique", "path": "app/src/main/java/com/example/msf/msf/Utils/DataAdapter.java", "license": "mit", "size": 18193 }
[ "android.content.Context", "com.example.msf.msf.Utils" ]
import android.content.Context; import com.example.msf.msf.Utils;
import android.content.*; import com.example.msf.msf.*;
[ "android.content", "com.example.msf" ]
android.content; com.example.msf;
735,299
public int getNumberOfOutputParameters() { if (numberOfOutputValues == -1) { COSArray rangeValues = getRangeValues(); numberOfOutputValues = rangeValues.size() / 2; } return numberOfOutputValues; }
int function() { if (numberOfOutputValues == -1) { COSArray rangeValues = getRangeValues(); numberOfOutputValues = rangeValues.size() / 2; } return numberOfOutputValues; }
/** * This will get the number of output parameters that * have a range specified. A range for output parameters * is optional so this may return zero for a function * that does have output parameters, this will simply return the * number that have the range specified. * * @return The number of output parameters that have a range * specified. */
This will get the number of output parameters that have a range specified. A range for output parameters is optional so this may return zero for a function that does have output parameters, this will simply return the number that have the range specified
getNumberOfOutputParameters
{ "repo_name": "kalaspuffar/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/function/PDFunction.java", "license": "apache-2.0", "size": 10573 }
[ "org.apache.pdfbox.cos.COSArray" ]
import org.apache.pdfbox.cos.COSArray;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
133,625
EReference getHLAnnotation_Structure();
EReference getHLAnnotation_Structure();
/** * Returns the meta object for the containment reference '{@link fr.lip6.move.pnml.symmetricnet.hlcorestructure.HLAnnotation#getStructure <em>Structure</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Structure</em>'. * @see fr.lip6.move.pnml.symmetricnet.hlcorestructure.HLAnnotation#getStructure() * @see #getHLAnnotation() * @generated */
Returns the meta object for the containment reference '<code>fr.lip6.move.pnml.symmetricnet.hlcorestructure.HLAnnotation#getStructure Structure</code>'.
getHLAnnotation_Structure
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/hlcorestructure/HlcorestructurePackage.java", "license": "epl-1.0", "size": 178846 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
30,655
public EnumJvmMemoryGCVerboseLevel getJvmMemoryGCVerboseLevel() throws SnmpStatusException { if (ManagementFactory.getMemoryMXBean().isVerbose()) return JvmMemoryGCVerboseLevelVerbose; else return JvmMemoryGCVerboseLevelSilent; }
EnumJvmMemoryGCVerboseLevel function() throws SnmpStatusException { if (ManagementFactory.getMemoryMXBean().isVerbose()) return JvmMemoryGCVerboseLevelVerbose; else return JvmMemoryGCVerboseLevelSilent; }
/** * Getter for the "JvmMemoryGCVerboseLevel" variable. */
Getter for the "JvmMemoryGCVerboseLevel" variable
getJvmMemoryGCVerboseLevel
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java", "license": "mit", "size": 13562 }
[ "com.sun.jmx.snmp.SnmpStatusException", "java.lang.management.ManagementFactory" ]
import com.sun.jmx.snmp.SnmpStatusException; import java.lang.management.ManagementFactory;
import com.sun.jmx.snmp.*; import java.lang.management.*;
[ "com.sun.jmx", "java.lang" ]
com.sun.jmx; java.lang;
1,662,686
GenericCriteria setLockMode(String alias, LockMode lockMode);
GenericCriteria setLockMode(String alias, LockMode lockMode);
/** * Set the lock mode of the aliased entity * * @param alias * The previously assigned alias representing the entity to which the given * lock mode should apply. * @param lockMode * The lock mode to be applied * @return this (for method chaining) */
Set the lock mode of the aliased entity
setLockMode
{ "repo_name": "openfurther/further-open-core", "path": "core/core-data/src/main/java/edu/utah/further/core/data/hibernate/adapter/GenericCriteria.java", "license": "apache-2.0", "size": 11573 }
[ "org.hibernate.LockMode" ]
import org.hibernate.LockMode;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
888,608
public void copyComponents(ArrayList<Component> source) { for (Component c : source) { components.add(c.copy()); } }
void function(ArrayList<Component> source) { for (Component c : source) { components.add(c.copy()); } }
/** * Copy the components from the source array into this class * * @param source */
Copy the components from the source array into this class
copyComponents
{ "repo_name": "rsahlin/graphics-by-opengl", "path": "graphics-by-opengl-j2se/src/main/java/com/nucleus/scene/ComponentNode.java", "license": "apache-2.0", "size": 5922 }
[ "com.nucleus.component.Component", "java.util.ArrayList" ]
import com.nucleus.component.Component; import java.util.ArrayList;
import com.nucleus.component.*; import java.util.*;
[ "com.nucleus.component", "java.util" ]
com.nucleus.component; java.util;
1,976,768
if (req == null) throw new NullPointerException("the request cannot be null"); // init the context try { RequestData.context.set(new Context(req)); } catch (C5CException e) { throw new RuntimeException("Couldn't initialize the context.", e); } String referer = req.getHeader("referer"); if(StringUtils.isNullOrEmptyOrBlank(referer)) locale.set(req.getLocale()); try { URL url = new URL(referer); Map<String, String> params = StringUtils.divideAndDecodeQueryString(url.getQuery()); String langCode = params.get("langCode"); if(StringUtils.isNullOrEmptyOrBlank(langCode)) { logger.warn("Couldn't analyse the locale from the referer to use, take the default one."); locale.set(PropertiesLoader.getDefaultLocale()); } else { locale.set(new Locale(langCode.toLowerCase())); } } catch (Exception e) { logger.warn("Couldn't analyse the locale to use, take the default one."); locale.set(PropertiesLoader.getDefaultLocale()); } }
if (req == null) throw new NullPointerException(STR); try { RequestData.context.set(new Context(req)); } catch (C5CException e) { throw new RuntimeException(STR, e); } String referer = req.getHeader(STR); if(StringUtils.isNullOrEmptyOrBlank(referer)) locale.set(req.getLocale()); try { URL url = new URL(referer); Map<String, String> params = StringUtils.divideAndDecodeQueryString(url.getQuery()); String langCode = params.get(STR); if(StringUtils.isNullOrEmptyOrBlank(langCode)) { logger.warn(STR); locale.set(PropertiesLoader.getDefaultLocale()); } else { locale.set(new Locale(langCode.toLowerCase())); } } catch (Exception e) { logger.warn(STR); locale.set(PropertiesLoader.getDefaultLocale()); } }
/** * Initializes the current request cycle. * * @param req * current user request instance */
Initializes the current request cycle
beginRequest
{ "repo_name": "th-schwarz/C5Connector.Java", "path": "src/main/java/codes/thischwa/c5c/requestcycle/RequestData.java", "license": "mpl-2.0", "size": 3231 }
[ "codes.thischwa.c5c.PropertiesLoader", "codes.thischwa.c5c.exception.C5CException", "codes.thischwa.c5c.util.StringUtils", "java.util.Locale", "java.util.Map" ]
import codes.thischwa.c5c.PropertiesLoader; import codes.thischwa.c5c.exception.C5CException; import codes.thischwa.c5c.util.StringUtils; import java.util.Locale; import java.util.Map;
import codes.thischwa.c5c.*; import codes.thischwa.c5c.exception.*; import codes.thischwa.c5c.util.*; import java.util.*;
[ "codes.thischwa.c5c", "java.util" ]
codes.thischwa.c5c; java.util;
2,663,024
public void invoke(String[] args, PrintStream out) { Shell<MessageCounter> stdioShell = this.init(args, null, out, false); }
void function(String[] args, PrintStream out) { Shell<MessageCounter> stdioShell = this.init(args, null, out, false); }
/** * Implements {@link EmulatorControllable#invoke(String[], PrintStream) * EmulatorControllableApplication#start}. */
Implements <code>EmulatorControllable#invoke(String[], PrintStream) EmulatorControllableApplication#start</code>
invoke
{ "repo_name": "shudo/overlayweaver", "path": "src/ow/tool/msgcounter/Main.java", "license": "apache-2.0", "size": 6030 }
[ "java.io.PrintStream" ]
import java.io.PrintStream;
import java.io.*;
[ "java.io" ]
java.io;
2,765,092
private void prepareEmptySources(ReadFilter readFilter) throws IOException, InterruptedException { Iterator<StreamEventSource> iterator = emptySources.iterator(); while (iterator.hasNext()) { StreamEventSource source = iterator.next(); int len = source.prepare(readFilter); if (len != 0) { iterator.remove(); if (len > 0) { eventSources.enqueue(source); } } } }
void function(ReadFilter readFilter) throws IOException, InterruptedException { Iterator<StreamEventSource> iterator = emptySources.iterator(); while (iterator.hasNext()) { StreamEventSource source = iterator.next(); int len = source.prepare(readFilter); if (len != 0) { iterator.remove(); if (len > 0) { eventSources.enqueue(source); } } } }
/** * For all sources that doesn't have any event buffered, try to read an event and put it in the priority queue * if event is available. */
For all sources that doesn't have any event buffered, try to read an event and put it in the priority queue if event is available
prepareEmptySources
{ "repo_name": "chtyim/cdap", "path": "cdap-data-fabric/src/main/java/co/cask/cdap/data/stream/MultiLiveStreamFileReader.java", "license": "apache-2.0", "size": 8312 }
[ "co.cask.cdap.data.file.ReadFilter", "java.io.IOException", "java.util.Iterator" ]
import co.cask.cdap.data.file.ReadFilter; import java.io.IOException; import java.util.Iterator;
import co.cask.cdap.data.file.*; import java.io.*; import java.util.*;
[ "co.cask.cdap", "java.io", "java.util" ]
co.cask.cdap; java.io; java.util;
2,868,584
public boolean dispatchMediaButtonEvent(KeyEvent keyEvent) { if (keyEvent == null) { throw new IllegalArgumentException("KeyEvent may not be null"); } return mImpl.dispatchMediaButtonEvent(keyEvent); }
boolean function(KeyEvent keyEvent) { if (keyEvent == null) { throw new IllegalArgumentException(STR); } return mImpl.dispatchMediaButtonEvent(keyEvent); }
/** * Sends the specified media button event to the session. Only media keys can * be sent by this method, other keys will be ignored. * * @param keyEvent The media button event to dispatch. * @return true if the event was sent to the session, false otherwise. */
Sends the specified media button event to the session. Only media keys can be sent by this method, other keys will be ignored
dispatchMediaButtonEvent
{ "repo_name": "AndroidX/androidx", "path": "media/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java", "license": "apache-2.0", "size": 97769 }
[ "android.view.KeyEvent" ]
import android.view.KeyEvent;
import android.view.*;
[ "android.view" ]
android.view;
645,941
public boolean isStatic() { return Modifier.isStatic(this.modifier); }
boolean function() { return Modifier.isStatic(this.modifier); }
/** * Checks if method is static. * * @return true if method is static, false otherwise */
Checks if method is static
isStatic
{ "repo_name": "mschoettle/ecse429-fall15-project", "path": "ca.mcgill.sel.ram.gui/src/ca/mcgill/sel/ram/ui/views/structural/wrappers/MethodWrapper.java", "license": "gpl-2.0", "size": 2075 }
[ "java.lang.reflect.Modifier" ]
import java.lang.reflect.Modifier;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
823,025
@Override public NotificationHubCreateOrUpdateResponse createOrUpdate(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) throws IOException, ServiceException { // Validate if (resourceGroupName == null) { throw new NullPointerException("resourceGroupName"); } if (namespaceName == null) { throw new NullPointerException("namespaceName"); } if (notificationHubName == null) { throw new NullPointerException("notificationHubName"); } if (parameters == null) { throw new NullPointerException("parameters"); } if (parameters.getLocation() == null) { throw new NullPointerException("parameters.Location"); } if (parameters.getProperties() == null) { throw new NullPointerException("parameters.Properties"); } // Tracing boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); tracingParameters.put("resourceGroupName", resourceGroupName); tracingParameters.put("namespaceName", namespaceName); tracingParameters.put("notificationHubName", notificationHubName); tracingParameters.put("parameters", parameters); CloudTracing.enter(invocationId, this, "createOrUpdateAsync", tracingParameters); } // Construct URL String url = ""; url = url + "/subscriptions/"; if (this.getClient().getCredentials().getSubscriptionId() != null) { url = url + URLEncoder.encode(this.getClient().getCredentials().getSubscriptionId(), "UTF-8"); } url = url + "/resourceGroups/"; url = url + URLEncoder.encode(resourceGroupName, "UTF-8"); url = url + "/providers/"; url = url + "Microsoft.NotificationHubs"; url = url + "/namespaces/"; url = url + URLEncoder.encode(namespaceName, "UTF-8"); url = url + "/notificationHubs/"; url = url + URLEncoder.encode(notificationHubName, "UTF-8"); ArrayList<String> queryParameters = new ArrayList<String>(); queryParameters.add("api-version=" + "2014-09-01"); if (queryParameters.size() > 0) { url = url + "?" + CollectionStringBuilder.join(queryParameters, "&"); } String baseUrl = this.getClient().getBaseUri().toString(); // Trim '/' character from the end of baseUrl and beginning of url. if (baseUrl.charAt(baseUrl.length() - 1) == '/') { baseUrl = baseUrl.substring(0, (baseUrl.length() - 1) + 0); } if (url.charAt(0) == '/') { url = url.substring(1); } url = baseUrl + "/" + url; url = url.replace(" ", "%20"); // Create HTTP transport objects HttpPut httpRequest = new HttpPut(url); // Set Headers httpRequest.setHeader("Content-Type", "application/json"); // Serialize Request String requestContent = null; JsonNode requestDoc = null; ObjectMapper objectMapper = new ObjectMapper(); ObjectNode notificationHubCreateOrUpdateParametersValue = objectMapper.createObjectNode(); requestDoc = notificationHubCreateOrUpdateParametersValue; ((ObjectNode) notificationHubCreateOrUpdateParametersValue).put("location", parameters.getLocation()); if (parameters.getTags() != null) { if (parameters.getTags() instanceof LazyCollection == false || ((LazyCollection) parameters.getTags()).isInitialized()) { ObjectNode tagsDictionary = objectMapper.createObjectNode(); for (Map.Entry<String, String> entry : parameters.getTags().entrySet()) { String tagsKey = entry.getKey(); String tagsValue = entry.getValue(); ((ObjectNode) tagsDictionary).put(tagsKey, tagsValue); } ((ObjectNode) notificationHubCreateOrUpdateParametersValue).put("tags", tagsDictionary); } } ((ObjectNode) notificationHubCreateOrUpdateParametersValue).put("properties", NotificationHubProperties.toString(parameters.getProperties())); StringWriter stringWriter = new StringWriter(); objectMapper.writeValue(stringWriter, requestDoc); requestContent = stringWriter.toString(); StringEntity entity = new StringEntity(requestContent); httpRequest.setEntity(entity); httpRequest.setHeader("Content-Type", "application/json"); // Send Request HttpResponse httpResponse = null; try { if (shouldTrace) { CloudTracing.sendRequest(invocationId, httpRequest); } httpResponse = this.getClient().getHttpClient().execute(httpRequest); if (shouldTrace) { CloudTracing.receiveResponse(invocationId, httpResponse); } int statusCode = httpResponse.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { ServiceException ex = ServiceException.createFromJson(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { CloudTracing.error(invocationId, ex); } throw ex; } // Create Result NotificationHubCreateOrUpdateResponse result = null; // Deserialize Response if (statusCode == HttpStatus.SC_OK) { InputStream responseContent = httpResponse.getEntity().getContent(); result = new NotificationHubCreateOrUpdateResponse(); JsonNode responseDoc = null; if (responseContent == null == false) { responseDoc = objectMapper.readTree(responseContent); } if (responseDoc != null && responseDoc instanceof NullNode == false) { NotificationHubResource valueInstance = new NotificationHubResource(); result.setValue(valueInstance); JsonNode idValue = responseDoc.get("id"); if (idValue != null && idValue instanceof NullNode == false) { String idInstance; idInstance = idValue.getTextValue(); valueInstance.setId(idInstance); } JsonNode locationValue = responseDoc.get("location"); if (locationValue != null && locationValue instanceof NullNode == false) { String locationInstance; locationInstance = locationValue.getTextValue(); valueInstance.setLocation(locationInstance); } JsonNode nameValue = responseDoc.get("name"); if (nameValue != null && nameValue instanceof NullNode == false) { String nameInstance; nameInstance = nameValue.getTextValue(); valueInstance.setName(nameInstance); } JsonNode typeValue = responseDoc.get("type"); if (typeValue != null && typeValue instanceof NullNode == false) { String typeInstance; typeInstance = typeValue.getTextValue(); valueInstance.setType(typeInstance); } JsonNode tagsSequenceElement = ((JsonNode) responseDoc.get("tags")); if (tagsSequenceElement != null && tagsSequenceElement instanceof NullNode == false) { Iterator<Map.Entry<String, JsonNode>> itr = tagsSequenceElement.getFields(); while (itr.hasNext()) { Map.Entry<String, JsonNode> property = itr.next(); String tagsKey2 = property.getKey(); String tagsValue2 = property.getValue().getTextValue(); valueInstance.getTags().put(tagsKey2, tagsValue2); } } JsonNode propertiesValue = responseDoc.get("properties"); if (propertiesValue != null && propertiesValue instanceof NullNode == false) { NotificationHubProperties propertiesInstance = new NotificationHubProperties(); valueInstance.setProperties(propertiesInstance); } } } result.setStatusCode(statusCode); if (httpResponse.getHeaders("x-ms-request-id").length > 0) { result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } }
NotificationHubCreateOrUpdateResponse function(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) throws IOException, ServiceException { if (resourceGroupName == null) { throw new NullPointerException(STR); } if (namespaceName == null) { throw new NullPointerException(STR); } if (notificationHubName == null) { throw new NullPointerException(STR); } if (parameters == null) { throw new NullPointerException(STR); } if (parameters.getLocation() == null) { throw new NullPointerException(STR); } if (parameters.getProperties() == null) { throw new NullPointerException(STR); } boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); tracingParameters.put(STR, resourceGroupName); tracingParameters.put(STR, namespaceName); tracingParameters.put(STR, notificationHubName); tracingParameters.put(STR, parameters); CloudTracing.enter(invocationId, this, STR, tracingParameters); } String url = STR/subscriptions/STRUTF-8STR/resourceGroups/STRUTF-8STR/providers/STRMicrosoft.NotificationHubsSTR/namespaces/STRUTF-8STR/notificationHubs/STRUTF-8STRapi-version=STR2014-09-01STR?STR&STR/STR STR%20STRContent-TypeSTRapplication/jsonSTRlocationSTRtagsSTRpropertiesSTRContent-TypeSTRapplication/jsonSTRidSTRlocationSTRnameSTRtypeSTRtagsSTRpropertiesSTRx-ms-request-idSTRx-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } }
/** * Creates a new NotificationHub in a namespace. (see * http://msdn.microsoft.com/en-us/library/windowsazure/jj856303.aspx for * more information) * * @param resourceGroupName Required. The name of the resource group. * @param namespaceName Required. The namespace name. * @param notificationHubName Required. The notification hub name. * @param parameters Required. Parameters supplied to the create a Namespace * Resource. * @throws IOException Signals that an I/O exception of some sort has * occurred. This class is the general class of exceptions produced by * failed or interrupted I/O operations. * @throws ServiceException Thrown if an unexpected response is found. * @return Response of the CreateOrUpdate operation on the NotificationHub */
Creates a new NotificationHub in a namespace. (see HREF for more information)
createOrUpdate
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/NotificationHubOperationsImpl.java", "license": "apache-2.0", "size": 120338 }
[ "com.microsoft.azure.management.notificationhubs.models.NotificationHubCreateOrUpdateParameters", "com.microsoft.azure.management.notificationhubs.models.NotificationHubCreateOrUpdateResponse", "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.tracing.CloudTracing", "java.io.IOException", "java.util.HashMap" ]
import com.microsoft.azure.management.notificationhubs.models.NotificationHubCreateOrUpdateParameters; import com.microsoft.azure.management.notificationhubs.models.NotificationHubCreateOrUpdateResponse; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.util.HashMap;
import com.microsoft.azure.management.notificationhubs.models.*; import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.tracing.*; import java.io.*; import java.util.*;
[ "com.microsoft.azure", "com.microsoft.windowsazure", "java.io", "java.util" ]
com.microsoft.azure; com.microsoft.windowsazure; java.io; java.util;
2,140,043
public state_lkp getstate_lkp(long state_id) throws PortalException, SystemException { return state_lkpPersistence.findByPrimaryKey(state_id); }
state_lkp function(long state_id) throws PortalException, SystemException { return state_lkpPersistence.findByPrimaryKey(state_id); }
/** * Returns the state_lkp with the primary key. * * @param state_id the primary key of the state_lkp * @return the state_lkp * @throws PortalException if a state_lkp with the primary key could not be found * @throws SystemException if a system exception occurred */
Returns the state_lkp with the primary key
getstate_lkp
{ "repo_name": "iucn-whp/world-heritage-outlook", "path": "portlets/iucn-dbservice-portlet/docroot/WEB-INF/src/com/iucn/whp/dbservice/service/base/state_lkpLocalServiceBaseImpl.java", "license": "gpl-2.0", "size": 174889 }
[ "com.liferay.portal.kernel.exception.PortalException", "com.liferay.portal.kernel.exception.SystemException" ]
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.exception.*;
[ "com.liferay.portal" ]
com.liferay.portal;
1,787,533
@Override public synchronized void receiveAck(int blockIndex) { rejoinLog.trace("Received block ack for index " + blockIndex); m_outstandingWorkCount.decrementAndGet(); SendWork work = m_outstandingWork.remove(blockIndex); // releases the BBContainers and cleans up if (work != null) { work.discard(); } else { rejoinLog.warn("No block ack found for index " + blockIndex); } } public static class SnapshotSender implements Runnable { private final Mailbox m_mb; private final MessageFactory m_msgFactory; private final LinkedBlockingQueue<SendWork> m_workQueue; private final AtomicInteger m_expectedEOFs; final Map<Long, AtomicLong> m_bytesSent; final Map<Long, AtomicLong> m_worksSent; volatile Exception m_lastException = null; public SnapshotSender(Mailbox mb) { this(mb, new DefaultMessageFactory()); } public SnapshotSender(Mailbox mb, MessageFactory msgFactory) { Preconditions.checkArgument(mb != null); m_mb = mb; m_msgFactory = msgFactory; m_workQueue = new LinkedBlockingQueue<SendWork>(); m_expectedEOFs = new AtomicInteger(); m_bytesSent = Collections.synchronizedMap(new HashMap<Long, AtomicLong>()); m_worksSent = Collections.synchronizedMap(new HashMap<Long, AtomicLong>()); }
synchronized void function(int blockIndex) { rejoinLog.trace(STR + blockIndex); m_outstandingWorkCount.decrementAndGet(); SendWork work = m_outstandingWork.remove(blockIndex); if (work != null) { work.discard(); } else { rejoinLog.warn(STR + blockIndex); } } public static class SnapshotSender implements Runnable { private final Mailbox m_mb; private final MessageFactory m_msgFactory; private final LinkedBlockingQueue<SendWork> m_workQueue; private final AtomicInteger m_expectedEOFs; final Map<Long, AtomicLong> m_bytesSent; final Map<Long, AtomicLong> m_worksSent; volatile Exception m_lastException = null; public SnapshotSender(Mailbox mb) { this(mb, new DefaultMessageFactory()); } public SnapshotSender(Mailbox mb, MessageFactory msgFactory) { Preconditions.checkArgument(mb != null); m_mb = mb; m_msgFactory = msgFactory; m_workQueue = new LinkedBlockingQueue<SendWork>(); m_expectedEOFs = new AtomicInteger(); m_bytesSent = Collections.synchronizedMap(new HashMap<Long, AtomicLong>()); m_worksSent = Collections.synchronizedMap(new HashMap<Long, AtomicLong>()); }
/** * Synchronized method to handle the arrival of an Ack. * @param blockIndex The index of the block that is being acked. */
Synchronized method to handle the arrival of an Ack
receiveAck
{ "repo_name": "simonzhangsm/voltdb", "path": "src/frontend/org/voltdb/rejoin/StreamSnapshotDataTarget.java", "license": "agpl-3.0", "size": 23610 }
[ "com.google_voltpatches.common.base.Preconditions", "java.util.Collections", "java.util.HashMap", "java.util.Map", "java.util.concurrent.LinkedBlockingQueue", "java.util.concurrent.atomic.AtomicInteger", "java.util.concurrent.atomic.AtomicLong", "org.voltcore.messaging.Mailbox" ]
import com.google_voltpatches.common.base.Preconditions; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import org.voltcore.messaging.Mailbox;
import com.google_voltpatches.common.base.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.voltcore.messaging.*;
[ "com.google_voltpatches.common", "java.util", "org.voltcore.messaging" ]
com.google_voltpatches.common; java.util; org.voltcore.messaging;
390,629
@Test public void testUpdateUsingContentStringWithInvalidSite() throws Exception { // Setup mock object doThrow(ErrorManager.createError(StudioImplErrorCode.INVALID_SITE, "Unit test")).when(contentManagerMock) .write(Mockito.any(Context.class), Mockito.anyString(), Mockito.any(ItemId.class), Mockito.any(LockHandle.class), Mockito.any(InputStream.class)); when(securityServiceMock.validate(Mockito.any(Context.class))).thenReturn(true); // setup parameters Context context = new Context(UUID.randomUUID().toString(), new Tenant()); String site = RandomStringUtils.random(10); String assetId = UUID.randomUUID().toString(); ItemId assetItemId = new ItemId(assetId); String content = RandomStringUtils.random(1000); Map<String, String> props = new HashMap<>(); // execute tested method try { Item testItem = assetServiceSUT.update(context, site, assetItemId, content, props); } catch (StudioException expectedException) { // assert and verify assertEquals(StudioImplErrorCode.INVALID_SITE.getCode(), expectedException.getErrorCode()); verify(contentManagerMock, times(1)).write(Mockito.any(Context.class), Mockito.anyString(), Mockito.any(ItemId.class), Mockito.any(LockHandle.class), Mockito.any(InputStream.class)); verify(securityServiceMock, times(1)).validate(Mockito.any(Context.class)); return; } fail(); }
void function() throws Exception { doThrow(ErrorManager.createError(StudioImplErrorCode.INVALID_SITE, STR)).when(contentManagerMock) .write(Mockito.any(Context.class), Mockito.anyString(), Mockito.any(ItemId.class), Mockito.any(LockHandle.class), Mockito.any(InputStream.class)); when(securityServiceMock.validate(Mockito.any(Context.class))).thenReturn(true); Context context = new Context(UUID.randomUUID().toString(), new Tenant()); String site = RandomStringUtils.random(10); String assetId = UUID.randomUUID().toString(); ItemId assetItemId = new ItemId(assetId); String content = RandomStringUtils.random(1000); Map<String, String> props = new HashMap<>(); try { Item testItem = assetServiceSUT.update(context, site, assetItemId, content, props); } catch (StudioException expectedException) { assertEquals(StudioImplErrorCode.INVALID_SITE.getCode(), expectedException.getErrorCode()); verify(contentManagerMock, times(1)).write(Mockito.any(Context.class), Mockito.anyString(), Mockito.any(ItemId.class), Mockito.any(LockHandle.class), Mockito.any(InputStream.class)); verify(securityServiceMock, times(1)).validate(Mockito.any(Context.class)); return; } fail(); }
/** * Use case 35: * Test update method with string content using invalid site. * * @throws Exception */
Use case 35: Test update method with string content using invalid site
testUpdateUsingContentStringWithInvalidSite
{ "repo_name": "craftercms/studio3", "path": "impl/src/test/java/org/craftercms/studio/impl/content/AssetServiceImplTest.java", "license": "gpl-3.0", "size": 78760 }
[ "java.io.InputStream", "java.util.HashMap", "java.util.Map", "java.util.UUID", "org.apache.commons.lang.RandomStringUtils", "org.craftercms.studio.commons.dto.Context", "org.craftercms.studio.commons.dto.Item", "org.craftercms.studio.commons.dto.ItemId", "org.craftercms.studio.commons.dto.LockHandle", "org.craftercms.studio.commons.dto.Tenant", "org.craftercms.studio.commons.exception.ErrorManager", "org.craftercms.studio.commons.exception.StudioException", "org.craftercms.studio.impl.exception.StudioImplErrorCode", "org.junit.Assert", "org.mockito.Mockito" ]
import java.io.InputStream; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.commons.lang.RandomStringUtils; import org.craftercms.studio.commons.dto.Context; import org.craftercms.studio.commons.dto.Item; import org.craftercms.studio.commons.dto.ItemId; import org.craftercms.studio.commons.dto.LockHandle; import org.craftercms.studio.commons.dto.Tenant; import org.craftercms.studio.commons.exception.ErrorManager; import org.craftercms.studio.commons.exception.StudioException; import org.craftercms.studio.impl.exception.StudioImplErrorCode; import org.junit.Assert; import org.mockito.Mockito;
import java.io.*; import java.util.*; import org.apache.commons.lang.*; import org.craftercms.studio.commons.dto.*; import org.craftercms.studio.commons.exception.*; import org.craftercms.studio.impl.exception.*; import org.junit.*; import org.mockito.*;
[ "java.io", "java.util", "org.apache.commons", "org.craftercms.studio", "org.junit", "org.mockito" ]
java.io; java.util; org.apache.commons; org.craftercms.studio; org.junit; org.mockito;
720,153
private void genMethodTypeSignature(IMethodBinding method) { genOptFormalTypeParameters(method.getTypeParameters()); sb.append('('); for (ITypeBinding param : method.getParameterTypes()) { genTypeSignature(param); } sb.append(')'); genReturnType(method.getReturnType()); ITypeBinding[] exceptionTypes = method.getExceptionTypes(); boolean hasGenericException = false; for (ITypeBinding exception : exceptionTypes) { if (exception.isGenericType() || exception.isParameterizedType()) { hasGenericException = true; break; } } if (hasGenericException) { for (ITypeBinding exception : exceptionTypes) { sb.append('^'); if (exception.isTypeVariable()) { genTypeVariableSignature(exception); } else { genClassTypeSignature(exception); } } } }
void function(IMethodBinding method) { genOptFormalTypeParameters(method.getTypeParameters()); sb.append('('); for (ITypeBinding param : method.getParameterTypes()) { genTypeSignature(param); } sb.append(')'); genReturnType(method.getReturnType()); ITypeBinding[] exceptionTypes = method.getExceptionTypes(); boolean hasGenericException = false; for (ITypeBinding exception : exceptionTypes) { if (exception.isGenericType() exception.isParameterizedType()) { hasGenericException = true; break; } } if (hasGenericException) { for (ITypeBinding exception : exceptionTypes) { sb.append('^'); if (exception.isTypeVariable()) { genTypeVariableSignature(exception); } else { genClassTypeSignature(exception); } } } }
/** * MethodTypeSignature ::= [FormalTypeParameters] * "(" {TypeSignature} ")" ReturnType {ThrowsSignature}. */
MethodTypeSignature ::= [FormalTypeParameters] "(" {TypeSignature} ")" ReturnType {ThrowsSignature}
genMethodTypeSignature
{ "repo_name": "halfhp/j2objc", "path": "translator/src/main/java/com/google/devtools/j2objc/gen/SignatureGenerator.java", "license": "apache-2.0", "size": 8767 }
[ "org.eclipse.jdt.core.dom.IMethodBinding", "org.eclipse.jdt.core.dom.ITypeBinding" ]
import org.eclipse.jdt.core.dom.IMethodBinding; import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
2,277,084
public String getAddColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon) { return "ALTER TABLE "+tablename+" ADD "+getFieldDefinition(v, tk, pk, use_autoinc, true, false); }
String function(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon) { return STR+tablename+STR+getFieldDefinition(v, tk, pk, use_autoinc, true, false); }
/** * Generates the SQL statement to add a column to the specified table * For this generic type, i set it to the most common possibility. * * @param tablename The table to add * @param v The column defined as a value * @param tk the name of the technical key field * @param use_autoinc whether or not this field uses auto increment * @param pk the name of the primary key field * @param semicolon whether or not to add a semi-colon behind the statement. * @return the SQL statement to add a column to the specified table */
Generates the SQL statement to add a column to the specified table For this generic type, i set it to the most common possibility
getAddColumnStatement
{ "repo_name": "yintaoxue/read-open-source-code", "path": "kettle4.3/src/org/pentaho/di/core/database/GenericDatabaseMeta.java", "license": "apache-2.0", "size": 7445 }
[ "org.pentaho.di.core.row.ValueMetaInterface" ]
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,361,424
@Test void encodeAndExpectServiceException() { LdaptivePasswordEncoder encoder = new LdaptivePasswordEncoder("FOO", "BAR"); assertThrows(ServiceException.class, () -> encoder.encode("HelloWorld")); }
void encodeAndExpectServiceException() { LdaptivePasswordEncoder encoder = new LdaptivePasswordEncoder("FOO", "BAR"); assertThrows(ServiceException.class, () -> encoder.encode(STR)); }
/** * Encode and expect service exception. */
Encode and expect service exception
encodeAndExpectServiceException
{ "repo_name": "bremersee/common", "path": "common-base-ldaptive-security/src/test/java/org/bremersee/security/core/userdetails/LdaptivePasswordEncoderTest.java", "license": "apache-2.0", "size": 3956 }
[ "org.bremersee.exception.ServiceException", "org.junit.jupiter.api.Assertions" ]
import org.bremersee.exception.ServiceException; import org.junit.jupiter.api.Assertions;
import org.bremersee.exception.*; import org.junit.jupiter.api.*;
[ "org.bremersee.exception", "org.junit.jupiter" ]
org.bremersee.exception; org.junit.jupiter;
552,408
public void setResourcePattern(String resourcePattern) { Assert.notNull(resourcePattern, "'resourcePattern' must not be null"); this.resourcePattern = resourcePattern; }
void function(String resourcePattern) { Assert.notNull(resourcePattern, STR); this.resourcePattern = resourcePattern; }
/** * Set the resource pattern to use when scanning the classpath. * This value will be appended to each base package name. * @see #findTypesToRegister() * @see #DEFAULT_RESOURCE_PATTERN */
Set the resource pattern to use when scanning the classpath. This value will be appended to each base package name
setResourcePattern
{ "repo_name": "azureplus/spring-flex", "path": "spring-flex-core/src/main/java/org/springframework/flex/core/io/ClassPathScanningAmfConversionServiceConfigProcessor.java", "license": "apache-2.0", "size": 12251 }
[ "org.springframework.util.Assert" ]
import org.springframework.util.Assert;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
1,088,319
public void onUpdatedChannels(List<ChannelData> channels) { model.updateChannels(channels); view.showChannelData(); }
void function(List<ChannelData> channels) { model.updateChannels(channels); view.showChannelData(); }
/** * Implemented as specified by the {@link Editor} interface. * @see Editor#onUpdatedChannels(List) */
Implemented as specified by the <code>Editor</code> interface
onUpdatedChannels
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorComponent.java", "license": "gpl-2.0", "size": 35936 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,642,754
@Override public void setHeaders(Stub stub, DfpUser user) throws ServiceException { try { if (user.getRegisteredAuthToken() == null) { user.setAuthToken(new AuthToken(user.getEmail(), user.getPassword()).getAuthToken()); } Class<?> clientLoginClass = Class.forName(packagePrefix + this.toString() + "." + "ClientLogin"); Class<?> authenticationClass = Class.forName(packagePrefix + this.toString() + "." + "Authentication"); Object clientLogin = clientLoginClass.getConstructor(String.class, String.class).newInstance(null, user.getRegisteredAuthToken()); stub.setHeader(namespace, "RequestHeader", Class.forName(packagePrefix + this.toString() + "." + "SoapRequestHeader") .getConstructor(String.class, String.class, authenticationClass) .newInstance(user.getNetworkCode(), user.getClientLibraryIdentifier(), clientLogin)); } catch (IllegalStateException e) { throw new ServiceException("Could not get ClientLogin token for user.", e); } catch (AuthTokenException e) { throw new ServiceException("Could not get ClientLogin token for user.", e); } catch (InstantiationException e) { throw new ServiceException("Could not create service class. Check classpath.", e); } catch (IllegalAccessException e) { throw new ServiceException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new ServiceException("Could not create service class. Check classpath.", e); } catch (IllegalArgumentException e) { throw new ServiceException(e.getMessage(), e); } catch (SecurityException e) { throw new ServiceException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new ServiceException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new ServiceException("Could not create service class. " + "Check that the correct version of AXIS is being used.", e); } } }
void function(Stub stub, DfpUser user) throws ServiceException { try { if (user.getRegisteredAuthToken() == null) { user.setAuthToken(new AuthToken(user.getEmail(), user.getPassword()).getAuthToken()); } Class<?> clientLoginClass = Class.forName(packagePrefix + this.toString() + "." + STR); Class<?> authenticationClass = Class.forName(packagePrefix + this.toString() + "." + STR); Object clientLogin = clientLoginClass.getConstructor(String.class, String.class).newInstance(null, user.getRegisteredAuthToken()); stub.setHeader(namespace, STR, Class.forName(packagePrefix + this.toString() + "." + STR) .getConstructor(String.class, String.class, authenticationClass) .newInstance(user.getNetworkCode(), user.getClientLibraryIdentifier(), clientLogin)); } catch (IllegalStateException e) { throw new ServiceException(STR, e); } catch (AuthTokenException e) { throw new ServiceException(STR, e); } catch (InstantiationException e) { throw new ServiceException(STR, e); } catch (IllegalAccessException e) { throw new ServiceException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new ServiceException(STR, e); } catch (IllegalArgumentException e) { throw new ServiceException(e.getMessage(), e); } catch (SecurityException e) { throw new ServiceException(e.getMessage(), e); } catch (InvocationTargetException e) { throw new ServiceException(e.getMessage(), e); } catch (NoSuchMethodException e) { throw new ServiceException(STR + STR, e); } } }
/** * See {@link DfpVersion#setHeaders(Stub, DfpUser)}. */
See <code>DfpVersion#setHeaders(Stub, DfpUser)</code>
setHeaders
{ "repo_name": "google-code-export/google-api-dfp-java", "path": "src/com/google/api/ads/dfp/lib/DfpVersion.java", "license": "apache-2.0", "size": 26030 }
[ "java.lang.reflect.InvocationTargetException", "javax.xml.rpc.ServiceException", "org.apache.axis.client.Stub" ]
import java.lang.reflect.InvocationTargetException; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Stub;
import java.lang.reflect.*; import javax.xml.rpc.*; import org.apache.axis.client.*;
[ "java.lang", "javax.xml", "org.apache.axis" ]
java.lang; javax.xml; org.apache.axis;
1,212,073
MkdirsOptions options = MkdirsOptions.defaults(); // Verify the default createParent is true. assertTrue(options.getCreateParent()); // Verify that the owner and group are not set. assertEquals("", options.getOwner()); assertEquals("", options.getGroup()); assertEquals(Mode.defaults().applyDirectoryUMask(), options.getMode()); }
MkdirsOptions options = MkdirsOptions.defaults(); assertTrue(options.getCreateParent()); assertEquals(STR", options.getGroup()); assertEquals(Mode.defaults().applyDirectoryUMask(), options.getMode()); }
/** * Tests for default {@link MkdirsOptions}. */
Tests for default <code>MkdirsOptions</code>
defaults
{ "repo_name": "riversand963/alluxio", "path": "core/common/src/test/java/alluxio/underfs/options/MkdirsOptionsTest.java", "license": "apache-2.0", "size": 3299 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,912,262
public static Label findLabel(Container cont, ComponentChooser chooser) { return findLabel(cont, chooser, 0); }
static Label function(Container cont, ComponentChooser chooser) { return findLabel(cont, chooser, 0); }
/** * Searches Label in container. * * @param cont Container to search component in. * @param chooser a component chooser specifying searching criteria. * @return Label instance or null if component was not found. */
Searches Label in container
findLabel
{ "repo_name": "md-5/jdk10", "path": "test/jdk/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/LabelOperator.java", "license": "gpl-2.0", "size": 12364 }
[ "java.awt.Container", "java.awt.Label", "org.netbeans.jemmy.ComponentChooser" ]
import java.awt.Container; import java.awt.Label; import org.netbeans.jemmy.ComponentChooser;
import java.awt.*; import org.netbeans.jemmy.*;
[ "java.awt", "org.netbeans.jemmy" ]
java.awt; org.netbeans.jemmy;
2,382,500
@Override public Enumeration<String> getHeaderNames() { return coyoteRequest.getMimeHeaders().names(); }
Enumeration<String> function() { return coyoteRequest.getMimeHeaders().names(); }
/** * Return the names of all headers received with this request. */
Return the names of all headers received with this request
getHeaderNames
{ "repo_name": "wenzhucjy/tomcat_source", "path": "tomcat-8.0.9-sourcecode/java/org/apache/catalina/connector/Request.java", "license": "apache-2.0", "size": 101815 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,193,541
public static void createBlockPath(String path) throws IOException { try { createStorageDirPath(PathUtils.getParent(path)); } catch (InvalidPathException e) { throw new IOException("Failed to create block path, get parent path of " + path + "failed", e); } catch (IOException e) { throw new IOException("Failed to create block path " + path, e); } }
static void function(String path) throws IOException { try { createStorageDirPath(PathUtils.getParent(path)); } catch (InvalidPathException e) { throw new IOException(STR + path + STR, e); } catch (IOException e) { throw new IOException(STR + path, e); } }
/** * Creates the local block path and all the parent directories. Also, sets the appropriate * permissions. * * @param path the path of the block * @throws IOException when fails to create block path and parent directories with appropriate * permissions. */
Creates the local block path and all the parent directories. Also, sets the appropriate permissions
createBlockPath
{ "repo_name": "bit-zyl/Alluxio-Nvdimm", "path": "core/common/src/main/java/alluxio/util/io/FileUtils.java", "license": "apache-2.0", "size": 10994 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
315,974
public void addItems(Collection<Long> items) { this.items.addAll(items); }
void function(Collection<Long> items) { this.items.addAll(items); }
/** * Adds all items of a given collection to this inventory. * * @param items */
Adds all items of a given collection to this inventory
addItems
{ "repo_name": "kosmonet/neon", "path": "src/neon/common/entity/components/Inventory.java", "license": "gpl-3.0", "size": 2683 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,200,953
EClass getTransitionRoot();
EClass getTransitionRoot();
/** * Returns the meta object for class '{@link org.yakindu.sct.model.stext.stext.TransitionRoot <em>Transition Root</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Transition Root</em>'. * @see org.yakindu.sct.model.stext.stext.TransitionRoot * @generated */
Returns the meta object for class '<code>org.yakindu.sct.model.stext.stext.TransitionRoot Transition Root</code>'.
getTransitionRoot
{ "repo_name": "Yakindu/statecharts", "path": "plugins/org.yakindu.sct.model.stext/emf-gen/org/yakindu/sct/model/stext/stext/StextPackage.java", "license": "epl-1.0", "size": 92325 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,525,132
public static synchronized DefaultBandwidthMeter getSingletonInstance(Context context) { if (singletonInstance == null) { singletonInstance = new DefaultBandwidthMeter.Builder(context).build(); } return singletonInstance; } private static final int ELAPSED_MILLIS_FOR_ESTIMATE = 2000; private static final int BYTES_TRANSFERRED_FOR_ESTIMATE = 512 * 1024; @Nullable private final Context context; private final SparseArray<Long> initialBitrateEstimates; private final EventDispatcher<EventListener> eventDispatcher; private final SlidingPercentile slidingPercentile; private final Clock clock; private int streamCount; private long sampleStartTimeMs; private long sampleBytesTransferred; @C.NetworkType private int networkType; private long totalElapsedTimeMs; private long totalBytesTransferred; private long bitrateEstimate; private long lastReportedBitrateEstimate; private boolean networkTypeOverrideSet; @C.NetworkType private int networkTypeOverride; @Deprecated public DefaultBandwidthMeter() { this( null, new SparseArray<>(), DEFAULT_SLIDING_WINDOW_MAX_WEIGHT, Clock.DEFAULT, false); } private DefaultBandwidthMeter( @Nullable Context context, SparseArray<Long> initialBitrateEstimates, int maxWeight, Clock clock, boolean resetOnNetworkTypeChange) { this.context = context == null ? null : context.getApplicationContext(); this.initialBitrateEstimates = initialBitrateEstimates; this.eventDispatcher = new EventDispatcher<>(); this.slidingPercentile = new SlidingPercentile(maxWeight); this.clock = clock; // Set the initial network type and bitrate estimate networkType = context == null ? C.NETWORK_TYPE_UNKNOWN : Util.getNetworkType(context); bitrateEstimate = getInitialBitrateEstimateForNetworkType(networkType); // Register to receive connectivity actions if possible. if (context != null && resetOnNetworkTypeChange) { ConnectivityActionReceiver connectivityActionReceiver = ConnectivityActionReceiver.getInstance(context); connectivityActionReceiver.register( this); } }
static synchronized DefaultBandwidthMeter function(Context context) { if (singletonInstance == null) { singletonInstance = new DefaultBandwidthMeter.Builder(context).build(); } return singletonInstance; } private static final int ELAPSED_MILLIS_FOR_ESTIMATE = 2000; private static final int BYTES_TRANSFERRED_FOR_ESTIMATE = 512 * 1024; @Nullable private final Context context; private final SparseArray<Long> initialBitrateEstimates; private final EventDispatcher<EventListener> eventDispatcher; private final SlidingPercentile slidingPercentile; private final Clock clock; private int streamCount; private long sampleStartTimeMs; private long sampleBytesTransferred; @C.NetworkType private int networkType; private long totalElapsedTimeMs; private long totalBytesTransferred; private long bitrateEstimate; private long lastReportedBitrateEstimate; private boolean networkTypeOverrideSet; @C.NetworkType private int networkTypeOverride; public DefaultBandwidthMeter() { this( null, new SparseArray<>(), DEFAULT_SLIDING_WINDOW_MAX_WEIGHT, Clock.DEFAULT, false); } private DefaultBandwidthMeter( @Nullable Context context, SparseArray<Long> initialBitrateEstimates, int maxWeight, Clock clock, boolean resetOnNetworkTypeChange) { this.context = context == null ? null : context.getApplicationContext(); this.initialBitrateEstimates = initialBitrateEstimates; this.eventDispatcher = new EventDispatcher<>(); this.slidingPercentile = new SlidingPercentile(maxWeight); this.clock = clock; networkType = context == null ? C.NETWORK_TYPE_UNKNOWN : Util.getNetworkType(context); bitrateEstimate = getInitialBitrateEstimateForNetworkType(networkType); if (context != null && resetOnNetworkTypeChange) { ConnectivityActionReceiver connectivityActionReceiver = ConnectivityActionReceiver.getInstance(context); connectivityActionReceiver.register( this); } }
/** * Returns a singleton instance of a {@link DefaultBandwidthMeter} with default configuration. * * @param context A {@link Context}. * @return The singleton instance. */
Returns a singleton instance of a <code>DefaultBandwidthMeter</code> with default configuration
getSingletonInstance
{ "repo_name": "tkpb/Telegram", "path": "TMessagesProj/src/main/java/com/google/android/exoplayer2/upstream/DefaultBandwidthMeter.java", "license": "gpl-2.0", "size": 33738 }
[ "android.content.Context", "android.util.SparseArray", "androidx.annotation.Nullable", "com.google.android.exoplayer2.util.Clock", "com.google.android.exoplayer2.util.EventDispatcher", "com.google.android.exoplayer2.util.SlidingPercentile", "com.google.android.exoplayer2.util.Util" ]
import android.content.Context; import android.util.SparseArray; import androidx.annotation.Nullable; import com.google.android.exoplayer2.util.Clock; import com.google.android.exoplayer2.util.EventDispatcher; import com.google.android.exoplayer2.util.SlidingPercentile; import com.google.android.exoplayer2.util.Util;
import android.content.*; import android.util.*; import androidx.annotation.*; import com.google.android.exoplayer2.util.*;
[ "android.content", "android.util", "androidx.annotation", "com.google.android" ]
android.content; android.util; androidx.annotation; com.google.android;
808,862
private DataLakeAnalyticsUsqlActivityTypeProperties innerTypeProperties() { return this.innerTypeProperties; }
DataLakeAnalyticsUsqlActivityTypeProperties function() { return this.innerTypeProperties; }
/** * Get the innerTypeProperties property: Data Lake Analytics U-SQL activity properties. * * @return the innerTypeProperties value. */
Get the innerTypeProperties property: Data Lake Analytics U-SQL activity properties
innerTypeProperties
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/DataLakeAnalyticsUsqlActivity.java", "license": "mit", "size": 10435 }
[ "com.azure.resourcemanager.datafactory.fluent.models.DataLakeAnalyticsUsqlActivityTypeProperties" ]
import com.azure.resourcemanager.datafactory.fluent.models.DataLakeAnalyticsUsqlActivityTypeProperties;
import com.azure.resourcemanager.datafactory.fluent.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
2,068,300
@Override protected void initialize() { super.initialize(); m_Containers = new ArrayList<>(); }
void function() { super.initialize(); m_Containers = new ArrayList<>(); }
/** * Initializes the members. */
Initializes the members
initialize
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-weka/src/main/java/weka/classifiers/MultiLevelSplitGenerator.java", "license": "gpl-3.0", "size": 14525 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,901,414
@FIXVersion(introduced="5.0SP1") public ApplicationSequenceControl getApplicationSequenceControl() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); }
@FIXVersion(introduced=STR) ApplicationSequenceControl function() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); }
/** * Message field getter. * @return field value */
Message field getter
getApplicationSequenceControl
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/DerivativeSecurityListMsg.java", "license": "gpl-3.0", "size": 23172 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.comp.ApplicationSequenceControl" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.comp.ApplicationSequenceControl;
import net.hades.fix.message.anno.*; import net.hades.fix.message.comp.*;
[ "net.hades.fix" ]
net.hades.fix;
1,604,096
@Nonnull public static <T> BooleanExpression neq(final SelectListItem<T> col, @Nullable final T value) { return new Not( new ColumnEquals<T>( col, value)); }
static <T> BooleanExpression function(final SelectListItem<T> col, @Nullable final T value) { return new Not( new ColumnEquals<T>( col, value)); }
/** * This method creates a condition filtering only those rows whose value in column col does not equal the parameter value. */
This method creates a condition filtering only those rows whose value in column col does not equal the parameter value
neq
{ "repo_name": "freiheit-com/sqlapi4j", "path": "core/src/main/java/com/freiheit/sqlapi4j/query/Sql.java", "license": "apache-2.0", "size": 26009 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
2,532,664
public void printStats( int seconds ) { log.logBasic( " " ); if ( steps == null ) { return; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); StepInterface step = sid.step; long proc = step.getProcessed(); if ( seconds != 0 ) { if ( step.getErrors() == 0 ) { log .logBasic( BaseMessages .getString( PKG, "Trans.Log.ProcessSuccessfullyInfo", step.getStepname(), "." + step.getCopy(), String .valueOf( proc ), String.valueOf( ( proc / seconds ) ) ) ); } else { log .logError( BaseMessages .getString( PKG, "Trans.Log.ProcessErrorInfo", step.getStepname(), "." + step.getCopy(), String.valueOf( step .getErrors() ), String.valueOf( proc ), String.valueOf( proc / seconds ) ) ); } } else { if ( step.getErrors() == 0 ) { log .logBasic( BaseMessages .getString( PKG, "Trans.Log.ProcessSuccessfullyInfo", step.getStepname(), "." + step.getCopy(), String .valueOf( proc ), seconds != 0 ? String.valueOf( ( proc / seconds ) ) : "-" ) ); } else { log .logError( BaseMessages .getString( PKG, "Trans.Log.ProcessErrorInfo2", step.getStepname(), "." + step.getCopy(), String.valueOf( step .getErrors() ), String.valueOf( proc ), String.valueOf( seconds ) ) ); } } } }
void function( int seconds ) { log.logBasic( " " ); if ( steps == null ) { return; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); StepInterface step = sid.step; long proc = step.getProcessed(); if ( seconds != 0 ) { if ( step.getErrors() == 0 ) { log .logBasic( BaseMessages .getString( PKG, STR, step.getStepname(), "." + step.getCopy(), String .valueOf( proc ), String.valueOf( ( proc / seconds ) ) ) ); } else { log .logError( BaseMessages .getString( PKG, STR, step.getStepname(), "." + step.getCopy(), String.valueOf( step .getErrors() ), String.valueOf( proc ), String.valueOf( proc / seconds ) ) ); } } else { if ( step.getErrors() == 0 ) { log .logBasic( BaseMessages .getString( PKG, STR, step.getStepname(), "." + step.getCopy(), String .valueOf( proc ), seconds != 0 ? String.valueOf( ( proc / seconds ) ) : "-" ) ); } else { log .logError( BaseMessages .getString( PKG, STR, step.getStepname(), "." + step.getCopy(), String.valueOf( step .getErrors() ), String.valueOf( proc ), String.valueOf( seconds ) ) ); } } } }
/** * Logs the execution statistics for the transformation for the specified time interval. If the total length of * execution is supplied as the interval, then the statistics represent the average throughput (lines * read/written/updated/rejected/etc. per second) for the entire execution. * * @param seconds * the time interval (in seconds) */
Logs the execution statistics for the transformation for the specified time interval. If the total length of execution is supplied as the interval, then the statistics represent the average throughput (lines read/written/updated/rejected/etc. per second) for the entire execution
printStats
{ "repo_name": "EcoleKeine/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 194675 }
[ "org.pentaho.di.i18n.BaseMessages", "org.pentaho.di.trans.step.StepInterface", "org.pentaho.di.trans.step.StepMetaDataCombi" ]
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMetaDataCombi;
import org.pentaho.di.i18n.*; import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,891,837
@Override public int bind(PreparedStatement statement, QueryParameters qp, SessionImplementor session, int position) throws SQLException { TypedValue typedValue = qp.getNamedParameters().get( name ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); }
int function(PreparedStatement statement, QueryParameters qp, SessionImplementor session, int position) throws SQLException { TypedValue typedValue = qp.getNamedParameters().get( name ); typedValue.getType().nullSafeSet( statement, typedValue.getValue(), position, session ); return typedValue.getType().getColumnSpan( session.getFactory() ); }
/** * Bind the appropriate value into the given statement at the specified position. * * @param statement The statement into which the value should be bound. * @param qp The defined values for the current query execution. * @param session The session against which the current execution is occuring. * @param position The position from which to start binding value(s). * * @return The number of sql bind positions "eaten" by this bind operation. */
Bind the appropriate value into the given statement at the specified position
bind
{ "repo_name": "kevin-chen-hw/LDAE", "path": "com.huawei.soa.ldae/src/main/java/org/hibernate/param/NamedParameterSpecification.java", "license": "lgpl-2.1", "size": 2984 }
[ "java.sql.PreparedStatement", "java.sql.SQLException", "org.hibernate.engine.spi.QueryParameters", "org.hibernate.engine.spi.SessionImplementor", "org.hibernate.engine.spi.TypedValue" ]
import java.sql.PreparedStatement; import java.sql.SQLException; import org.hibernate.engine.spi.QueryParameters; import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.TypedValue;
import java.sql.*; import org.hibernate.engine.spi.*;
[ "java.sql", "org.hibernate.engine" ]
java.sql; org.hibernate.engine;
640,964
public XMLSignatureInput resolve(Attr uri, String baseURI, boolean secureValidation) throws ResourceResolverException { ResourceResolverContext context = new ResourceResolverContext(uri, baseURI, secureValidation); return resolverSpi.engineResolveURI(context); }
XMLSignatureInput function(Attr uri, String baseURI, boolean secureValidation) throws ResourceResolverException { ResourceResolverContext context = new ResourceResolverContext(uri, baseURI, secureValidation); return resolverSpi.engineResolveURI(context); }
/** * Method resolve * * @param uri * @param baseURI * @return the resource * * @throws ResourceResolverException */
Method resolve
resolve
{ "repo_name": "itgeeker/jdk", "path": "src/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java", "license": "apache-2.0", "size": 13904 }
[ "com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput", "org.w3c.dom.Attr" ]
import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import org.w3c.dom.Attr;
import com.sun.org.apache.xml.internal.security.signature.*; import org.w3c.dom.*;
[ "com.sun.org", "org.w3c.dom" ]
com.sun.org; org.w3c.dom;
2,807,941
public static void toFile(String fileName, String txt) throws IOException { PrintWriter pw = new PrintWriter(new FileWriter(fileName)); pw.print(txt); pw.close(); }
static void function(String fileName, String txt) throws IOException { PrintWriter pw = new PrintWriter(new FileWriter(fileName)); pw.print(txt); pw.close(); }
/** * Write string to file * @param fileName file name * @param txt string to write to file * @throws IOException */
Write string to file
toFile
{ "repo_name": "RomanHargrave/jsigner", "path": "jsigner-modsl-core/src/main/java/org/modsl/core/util/Utils.java", "license": "apache-2.0", "size": 2779 }
[ "java.io.FileWriter", "java.io.IOException", "java.io.PrintWriter" ]
import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
2,580,726
ActivityCheck popupScreen(PopupActivity popup);
ActivityCheck popupScreen(PopupActivity popup);
/** * Creates a brand new instance for checking actions over {@link PopupActivity} instances. */
Creates a brand new instance for checking actions over <code>PopupActivity</code> instances
popupScreen
{ "repo_name": "karreiro/uberfire", "path": "uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/authz/WorkbenchController.java", "license": "apache-2.0", "size": 4002 }
[ "org.uberfire.client.mvp.PopupActivity" ]
import org.uberfire.client.mvp.PopupActivity;
import org.uberfire.client.mvp.*;
[ "org.uberfire.client" ]
org.uberfire.client;
1,946,317
public static final <T extends Comparable<? super T>> int compare(final List<T> left, final List<T> right) { if (left == null && right == null) { return 0; } else if (left == null) { return -1; } else if (right == null) { return 1; } else { int l = left.size(); int r = right.size(); if (l != r) { return l - r; } for (int i = 0; i < l; i++) { int compareTo = compare(left.get(i), right.get(i)); if (compareTo != 0) { return compareTo; } } return 0; } }
static final <T extends Comparable<? super T>> int function(final List<T> left, final List<T> right) { if (left == null && right == null) { return 0; } else if (left == null) { return -1; } else if (right == null) { return 1; } else { int l = left.size(); int r = right.size(); if (l != r) { return l - r; } for (int i = 0; i < l; i++) { int compareTo = compare(left.get(i), right.get(i)); if (compareTo != 0) { return compareTo; } } return 0; } }
/** * Compares two lists -- account for <code>null</code>. The lists must * contain comparable objects. * * @param left * The left list to compare; may be <code>null</code>. This * list must only contain instances of <code>Comparable</code>. * @param right * The right list to compare; may be <code>null</code>. This * list must only contain instances of <code>Comparable</code>. * @return The result of the comparison. <code>null</code> is considered * to be the least possible value. A shorter list is considered less * than a longer list. */
Compares two lists -- account for <code>null</code>. The lists must contain comparable objects
compare
{ "repo_name": "ControlSystemStudio/org.csstudio.iter", "path": "plugins/org.eclipse.jface/src/org/eclipse/jface/util/Util.java", "license": "epl-1.0", "size": 17775 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,825,602
private static void writeSchemaColumns(TupleMetadata schema, BaseWriter.MapWriter fieldWriter, boolean allTextMode) { for (ColumnMetadata columnMetadata : schema) { writeSingleOrArrayColumn(columnMetadata, fieldWriter, allTextMode); } }
static void function(TupleMetadata schema, BaseWriter.MapWriter fieldWriter, boolean allTextMode) { for (ColumnMetadata columnMetadata : schema) { writeSingleOrArrayColumn(columnMetadata, fieldWriter, allTextMode); } }
/** * Creates writers for all columns taken from {@code TupleMetadata schema}. * * @param schema table or map schema * @param fieldWriter parent writer for writers to create * @param allTextMode whether all primitive writers should be of varchar type */
Creates writers for all columns taken from TupleMetadata schema
writeSchemaColumns
{ "repo_name": "Ben-Zvi/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReaderUtils.java", "license": "apache-2.0", "size": 10066 }
[ "org.apache.drill.exec.record.metadata.ColumnMetadata", "org.apache.drill.exec.record.metadata.TupleMetadata", "org.apache.drill.exec.vector.complex.writer.BaseWriter" ]
import org.apache.drill.exec.record.metadata.ColumnMetadata; import org.apache.drill.exec.record.metadata.TupleMetadata; import org.apache.drill.exec.vector.complex.writer.BaseWriter;
import org.apache.drill.exec.record.metadata.*; import org.apache.drill.exec.vector.complex.writer.*;
[ "org.apache.drill" ]
org.apache.drill;
1,609,654
void removeContainerPortMapping( Host host, Protocol protocol, String containerIp, int containerPort, int rhPort ) throws NetworkManagerException;
void removeContainerPortMapping( Host host, Protocol protocol, String containerIp, int containerPort, int rhPort ) throws NetworkManagerException;
/** * Removes specified container port mapping * * @param host RH host * @param protocol protocol * @param containerIp ip of container * @param containerPort container port * @param rhPort RH port */
Removes specified container port mapping
removeContainerPortMapping
{ "repo_name": "subutai-io/Subutai", "path": "management/server/core/network-manager/network-manager-api/src/main/java/io/subutai/core/network/api/NetworkManager.java", "license": "apache-2.0", "size": 5792 }
[ "io.subutai.common.peer.Host", "io.subutai.common.protocol.Protocol" ]
import io.subutai.common.peer.Host; import io.subutai.common.protocol.Protocol;
import io.subutai.common.peer.*; import io.subutai.common.protocol.*;
[ "io.subutai.common" ]
io.subutai.common;
2,262,769
private static void addPreviousLayer(List<List<SpikingNeuron>> layers, List<SpikingNeuron> sourceLayer, List<SpikingNeuron> layerToCheck) { // Stop adding layers when the number of layers exceeds this. Here // to prevent infinite recursions that result when invalid networks // are used with these methods. Perhaps there is a better way to // check for such a problem though... final int MAXLAYERS = 100; // The next layer. A Set to prevent duplicates. Set<SpikingNeuron> newLayerTemp = new HashSet<SpikingNeuron>(); boolean theNextLayerIsTheSourceLayer = false; // Populate next layer for (SpikingNeuron neuron : layerToCheck) { for (SpikingSynapse synapse : neuron.getFanIn()) { SpikingNeuron sourceNeuron = synapse.getSource(); if (sourceLayer.contains(sourceNeuron)) { theNextLayerIsTheSourceLayer = true; } // Ignore recurrent connections if (sourceNeuron == neuron) { continue; } newLayerTemp.add(synapse.getSource()); } } if ((theNextLayerIsTheSourceLayer) || (newLayerTemp.size() == 0) || (layers.size() > MAXLAYERS)) { // We're done. We found the source layer or there was a problem. Add // the source layer and move on. layers.add(sourceLayer); } else { // Add this hidden layer then recursively add another layer, if // there is one. List<SpikingNeuron> newLayer = new ArrayList<SpikingNeuron>(newLayerTemp); Collections.sort(newLayer, OrientationComparator.X_ORDER); layers.add(newLayer); addPreviousLayer(layers, sourceLayer, newLayer); } }
static void function(List<List<SpikingNeuron>> layers, List<SpikingNeuron> sourceLayer, List<SpikingNeuron> layerToCheck) { final int MAXLAYERS = 100; Set<SpikingNeuron> newLayerTemp = new HashSet<SpikingNeuron>(); boolean theNextLayerIsTheSourceLayer = false; for (SpikingNeuron neuron : layerToCheck) { for (SpikingSynapse synapse : neuron.getFanIn()) { SpikingNeuron sourceNeuron = synapse.getSource(); if (sourceLayer.contains(sourceNeuron)) { theNextLayerIsTheSourceLayer = true; } if (sourceNeuron == neuron) { continue; } newLayerTemp.add(synapse.getSource()); } } if ((theNextLayerIsTheSourceLayer) (newLayerTemp.size() == 0) (layers.size() > MAXLAYERS)) { layers.add(sourceLayer); } else { List<SpikingNeuron> newLayer = new ArrayList<SpikingNeuron>(newLayerTemp); Collections.sort(newLayer, OrientationComparator.X_ORDER); layers.add(newLayer); addPreviousLayer(layers, sourceLayer, newLayer); } }
/** * Helper method for getIntermedateLayers. Add the "next layer down" in the * hierarchy. * * @param layers the current set of layers * @param sourceLayer the source layer * @param layerToCheck the current layer. Look for previous layers and if * one is found add it to the layers. */
Helper method for getIntermedateLayers. Add the "next layer down" in the hierarchy
addPreviousLayer
{ "repo_name": "automenta/java_dann", "path": "src/syncleus/dann/neural/spiking/util/SimnetUtils.java", "license": "agpl-3.0", "size": 11862 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.HashSet", "java.util.List", "java.util.Set" ]
import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,485,342
public InetSocketAddress localControl() { return localControl; } private UdpChannel(final Context context) { this.remoteData = context.remoteData; this.localData = context.localData; this.remoteControl = context.remoteControl; this.localControl = context.localControl; this.uriStr = context.uriStr; this.canonicalForm = context.canonicalForm; this.localInterface = context.localInterface; } /** * The canonical form for the channel * <p> * {@link UdpChannel#canonicalise(java.net.InetSocketAddress, java.net.InetSocketAddress)}
InetSocketAddress function() { return localControl; } private UdpChannel(final Context context) { this.remoteData = context.remoteData; this.localData = context.localData; this.remoteControl = context.remoteControl; this.localControl = context.localControl; this.uriStr = context.uriStr; this.canonicalForm = context.canonicalForm; this.localInterface = context.localInterface; } /** * The canonical form for the channel * <p> * {@link UdpChannel#canonicalise(java.net.InetSocketAddress, java.net.InetSocketAddress)}
/** * Local control address information * * @return local control address information */
Local control address information
localControl
{ "repo_name": "qed-/Aeron", "path": "aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/UdpChannel.java", "license": "apache-2.0", "size": 15984 }
[ "java.net.InetSocketAddress" ]
import java.net.InetSocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
2,820,829
@Nonnull public Fido2AuthenticationMethodRequestBuilder fido2Methods(@Nonnull final String id) { return new Fido2AuthenticationMethodRequestBuilder(getRequestUrlWithAdditionalSegment("fido2Methods") + "/" + id, getClient(), null); }
Fido2AuthenticationMethodRequestBuilder function(@Nonnull final String id) { return new Fido2AuthenticationMethodRequestBuilder(getRequestUrlWithAdditionalSegment(STR) + "/" + id, getClient(), null); }
/** * Gets a request builder for the Fido2AuthenticationMethod item * * @return the request builder * @param id the item identifier */
Gets a request builder for the Fido2AuthenticationMethod item
fido2Methods
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/AuthenticationRequestBuilder.java", "license": "mit", "size": 6575 }
[ "com.microsoft.graph.requests.Fido2AuthenticationMethodRequestBuilder", "javax.annotation.Nonnull" ]
import com.microsoft.graph.requests.Fido2AuthenticationMethodRequestBuilder; import javax.annotation.Nonnull;
import com.microsoft.graph.requests.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
1,183,719
public SubnetInner withResourceNavigationLinks(List<ResourceNavigationLinkInner> resourceNavigationLinks) { this.resourceNavigationLinks = resourceNavigationLinks; return this; }
SubnetInner function(List<ResourceNavigationLinkInner> resourceNavigationLinks) { this.resourceNavigationLinks = resourceNavigationLinks; return this; }
/** * Set the resourceNavigationLinks value. * * @param resourceNavigationLinks the resourceNavigationLinks value to set * @return the SubnetInner object itself. */
Set the resourceNavigationLinks value
withResourceNavigationLinks
{ "repo_name": "jianghaolu/azure-sdk-for-java", "path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SubnetInner.java", "license": "mit", "size": 5694 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,435,425
public List<ByteBuf> decompose(int offset, int length) { checkIndex(offset, length); if (length == 0) { return Collections.emptyList(); } int componentId = toComponentIndex(offset); List<ByteBuf> slice = new ArrayList<ByteBuf>(components.size()); // The first component Component firstC = components.get(componentId); ByteBuf first = firstC.buf.duplicate(); first.readerIndex(offset - firstC.offset); ByteBuf buf = first; int bytesToSlice = length; do { int readableBytes = buf.readableBytes(); if (bytesToSlice <= readableBytes) { // Last component buf.writerIndex(buf.readerIndex() + bytesToSlice); slice.add(buf); break; } else { // Not the last component slice.add(buf); bytesToSlice -= readableBytes; componentId ++; // Fetch the next component. buf = components.get(componentId).buf.duplicate(); } } while (bytesToSlice > 0); // Slice all components because only readable bytes are interesting. for (int i = 0; i < slice.size(); i ++) { slice.set(i, slice.get(i).slice()); } return slice; }
List<ByteBuf> function(int offset, int length) { checkIndex(offset, length); if (length == 0) { return Collections.emptyList(); } int componentId = toComponentIndex(offset); List<ByteBuf> slice = new ArrayList<ByteBuf>(components.size()); Component firstC = components.get(componentId); ByteBuf first = firstC.buf.duplicate(); first.readerIndex(offset - firstC.offset); ByteBuf buf = first; int bytesToSlice = length; do { int readableBytes = buf.readableBytes(); if (bytesToSlice <= readableBytes) { buf.writerIndex(buf.readerIndex() + bytesToSlice); slice.add(buf); break; } else { slice.add(buf); bytesToSlice -= readableBytes; componentId ++; buf = components.get(componentId).buf.duplicate(); } } while (bytesToSlice > 0); for (int i = 0; i < slice.size(); i ++) { slice.set(i, slice.get(i).slice()); } return slice; }
/** * Same with {@link #slice(int, int)} except that this method returns a list. */
Same with <code>#slice(int, int)</code> except that this method returns a list
decompose
{ "repo_name": "kaustubh-walokar/grpc-poll-service", "path": "lib/netty/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java", "license": "bsd-3-clause", "size": 51801 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
524,364
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException { if (chart == null) { throw new IllegalArgumentException("Null 'chart' argument."); } BufferedImage image = chart.createBufferedImage(width, height, BufferedImage.TYPE_INT_RGB, info); EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out); }
static void function(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException { if (chart == null) { throw new IllegalArgumentException(STR); } BufferedImage image = chart.createBufferedImage(width, height, BufferedImage.TYPE_INT_RGB, info); EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out); }
/** * Writes a chart to an output stream in JPEG format. This method allows * you to pass in a {@link ChartRenderingInfo} object, to collect * information about the chart dimensions/entities. You will need this * info if you want to create an HTML image map. * * @param out the output stream (<code>null</code> not permitted). * @param chart the chart (<code>null</code> not permitted). * @param width the image width. * @param height the image height. * @param info the chart rendering info (<code>null</code> permitted). * * @throws IOException if there are any I/O errors. */
Writes a chart to an output stream in JPEG format. This method allows you to pass in a <code>ChartRenderingInfo</code> object, to collect information about the chart dimensions/entities. You will need this info if you want to create an HTML image map
writeChartAsJPEG
{ "repo_name": "linuxuser586/jfreechart", "path": "source/org/jfree/chart/ChartUtilities.java", "license": "lgpl-2.1", "size": 30510 }
[ "java.awt.image.BufferedImage", "java.io.IOException", "java.io.OutputStream", "org.jfree.chart.encoders.EncoderUtil", "org.jfree.chart.encoders.ImageFormat" ]
import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; import org.jfree.chart.encoders.EncoderUtil; import org.jfree.chart.encoders.ImageFormat;
import java.awt.image.*; import java.io.*; import org.jfree.chart.encoders.*;
[ "java.awt", "java.io", "org.jfree.chart" ]
java.awt; java.io; org.jfree.chart;
548,845
public boolean isResourcePresent(LocalizedResource rsrc) { boolean ret = true; if (rsrc.getState() == ResourceState.LOCALIZED) { File file = new File(rsrc.getLocalPath().toUri().getRawPath(). toString()); if (!file.exists()) { ret = false; } } return ret; }
boolean function(LocalizedResource rsrc) { boolean ret = true; if (rsrc.getState() == ResourceState.LOCALIZED) { File file = new File(rsrc.getLocalPath().toUri().getRawPath(). toString()); if (!file.exists()) { ret = false; } } return ret; }
/** * This module checks if the resource which was localized is already present * or not * * @param rsrc * @return true/false based on resource is present or not */
This module checks if the resource which was localized is already present or not
isResourcePresent
{ "repo_name": "JuntaoZhang/myhadoop-2.2.0", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/LocalResourcesTrackerImpl.java", "license": "apache-2.0", "size": 11483 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,987,102
public Class<?>[] findSignatureClasses(String signature[], ClassLoader loader) throws ReflectionException { if (signature == null) return null; final ClassLoader aLoader = loader; final int length= signature.length; final Class<?> tab[]=new Class<?>[length]; if (length == 0) return tab; try { for (int i= 0; i < length; i++) { // Start handling primitive types (int. boolean and so // forth) // final Class<?> primCla = primitiveClasses.get(signature[i]); if (primCla != null) { tab[i] = primCla; continue; } ReflectUtil.checkPackageAccess(signature[i]); // Ok we do not have a primitive type ! We need to build // the signature of the method // if (aLoader != null) { // We need to load the class through the class // loader of the target object. // tab[i] = Class.forName(signature[i], false, aLoader); } else { // Load through the default class loader // tab[i] = findClass(signature[i], this.getClass().getClassLoader()); } } } catch (ClassNotFoundException e) { if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) { MBEANSERVER_LOGGER.logp(Level.FINEST, MBeanInstantiator.class.getName(), "findSignatureClasses", "The parameter class could not be found", e); } throw new ReflectionException(e, "The parameter class could not be found"); } catch (RuntimeException e) { if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) { MBEANSERVER_LOGGER.logp(Level.FINEST, MBeanInstantiator.class.getName(), "findSignatureClasses", "Unexpected exception", e); } throw e; } return tab; }
Class<?>[] function(String signature[], ClassLoader loader) throws ReflectionException { if (signature == null) return null; final ClassLoader aLoader = loader; final int length= signature.length; final Class<?> tab[]=new Class<?>[length]; if (length == 0) return tab; try { for (int i= 0; i < length; i++) { final Class<?> primCla = primitiveClasses.get(signature[i]); if (primCla != null) { tab[i] = primCla; continue; } ReflectUtil.checkPackageAccess(signature[i]); } else { this.getClass().getClassLoader()); } } } catch (ClassNotFoundException e) { if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) { MBEANSERVER_LOGGER.logp(Level.FINEST, MBeanInstantiator.class.getName(), STR, STR, e); } throw new ReflectionException(e, STR); } catch (RuntimeException e) { if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) { MBEANSERVER_LOGGER.logp(Level.FINEST, MBeanInstantiator.class.getName(), STR, STR, e); } throw e; } return tab; }
/** * Return an array of Class corresponding to the given signature, using * the specified class loader. */
Return an array of Class corresponding to the given signature, using the specified class loader
findSignatureClasses
{ "repo_name": "haikuowuya/android_system_code", "path": "src/com/sun/jmx/mbeanserver/MBeanInstantiator.java", "license": "apache-2.0", "size": 27711 }
[ "java.util.logging.Level", "javax.management.ReflectionException" ]
import java.util.logging.Level; import javax.management.ReflectionException;
import java.util.logging.*; import javax.management.*;
[ "java.util", "javax.management" ]
java.util; javax.management;
1,051,315
public void init(ServiceOperatorRepository serviceOperatorRepository, EncoderRepository encoderRepository) { this.serviceOperatorRepository = Objects.requireNonNull(serviceOperatorRepository); this.encoderRepository = Objects.requireNonNull(encoderRepository); generateProcedureDescriptionFormatMaps(); }
void function(ServiceOperatorRepository serviceOperatorRepository, EncoderRepository encoderRepository) { this.serviceOperatorRepository = Objects.requireNonNull(serviceOperatorRepository); this.encoderRepository = Objects.requireNonNull(encoderRepository); generateProcedureDescriptionFormatMaps(); }
/** * This class does not implement {@link Constructable} due to some circular dependencies that can lead to an * incorrect initialization order; instead {@link ProcedureDescriptionFormatRepositoryInitializer} does this for us. * * @param serviceOperatorRepository the service operator respository * @param encoderRepository the encoder repository */
This class does not implement <code>Constructable</code> due to some circular dependencies that can lead to an incorrect initialization order; instead <code>ProcedureDescriptionFormatRepositoryInitializer</code> does this for us
init
{ "repo_name": "autermann/SOS", "path": "core/api/src/main/java/org/n52/sos/coding/encode/ProcedureDescriptionFormatRepository.java", "license": "gpl-2.0", "size": 11208 }
[ "java.util.Objects", "org.n52.iceland.service.operator.ServiceOperatorRepository", "org.n52.svalbard.encode.EncoderRepository" ]
import java.util.Objects; import org.n52.iceland.service.operator.ServiceOperatorRepository; import org.n52.svalbard.encode.EncoderRepository;
import java.util.*; import org.n52.iceland.service.operator.*; import org.n52.svalbard.encode.*;
[ "java.util", "org.n52.iceland", "org.n52.svalbard" ]
java.util; org.n52.iceland; org.n52.svalbard;
128,417
public NestedSet<Artifact> getRootMergeZips() { return rootMergeZips; }
NestedSet<Artifact> function() { return rootMergeZips; }
/** * Returns all zip files whose contents should be merged into final ipa and outside the * main bundle. For instance, if a merge zip contains files dir1/file1, then the resulting * bundling would have additional files at: * <ul> * <li>dir1/file1 * <li>{bundleDir}/other_files * </ul> */
Returns all zip files whose contents should be merged into final ipa and outside the main bundle. For instance, if a merge zip contains files dir1/file1, then the resulting bundling would have additional files at: dir1/file1 {bundleDir}/other_files
getRootMergeZips
{ "repo_name": "dropbox/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/Bundling.java", "license": "apache-2.0", "size": 25418 }
[ "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.collect.nestedset.NestedSet" ]
import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.collect.nestedset.*;
[ "com.google.devtools" ]
com.google.devtools;
281,060
public static boolean hasTokenInformation(Bundle bundle) { if (bundle == null) { return false; } String token = bundle.getString(TOKEN_KEY); if ((token == null) || (token.length() == 0)) { return false; } long expiresMilliseconds = bundle.getLong(EXPIRATION_DATE_KEY, 0L); if (expiresMilliseconds == 0L) { return false; } return true; }
static boolean function(Bundle bundle) { if (bundle == null) { return false; } String token = bundle.getString(TOKEN_KEY); if ((token == null) (token.length() == 0)) { return false; } long expiresMilliseconds = bundle.getLong(EXPIRATION_DATE_KEY, 0L); if (expiresMilliseconds == 0L) { return false; } return true; }
/** * Returns a boolean indicating whether a Bundle contains properties that * could be a valid saved token. * * @param bundle * A Bundle to check for token information. * @return a boolean indicating whether a Bundle contains properties that * could be a valid saved token. */
Returns a boolean indicating whether a Bundle contains properties that could be a valid saved token
hasTokenInformation
{ "repo_name": "greenhalolabs/facebooklogin", "path": "facebooklogin/src/main/java/com/greenhalolabs/facebooklogin/TokenCachingStrategy.java", "license": "mit", "size": 11864 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
71,522
public boolean isCurrentlyPaused() { return isPlaying() && ((PlaybackPreferences.getCurrentPlayerStatus() == PlaybackPreferences.PLAYER_STATUS_PAUSED)); }
boolean function() { return isPlaying() && ((PlaybackPreferences.getCurrentPlayerStatus() == PlaybackPreferences.PLAYER_STATUS_PAUSED)); }
/** * Reads playback preferences to determine whether this FeedMedia object is * currently being played and the current player status is paused. */
Reads playback preferences to determine whether this FeedMedia object is currently being played and the current player status is paused
isCurrentlyPaused
{ "repo_name": "jimulabs/AntennaPod-mirror", "path": "core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java", "license": "mit", "size": 13015 }
[ "de.danoeh.antennapod.core.preferences.PlaybackPreferences" ]
import de.danoeh.antennapod.core.preferences.PlaybackPreferences;
import de.danoeh.antennapod.core.preferences.*;
[ "de.danoeh.antennapod" ]
de.danoeh.antennapod;
993,669
protected void setPermission(FsPermission permission) { this.permission = (permission == null) ? FsPermission.getFileDefault() : permission; }
void function(FsPermission permission) { this.permission = (permission == null) ? FsPermission.getFileDefault() : permission; }
/** * Sets permission. * @param permission if permission is null, default value is set */
Sets permission
setPermission
{ "repo_name": "odpi/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java", "license": "apache-2.0", "size": 11757 }
[ "org.apache.hadoop.fs.permission.FsPermission" ]
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.fs.permission.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,750,439
public Boolean getUsesNativeSQL() { if (!(getSession().getDatasourceLogin().getDatasourcePlatform() instanceof DatabasePlatform)) { return Boolean.FALSE; } return Boolean.valueOf(getSession().getDatasourceLogin().getPlatform().usesNativeSQL()); }
Boolean function() { if (!(getSession().getDatasourceLogin().getDatasourcePlatform() instanceof DatabasePlatform)) { return Boolean.FALSE; } return Boolean.valueOf(getSession().getDatasourceLogin().getPlatform().usesNativeSQL()); }
/** * Shows if native SQL is being used */
Shows if native SQL is being used
getUsesNativeSQL
{ "repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/services/RuntimeServices.java", "license": "epl-1.0", "size": 71544 }
[ "org.eclipse.persistence.internal.databaseaccess.DatabasePlatform" ]
import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform;
import org.eclipse.persistence.internal.databaseaccess.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
2,306,089
private void extractInput(String[] args) throws MPIException { try { InputFile = args[0]; K = Integer.parseInt(args[1]); Epsilon = Double.parseDouble(args[2]); } catch (Exception e) { if (MyRank == MASTER_ID) { System.out.printf("Arguments: <InputFile> <#Clusters> <Threshold>\n"); } MPI.Finalize(); System.exit(0); } List<Double> xList = new ArrayList<Double>(); List<Double> yList = new ArrayList<Double>(); BufferedReader in; try { in = new BufferedReader(new FileReader(InputFile)); while (in.ready()) { String[] s = in.readLine().split(","); xList.add(Double.parseDouble(s[0])); yList.add(Double.parseDouble(s[1])); } in.close(); } catch (IOException e) { if (MyRank == MASTER_ID) { System.out.printf("Exception while reading input file -- %s\n", e.getMessage()); } MPI.Finalize(); System.exit(0); } N = xList.size(); X = new double[N]; Y = new double[N]; for (int i = 0; i < N; i++) { X[i] = xList.get(i); Y[i] = yList.get(i); } if (MyRank == MASTER_ID) { System.out.printf("Successfully loaded %d data points!\n", xList.size()); } }
void function(String[] args) throws MPIException { try { InputFile = args[0]; K = Integer.parseInt(args[1]); Epsilon = Double.parseDouble(args[2]); } catch (Exception e) { if (MyRank == MASTER_ID) { System.out.printf(STR); } MPI.Finalize(); System.exit(0); } List<Double> xList = new ArrayList<Double>(); List<Double> yList = new ArrayList<Double>(); BufferedReader in; try { in = new BufferedReader(new FileReader(InputFile)); while (in.ready()) { String[] s = in.readLine().split(","); xList.add(Double.parseDouble(s[0])); yList.add(Double.parseDouble(s[1])); } in.close(); } catch (IOException e) { if (MyRank == MASTER_ID) { System.out.printf(STR, e.getMessage()); } MPI.Finalize(); System.exit(0); } N = xList.size(); X = new double[N]; Y = new double[N]; for (int i = 0; i < N; i++) { X[i] = xList.get(i); Y[i] = yList.get(i); } if (MyRank == MASTER_ID) { System.out.printf(STR, xList.size()); } }
/** * Loads input parameters and data from user. (Used by All) * * @param args Command-line arguments from user * @throws MPIException MPI-related exceptions during execution. */
Loads input parameters and data from user. (Used by All)
extractInput
{ "repo_name": "ymzong/dsf14", "path": "OpenMPIKMeans/src/com/yzong/dsf14/openMPIKMeans/euclidean/EuclideanParallel.java", "license": "mit", "size": 11804 }
[ "java.io.BufferedReader", "java.io.FileReader", "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,951,672
public List<NetworkInterfaceTapConfigurationInner> networkInterfaceTapConfigurations() { return this.networkInterfaceTapConfigurations; }
List<NetworkInterfaceTapConfigurationInner> function() { return this.networkInterfaceTapConfigurations; }
/** * Get specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. * * @return the networkInterfaceTapConfigurations value */
Get specifies the list of resource IDs for the network interface IP configuration that needs to be tapped
networkInterfaceTapConfigurations
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/VirtualNetworkTapInner.java", "license": "mit", "size": 6638 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,527,086
void injectKeytab(ExecutionCommand ec, String command, String targetHost) throws AmbariException { String dataDir = ec.getCommandParams().get(KerberosServerAction.DATA_DIRECTORY); if(dataDir != null) { KerberosIdentityDataFileReader reader = null; List<Map<String, String>> kcp = ec.getKerberosCommandParams(); try { reader = kerberosIdentityDataFileReaderFactory.createKerberosIdentityDataFileReader(new File(dataDir, KerberosIdentityDataFileReader.DATA_FILE_NAME)); for (Map<String, String> record : reader) { String hostName = record.get(KerberosIdentityDataFileReader.HOSTNAME); if (targetHost.equalsIgnoreCase(hostName)) { if ("SET_KEYTAB".equalsIgnoreCase(command)) { String keytabFilePath = record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH); if (keytabFilePath != null) { String sha1Keytab = DigestUtils.sha1Hex(keytabFilePath); File keytabFile = new File(dataDir + File.separator + hostName + File.separator + sha1Keytab); if (keytabFile.canRead()) { Map<String, String> keytabMap = new HashMap<String, String>(); String principal = record.get(KerberosIdentityDataFileReader.PRINCIPAL); String isService = record.get(KerberosIdentityDataFileReader.SERVICE); keytabMap.put(KerberosIdentityDataFileReader.HOSTNAME, hostName); keytabMap.put(KerberosIdentityDataFileReader.SERVICE, isService); keytabMap.put(KerberosIdentityDataFileReader.COMPONENT, record.get(KerberosIdentityDataFileReader.COMPONENT)); keytabMap.put(KerberosIdentityDataFileReader.PRINCIPAL, principal); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH, keytabFilePath); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_NAME, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_NAME)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_ACCESS, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_ACCESS)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_NAME, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_NAME)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_ACCESS, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_ACCESS)); BufferedInputStream bufferedIn = new BufferedInputStream(new FileInputStream(keytabFile)); byte[] keytabContent = null; try { keytabContent = IOUtils.toByteArray(bufferedIn); } finally { bufferedIn.close(); } String keytabContentBase64 = Base64.encodeBase64String(keytabContent); keytabMap.put(KerberosServerAction.KEYTAB_CONTENT_BASE64, keytabContentBase64); kcp.add(keytabMap); } } } else if ("REMOVE_KEYTAB".equalsIgnoreCase(command)) { Map<String, String> keytabMap = new HashMap<String, String>(); keytabMap.put(KerberosIdentityDataFileReader.HOSTNAME, hostName); keytabMap.put(KerberosIdentityDataFileReader.SERVICE, record.get(KerberosIdentityDataFileReader.SERVICE)); keytabMap.put(KerberosIdentityDataFileReader.COMPONENT, record.get(KerberosIdentityDataFileReader.COMPONENT)); keytabMap.put(KerberosIdentityDataFileReader.PRINCIPAL, record.get(KerberosIdentityDataFileReader.PRINCIPAL)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH)); kcp.add(keytabMap); } } } } catch (IOException e) { throw new AmbariException("Could not inject keytabs to enable kerberos"); } finally { if (reader != null) { try { reader.close(); } catch (Throwable t) { // ignored } } } ec.setKerberosCommandParams(kcp); } }
void injectKeytab(ExecutionCommand ec, String command, String targetHost) throws AmbariException { String dataDir = ec.getCommandParams().get(KerberosServerAction.DATA_DIRECTORY); if(dataDir != null) { KerberosIdentityDataFileReader reader = null; List<Map<String, String>> kcp = ec.getKerberosCommandParams(); try { reader = kerberosIdentityDataFileReaderFactory.createKerberosIdentityDataFileReader(new File(dataDir, KerberosIdentityDataFileReader.DATA_FILE_NAME)); for (Map<String, String> record : reader) { String hostName = record.get(KerberosIdentityDataFileReader.HOSTNAME); if (targetHost.equalsIgnoreCase(hostName)) { if (STR.equalsIgnoreCase(command)) { String keytabFilePath = record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH); if (keytabFilePath != null) { String sha1Keytab = DigestUtils.sha1Hex(keytabFilePath); File keytabFile = new File(dataDir + File.separator + hostName + File.separator + sha1Keytab); if (keytabFile.canRead()) { Map<String, String> keytabMap = new HashMap<String, String>(); String principal = record.get(KerberosIdentityDataFileReader.PRINCIPAL); String isService = record.get(KerberosIdentityDataFileReader.SERVICE); keytabMap.put(KerberosIdentityDataFileReader.HOSTNAME, hostName); keytabMap.put(KerberosIdentityDataFileReader.SERVICE, isService); keytabMap.put(KerberosIdentityDataFileReader.COMPONENT, record.get(KerberosIdentityDataFileReader.COMPONENT)); keytabMap.put(KerberosIdentityDataFileReader.PRINCIPAL, principal); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH, keytabFilePath); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_NAME, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_NAME)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_ACCESS, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_OWNER_ACCESS)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_NAME, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_NAME)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_ACCESS, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_GROUP_ACCESS)); BufferedInputStream bufferedIn = new BufferedInputStream(new FileInputStream(keytabFile)); byte[] keytabContent = null; try { keytabContent = IOUtils.toByteArray(bufferedIn); } finally { bufferedIn.close(); } String keytabContentBase64 = Base64.encodeBase64String(keytabContent); keytabMap.put(KerberosServerAction.KEYTAB_CONTENT_BASE64, keytabContentBase64); kcp.add(keytabMap); } } } else if (STR.equalsIgnoreCase(command)) { Map<String, String> keytabMap = new HashMap<String, String>(); keytabMap.put(KerberosIdentityDataFileReader.HOSTNAME, hostName); keytabMap.put(KerberosIdentityDataFileReader.SERVICE, record.get(KerberosIdentityDataFileReader.SERVICE)); keytabMap.put(KerberosIdentityDataFileReader.COMPONENT, record.get(KerberosIdentityDataFileReader.COMPONENT)); keytabMap.put(KerberosIdentityDataFileReader.PRINCIPAL, record.get(KerberosIdentityDataFileReader.PRINCIPAL)); keytabMap.put(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH, record.get(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH)); kcp.add(keytabMap); } } } } catch (IOException e) { throw new AmbariException(STR); } finally { if (reader != null) { try { reader.close(); } catch (Throwable t) { } } } ec.setKerberosCommandParams(kcp); } }
/** * Insert Kerberos keytab details into the ExecutionCommand for the SET_KEYTAB custom command if * any keytab details and associated data exists for the target host. * * @param ec the ExecutionCommand to update * @param command a name of the relevant keytab command * @param targetHost a name of the host the relevant command is destined for * @throws AmbariException */
Insert Kerberos keytab details into the ExecutionCommand for the SET_KEYTAB custom command if any keytab details and associated data exists for the target host
injectKeytab
{ "repo_name": "alexryndin/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java", "license": "apache-2.0", "size": 29141 }
[ "java.io.BufferedInputStream", "java.io.File", "java.io.FileInputStream", "java.io.IOException", "java.util.HashMap", "java.util.List", "java.util.Map", "org.apache.ambari.server.AmbariException", "org.apache.ambari.server.serveraction.kerberos.KerberosIdentityDataFileReader", "org.apache.ambari.server.serveraction.kerberos.KerberosServerAction", "org.apache.commons.codec.binary.Base64", "org.apache.commons.codec.digest.DigestUtils", "org.apache.commons.io.IOUtils" ]
import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.serveraction.kerberos.KerberosIdentityDataFileReader; import org.apache.ambari.server.serveraction.kerberos.KerberosServerAction; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils;
import java.io.*; import java.util.*; import org.apache.ambari.server.*; import org.apache.ambari.server.serveraction.kerberos.*; import org.apache.commons.codec.binary.*; import org.apache.commons.codec.digest.*; import org.apache.commons.io.*;
[ "java.io", "java.util", "org.apache.ambari", "org.apache.commons" ]
java.io; java.util; org.apache.ambari; org.apache.commons;
289,167
private void displaySplashScreen() { m_connect.setVisibility(View.GONE); m_scanner.setVisibility(View.GONE); m_title_bar.setVisibility(View.GONE); m_upgrade.setVisibility(View.GONE); m_splash.setVisibility(View.VISIBLE); }
void function() { m_connect.setVisibility(View.GONE); m_scanner.setVisibility(View.GONE); m_title_bar.setVisibility(View.GONE); m_upgrade.setVisibility(View.GONE); m_splash.setVisibility(View.VISIBLE); }
/** * Displays No3g splash screen */
Displays No3g splash screen
displaySplashScreen
{ "repo_name": "virtualabs/Youspot", "path": "src/com/youspot/No3g.java", "license": "gpl-2.0", "size": 28315 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
1,055,653
final ConnectedComponentInterface getRightCComponent() { return rightHandSideComponent; }
final ConnectedComponentInterface getRightCComponent() { return rightHandSideComponent; }
/** * This method returns connected component from right handSide rule, which * this action should be applied to (may be "null"). */
This method returns connected component from right handSide rule, which this action should be applied to (may be "null")
getRightCComponent
{ "repo_name": "kappamodeler/jkappa", "path": "src/main/com/plectix/simulator/simulationclasses/action/Action.java", "license": "lgpl-3.0", "size": 7790 }
[ "com.plectix.simulator.interfaces.ConnectedComponentInterface" ]
import com.plectix.simulator.interfaces.ConnectedComponentInterface;
import com.plectix.simulator.interfaces.*;
[ "com.plectix.simulator" ]
com.plectix.simulator;
868,404
@TestOnly public boolean selectSingle(Editor editor, PsiFile file, String annotationShortName) { if (mySingleMode) { throw new IllegalStateException(); } mySingleMode = true; final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset()); if (owner == null || owner.getModifierList() == null || !ExternalAnnotationsManagerImpl.areExternalAnnotationsApplicable(owner)) { return false; } Optional<AnnotationProvider> provider = availableAnnotations(owner, file.getProject()) .filter(p -> StringUtil.getShortName(p.getName(file.getProject())).equals(annotationShortName)) .collect(MoreCollectors.onlyOne()); myAnnotationProvider = provider.orElse(null); return provider.isPresent(); }
boolean function(Editor editor, PsiFile file, String annotationShortName) { if (mySingleMode) { throw new IllegalStateException(); } mySingleMode = true; final PsiModifierListOwner owner = AddAnnotationPsiFix.getContainer(file, editor.getCaretModel().getOffset()); if (owner == null owner.getModifierList() == null !ExternalAnnotationsManagerImpl.areExternalAnnotationsApplicable(owner)) { return false; } Optional<AnnotationProvider> provider = availableAnnotations(owner, file.getProject()) .filter(p -> StringUtil.getShortName(p.getName(file.getProject())).equals(annotationShortName)) .collect(MoreCollectors.onlyOne()); myAnnotationProvider = provider.orElse(null); return provider.isPresent(); }
/** * Configure the intention to annotate an element at caret in the editor with concrete annotation * * @param editor an editor * @param file a file * @param annotationShortName a short name of the annotation to add * @return true if specified annotation is provided and could be added to the element under caret, false otherwise */
Configure the intention to annotate an element at caret in the editor with concrete annotation
selectSingle
{ "repo_name": "goodwinnk/intellij-community", "path": "java/java-impl/src/com/intellij/codeInsight/intention/impl/AnnotateIntentionAction.java", "license": "apache-2.0", "size": 6245 }
[ "com.intellij.codeInsight.ExternalAnnotationsManagerImpl", "com.intellij.codeInsight.externalAnnotation.AnnotationProvider", "com.intellij.codeInsight.intention.AddAnnotationPsiFix", "com.intellij.openapi.editor.Editor", "com.intellij.openapi.util.text.StringUtil", "com.intellij.psi.PsiFile", "com.intellij.psi.PsiModifierListOwner", "java.util.Optional", "one.util.streamex.MoreCollectors" ]
import com.intellij.codeInsight.ExternalAnnotationsManagerImpl; import com.intellij.codeInsight.externalAnnotation.AnnotationProvider; import com.intellij.codeInsight.intention.AddAnnotationPsiFix; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiModifierListOwner; import java.util.Optional; import one.util.streamex.MoreCollectors;
import com.intellij.*; import com.intellij.openapi.editor.*; import com.intellij.openapi.util.text.*; import com.intellij.psi.*; import java.util.*; import one.util.streamex.*;
[ "com.intellij", "com.intellij.openapi", "com.intellij.psi", "java.util", "one.util.streamex" ]
com.intellij; com.intellij.openapi; com.intellij.psi; java.util; one.util.streamex;
568,292
public void setParameters(List<?> parameters) { this.parameters = parameters; }
void function(List<?> parameters) { this.parameters = parameters; }
/** * Set the parameters * * @param parameters the parameters */
Set the parameters
setParameters
{ "repo_name": "JoeCarlson/intermine", "path": "intermine/objectstore/main/src/org/intermine/objectstore/query/iql/IqlQuery.java", "license": "lgpl-2.1", "size": 38394 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,777,712
@ServiceMethod(returns = ReturnType.SINGLE) public GeoBackupPolicyInner get( String resourceGroupName, String serverName, String databaseName, GeoBackupPolicyName geoBackupPolicyName) { return getAsync(resourceGroupName, serverName, databaseName, geoBackupPolicyName).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) GeoBackupPolicyInner function( String resourceGroupName, String serverName, String databaseName, GeoBackupPolicyName geoBackupPolicyName) { return getAsync(resourceGroupName, serverName, databaseName, geoBackupPolicyName).block(); }
/** * Gets a geo backup policy. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value * from the Azure Resource Manager API or the portal. * @param serverName The name of the server. * @param databaseName The name of the database. * @param geoBackupPolicyName The name of the geo backup policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a geo backup policy. */
Gets a geo backup policy
get
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/GeoBackupPoliciesClientImpl.java", "license": "mit", "size": 34806 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.sql.fluent.models.GeoBackupPolicyInner", "com.azure.resourcemanager.sql.models.GeoBackupPolicyName" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.sql.fluent.models.GeoBackupPolicyInner; import com.azure.resourcemanager.sql.models.GeoBackupPolicyName;
import com.azure.core.annotation.*; import com.azure.resourcemanager.sql.fluent.models.*; import com.azure.resourcemanager.sql.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,047,965
private ITypeTerm processFunctionCallExpression(FunctionCall fc) { return findOrCreateFunctionCallTerm(fc); }
ITypeTerm function(FunctionCall fc) { return findOrCreateFunctionCallTerm(fc); }
/** * for function calls, return a constraint variable that corresponds to the * callee's return type. The generation of constraints that require the type of each actual * parameter to be a subtype of the type of the corresponding formal parameter happens * in processFunctionCallParams */
for function calls, return a constraint variable that corresponds to the callee's return type. The generation of constraints that require the type of each actual parameter to be a subtype of the type of the corresponding formal parameter happens in processFunctionCallParams
processFunctionCallExpression
{ "repo_name": "csgordon/SJS", "path": "sjsc/src/main/java/com/samsung/sjs/constraintgenerator/ConstraintVisitor.java", "license": "apache-2.0", "size": 70132 }
[ "com.samsung.sjs.typeconstraints.ITypeTerm", "org.mozilla.javascript.ast.FunctionCall" ]
import com.samsung.sjs.typeconstraints.ITypeTerm; import org.mozilla.javascript.ast.FunctionCall;
import com.samsung.sjs.typeconstraints.*; import org.mozilla.javascript.ast.*;
[ "com.samsung.sjs", "org.mozilla.javascript" ]
com.samsung.sjs; org.mozilla.javascript;
1,509,624
public TibcoInstallation.DescriptorImpl getToolDescriptor() { return ToolInstallation.all().get( TibcoInstallation.DescriptorImpl.class); }
TibcoInstallation.DescriptorImpl function() { return ToolInstallation.all().get( TibcoInstallation.DescriptorImpl.class); }
/** * Obtains the {@link TibcoInstallation.DescriptorImpl} instance. */
Obtains the <code>TibcoInstallation.DescriptorImpl</code> instance
getToolDescriptor
{ "repo_name": "federicopastore/TibcoBuilder", "path": "src/main/java/org/jenkinsci/plugins/tibco/AmxEclipseAntBuilder.java", "license": "mit", "size": 12964 }
[ "hudson.tools.ToolInstallation", "org.jenkinsci.plugins.tibco.installation.TibcoInstallation" ]
import hudson.tools.ToolInstallation; import org.jenkinsci.plugins.tibco.installation.TibcoInstallation;
import hudson.tools.*; import org.jenkinsci.plugins.tibco.installation.*;
[ "hudson.tools", "org.jenkinsci.plugins" ]
hudson.tools; org.jenkinsci.plugins;
2,149,423
@Test public void testDelete() throws Exception { long size = countArticles(); EntityManager em = emf.createEntityManager(); String[] ids = new String[]{"132"}; // insert all items for (String id : ids) { // item should not be in the db Query query = em.createQuery(new StringBuilder().append("SELECT x FROM news x WHERE x.fs_id = ").append(id).toString()); assertEquals(0, query.getResultList().size()); // load content String content = getContent("src/test/resources/inbox/add/pressreleasesdetails_" + id + ".xml", "hibernate"); // send content to jms broker template.sendBody("jms:topic:BUS_OUT", content); // wait Thread.sleep(TimeOuts.LONG); query = em.createQuery(new StringBuilder().append("SELECT x FROM news x WHERE x.fs_id = ").append(id).toString()); assertEquals(1, query.getResultList().size()); } // wait Thread.sleep(TimeOuts.LONG); assertEquals("not all items are present", size+ids.length, countArticles()); // now send the delete command for (String id : ids) { // load content String content = getContent("src/test/resources/inbox/delete/pressreleasesdetails_" + id + ".xml", "hibernate"); // send content to jms broker template.sendBody("jms:topic:BUS_OUT", content); // wait Thread.sleep(TimeOuts.LONG); // item should be deleted Query query = em.createQuery(new StringBuilder().append("SELECT x FROM news x WHERE x.fs_id = ").append(id).toString()); assertEquals(0, query.getResultList().size()); } assertEquals("ups, there are items left in the db", size, countArticles()); em.close(); }
void function() throws Exception { long size = countArticles(); EntityManager em = emf.createEntityManager(); String[] ids = new String[]{"132"}; for (String id : ids) { Query query = em.createQuery(new StringBuilder().append(STR).append(id).toString()); assertEquals(0, query.getResultList().size()); String content = getContent(STR + id + ".xml", STR); template.sendBody(STR, content); Thread.sleep(TimeOuts.LONG); query = em.createQuery(new StringBuilder().append(STR).append(id).toString()); assertEquals(1, query.getResultList().size()); } Thread.sleep(TimeOuts.LONG); assertEquals(STR, size+ids.length, countArticles()); for (String id : ids) { String content = getContent(STR + id + ".xml", STR); template.sendBody(STR, content); Thread.sleep(TimeOuts.LONG); Query query = em.createQuery(new StringBuilder().append(STR).append(id).toString()); assertEquals(0, query.getResultList().size()); } assertEquals(STR, size, countArticles()); em.close(); }
/** * Test delete. * * @throws Exception the exception */
Test delete
testDelete
{ "repo_name": "e-Spirit/uxbridge-samples", "path": "newsDrillDown/adapter/hibernate/src/test/java/com/espirit/moddev/examples/uxbridge/newsdrilldown/test/CommandITCase.java", "license": "apache-2.0", "size": 14283 }
[ "javax.persistence.EntityManager", "javax.persistence.Query" ]
import javax.persistence.EntityManager; import javax.persistence.Query;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
297,923