method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
protected void configure(ValueParser values) { Locale locale = values.getLocale(ToolContext.LOCALE_KEY); if (locale != null) { setLocale(locale); } } /** * This returns the configured default {@link Locale} for this tool. * * @return the default {@link Locale}
void function(ValueParser values) { Locale locale = values.getLocale(ToolContext.LOCALE_KEY); if (locale != null) { setLocale(locale); } } /** * This returns the configured default {@link Locale} for this tool. * * @return the default {@link Locale}
/** * Does the actual configuration. This is protected, so * subclasses may share the same ValueParser and call configure * at any time, while preventing templates from doing so when * configure(Map) is locked. */
Does the actual configuration. This is protected, so subclasses may share the same ValueParser and call configure at any time, while preventing templates from doing so when configure(Map) is locked
configure
{ "repo_name": "fluidinfo/velocity-tools-packaging", "path": "src/main/java/org/apache/velocity/tools/generic/LocaleConfig.java", "license": "apache-2.0", "size": 2163 }
[ "java.util.Locale", "org.apache.velocity.tools.ToolContext" ]
import java.util.Locale; import org.apache.velocity.tools.ToolContext;
import java.util.*; import org.apache.velocity.tools.*;
[ "java.util", "org.apache.velocity" ]
java.util; org.apache.velocity;
2,208,908
public static void undeployBlock(AspectIfc a) { if(a != null) { threadDeployer.$undeployFrom(a.$getAspectRegistry(), a); } }
static void function(AspectIfc a) { if(a != null) { threadDeployer.$undeployFrom(a.$getAspectRegistry(), a); } }
/** * Undeploy aspect from the current thread (used for deploy block) * * @param a Aspect object */
Undeploy aspect from the current thread (used for deploy block)
undeployBlock
{ "repo_name": "tud-stg-lang/caesar-compiler", "path": "src/org/caesarj/runtime/DeploySupport.java", "license": "gpl-2.0", "size": 3423 }
[ "org.caesarj.runtime.aspects.AspectIfc" ]
import org.caesarj.runtime.aspects.AspectIfc;
import org.caesarj.runtime.aspects.*;
[ "org.caesarj.runtime" ]
org.caesarj.runtime;
2,831,622
public Location getLastKnownLocation(Context context) { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // TODO: Consider calling // ActivityCompat#requestPermissions // here to request the missing permissions, and then overriding // public void onRequestPermissionsResult(int requestCode, String[] permissions, // int[] grantResults) // to handle the case where the user grants the permission. See the documentation // for ActivityCompat#requestPermissions for more details. return null; } Location lastLocationNW = mLocationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); Location lastLocationGPS = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (lastLocationGPS != null || lastLocationNW != null) { mOldLocation = isBetterLocation(lastLocationNW, lastLocationGPS) ? lastLocationNW : lastLocationGPS; } return mOldLocation; }
Location function(Context context) { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return null; } Location lastLocationNW = mLocationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); Location lastLocationGPS = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (lastLocationGPS != null lastLocationNW != null) { mOldLocation = isBetterLocation(lastLocationNW, lastLocationGPS) ? lastLocationNW : lastLocationGPS; } return mOldLocation; }
/** Gives the best location after making a comparison between * Last location of N/W and that of GPS */
Gives the best location after making a comparison between Last location of N/W and that of GPS
getLastKnownLocation
{ "repo_name": "j0rg3n/skattejakt", "path": "app/src/main/java/com/Android2/model/CustomLocationManager.java", "license": "apache-2.0", "size": 10342 }
[ "android.content.Context", "android.content.pm.PackageManager", "android.location.Location", "android.location.LocationManager", "android.support.v4.app.ActivityCompat" ]
import android.content.Context; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; import android.support.v4.app.ActivityCompat;
import android.content.*; import android.content.pm.*; import android.location.*; import android.support.v4.app.*;
[ "android.content", "android.location", "android.support" ]
android.content; android.location; android.support;
764,319
@Generated @CVariable() @NInt public static native long GCKeyCodePeriod();
@CVariable() static native long function();
/** * . or > */
. or >
GCKeyCodePeriod
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/gamecontroller/c/GameController.java", "license": "apache-2.0", "size": 61506 }
[ "org.moe.natj.c.ann.CVariable" ]
import org.moe.natj.c.ann.CVariable;
import org.moe.natj.c.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
1,250,274
public Properties getEnvironment() { return environment; }
Properties function() { return environment; }
/** * Return the environment for the JNDI InitialContext. */
Return the environment for the JNDI InitialContext
getEnvironment
{ "repo_name": "raedle/univis", "path": "lib/springframework-1.2.8/src/org/springframework/jndi/JndiTemplate.java", "license": "lgpl-2.1", "size": 6657 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,668,397
public com.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse listSessionEntityTypes( com.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest request) { return blockingUnaryCall( getChannel(), getListSessionEntityTypesMethodHelper(), getCallOptions(), request); }
com.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse function( com.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest request) { return blockingUnaryCall( getChannel(), getListSessionEntityTypesMethodHelper(), getCallOptions(), request); }
/** * * * <pre> * Returns the list of all session entity types in the specified session. * </pre> */
<code> Returns the list of all session entity types in the specified session. </code>
listSessionEntityTypes
{ "repo_name": "vam-google/google-cloud-java", "path": "google-api-grpc/grpc-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SessionEntityTypesGrpc.java", "license": "apache-2.0", "size": 39430 }
[ "io.grpc.stub.ClientCalls" ]
import io.grpc.stub.ClientCalls;
import io.grpc.stub.*;
[ "io.grpc.stub" ]
io.grpc.stub;
291,399
private void uninstallBorder(JRootPane root) { LookAndFeel.uninstallBorder(root); }
void function(JRootPane root) { LookAndFeel.uninstallBorder(root); }
/** * Removes any border that may have been installed. */
Removes any border that may have been installed
uninstallBorder
{ "repo_name": "takisd123/executequery", "path": "src/org/underworldlabs/swing/plaf/bumpygradient/BumpyGradientRootPaneUI.java", "license": "gpl-3.0", "size": 36333 }
[ "javax.swing.JRootPane", "javax.swing.LookAndFeel" ]
import javax.swing.JRootPane; import javax.swing.LookAndFeel;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
386,291
UnfilteredPartitionIterator select(DecoratedKey partitionKey, ClusteringIndexFilter clusteringIndexFilter, ColumnFilter columnFilter);
UnfilteredPartitionIterator select(DecoratedKey partitionKey, ClusteringIndexFilter clusteringIndexFilter, ColumnFilter columnFilter);
/** * Selects the rows from a single partition. * * @param partitionKey the partition key * @param clusteringIndexFilter the clustering columns to selected * @param columnFilter the selected columns * @return the rows corresponding to the requested data. */
Selects the rows from a single partition
select
{ "repo_name": "belliottsmith/cassandra", "path": "src/java/org/apache/cassandra/db/virtual/VirtualTable.java", "license": "apache-2.0", "size": 2613 }
[ "org.apache.cassandra.db.DecoratedKey", "org.apache.cassandra.db.filter.ClusteringIndexFilter", "org.apache.cassandra.db.filter.ColumnFilter", "org.apache.cassandra.db.partitions.UnfilteredPartitionIterator" ]
import org.apache.cassandra.db.DecoratedKey; import org.apache.cassandra.db.filter.ClusteringIndexFilter; import org.apache.cassandra.db.filter.ColumnFilter; import org.apache.cassandra.db.partitions.UnfilteredPartitionIterator;
import org.apache.cassandra.db.*; import org.apache.cassandra.db.filter.*; import org.apache.cassandra.db.partitions.*;
[ "org.apache.cassandra" ]
org.apache.cassandra;
1,057,836
public static void setDisconnectNotification(String logOutUrl, MainActivity mActivity, boolean nuovoSistema) { Intent disconnectIntent = new Intent(mActivity, DisconnectActivity.class); disconnectIntent.putExtra(DisconnectActivity.LOGOUT_URL, logOutUrl); disconnectIntent.putExtra(DisconnectActivity.NEWSYSTEM, nuovoSistema); PendingIntent pIntent = PendingIntent.getActivity(mActivity, 0, disconnectIntent, Intent.FLAG_ACTIVITY_NEW_TASK); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mActivity).setSmallIcon(R.drawable.ic_launcher).setContentTitle(mActivity.getString(R.string.disconnect_notification_title)).setContentIntent(pIntent).setAutoCancel(true).setContentText(mActivity.getString(R.string.disconnect_notification_message)).setVibrate(mVibratePattern); NotificationManager mNotifyMgr = (NotificationManager) mActivity.getSystemService(Context.NOTIFICATION_SERVICE); mNotifyMgr.notify(DisconnectActivity.NOTIFICATION_ID, mBuilder.build()); }
static void function(String logOutUrl, MainActivity mActivity, boolean nuovoSistema) { Intent disconnectIntent = new Intent(mActivity, DisconnectActivity.class); disconnectIntent.putExtra(DisconnectActivity.LOGOUT_URL, logOutUrl); disconnectIntent.putExtra(DisconnectActivity.NEWSYSTEM, nuovoSistema); PendingIntent pIntent = PendingIntent.getActivity(mActivity, 0, disconnectIntent, Intent.FLAG_ACTIVITY_NEW_TASK); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mActivity).setSmallIcon(R.drawable.ic_launcher).setContentTitle(mActivity.getString(R.string.disconnect_notification_title)).setContentIntent(pIntent).setAutoCancel(true).setContentText(mActivity.getString(R.string.disconnect_notification_message)).setVibrate(mVibratePattern); NotificationManager mNotifyMgr = (NotificationManager) mActivity.getSystemService(Context.NOTIFICATION_SERVICE); mNotifyMgr.notify(DisconnectActivity.NOTIFICATION_ID, mBuilder.build()); }
/** * Once connected, it sets the Disconnect Notification. This method is used * from both the system. * * @param logOutUrl */
Once connected, it sets the Disconnect Notification. This method is used from both the system
setDisconnectNotification
{ "repo_name": "FedericoPonzi/SapienzaWifi", "path": "src/it/uniroma1/sapienzawifi/util/Utility.java", "license": "gpl-2.0", "size": 5303 }
[ "android.app.NotificationManager", "android.app.PendingIntent", "android.content.Context", "android.content.Intent", "android.support.v4.app.NotificationCompat", "it.uniroma1.sapienzawifi.DisconnectActivity", "it.uniroma1.sapienzawifi.MainActivity" ]
import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.support.v4.app.NotificationCompat; import it.uniroma1.sapienzawifi.DisconnectActivity; import it.uniroma1.sapienzawifi.MainActivity;
import android.app.*; import android.content.*; import android.support.v4.app.*; import it.uniroma1.sapienzawifi.*;
[ "android.app", "android.content", "android.support", "it.uniroma1.sapienzawifi" ]
android.app; android.content; android.support; it.uniroma1.sapienzawifi;
1,130,034
public NetworkInterfaceTapConfigurationsClient getNetworkInterfaceTapConfigurations() { return this.networkInterfaceTapConfigurations; } private final NetworkProfilesClient networkProfiles;
NetworkInterfaceTapConfigurationsClient function() { return this.networkInterfaceTapConfigurations; } private final NetworkProfilesClient networkProfiles;
/** * Gets the NetworkInterfaceTapConfigurationsClient object to access its operations. * * @return the NetworkInterfaceTapConfigurationsClient object. */
Gets the NetworkInterfaceTapConfigurationsClient object to access its operations
getNetworkInterfaceTapConfigurations
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkManagementClientImpl.java", "license": "mit", "size": 182764 }
[ "com.azure.resourcemanager.network.fluent.NetworkInterfaceTapConfigurationsClient", "com.azure.resourcemanager.network.fluent.NetworkProfilesClient" ]
import com.azure.resourcemanager.network.fluent.NetworkInterfaceTapConfigurationsClient; import com.azure.resourcemanager.network.fluent.NetworkProfilesClient;
import com.azure.resourcemanager.network.fluent.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
1,355,240
@Parameters({"redirectUris"}) @Test public void applicationTypeWeb(final String redirectUris) throws Exception { showTitle("applicationTypeWeb"); // 1. Register client RegisterClient registerClient = new RegisterClient(registrationEndpoint); RegisterResponse registerResponse = registerClient.execRegister(ApplicationType.WEB, "oxAuth test app", StringUtils.spaceSeparatedToList(redirectUris)); showClient(registerClient); assertEquals(registerResponse.getStatus(), 200, "Unexpected response code: " + registerResponse.getEntity()); assertNotNull(registerResponse.getClientId()); assertNotNull(registerResponse.getClientSecret()); assertNotNull(registerResponse.getRegistrationAccessToken()); assertNotNull(registerResponse.getClientIdIssuedAt()); assertNotNull(registerResponse.getClientSecretExpiresAt()); String registrationAccessToken = registerResponse.getRegistrationAccessToken(); String registrationClientUri = registerResponse.getRegistrationClientUri(); // 2. Client read RegisterRequest readClientRequest = new RegisterRequest(registrationAccessToken); RegisterClient readClient = new RegisterClient(registrationClientUri); readClient.setRequest(readClientRequest); RegisterResponse readClientResponse = readClient.exec(); showClient(readClient); assertEquals(readClientResponse.getStatus(), 200, "Unexpected response code: " + readClientResponse.getEntity()); assertNotNull(readClientResponse.getClientId()); assertNotNull(readClientResponse.getClientSecret()); assertNotNull(readClientResponse.getClientIdIssuedAt()); assertNotNull(readClientResponse.getClientSecretExpiresAt()); assertNotNull(readClientResponse.getClaims().get(APPLICATION_TYPE.toString())); assertEquals(readClientResponse.getClaims().get(APPLICATION_TYPE.toString()), ApplicationType.WEB.toString()); assertNotNull(readClientResponse.getClaims().get(RESPONSE_TYPES.toString())); assertNotNull(readClientResponse.getClaims().get(REDIRECT_URIS.toString())); assertNotNull(readClientResponse.getClaims().get(APPLICATION_TYPE.toString())); assertNotNull(readClientResponse.getClaims().get(CLIENT_NAME.toString())); assertNotNull(readClientResponse.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString())); assertNotNull(readClientResponse.getClaims().get("scopes")); }
@Parameters({STR}) void function(final String redirectUris) throws Exception { showTitle(STR); RegisterClient registerClient = new RegisterClient(registrationEndpoint); RegisterResponse registerResponse = registerClient.execRegister(ApplicationType.WEB, STR, StringUtils.spaceSeparatedToList(redirectUris)); showClient(registerClient); assertEquals(registerResponse.getStatus(), 200, STR + registerResponse.getEntity()); assertNotNull(registerResponse.getClientId()); assertNotNull(registerResponse.getClientSecret()); assertNotNull(registerResponse.getRegistrationAccessToken()); assertNotNull(registerResponse.getClientIdIssuedAt()); assertNotNull(registerResponse.getClientSecretExpiresAt()); String registrationAccessToken = registerResponse.getRegistrationAccessToken(); String registrationClientUri = registerResponse.getRegistrationClientUri(); RegisterRequest readClientRequest = new RegisterRequest(registrationAccessToken); RegisterClient readClient = new RegisterClient(registrationClientUri); readClient.setRequest(readClientRequest); RegisterResponse readClientResponse = readClient.exec(); showClient(readClient); assertEquals(readClientResponse.getStatus(), 200, STR + readClientResponse.getEntity()); assertNotNull(readClientResponse.getClientId()); assertNotNull(readClientResponse.getClientSecret()); assertNotNull(readClientResponse.getClientIdIssuedAt()); assertNotNull(readClientResponse.getClientSecretExpiresAt()); assertNotNull(readClientResponse.getClaims().get(APPLICATION_TYPE.toString())); assertEquals(readClientResponse.getClaims().get(APPLICATION_TYPE.toString()), ApplicationType.WEB.toString()); assertNotNull(readClientResponse.getClaims().get(RESPONSE_TYPES.toString())); assertNotNull(readClientResponse.getClaims().get(REDIRECT_URIS.toString())); assertNotNull(readClientResponse.getClaims().get(APPLICATION_TYPE.toString())); assertNotNull(readClientResponse.getClaims().get(CLIENT_NAME.toString())); assertNotNull(readClientResponse.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString())); assertNotNull(readClientResponse.getClaims().get(STR)); }
/** * Register a client with Application Type <code>web</code>. * Read client to check whether it is using the Application Type <code>web</code>. */
Register a client with Application Type <code>web</code>. Read client to check whether it is using the Application Type <code>web</code>
applicationTypeWeb
{ "repo_name": "diedertimmers/oxAuth", "path": "Client/src/test/java/org/xdi/oxauth/ws/rs/ApplicationTypeRestrictionHttpTest.java", "license": "mit", "size": 13231 }
[ "org.testng.Assert", "org.testng.annotations.Parameters", "org.xdi.oxauth.client.RegisterClient", "org.xdi.oxauth.client.RegisterRequest", "org.xdi.oxauth.client.RegisterResponse", "org.xdi.oxauth.model.register.ApplicationType", "org.xdi.oxauth.model.util.StringUtils" ]
import org.testng.Assert; import org.testng.annotations.Parameters; import org.xdi.oxauth.client.RegisterClient; import org.xdi.oxauth.client.RegisterRequest; import org.xdi.oxauth.client.RegisterResponse; import org.xdi.oxauth.model.register.ApplicationType; import org.xdi.oxauth.model.util.StringUtils;
import org.testng.*; import org.testng.annotations.*; import org.xdi.oxauth.client.*; import org.xdi.oxauth.model.register.*; import org.xdi.oxauth.model.util.*;
[ "org.testng", "org.testng.annotations", "org.xdi.oxauth" ]
org.testng; org.testng.annotations; org.xdi.oxauth;
1,555,481
@Test() public void testObjectClassNameStartsWithHyphen() throws Exception { final Entry schemaEntry = minimalSchemaEntry.duplicate(); schemaEntry.addAttribute(Schema.ATTR_OBJECT_CLASS, "( 1.2.3.4 NAME '-test-oc' SUP top MAY cn )"); final File schemaFile = createTempFile(schemaEntry.toLDIF()); SchemaValidator schemaValidator = new SchemaValidator(); assertFalse(schemaValidator.allowNamesWithInitialHyphen()); final List<String> errorMessages = new ArrayList<>(5); Schema schema = schemaValidator.validateSchema(schemaFile, null, errorMessages); assertNotNull(schema); assertNotNull(schema.getAttributeType("dc")); assertNotNull(schema.getObjectClass("1.2.3.4")); assertNotNull(schema.getObjectClass("-test-oc")); assertFalse(errorMessages.isEmpty()); schemaValidator = new SchemaValidator(); schemaValidator.setAllowNamesWithInitialHyphen(true); assertTrue(schemaValidator.allowNamesWithInitialHyphen()); errorMessages.clear(); schema = schemaValidator.validateSchema(schemaFile, null, errorMessages); assertNotNull(schema); assertNotNull(schema.getAttributeType("dc")); assertNotNull(schema.getObjectClass("1.2.3.4")); assertNotNull(schema.getObjectClass("-test-oc")); assertTrue(errorMessages.isEmpty(), StaticUtils.linesToString(errorMessages)); }
@Test() void function() throws Exception { final Entry schemaEntry = minimalSchemaEntry.duplicate(); schemaEntry.addAttribute(Schema.ATTR_OBJECT_CLASS, STR); final File schemaFile = createTempFile(schemaEntry.toLDIF()); SchemaValidator schemaValidator = new SchemaValidator(); assertFalse(schemaValidator.allowNamesWithInitialHyphen()); final List<String> errorMessages = new ArrayList<>(5); Schema schema = schemaValidator.validateSchema(schemaFile, null, errorMessages); assertNotNull(schema); assertNotNull(schema.getAttributeType("dc")); assertNotNull(schema.getObjectClass(STR)); assertNotNull(schema.getObjectClass(STR)); assertFalse(errorMessages.isEmpty()); schemaValidator = new SchemaValidator(); schemaValidator.setAllowNamesWithInitialHyphen(true); assertTrue(schemaValidator.allowNamesWithInitialHyphen()); errorMessages.clear(); schema = schemaValidator.validateSchema(schemaFile, null, errorMessages); assertNotNull(schema); assertNotNull(schema.getAttributeType("dc")); assertNotNull(schema.getObjectClass(STR)); assertNotNull(schema.getObjectClass(STR)); assertTrue(errorMessages.isEmpty(), StaticUtils.linesToString(errorMessages)); }
/** * Tests the behavior for a schema entry that has an object class with a * name that starts with a hyphen. * * @throws Exception If an unexpected problem occurs. */
Tests the behavior for a schema entry that has an object class with a name that starts with a hyphen
testObjectClassNameStartsWithHyphen
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/schema/SchemaValidatorTestCase.java", "license": "gpl-2.0", "size": 262381 }
[ "com.unboundid.ldap.sdk.Entry", "com.unboundid.util.StaticUtils", "java.io.File", "java.util.ArrayList", "java.util.List", "org.testng.annotations.Test" ]
import com.unboundid.ldap.sdk.Entry; import com.unboundid.util.StaticUtils; import java.io.File; import java.util.ArrayList; import java.util.List; import org.testng.annotations.Test;
import com.unboundid.ldap.sdk.*; import com.unboundid.util.*; import java.io.*; import java.util.*; import org.testng.annotations.*;
[ "com.unboundid.ldap", "com.unboundid.util", "java.io", "java.util", "org.testng.annotations" ]
com.unboundid.ldap; com.unboundid.util; java.io; java.util; org.testng.annotations;
932,311
public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { ((ComponentUI) (uis.elementAt(i))).paint(a,b); } }
void function(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { ((ComponentUI) (uis.elementAt(i))).paint(a,b); } }
/** * Invokes the <code>paint</code> method on each UI handled by this object. */
Invokes the <code>paint</code> method on each UI handled by this object
paint
{ "repo_name": "isaacl/openjdk-jdk", "path": "src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java", "license": "gpl-2.0", "size": 7571 }
[ "java.awt.Graphics", "javax.swing.JComponent", "javax.swing.plaf.ComponentUI" ]
import java.awt.Graphics; import javax.swing.JComponent; import javax.swing.plaf.ComponentUI;
import java.awt.*; import javax.swing.*; import javax.swing.plaf.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,043,091
public List<ServerLocation> getRedundants() { List<ServerLocation> result = Collections.emptyList(); if (queueManager != null) { QueueManager.QueueConnections cons = queueManager.getAllConnections(); List<Connection> backupCons = cons.getBackups(); if (backupCons.size() > 0) { result = new ArrayList<>(backupCons.size()); for (Connection con : backupCons) { result.add(con.getServer()); } } } return result; }
List<ServerLocation> function() { List<ServerLocation> result = Collections.emptyList(); if (queueManager != null) { QueueManager.QueueConnections cons = queueManager.getAllConnections(); List<Connection> backupCons = cons.getBackups(); if (backupCons.size() > 0) { result = new ArrayList<>(backupCons.size()); for (Connection con : backupCons) { result.add(con.getServer()); } } } return result; }
/** * Test hook that returns a list of ServerLocation instances. Each ServerLocation describes a * redundant server. An empty list is returned if we have no redundant servers. */
Test hook that returns a list of ServerLocation instances. Each ServerLocation describes a redundant server. An empty list is returned if we have no redundant servers
getRedundants
{ "repo_name": "jdeppe-pivotal/geode", "path": "geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java", "license": "apache-2.0", "size": 54649 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List", "org.apache.geode.distributed.internal.ServerLocation" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.geode.distributed.internal.ServerLocation;
import java.util.*; import org.apache.geode.distributed.internal.*;
[ "java.util", "org.apache.geode" ]
java.util; org.apache.geode;
2,302,776
public Collection getValues(String fqn);
Collection function(String fqn);
/** * Gets all values from some given FQN. * * @param fqn String * @return Collection */
Gets all values from some given FQN
getValues
{ "repo_name": "Nwanda/jforum", "path": "src/net/jforum/cache/CacheEngine.java", "license": "bsd-3-clause", "size": 3553 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,626,428
super.startParsing( atts ); final String fieldName = atts.getValue( getUri(), "fieldname" ); if ( fieldName == null ) { throw new ParseException( "Required attribute 'fieldname' is missing.", getLocator() ); } elementFactory.setFieldname( fieldName ); }
super.startParsing( atts ); final String fieldName = atts.getValue( getUri(), STR ); if ( fieldName == null ) { throw new ParseException( STR, getLocator() ); } elementFactory.setFieldname( fieldName ); }
/** * Starts parsing. * * @param atts * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */
Starts parsing
startParsing
{ "repo_name": "EgorZhuk/pentaho-reporting", "path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/modules/parser/simple/readhandlers/ShapeFieldReadHandler.java", "license": "lgpl-2.1", "size": 2175 }
[ "org.pentaho.reporting.libraries.xmlns.parser.ParseException" ]
import org.pentaho.reporting.libraries.xmlns.parser.ParseException;
import org.pentaho.reporting.libraries.xmlns.parser.*;
[ "org.pentaho.reporting" ]
org.pentaho.reporting;
666,190
return getCorporationsForeignTradeCredits(null, null); } /** * <p>Fetch all corporations Foreign Trade Credits data which match the input * constraints.</p> * * @param items * the items * @param quarters * the quarters * @return the data wrapped in a list of * {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
return getCorporationsForeignTradeCredits(null, null); } /** * <p>Fetch all corporations Foreign Trade Credits data which match the input * constraints.</p> * * @param items * the items * @param quarters * the quarters * @return the data wrapped in a list of * {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
/** * <p>Fetch all corporations Foreign Trade Credits data.</p> * * @return the data wrapped in a list of * {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel} * objects * * @see #getCorporationsForeignTradeCredits(Collection, Collection) */
Fetch all corporations Foreign Trade Credits data
getCorporationsForeignTradeCredits
{ "repo_name": "dannil/scb-java-client", "path": "src/main/java/com/github/dannil/scbjavaclient/client/businessactivities/nonfinancialcorporations/BusinessActivitiesNonFinancialCorporationsClient.java", "license": "apache-2.0", "size": 2986 }
[ "com.github.dannil.scbjavaclient.model.ResponseModel" ]
import com.github.dannil.scbjavaclient.model.ResponseModel;
import com.github.dannil.scbjavaclient.model.*;
[ "com.github.dannil" ]
com.github.dannil;
584,316
Set<RevocationToken> getProcessedRevocations();
Set<RevocationToken> getProcessedRevocations();
/** * Returns a read only list of all revocations used in the process of the validation of all signatures from the * given document. * * @return The list of RevocationToken(s) */
Returns a read only list of all revocations used in the process of the validation of all signatures from the given document
getProcessedRevocations
{ "repo_name": "esig/dss", "path": "dss-document/src/main/java/eu/europa/esig/dss/validation/ValidationContext.java", "license": "lgpl-2.1", "size": 9743 }
[ "eu.europa.esig.dss.spi.x509.revocation.RevocationToken", "java.util.Set" ]
import eu.europa.esig.dss.spi.x509.revocation.RevocationToken; import java.util.Set;
import eu.europa.esig.dss.spi.x509.revocation.*; import java.util.*;
[ "eu.europa.esig", "java.util" ]
eu.europa.esig; java.util;
1,249,873
public void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> serviceCallConfigurations) { this.serviceCallConfigurations = serviceCallConfigurations; }
void function(List<ServiceCallConfigurationDefinition> serviceCallConfigurations) { this.serviceCallConfigurations = serviceCallConfigurations; }
/** * ServiceCall EIP configurations */
ServiceCall EIP configurations
setServiceCallConfigurations
{ "repo_name": "mcollovati/camel", "path": "components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java", "license": "apache-2.0", "size": 50811 }
[ "java.util.List", "org.apache.camel.model.cloud.ServiceCallConfigurationDefinition" ]
import java.util.List; import org.apache.camel.model.cloud.ServiceCallConfigurationDefinition;
import java.util.*; import org.apache.camel.model.cloud.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
549,726
@Override public AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState) { AxisState state; // if the axis is not visible, don't draw it... if (!isVisible()) { state = new AxisState(cursor); // even though the axis is not visible, we need ticks for the // gridlines... List ticks = refreshTicks(g2, state, dataArea, edge); state.setTicks(ticks); return state; } // draw the tick marks and labels... state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); if (getAttributedLabel() != null) { state = drawAttributedLabel(getAttributedLabel(), g2, plotArea, dataArea, edge, state); } else { state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); } createAndAddEntity(cursor, state, dataArea, edge, plotState); return state; }
AxisState function(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState) { AxisState state; if (!isVisible()) { state = new AxisState(cursor); List ticks = refreshTicks(g2, state, dataArea, edge); state.setTicks(ticks); return state; } state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); if (getAttributedLabel() != null) { state = drawAttributedLabel(getAttributedLabel(), g2, plotArea, dataArea, edge, state); } else { state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); } createAndAddEntity(cursor, state, dataArea, edge, plotState); return state; }
/** * Draws the axis on a Java 2D graphics device (such as the screen or a * printer). * * @param g2 the graphics device (<code>null</code> not permitted). * @param cursor the cursor location. * @param plotArea the area within which the axes and data should be drawn * (<code>null</code> not permitted). * @param dataArea the area within which the data should be drawn * (<code>null</code> not permitted). * @param edge the location of the axis (<code>null</code> not permitted). * @param plotState collects information about the plot * (<code>null</code> permitted). * * @return The axis state (never <code>null</code>). */
Draws the axis on a Java 2D graphics device (such as the screen or a printer)
draw
{ "repo_name": "hongliangpan/manydesigns.cn", "path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/axis/NumberAxis.java", "license": "lgpl-3.0", "size": 55177 }
[ "java.awt.Graphics2D", "java.awt.geom.Rectangle2D", "java.util.List", "org.jfree.chart.plot.PlotRenderingInfo", "org.jfree.ui.RectangleEdge" ]
import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.util.List; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.ui.RectangleEdge;
import java.awt.*; import java.awt.geom.*; import java.util.*; import org.jfree.chart.plot.*; import org.jfree.ui.*;
[ "java.awt", "java.util", "org.jfree.chart", "org.jfree.ui" ]
java.awt; java.util; org.jfree.chart; org.jfree.ui;
2,876,462
public SeqWareSettings getSettings() { return settings; }
SeqWareSettings function() { return settings; }
/** * <p>Getter for the field <code>settings</code>.</p> * * @return a {@link net.sourceforge.seqware.queryengine.backend.util.SeqWareSettings} object. */
Getter for the field <code>settings</code>
getSettings
{ "repo_name": "SeqWare/queryengine", "path": "seqware-queryengine-legacy/src/main/java/net/sourceforge/seqware/queryengine/backend/store/Store.java", "license": "gpl-3.0", "size": 6343 }
[ "net.sourceforge.seqware.queryengine.backend.util.SeqWareSettings" ]
import net.sourceforge.seqware.queryengine.backend.util.SeqWareSettings;
import net.sourceforge.seqware.queryengine.backend.util.*;
[ "net.sourceforge.seqware" ]
net.sourceforge.seqware;
2,555,223
OperationResponse beginDeleting(ServiceCertificateDeleteParameters parameters) throws IOException, ServiceException;
OperationResponse beginDeleting(ServiceCertificateDeleteParameters parameters) throws IOException, ServiceException;
/** * The Begin Deleting Service Certificate operation deletes a service * certificate from the certificate store of a hosted service. This * operation is an asynchronous operation. To determine whether the * management service has finished processing the request, call Get * Operation Status. (see * http://msdn.microsoft.com/en-us/library/windowsazure/ee460803.aspx for * more information) * * @param parameters Required. Parameters supplied to the Begin Deleting * Service Certificate operation. * @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 A standard service response including an HTTP status code and * request ID. */
The Begin Deleting Service Certificate operation deletes a service certificate from the certificate store of a hosted service. This operation is an asynchronous operation. To determine whether the management service has finished processing the request, call Get Operation Status. (see HREF for more information)
beginDeleting
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperations.java", "license": "apache-2.0", "size": 16857 }
[ "com.microsoft.windowsazure.core.OperationResponse", "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.management.compute.models.ServiceCertificateDeleteParameters", "java.io.IOException" ]
import com.microsoft.windowsazure.core.OperationResponse; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.compute.models.ServiceCertificateDeleteParameters; import java.io.IOException;
import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.compute.models.*; import java.io.*;
[ "com.microsoft.windowsazure", "java.io" ]
com.microsoft.windowsazure; java.io;
2,323,663
public int getsourceID() { return Dispatch.get(this, "sourceID").toInt(); }
int function() { return Dispatch.get(this, STR).toInt(); }
/** * Wrapper for calling the ActiveX-Method with input-parameter(s). * * @return the result is of type int */
Wrapper for calling the ActiveX-Method with input-parameter(s)
getsourceID
{ "repo_name": "cpesch/MetaMusic", "path": "itunes-com-library/src/main/java/slash/metamusic/itunes/com/binding/IITFileOrCDTrack.java", "license": "gpl-2.0", "size": 32709 }
[ "com.jacob.com.Dispatch" ]
import com.jacob.com.Dispatch;
import com.jacob.com.*;
[ "com.jacob.com" ]
com.jacob.com;
1,587,903
private AbstractSet processTerminal(AbstractSet last) { int ch; AbstractSet term = null; do { ch = lexemes.peek(); if ((ch & 0x8000ffff) == Lexer.CHAR_LEFT_PARENTHESIS) { int newFlags; lexemes.next(); newFlags = (ch & 0x00ff0000) >> 16; ch = ch & 0xff00ffff; if (ch == Lexer.CHAR_FLAGS) { flags = newFlags; } else { newFlags = (ch == Lexer.CHAR_NONCAP_GROUP) ? newFlags : flags; term = processExpression(ch, newFlags, last); if (lexemes.peek() != Lexer.CHAR_RIGHT_PARENTHESIS) { throw new PatternSyntaxException( Messages.getString("regex.0A"), lexemes.toString(), //$NON-NLS-1$ lexemes.getIndex()); } lexemes.next(); } } else switch (ch) { case Lexer.CHAR_LEFT_SQUARE_BRACKET: { lexemes.next(); boolean negative = false; if (lexemes.peek() == Lexer.CHAR_CARET) { negative = true; lexemes.next(); } term = processRange(negative, last); if (lexemes.peek() != Lexer.CHAR_RIGHT_SQUARE_BRACKET) throw new PatternSyntaxException( Messages.getString("regex.0B"), lexemes.toString(), //$NON-NLS-1$ lexemes.getIndex()); lexemes.setMode(Lexer.MODE_PATTERN); lexemes.next(); break; } case Lexer.CHAR_DOT: { lexemes.next(); if (!hasFlag(Pattern.DOTALL)) { term = new DotSet(AbstractLineTerminator .getInstance(flags)); } else { term = new DotAllSet(); } break; } case Lexer.CHAR_CARET: { lexemes.next(); consCount++; if (!hasFlag(Pattern.MULTILINE)) { term = new SOLSet(); } else { term = new MultiLineSOLSet(AbstractLineTerminator .getInstance(flags)); } break; } case Lexer.CHAR_DOLLAR: { lexemes.next(); consCount++; if (!hasFlag(Pattern.MULTILINE)) { if (!hasFlag(Pattern.UNIX_LINES)) { term = new EOLSet(consCount); } else { term = new UEOLSet(consCount); } } else { if (!hasFlag(Pattern.UNIX_LINES)) { term = new MultiLineEOLSet(consCount); } else { term = new UMultiLineEOLSet(consCount); } } break; } case Lexer.CHAR_WORD_BOUND: { lexemes.next(); term = new WordBoundary(true); break; } case Lexer.CHAR_NONWORD_BOUND: { lexemes.next(); term = new WordBoundary(false); break; } case Lexer.CHAR_END_OF_INPUT: { lexemes.next(); term = new EOISet(); break; } case Lexer.CHAR_END_OF_LINE: { lexemes.next(); term = new EOLSet(++consCount); break; } case Lexer.CHAR_START_OF_INPUT: { lexemes.next(); term = new SOLSet(); break; } case Lexer.CHAR_PREVIOUS_MATCH: { lexemes.next(); term = new PreviousMatch(); break; } case 0x80000000 | '1': case 0x80000000 | '2': case 0x80000000 | '3': case 0x80000000 | '4': case 0x80000000 | '5': case 0x80000000 | '6': case 0x80000000 | '7': case 0x80000000 | '8': case 0x80000000 | '9': { int number = (ch & 0x7FFFFFFF) - '0'; if (globalGroupIndex >= number) { lexemes.next(); consCount++; if (!hasFlag(Pattern.CASE_INSENSITIVE)) { term = new BackReferenceSet(number, consCount); } else if (!hasFlag(Pattern.UNICODE_CASE)) { term = new CIBackReferenceSet(number, consCount); } else { term = new UCIBackReferenceSet(number, consCount); } (backRefs [number]).isBackReferenced = true; needsBackRefReplacement = true; break; } else { throw new PatternSyntaxException( Messages.getString("regex.0C") //$NON-NLS-1$ , lexemes.toString(), lexemes.getIndex()); } } case 0: { AbstractCharClass cc = null; if ((cc = (AbstractCharClass) lexemes.peekSpecial()) != null) { term = processRangeSet(cc); } else if (!lexemes.isEmpty()) { //ch == 0 term = new CharSet((char) ch); } else { term = new EmptySet(last); break; } lexemes.next(); break; } default: { if (ch >= 0 && !lexemes.isSpecial()) { term = processCharSet(ch); lexemes.next(); } else if (ch == Lexer.CHAR_VERTICAL_BAR) { term = new EmptySet(last); } else if (ch == Lexer.CHAR_RIGHT_PARENTHESIS) { if (last instanceof FinalSet) { throw new PatternSyntaxException( Messages.getString("regex.09"), lexemes.toString(), //$NON-NLS-1$ lexemes.getIndex()); } else { term = new EmptySet(last); } } else { throw new PatternSyntaxException( Messages.getString("regex.0D", //$NON-NLS-1$ (lexemes.isSpecial() ? lexemes.peekSpecial() .toString() : Character .toString((char) ch))), lexemes .toString(), lexemes.getIndex()); } } } } while (ch == Lexer.CHAR_FLAGS); return term; }
AbstractSet function(AbstractSet last) { int ch; AbstractSet term = null; do { ch = lexemes.peek(); if ((ch & 0x8000ffff) == Lexer.CHAR_LEFT_PARENTHESIS) { int newFlags; lexemes.next(); newFlags = (ch & 0x00ff0000) >> 16; ch = ch & 0xff00ffff; if (ch == Lexer.CHAR_FLAGS) { flags = newFlags; } else { newFlags = (ch == Lexer.CHAR_NONCAP_GROUP) ? newFlags : flags; term = processExpression(ch, newFlags, last); if (lexemes.peek() != Lexer.CHAR_RIGHT_PARENTHESIS) { throw new PatternSyntaxException( Messages.getString(STR), lexemes.toString(), lexemes.getIndex()); } lexemes.next(); } } else switch (ch) { case Lexer.CHAR_LEFT_SQUARE_BRACKET: { lexemes.next(); boolean negative = false; if (lexemes.peek() == Lexer.CHAR_CARET) { negative = true; lexemes.next(); } term = processRange(negative, last); if (lexemes.peek() != Lexer.CHAR_RIGHT_SQUARE_BRACKET) throw new PatternSyntaxException( Messages.getString(STR), lexemes.toString(), lexemes.getIndex()); lexemes.setMode(Lexer.MODE_PATTERN); lexemes.next(); break; } case Lexer.CHAR_DOT: { lexemes.next(); if (!hasFlag(Pattern.DOTALL)) { term = new DotSet(AbstractLineTerminator .getInstance(flags)); } else { term = new DotAllSet(); } break; } case Lexer.CHAR_CARET: { lexemes.next(); consCount++; if (!hasFlag(Pattern.MULTILINE)) { term = new SOLSet(); } else { term = new MultiLineSOLSet(AbstractLineTerminator .getInstance(flags)); } break; } case Lexer.CHAR_DOLLAR: { lexemes.next(); consCount++; if (!hasFlag(Pattern.MULTILINE)) { if (!hasFlag(Pattern.UNIX_LINES)) { term = new EOLSet(consCount); } else { term = new UEOLSet(consCount); } } else { if (!hasFlag(Pattern.UNIX_LINES)) { term = new MultiLineEOLSet(consCount); } else { term = new UMultiLineEOLSet(consCount); } } break; } case Lexer.CHAR_WORD_BOUND: { lexemes.next(); term = new WordBoundary(true); break; } case Lexer.CHAR_NONWORD_BOUND: { lexemes.next(); term = new WordBoundary(false); break; } case Lexer.CHAR_END_OF_INPUT: { lexemes.next(); term = new EOISet(); break; } case Lexer.CHAR_END_OF_LINE: { lexemes.next(); term = new EOLSet(++consCount); break; } case Lexer.CHAR_START_OF_INPUT: { lexemes.next(); term = new SOLSet(); break; } case Lexer.CHAR_PREVIOUS_MATCH: { lexemes.next(); term = new PreviousMatch(); break; } case 0x80000000 '1': case 0x80000000 '2': case 0x80000000 '3': case 0x80000000 '4': case 0x80000000 '5': case 0x80000000 '6': case 0x80000000 '7': case 0x80000000 '8': case 0x80000000 '9': { int number = (ch & 0x7FFFFFFF) - '0'; if (globalGroupIndex >= number) { lexemes.next(); consCount++; if (!hasFlag(Pattern.CASE_INSENSITIVE)) { term = new BackReferenceSet(number, consCount); } else if (!hasFlag(Pattern.UNICODE_CASE)) { term = new CIBackReferenceSet(number, consCount); } else { term = new UCIBackReferenceSet(number, consCount); } (backRefs [number]).isBackReferenced = true; needsBackRefReplacement = true; break; } else { throw new PatternSyntaxException( Messages.getString(STR) , lexemes.toString(), lexemes.getIndex()); } } case 0: { AbstractCharClass cc = null; if ((cc = (AbstractCharClass) lexemes.peekSpecial()) != null) { term = processRangeSet(cc); } else if (!lexemes.isEmpty()) { term = new CharSet((char) ch); } else { term = new EmptySet(last); break; } lexemes.next(); break; } default: { if (ch >= 0 && !lexemes.isSpecial()) { term = processCharSet(ch); lexemes.next(); } else if (ch == Lexer.CHAR_VERTICAL_BAR) { term = new EmptySet(last); } else if (ch == Lexer.CHAR_RIGHT_PARENTHESIS) { if (last instanceof FinalSet) { throw new PatternSyntaxException( Messages.getString(STR), lexemes.toString(), lexemes.getIndex()); } else { term = new EmptySet(last); } } else { throw new PatternSyntaxException( Messages.getString(STR, (lexemes.isSpecial() ? lexemes.peekSpecial() .toString() : Character .toString((char) ch))), lexemes .toString(), lexemes.getIndex()); } } } } while (ch == Lexer.CHAR_FLAGS); return term; }
/** * T-> letter|[range]|{char-class}|(E) */
T-> letter|[range]|{char-class}|(E)
processTerminal
{ "repo_name": "freeVM/freeVM", "path": "enhanced/archive/classlib/java6/modules/regex/src/main/java/java/util/regex/Pattern.java", "license": "apache-2.0", "size": 47684 }
[ "org.apache.harmony.regex.internal.nls.Messages" ]
import org.apache.harmony.regex.internal.nls.Messages;
import org.apache.harmony.regex.internal.nls.*;
[ "org.apache.harmony" ]
org.apache.harmony;
2,423,559
public boolean hasbiboDateargued( org.ontoware.rdf2go.model.node.Node value ) { return Base.hasValue(this.model, this.getResource(), DATEARGUED); }
boolean function( org.ontoware.rdf2go.model.node.Node value ) { return Base.hasValue(this.model, this.getResource(), DATEARGUED); }
/** * Check if org.ontoware.rdfreactor.generator.java.JProperty@14f4038 has the given value (maybe among other values). * @param value the value to be checked * @return true if this property contains (maybe among other) the given value * * [Generated from RDFReactor template rule #get0has-value-dynamic] */
Check if org.ontoware.rdfreactor.generator.java.JProperty@14f4038 has the given value (maybe among other values)
hasbiboDateargued
{ "repo_name": "oeg-upm/biotea", "path": "src/ws/biotea/ld2rdf/rdf/model/bibo/LegalDocument.java", "license": "apache-2.0", "size": 31487 }
[ "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdfreactor" ]
org.ontoware.rdfreactor;
2,812,190
public static DataMapStatusDetail[] getEnabledDataMapStatusDetails() throws IOException { DataMapStatusDetail[] dataMapStatusDetails = storageProvider.getDataMapStatusDetails(); List<DataMapStatusDetail> statusDetailList = new ArrayList<>(); for (DataMapStatusDetail statusDetail : dataMapStatusDetails) { if (statusDetail.getStatus() == DataMapStatus.ENABLED) { statusDetailList.add(statusDetail); } } return statusDetailList.toArray(new DataMapStatusDetail[statusDetailList.size()]); }
static DataMapStatusDetail[] function() throws IOException { DataMapStatusDetail[] dataMapStatusDetails = storageProvider.getDataMapStatusDetails(); List<DataMapStatusDetail> statusDetailList = new ArrayList<>(); for (DataMapStatusDetail statusDetail : dataMapStatusDetails) { if (statusDetail.getStatus() == DataMapStatus.ENABLED) { statusDetailList.add(statusDetail); } } return statusDetailList.toArray(new DataMapStatusDetail[statusDetailList.size()]); }
/** * Get enabled datamap status details * @return * @throws IOException */
Get enabled datamap status details
getEnabledDataMapStatusDetails
{ "repo_name": "jackylk/incubator-carbondata", "path": "core/src/main/java/org/apache/carbondata/core/datamap/status/DataMapStatusManager.java", "license": "apache-2.0", "size": 8674 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
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;
195,673
@WorkerThread public @NonNull GroupCandidate recipientIdToCandidate(@NonNull RecipientId recipientId) throws IOException { final Recipient recipient = Recipient.resolved(recipientId); ACI aci = recipient.getAci().orNull(); if (aci == null) { throw new AssertionError("Non UUID members should have need detected by now"); } Optional<ProfileKeyCredential> profileKeyCredential = Optional.fromNullable(recipient.getProfileKeyCredential()); GroupCandidate candidate = new GroupCandidate(aci.uuid(), profileKeyCredential); if (!candidate.hasProfileKeyCredential()) { ProfileKey profileKey = ProfileKeyUtil.profileKeyOrNull(recipient.getProfileKey()); if (profileKey != null) { Log.i(TAG, String.format("No profile key credential on recipient %s, fetching", recipient.getId())); Optional<ProfileKeyCredential> profileKeyCredentialOptional = signalServiceAccountManager.resolveProfileKeyCredential(aci, profileKey, Locale.getDefault()); if (profileKeyCredentialOptional.isPresent()) { boolean updatedProfileKey = recipientDatabase.setProfileKeyCredential(recipient.getId(), profileKey, profileKeyCredentialOptional.get()); if (!updatedProfileKey) { Log.w(TAG, String.format("Failed to update the profile key credential on recipient %s", recipient.getId())); } else { Log.i(TAG, String.format("Got new profile key credential for recipient %s", recipient.getId())); candidate = candidate.withProfileKeyCredential(profileKeyCredentialOptional.get()); } } } } return candidate; }
@NonNull GroupCandidate function(@NonNull RecipientId recipientId) throws IOException { final Recipient recipient = Recipient.resolved(recipientId); ACI aci = recipient.getAci().orNull(); if (aci == null) { throw new AssertionError(STR); } Optional<ProfileKeyCredential> profileKeyCredential = Optional.fromNullable(recipient.getProfileKeyCredential()); GroupCandidate candidate = new GroupCandidate(aci.uuid(), profileKeyCredential); if (!candidate.hasProfileKeyCredential()) { ProfileKey profileKey = ProfileKeyUtil.profileKeyOrNull(recipient.getProfileKey()); if (profileKey != null) { Log.i(TAG, String.format(STR, recipient.getId())); Optional<ProfileKeyCredential> profileKeyCredentialOptional = signalServiceAccountManager.resolveProfileKeyCredential(aci, profileKey, Locale.getDefault()); if (profileKeyCredentialOptional.isPresent()) { boolean updatedProfileKey = recipientDatabase.setProfileKeyCredential(recipient.getId(), profileKey, profileKeyCredentialOptional.get()); if (!updatedProfileKey) { Log.w(TAG, String.format(STR, recipient.getId())); } else { Log.i(TAG, String.format(STR, recipient.getId())); candidate = candidate.withProfileKeyCredential(profileKeyCredentialOptional.get()); } } } } return candidate; }
/** * Given a recipient will create a {@link GroupCandidate} which may or may not have a profile key credential. * <p> * It will try to find missing profile key credentials from the server and persist locally. */
Given a recipient will create a <code>GroupCandidate</code> which may or may not have a profile key credential. It will try to find missing profile key credentials from the server and persist locally
recipientIdToCandidate
{ "repo_name": "AsamK/TextSecure", "path": "app/src/main/java/org/thoughtcrime/securesms/groups/v2/GroupCandidateHelper.java", "license": "gpl-3.0", "size": 3800 }
[ "androidx.annotation.NonNull", "java.io.IOException", "java.util.Locale", "org.signal.core.util.logging.Log", "org.signal.zkgroup.profiles.ProfileKey", "org.signal.zkgroup.profiles.ProfileKeyCredential", "org.thoughtcrime.securesms.crypto.ProfileKeyUtil", "org.thoughtcrime.securesms.recipients.Recipient", "org.thoughtcrime.securesms.recipients.RecipientId", "org.whispersystems.libsignal.util.guava.Optional", "org.whispersystems.signalservice.api.groupsv2.GroupCandidate" ]
import androidx.annotation.NonNull; import java.io.IOException; import java.util.Locale; import org.signal.core.util.logging.Log; import org.signal.zkgroup.profiles.ProfileKey; import org.signal.zkgroup.profiles.ProfileKeyCredential; import org.thoughtcrime.securesms.crypto.ProfileKeyUtil; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.RecipientId; import org.whispersystems.libsignal.util.guava.Optional; import org.whispersystems.signalservice.api.groupsv2.GroupCandidate;
import androidx.annotation.*; import java.io.*; import java.util.*; import org.signal.core.util.logging.*; import org.signal.zkgroup.profiles.*; import org.thoughtcrime.securesms.crypto.*; import org.thoughtcrime.securesms.recipients.*; import org.whispersystems.libsignal.util.guava.*; import org.whispersystems.signalservice.api.groupsv2.*;
[ "androidx.annotation", "java.io", "java.util", "org.signal.core", "org.signal.zkgroup", "org.thoughtcrime.securesms", "org.whispersystems.libsignal", "org.whispersystems.signalservice" ]
androidx.annotation; java.io; java.util; org.signal.core; org.signal.zkgroup; org.thoughtcrime.securesms; org.whispersystems.libsignal; org.whispersystems.signalservice;
2,471,625
public void testIsDebit_income_positveAmount() throws Exception { AccountingDocument accountingDocument = IsDebitTestUtils.getDocument(SpringContext.getBean(DocumentService.class), AdvanceDepositDocument.class); AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(accountingDocument, SourceAccountingLine.class, POSITIVE); assertFalse(IsDebitTestUtils.isDebit(SpringContext.getBean(DataDictionaryService.class), SpringContext.getBean(DataDictionaryService.class), accountingDocument, accountingLine)); }
void function() throws Exception { AccountingDocument accountingDocument = IsDebitTestUtils.getDocument(SpringContext.getBean(DocumentService.class), AdvanceDepositDocument.class); AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(accountingDocument, SourceAccountingLine.class, POSITIVE); assertFalse(IsDebitTestUtils.isDebit(SpringContext.getBean(DataDictionaryService.class), SpringContext.getBean(DataDictionaryService.class), accountingDocument, accountingLine)); }
/** * tests false is returned for a positive income * * @throws Exception */
tests false is returned for a positive income
testIsDebit_income_positveAmount
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "test/unit/src/org/kuali/kfs/fp/document/validation/impl/AdvanceDepositDocumentRuleTest.java", "license": "agpl-3.0", "size": 10934 }
[ "org.kuali.kfs.fp.document.AdvanceDepositDocument", "org.kuali.kfs.sys.businessobject.AccountingLine", "org.kuali.kfs.sys.businessobject.SourceAccountingLine", "org.kuali.kfs.sys.context.SpringContext", "org.kuali.kfs.sys.document.AccountingDocument", "org.kuali.kfs.sys.service.IsDebitTestUtils", "org.kuali.rice.kns.service.DataDictionaryService", "org.kuali.rice.krad.service.DocumentService" ]
import org.kuali.kfs.fp.document.AdvanceDepositDocument; import org.kuali.kfs.sys.businessobject.AccountingLine; import org.kuali.kfs.sys.businessobject.SourceAccountingLine; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.kfs.sys.document.AccountingDocument; import org.kuali.kfs.sys.service.IsDebitTestUtils; import org.kuali.rice.kns.service.DataDictionaryService; import org.kuali.rice.krad.service.DocumentService;
import org.kuali.kfs.fp.document.*; import org.kuali.kfs.sys.businessobject.*; import org.kuali.kfs.sys.context.*; import org.kuali.kfs.sys.document.*; import org.kuali.kfs.sys.service.*; import org.kuali.rice.kns.service.*; import org.kuali.rice.krad.service.*;
[ "org.kuali.kfs", "org.kuali.rice" ]
org.kuali.kfs; org.kuali.rice;
2,535,672
public static UdpChannel parse(final String uriStr) { try { final URI uri = new URI(uriStr); final String userInfo = uri.getUserInfo(); final int uriPort = uri.getPort(); final Map<String, String> params = UriUtil.parseQueryString(uri, new HashMap<>()); if (!"udp".equals(uri.getScheme())) { return malformedUri(uriStr); } final Context context = new Context() .uriStr(uriStr); final InetAddress hostAddress = InetAddress.getByName(uri.getHost()); if (hostAddress.isMulticastAddress()) { final byte[] addressAsBytes = hostAddress.getAddress(); if (BitUtil.isEven(addressAsBytes[LAST_MULTICAST_DIGIT])) { throw new IllegalArgumentException("Multicast data address must be odd"); } addressAsBytes[LAST_MULTICAST_DIGIT]++; final InetSocketAddress controlAddress = new InetSocketAddress(getByAddress(addressAsBytes), uriPort); final InetSocketAddress dataAddress = new InetSocketAddress(hostAddress, uriPort); final NetworkInterface localInterface = findInterface(userInfo, params); final InetSocketAddress localAddress = resolveToAddressOfInterface(localInterface, userInfo, params); context.localControlAddress(localAddress) .remoteControlAddress(controlAddress) .localDataAddress(localAddress) .remoteDataAddress(dataAddress) .localInterface(localInterface) .canonicalForm(canonicalise(localAddress, dataAddress)); } else { if (uriPort == -1) { return malformedUri(uriStr); } final InetSocketAddress remoteAddress = new InetSocketAddress(hostAddress, uriPort); final InetSocketAddress localAddress = determineLocalAddressFromUserInfo(userInfo); context.remoteControlAddress(remoteAddress) .remoteDataAddress(remoteAddress) .localControlAddress(localAddress) .localDataAddress(localAddress) .canonicalForm(canonicalise(localAddress, remoteAddress)); } return new UdpChannel(context); } catch (final Exception ex) { throw new InvalidChannelException(ex); } }
static UdpChannel function(final String uriStr) { try { final URI uri = new URI(uriStr); final String userInfo = uri.getUserInfo(); final int uriPort = uri.getPort(); final Map<String, String> params = UriUtil.parseQueryString(uri, new HashMap<>()); if (!"udp".equals(uri.getScheme())) { return malformedUri(uriStr); } final Context context = new Context() .uriStr(uriStr); final InetAddress hostAddress = InetAddress.getByName(uri.getHost()); if (hostAddress.isMulticastAddress()) { final byte[] addressAsBytes = hostAddress.getAddress(); if (BitUtil.isEven(addressAsBytes[LAST_MULTICAST_DIGIT])) { throw new IllegalArgumentException(STR); } addressAsBytes[LAST_MULTICAST_DIGIT]++; final InetSocketAddress controlAddress = new InetSocketAddress(getByAddress(addressAsBytes), uriPort); final InetSocketAddress dataAddress = new InetSocketAddress(hostAddress, uriPort); final NetworkInterface localInterface = findInterface(userInfo, params); final InetSocketAddress localAddress = resolveToAddressOfInterface(localInterface, userInfo, params); context.localControlAddress(localAddress) .remoteControlAddress(controlAddress) .localDataAddress(localAddress) .remoteDataAddress(dataAddress) .localInterface(localInterface) .canonicalForm(canonicalise(localAddress, dataAddress)); } else { if (uriPort == -1) { return malformedUri(uriStr); } final InetSocketAddress remoteAddress = new InetSocketAddress(hostAddress, uriPort); final InetSocketAddress localAddress = determineLocalAddressFromUserInfo(userInfo); context.remoteControlAddress(remoteAddress) .remoteDataAddress(remoteAddress) .localControlAddress(localAddress) .localDataAddress(localAddress) .canonicalForm(canonicalise(localAddress, remoteAddress)); } return new UdpChannel(context); } catch (final Exception ex) { throw new InvalidChannelException(ex); } }
/** * Parse URI and create channel * * @param uriStr to parse * @return created channel */
Parse URI and create channel
parse
{ "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.InetAddress", "java.net.InetSocketAddress", "java.net.NetworkInterface", "java.util.HashMap", "java.util.Map", "uk.co.real_logic.aeron.common.UriUtil", "uk.co.real_logic.aeron.driver.exceptions.InvalidChannelException", "uk.co.real_logic.agrona.BitUtil" ]
import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.NetworkInterface; import java.util.HashMap; import java.util.Map; import uk.co.real_logic.aeron.common.UriUtil; import uk.co.real_logic.aeron.driver.exceptions.InvalidChannelException; import uk.co.real_logic.agrona.BitUtil;
import java.net.*; import java.util.*; import uk.co.real_logic.aeron.common.*; import uk.co.real_logic.aeron.driver.exceptions.*; import uk.co.real_logic.agrona.*;
[ "java.net", "java.util", "uk.co.real_logic" ]
java.net; java.util; uk.co.real_logic;
2,820,825
@OpMethod(op = net.imagej.ops.transform.extendMirrorDoubleView.DefaultExtendMirrorDoubleView.class) public <T extends Type<T>, F extends RandomAccessibleInterval<T>> ExtendedRandomAccessibleInterval<T, F> extendMirrorDouble(final F input) { return (ExtendedRandomAccessibleInterval<T, F>) ops().run( DefaultExtendMirrorDoubleView.class, input); }
@OpMethod(op = net.imagej.ops.transform.extendMirrorDoubleView.DefaultExtendMirrorDoubleView.class) <T extends Type<T>, F extends RandomAccessibleInterval<T>> ExtendedRandomAccessibleInterval<T, F> function(final F input) { return (ExtendedRandomAccessibleInterval<T, F>) ops().run( DefaultExtendMirrorDoubleView.class, input); }
/** * Extend a RandomAccessibleInterval with a mirroring out-of-bounds strategy. * Boundary pixels are repeated. * * @param source the interval to extend. * @return (unbounded) RandomAccessible which extends the input interval to * infinity. * @see net.imglib2.outofbounds.OutOfBoundsMirrorDoubleBoundary */
Extend a RandomAccessibleInterval with a mirroring out-of-bounds strategy. Boundary pixels are repeated
extendMirrorDouble
{ "repo_name": "stelfrich/imagej-ops", "path": "src/main/java/net/imagej/ops/transform/TransformNamespace.java", "license": "bsd-2-clause", "size": 40764 }
[ "net.imagej.ops.OpMethod", "net.imagej.ops.transform.extendMirrorDoubleView.DefaultExtendMirrorDoubleView", "net.imglib2.RandomAccessibleInterval", "net.imglib2.type.Type", "net.imglib2.view.ExtendedRandomAccessibleInterval" ]
import net.imagej.ops.OpMethod; import net.imagej.ops.transform.extendMirrorDoubleView.DefaultExtendMirrorDoubleView; import net.imglib2.RandomAccessibleInterval; import net.imglib2.type.Type; import net.imglib2.view.ExtendedRandomAccessibleInterval;
import net.imagej.ops.*; import net.imagej.ops.transform.*; import net.imglib2.*; import net.imglib2.type.*; import net.imglib2.view.*;
[ "net.imagej.ops", "net.imglib2", "net.imglib2.type", "net.imglib2.view" ]
net.imagej.ops; net.imglib2; net.imglib2.type; net.imglib2.view;
975,355
public static void checkParam(String tag) { if (StringUtils.isNotBlank(tag)) { if (!isValid(tag.trim())) { throw new IllegalArgumentException("invalid tag : " + tag); } if (tag.length() > TAG_MAX_LEN) { throw new IllegalArgumentException("too long tag, over 16"); } } }
static void function(String tag) { if (StringUtils.isNotBlank(tag)) { if (!isValid(tag.trim())) { throw new IllegalArgumentException(STR + tag); } if (tag.length() > TAG_MAX_LEN) { throw new IllegalArgumentException(STR); } } }
/** * Check the tag. */
Check the tag
checkParam
{ "repo_name": "alibaba/nacos", "path": "config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java", "license": "apache-2.0", "size": 6806 }
[ "com.alibaba.nacos.common.utils.StringUtils" ]
import com.alibaba.nacos.common.utils.StringUtils;
import com.alibaba.nacos.common.utils.*;
[ "com.alibaba.nacos" ]
com.alibaba.nacos;
2,168,048
public Observable<ServiceResponse<Page<SkuInfoInner>>> listMultiRolePoolSkusSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<Page<SkuInfoInner>>> function(final String resourceGroupName, final String name) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (name == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * Get available SKUs for scaling a multi-role pool. * Get available SKUs for scaling a multi-role pool. * ServiceResponse<PageImpl<SkuInfoInner>> * @param resourceGroupName Name of the resource group to which the resource belongs. ServiceResponse<PageImpl<SkuInfoInner>> * @param name Name of the App Service Environment. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;SkuInfoInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Get available SKUs for scaling a multi-role pool. Get available SKUs for scaling a multi-role pool
listMultiRolePoolSkusSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/appservice/mgmt-v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java", "license": "mit", "size": 595166 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,234,505
public RelationshipDefinition addNamespace(Namespace namespace) { if (namespace == null) return this; if (namespaces.containsKey(namespace.name())) { throw new RelationshipException("Duplicate namespace: " + namespace.name()); } namespaces.put(namespace.name(), namespace.clone()); return this; }
RelationshipDefinition function(Namespace namespace) { if (namespace == null) return this; if (namespaces.containsKey(namespace.name())) { throw new RelationshipException(STR + namespace.name()); } namespaces.put(namespace.name(), namespace.clone()); return this; }
/** * Add a single Namespace to this relationship builder. * * @param namespace a Namespace. Cannot be null. * @return this relationship definition instance to facilitate method chaining. */
Add a single Namespace to this relationship builder
addNamespace
{ "repo_name": "RestExpress/HyperExpress", "path": "core/src/main/java/com/strategicgains/hyperexpress/builder/RelationshipDefinition.java", "license": "apache-2.0", "size": 14716 }
[ "com.strategicgains.hyperexpress.domain.Namespace", "com.strategicgains.hyperexpress.exception.RelationshipException" ]
import com.strategicgains.hyperexpress.domain.Namespace; import com.strategicgains.hyperexpress.exception.RelationshipException;
import com.strategicgains.hyperexpress.domain.*; import com.strategicgains.hyperexpress.exception.*;
[ "com.strategicgains.hyperexpress" ]
com.strategicgains.hyperexpress;
2,557,911
private SerialMessage setValueMessage(String str, int command) { logger.debug("NODE {}: Creating new message for application command NAME_SET to {}", this.getNode().getNodeId(), str); byte[] nameBuffer = null; byte encoding = ENCODING_ASCII; // First we want to see if this can be encoded in ASCII CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder(); if (asciiEncoder.canEncode(str) == true) { nameBuffer = str.getBytes(StandardCharsets.US_ASCII); } else { nameBuffer = str.getBytes(StandardCharsets.UTF_16); encoding = ENCODING_UTF16; } int len = nameBuffer.length; if (len > 16) { len = 16; } SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Set); byte[] newPayload = { (byte) this.getNode().getNodeId(), (byte) ((byte) len + 3), (byte) getCommandClass().getKey(), (byte) command, encoding }; byte[] msg = new byte[newPayload.length + len]; System.arraycopy(newPayload, 0, msg, 0, newPayload.length); System.arraycopy(nameBuffer, 0, msg, newPayload.length, len); result.setMessagePayload(msg); return result; }
SerialMessage function(String str, int command) { logger.debug(STR, this.getNode().getNodeId(), str); byte[] nameBuffer = null; byte encoding = ENCODING_ASCII; CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder(); if (asciiEncoder.canEncode(str) == true) { nameBuffer = str.getBytes(StandardCharsets.US_ASCII); } else { nameBuffer = str.getBytes(StandardCharsets.UTF_16); encoding = ENCODING_UTF16; } int len = nameBuffer.length; if (len > 16) { len = 16; } SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Set); byte[] newPayload = { (byte) this.getNode().getNodeId(), (byte) ((byte) len + 3), (byte) getCommandClass().getKey(), (byte) command, encoding }; byte[] msg = new byte[newPayload.length + len]; System.arraycopy(newPayload, 0, msg, 0, newPayload.length); System.arraycopy(nameBuffer, 0, msg, newPayload.length, len); result.setMessagePayload(msg); return result; }
/** * Gets a SerialMessage with the Name or Location SET command * * @param the level to set. * @return the serial message */
Gets a SerialMessage with the Name or Location SET command
setValueMessage
{ "repo_name": "jongj/openhab2-addons", "path": "addons/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveNodeNamingCommandClass.java", "license": "epl-1.0", "size": 14728 }
[ "java.nio.charset.CharsetEncoder", "java.nio.charset.StandardCharsets", "org.openhab.binding.zwave.internal.protocol.SerialMessage" ]
import java.nio.charset.CharsetEncoder; import java.nio.charset.StandardCharsets; import org.openhab.binding.zwave.internal.protocol.SerialMessage;
import java.nio.charset.*; import org.openhab.binding.zwave.internal.protocol.*;
[ "java.nio", "org.openhab.binding" ]
java.nio; org.openhab.binding;
2,306,131
public File getFolder() { return folder; }
File function() { return folder; }
/** * Returns the sketch folder. */
Returns the sketch folder
getFolder
{ "repo_name": "sujitbehera27/MyRoboticsProjects-Arduino", "path": "src/org/myrobotlab/arduino/Sketch.java", "license": "apache-2.0", "size": 35890 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,675,637
List<String> commonPathParts = CollectionUtils.filterCommonStart( parentPathElements, pathElements.subList(0, pathElements.size() - 1)); List<String> newPathParts = CollectionUtils.getRange(pathElements, commonPathParts.size()); parentPathElements = pathElements.subList(0, pathElements.size() - 1); int indentationLevel = commonPathParts.size(); String prefix = commonPathParts.isEmpty() ? "" : String.join(".", commonPathParts) + "."; return convertToPathElements(indentationLevel, prefix, newPathParts); }
List<String> commonPathParts = CollectionUtils.filterCommonStart( parentPathElements, pathElements.subList(0, pathElements.size() - 1)); List<String> newPathParts = CollectionUtils.getRange(pathElements, commonPathParts.size()); parentPathElements = pathElements.subList(0, pathElements.size() - 1); int indentationLevel = commonPathParts.size(); String prefix = commonPathParts.isEmpty() ? STR.STR."; return convertToPathElements(indentationLevel, prefix, newPathParts); }
/** * Returns all path elements for the given property that have not been traversed yet. * * @param pathElements all elements that make up the path of the property * @return the new path elements */
Returns all path elements for the given property that have not been traversed yet
getPathElements
{ "repo_name": "AuthMe/ConfigMe", "path": "src/main/java/ch/jalu/configme/resource/PropertyPathTraverser.java", "license": "mit", "size": 4592 }
[ "ch.jalu.configme.utils.CollectionUtils", "java.util.List" ]
import ch.jalu.configme.utils.CollectionUtils; import java.util.List;
import ch.jalu.configme.utils.*; import java.util.*;
[ "ch.jalu.configme", "java.util" ]
ch.jalu.configme; java.util;
2,899,882
public static void main(String[] args) { if (args.length > 0 && args[0].equals("redwood")) { Redwood.log(Redwood.DBG, "at the top"); Redwood.startTrack("Adaptor test controlled by redwood"); Logger topLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); topLogger.warning("I'm warning you!"); topLogger.severe("Now I'm using my severe voice."); topLogger.info("FYI"); Redwood.log(Redwood.DBG, "adapting"); JavaUtilLoggingAdaptor.adapt(); topLogger.warning("I'm warning you in Redwood!"); JavaUtilLoggingAdaptor.adapt(); // should be safe to call this twice topLogger.severe("Now I'm using my severe voice in Redwood!"); topLogger.info("FYI: Redwood rocks"); // make sure original java.util.logging levels are respected topLogger.setLevel(Level.OFF); topLogger.severe("We shouldn't see this message."); Redwood.log(Redwood.DBG, "at the bottom"); Redwood.endTrack("Adaptor test controlled by redwood"); } else { // Reverse mapping Logger topLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); // Can be Logger.getGlobal() in jdk1.7 // topLogger.addHandler(new ConsoleHandler()); Logger logger = Logger.getLogger(JavaUtilLoggingAdaptor.class.getName()); topLogger.info("Starting test"); logger.log(Level.INFO, "Hello from the class logger"); Redwood.log("Hello from Redwood!"); Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log("Hello from Redwood -> Java!"); Redwood.log("Hello from Redwood -> Java again!"); logger.log(Level.INFO, "Hello again from the class logger"); Redwood.startTrack("a track"); Redwood.log("Inside a track"); logger.log(Level.INFO, "Hello a third time from the class logger"); Redwood.endTrack("a track"); logger.log(Level.INFO, "Hello a fourth time from the class logger"); } }
static void function(String[] args) { if (args.length > 0 && args[0].equals(STR)) { Redwood.log(Redwood.DBG, STR); Redwood.startTrack(STR); Logger topLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); topLogger.warning(STR); topLogger.severe(STR); topLogger.info("FYI"); Redwood.log(Redwood.DBG, STR); JavaUtilLoggingAdaptor.adapt(); topLogger.warning(STR); JavaUtilLoggingAdaptor.adapt(); topLogger.severe(STR); topLogger.info(STR); topLogger.setLevel(Level.OFF); topLogger.severe(STR); Redwood.log(Redwood.DBG, STR); Redwood.endTrack(STR); } else { Logger topLogger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); Logger logger = Logger.getLogger(JavaUtilLoggingAdaptor.class.getName()); topLogger.info(STR); logger.log(Level.INFO, STR); Redwood.log(STR); Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log(STR); Redwood.log(STR); logger.log(Level.INFO, STR); Redwood.startTrack(STR); Redwood.log(STR); logger.log(Level.INFO, STR); Redwood.endTrack(STR); logger.log(Level.INFO, STR); } }
/** * Simple test case. */
Simple test case
main
{ "repo_name": "heeyounglee/hcoref", "path": "src/edu/stanford/nlp/util/logging/JavaUtilLoggingAdaptor.java", "license": "gpl-2.0", "size": 4756 }
[ "java.util.logging.Level", "java.util.logging.Logger" ]
import java.util.logging.Level; import java.util.logging.Logger;
import java.util.logging.*;
[ "java.util" ]
java.util;
2,272,605
@Override public boolean isMatch(HttpServletRequest request) { long now = Alarm.getCurrentTime(); long prevEnable = _enableAt.prevTime(now); long prevDisable = _disableAt.prevTime(now); return prevEnable > 0 && prevDisable <= prevEnable; }
boolean function(HttpServletRequest request) { long now = Alarm.getCurrentTime(); long prevEnable = _enableAt.prevTime(now); long prevDisable = _disableAt.prevTime(now); return prevEnable > 0 && prevDisable <= prevEnable; }
/** * True if the predicate matches. * * @param request the servlet request to test */
True if the predicate matches
isMatch
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/rewrite/IfCron.java", "license": "gpl-2.0", "size": 2976 }
[ "com.caucho.util.Alarm", "javax.servlet.http.HttpServletRequest" ]
import com.caucho.util.Alarm; import javax.servlet.http.HttpServletRequest;
import com.caucho.util.*; import javax.servlet.http.*;
[ "com.caucho.util", "javax.servlet" ]
com.caucho.util; javax.servlet;
1,908,110
public static void loadJars(final Set<File> jarFiles, final IStandardDescriptionUpdater descriptionUpdater) { Preconditions.checkNotNull(jarFiles, "IE00700: JAR files argument can not be null"); Preconditions.checkNotNull(descriptionUpdater, "IE00701: Description updater argument can not be null"); descriptionUpdater.reset(); descriptionUpdater.setMaximum(jarFiles.size()); for (final File file : jarFiles) { descriptionUpdater.next(); descriptionUpdater.setDescription(String.format("Loading JAR file %s", file.getName())); NaviLogger.info("Loading JAR file %s", file.getAbsolutePath()); ClassPathHacker.addFile(file); } }
static void function(final Set<File> jarFiles, final IStandardDescriptionUpdater descriptionUpdater) { Preconditions.checkNotNull(jarFiles, STR); Preconditions.checkNotNull(descriptionUpdater, STR); descriptionUpdater.reset(); descriptionUpdater.setMaximum(jarFiles.size()); for (final File file : jarFiles) { descriptionUpdater.next(); descriptionUpdater.setDescription(String.format(STR, file.getName())); NaviLogger.info(STR, file.getAbsolutePath()); ClassPathHacker.addFile(file); } }
/** * Loads the given JAR files. * * @param jarFiles List of JAR files to load. * @param descriptionUpdater Description updater. */
Loads the given JAR files
loadJars
{ "repo_name": "guiquanz/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Plugins/JarLoader.java", "license": "apache-2.0", "size": 3358 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.binnavi.Log", "com.google.security.zynamics.zylib.gui.ProgressDialogs", "com.google.security.zynamics.zylib.plugins.ClassPathHacker", "java.io.File", "java.util.Set" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.Log; import com.google.security.zynamics.zylib.gui.ProgressDialogs; import com.google.security.zynamics.zylib.plugins.ClassPathHacker; import java.io.File; import java.util.Set;
import com.google.common.base.*; import com.google.security.zynamics.binnavi.*; import com.google.security.zynamics.zylib.gui.*; import com.google.security.zynamics.zylib.plugins.*; import java.io.*; import java.util.*;
[ "com.google.common", "com.google.security", "java.io", "java.util" ]
com.google.common; com.google.security; java.io; java.util;
2,624,366
public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); }
void function(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); }
/** * This adds a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a listener.
addListener
{ "repo_name": "harsha1979/developer-studio", "path": "data-services/org.wso2.developerstudio.eclipse.ds.edit/src/org/wso2/developerstudio/eclipse/ds/provider/DsItemProviderAdapterFactory.java", "license": "apache-2.0", "size": 32352 }
[ "org.eclipse.emf.edit.provider.INotifyChangedListener" ]
import org.eclipse.emf.edit.provider.INotifyChangedListener;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
894,375
public void _draw(Graphics2D gphx, Game game, Rectangle r) { if(shrinkfactor != 1) { r.width *= shrinkfactor; r.height *= shrinkfactor; r.x += (rect.width-r.width)/2; r.y += (rect.height-r.height)/2; } gphx.setColor(color); if(is_avatar) { gphx.fillOval((int) r.getX(), (int) r.getY(), r.width, r.height); }else if(!is_static) { gphx.fillRect(r.x, r.y, r.width, r.height); }else { gphx.fillRect(r.x, r.y, r.width, r.height); } }
void function(Graphics2D gphx, Game game, Rectangle r) { if(shrinkfactor != 1) { r.width *= shrinkfactor; r.height *= shrinkfactor; r.x += (rect.width-r.width)/2; r.y += (rect.height-r.height)/2; } gphx.setColor(color); if(is_avatar) { gphx.fillOval((int) r.getX(), (int) r.getY(), r.width, r.height); }else if(!is_static) { gphx.fillRect(r.x, r.y, r.width, r.height); }else { gphx.fillRect(r.x, r.y, r.width, r.height); } }
/** * Draws the not-oriented part of the sprite * @param gphx graphics object to draw in. * @param game reference to the game that is being played now. */
Draws the not-oriented part of the sprite
_draw
{ "repo_name": "tohahn/UE_ML", "path": "UE06/gvgai/src/core/VGDLSprite.java", "license": "gpl-3.0", "size": 32756 }
[ "java.awt.Graphics2D", "java.awt.Rectangle" ]
import java.awt.Graphics2D; import java.awt.Rectangle;
import java.awt.*;
[ "java.awt" ]
java.awt;
870,538
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 OntoumlItemProviderAdapterFactory()); 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 OntoumlItemProviderAdapterFactory()); 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": "MenthorTools/ontouml", "path": "net.menthor.onto2.ontouml.editor/src-gen/net/menthor/onto2/ontouml/presentation/OntoumlEditor.java", "license": "mit", "size": 55845 }
[ "net.menthor.onto2.ontouml.provider.OntoumlItemProviderAdapterFactory", "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 net.menthor.onto2.ontouml.provider.OntoumlItemProviderAdapterFactory; 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 net.menthor.onto2.ontouml.provider.*; import org.eclipse.emf.common.command.*; import org.eclipse.emf.edit.provider.*; import org.eclipse.emf.edit.provider.resource.*;
[ "net.menthor.onto2", "org.eclipse.emf" ]
net.menthor.onto2; org.eclipse.emf;
2,150,533
protected void setKeyringMonitorRegistration(ServiceRegistration<KeyringMonitor> keyringMonitorRegistration) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "setKeyringMonitorRegistration"); } this.keyringMonitorRegistration = keyringMonitorRegistration; }
void function(ServiceRegistration<KeyringMonitor> keyringMonitorRegistration) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, STR); } this.keyringMonitorRegistration = keyringMonitorRegistration; }
/** * Sets the keyring monitor registration. * * @param keyringMonitorRegistration */
Sets the keyring monitor registration
setKeyringMonitorRegistration
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/internal/KeystoreConfigurationFactory.java", "license": "epl-1.0", "size": 16232 }
[ "com.ibm.websphere.ras.Tr", "com.ibm.websphere.ras.TraceComponent", "com.ibm.ws.ssl.KeyringMonitor", "org.osgi.framework.ServiceRegistration" ]
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.ssl.KeyringMonitor; import org.osgi.framework.ServiceRegistration;
import com.ibm.websphere.ras.*; import com.ibm.ws.ssl.*; import org.osgi.framework.*;
[ "com.ibm.websphere", "com.ibm.ws", "org.osgi.framework" ]
com.ibm.websphere; com.ibm.ws; org.osgi.framework;
659,770
public AzureResourceErrorInfo withDetails(List<AzureResourceErrorInfo> details) { this.details = details; return this; }
AzureResourceErrorInfo function(List<AzureResourceErrorInfo> details) { this.details = details; return this; }
/** * Set the error details. * * @param details the details value to set * @return the AzureResourceErrorInfo object itself. */
Set the error details
withDetails
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/logic/mgmt-v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/AzureResourceErrorInfo.java", "license": "mit", "size": 1634 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
323,486
@RequestMapping(value = "/db/mgt/pb/inv/nwrsp/*.html", method = RequestMethod.GET) @ValidUser public ModelAndView doAddRespondent(HttpServletRequest request) { // get survey from URL, assert ownership Survey survey = getSurveyFromRestfulUrl(request); AddRespondentCommand command = new AddRespondentCommand(); Map<String, Object> model = new HashMap<String, Object>(); model.put("survey", survey); model.put("command", command); // show view return new ModelAndView("/dashboard/manage/publishTab/invites/addRespondent", model); } // ======================================================================
@RequestMapping(value = STR, method = RequestMethod.GET) ModelAndView function(HttpServletRequest request) { Survey survey = getSurveyFromRestfulUrl(request); AddRespondentCommand command = new AddRespondentCommand(); Map<String, Object> model = new HashMap<String, Object>(); model.put(STR, survey); model.put(STR, command); return new ModelAndView(STR, model); }
/** * Show Add Respondent view. * * @return ModelAndView */
Show Add Respondent view
doAddRespondent
{ "repo_name": "onlyasurvey/OAS_workspace", "path": "OnlyASurveyRoot/OnlyASurveyWeb/src/main/java/com/oas/controller/dashboard/editsurvey/InvitationController.java", "license": "agpl-3.0", "size": 13021 }
[ "com.oas.command.model.AddRespondentCommand", "com.oas.model.Survey", "java.util.HashMap", "java.util.Map", "javax.servlet.http.HttpServletRequest", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.servlet.ModelAndView" ]
import com.oas.command.model.AddRespondentCommand; import com.oas.model.Survey; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView;
import com.oas.command.model.*; import com.oas.model.*; import java.util.*; import javax.servlet.http.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.*;
[ "com.oas.command", "com.oas.model", "java.util", "javax.servlet", "org.springframework.web" ]
com.oas.command; com.oas.model; java.util; javax.servlet; org.springframework.web;
56,841
public Item startElement(QName name) throws RelaxException { Item nextElt = _eltItem.startElement(name); if (nextElt == null) return null; else if (nextElt == _eltItem) return this; else return nextElt.inElementContinuation(_contItem); }
Item function(QName name) throws RelaxException { Item nextElt = _eltItem.startElement(name); if (nextElt == null) return null; else if (nextElt == _eltItem) return this; else return nextElt.inElementContinuation(_contItem); }
/** * Returns the next item when an element of the given name is returned * * @param name the name of the element * * @return the program for handling the element */
Returns the next item when an element of the given name is returned
startElement
{ "repo_name": "dlitz/resin", "path": "modules/kernel/src/com/caucho/relaxng/program/InElementItem.java", "license": "gpl-2.0", "size": 7241 }
[ "com.caucho.relaxng.RelaxException", "com.caucho.xml.QName" ]
import com.caucho.relaxng.RelaxException; import com.caucho.xml.QName;
import com.caucho.relaxng.*; import com.caucho.xml.*;
[ "com.caucho.relaxng", "com.caucho.xml" ]
com.caucho.relaxng; com.caucho.xml;
294,889
public void setBeanFactory(BeanFactory beanFactory) { if (!(beanFactory instanceof ListableBeanFactory)) { throw new IllegalStateException(getClass().getSimpleName() + " requires a ListableBeanFactory"); } this.beanFactory = (ListableBeanFactory) beanFactory; }
void function(BeanFactory beanFactory) { if (!(beanFactory instanceof ListableBeanFactory)) { throw new IllegalStateException(getClass().getSimpleName() + STR); } this.beanFactory = (ListableBeanFactory) beanFactory; }
/** * Obtains all web service beans and publishes them as JAX-WS endpoints. */
Obtains all web service beans and publishes them as JAX-WS endpoints
setBeanFactory
{ "repo_name": "cbeams-archive/spring-framework-2.5.x", "path": "tiger/src/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java", "license": "apache-2.0", "size": 4756 }
[ "org.springframework.beans.factory.BeanFactory", "org.springframework.beans.factory.ListableBeanFactory" ]
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.*;
[ "org.springframework.beans" ]
org.springframework.beans;
2,566,372
public IgniteInternalFuture<?> removeAllAsync(@Nullable Collection<? extends K> keys);
IgniteInternalFuture<?> function(@Nullable Collection<? extends K> keys);
/** * Asynchronously removes given key mappings from cache for entries. * <p> * If write-through is enabled, the values will be removed from {@link CacheStore} via {@link IgniteDataStreamer}. * <h2 class="header">Transactions</h2> * This method is transactional and will enlist the entry into ongoing transaction * if there is one. * * @param keys Keys whose mappings are to be removed from cache. * @return Future for the remove operation. The future will complete whenever * remove operation completes. */
Asynchronously removes given key mappings from cache for entries. If write-through is enabled, the values will be removed from <code>CacheStore</code> via <code>IgniteDataStreamer</code>. Transactions This method is transactional and will enlist the entry into ongoing transaction if there is one
removeAllAsync
{ "repo_name": "dlnufox/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java", "license": "apache-2.0", "size": 85622 }
[ "java.util.Collection", "org.apache.ignite.internal.IgniteInternalFuture", "org.jetbrains.annotations.Nullable" ]
import java.util.Collection; import org.apache.ignite.internal.IgniteInternalFuture; import org.jetbrains.annotations.Nullable;
import java.util.*; import org.apache.ignite.internal.*; import org.jetbrains.annotations.*;
[ "java.util", "org.apache.ignite", "org.jetbrains.annotations" ]
java.util; org.apache.ignite; org.jetbrains.annotations;
2,839,919
@Override public int executeBatch(Statement statement, boolean isStatementPrepared) throws java.sql.SQLException { if (usesNativeBatchWriting() && isStatementPrepared) { int rowCount = 0; try { rowCount = ((OraclePreparedStatement)statement).sendBatch(); } finally { ((OraclePreparedStatement) statement).setExecuteBatch(1); } return rowCount; } else { @SuppressWarnings("unused") int[] results = statement.executeBatch(); return statement.getUpdateCount(); } }
int function(Statement statement, boolean isStatementPrepared) throws java.sql.SQLException { if (usesNativeBatchWriting() && isStatementPrepared) { int rowCount = 0; try { rowCount = ((OraclePreparedStatement)statement).sendBatch(); } finally { ((OraclePreparedStatement) statement).setExecuteBatch(1); } return rowCount; } else { @SuppressWarnings(STR) int[] results = statement.executeBatch(); return statement.getUpdateCount(); } }
/** * Internal: This gets called on each batch statement execution * Needs to be implemented so that it returns the number of rows successfully modified * by this statement for optimistic locking purposes (if useNativeBatchWriting is enabled, and * the call uses optimistic locking). * * @param isStatementPrepared - flag is set to true if this statement is prepared * @return - number of rows modified/deleted by this statement */
Internal: This gets called on each batch statement execution Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes (if useNativeBatchWriting is enabled, and the call uses optimistic locking)
executeBatch
{ "repo_name": "gameduell/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.oracle/src/org/eclipse/persistence/platform/database/oracle/Oracle10Platform.java", "license": "epl-1.0", "size": 4532 }
[ "java.sql.SQLException", "java.sql.Statement", "oracle.jdbc.OraclePreparedStatement" ]
import java.sql.SQLException; import java.sql.Statement; import oracle.jdbc.OraclePreparedStatement;
import java.sql.*; import oracle.jdbc.*;
[ "java.sql", "oracle.jdbc" ]
java.sql; oracle.jdbc;
322,014
private void processIfUngraded( AssignmentSubmission submission, boolean isNext ) { String flag = isNext ? FLAG_NEXT_UNGRADED : FLAG_PREV_UNGRADED; resetNavOptions( flag ); // If the submission is ungraded, set the appropriate flag and reference; return true if( !submission.getGraded() ) { applyNavOption( flag, submission ); } }
void function( AssignmentSubmission submission, boolean isNext ) { String flag = isNext ? FLAG_NEXT_UNGRADED : FLAG_PREV_UNGRADED; resetNavOptions( flag ); if( !submission.getGraded() ) { applyNavOption( flag, submission ); } }
/** * SAK-29314 - Determine if the given assignment submission is graded or not, whether * it has an actual 'submission' or not. * * @param submission - the submission to be checked * @param isNext - true/false; is for next submission (true), or previous (false) */
SAK-29314 - Determine if the given assignment submission is graded or not, whether it has an actual 'submission' or not
processIfUngraded
{ "repo_name": "frasese/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 686269 }
[ "org.sakaiproject.assignment.api.AssignmentSubmission" ]
import org.sakaiproject.assignment.api.AssignmentSubmission;
import org.sakaiproject.assignment.api.*;
[ "org.sakaiproject.assignment" ]
org.sakaiproject.assignment;
1,496,853
public ServiceFuture<Void> beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); }
ServiceFuture<Void> function(String resourceGroupName, String circuitName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); }
/** * Deletes the specified express route circuit. * * @param resourceGroupName The name of the resource group. * @param circuitName The name of the express route circuit. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Deletes the specified express route circuit
beginDeleteAsync
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/network/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitsInner.java", "license": "mit", "size": 125131 }
[ "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,779,691
@Test(groups={"DataPrepAdvanceSearch"}) public void dataPrep_AdvSearch_ALF_5018() throws Exception { String testName = getTestName(); String siteName = getSiteName(testName); String testUser = getUserNameFreeDomain(testName); String[] testUserInfo = new String[] { testUser }; String folderName; try { ContentDetails contentDetails = new ContentDetails(); // User CreateUserAPI.CreateActivateUser(drone, ADMIN_USERNAME, testUserInfo); // Login ShareUser.login(drone, testUser, testPassword); // Site ShareUser.createSite(drone, siteName, AbstractUtils.SITE_VISIBILITY_PUBLIC).render(maxWaitTime); // Creating 5 content Items. String searchTerm = siteName + "_test"; contentDetails.setName(searchTerm + 1); contentDetails.setTitle("Eeee"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 2); contentDetails.setTitle("Dddd"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 3); contentDetails.setTitle("Cccc"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 4); contentDetails.setTitle("Bbbb"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 5); contentDetails.setTitle("Aaaa"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); // Creating 5 folders searchTerm = siteName + "_testing"; folderName = (searchTerm + 1); ShareUserSitePage.createFolder(drone, folderName, "Eeee", null); folderName = (searchTerm + 2); ShareUserSitePage.createFolder(drone, folderName, "Dddd", null); folderName = (searchTerm + 3); ShareUserSitePage.createFolder(drone, folderName, "Cccc", null); folderName = (searchTerm + 4); ShareUserSitePage.createFolder(drone, folderName, "Bbbb", null); folderName = (searchTerm + 5); ShareUserSitePage.createFolder(drone, folderName, "Aaaa", null); } catch (Throwable e) { reportError(drone, testName, e); } finally { testCleanup(drone, testName); } }
@Test(groups={STR}) void function() throws Exception { String testName = getTestName(); String siteName = getSiteName(testName); String testUser = getUserNameFreeDomain(testName); String[] testUserInfo = new String[] { testUser }; String folderName; try { ContentDetails contentDetails = new ContentDetails(); CreateUserAPI.CreateActivateUser(drone, ADMIN_USERNAME, testUserInfo); ShareUser.login(drone, testUser, testPassword); ShareUser.createSite(drone, siteName, AbstractUtils.SITE_VISIBILITY_PUBLIC).render(maxWaitTime); String searchTerm = siteName + "_test"; contentDetails.setName(searchTerm + 1); contentDetails.setTitle("Eeee"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 2); contentDetails.setTitle("Dddd"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 3); contentDetails.setTitle("Cccc"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 4); contentDetails.setTitle("Bbbb"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); contentDetails.setName(searchTerm + 5); contentDetails.setTitle("Aaaa"); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); searchTerm = siteName + STR; folderName = (searchTerm + 1); ShareUserSitePage.createFolder(drone, folderName, "Eeee", null); folderName = (searchTerm + 2); ShareUserSitePage.createFolder(drone, folderName, "Dddd", null); folderName = (searchTerm + 3); ShareUserSitePage.createFolder(drone, folderName, "Cccc", null); folderName = (searchTerm + 4); ShareUserSitePage.createFolder(drone, folderName, "Bbbb", null); folderName = (searchTerm + 5); ShareUserSitePage.createFolder(drone, folderName, "Aaaa", null); } catch (Throwable e) { reportError(drone, testName, e); } finally { testCleanup(drone, testName); } }
/** * DataPreparation method - ALF-5018 * <ul> * <li>Login</li> * <li>Create Users</li> * <li>Create Site</li> * <li>Create and upload file with title and folders</li> * </ul> * * @throws Exception */
DataPreparation method - ALF-5018 Login Create Users Create Site Create and upload file with title and folders
dataPrep_AdvSearch_ALF_5018
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/qa-share/src/test/java/org/alfresco/share/search/AdvanceSearchTest.java", "license": "lgpl-3.0", "size": 123894 }
[ "org.alfresco.po.share.site.document.ContentDetails", "org.alfresco.po.share.site.document.ContentType", "org.alfresco.share.util.AbstractUtils", "org.alfresco.share.util.ShareUser", "org.alfresco.share.util.ShareUserSitePage", "org.alfresco.share.util.api.CreateUserAPI", "org.testng.annotations.Test" ]
import org.alfresco.po.share.site.document.ContentDetails; import org.alfresco.po.share.site.document.ContentType; import org.alfresco.share.util.AbstractUtils; import org.alfresco.share.util.ShareUser; import org.alfresco.share.util.ShareUserSitePage; import org.alfresco.share.util.api.CreateUserAPI; import org.testng.annotations.Test;
import org.alfresco.po.share.site.document.*; import org.alfresco.share.util.*; import org.alfresco.share.util.api.*; import org.testng.annotations.*;
[ "org.alfresco.po", "org.alfresco.share", "org.testng.annotations" ]
org.alfresco.po; org.alfresco.share; org.testng.annotations;
2,122,824
private void unboxOrCast(MethodVisitor methodVisitor, Class<?> targetClass, Type targetType) { if (targetClass.isPrimitive()) { // Unbox value Type boxedType = Type.getType(JavaReflectionUtil.getWrapperTypeForPrimitiveType(targetClass)); methodVisitor.visitTypeInsn(CHECKCAST, boxedType.getInternalName()); String valueMethodDescriptor = Type.getMethodDescriptor(targetType); methodVisitor.visitMethodInsn(INVOKEVIRTUAL, boxedType.getInternalName(), targetClass.getName() + "Value", valueMethodDescriptor, false); } else { // Cast to return type methodVisitor.visitTypeInsn(CHECKCAST, targetClass.isArray() ? "[" + targetType.getElementType().getDescriptor() : targetType.getInternalName()); } }
void function(MethodVisitor methodVisitor, Class<?> targetClass, Type targetType) { if (targetClass.isPrimitive()) { Type boxedType = Type.getType(JavaReflectionUtil.getWrapperTypeForPrimitiveType(targetClass)); methodVisitor.visitTypeInsn(CHECKCAST, boxedType.getInternalName()); String valueMethodDescriptor = Type.getMethodDescriptor(targetType); methodVisitor.visitMethodInsn(INVOKEVIRTUAL, boxedType.getInternalName(), targetClass.getName() + "Value", valueMethodDescriptor, false); } else { methodVisitor.visitTypeInsn(CHECKCAST, targetClass.isArray() ? "[" + targetType.getElementType().getDescriptor() : targetType.getInternalName()); } }
/** * Unboxes or casts the value at the top of the stack. */
Unboxes or casts the value at the top of the stack
unboxOrCast
{ "repo_name": "robinverduijn/gradle", "path": "subprojects/model-core/src/main/java/org/gradle/internal/instantiation/generator/AsmBackedClassGenerator.java", "license": "apache-2.0", "size": 92283 }
[ "org.gradle.internal.reflect.JavaReflectionUtil", "org.objectweb.asm.MethodVisitor", "org.objectweb.asm.Type" ]
import org.gradle.internal.reflect.JavaReflectionUtil; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Type;
import org.gradle.internal.reflect.*; import org.objectweb.asm.*;
[ "org.gradle.internal", "org.objectweb.asm" ]
org.gradle.internal; org.objectweb.asm;
168,693
public static java.util.List extractPathResultDetailsList(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.PathologyResultDetailVoCollection voCollection) { return extractPathResultDetailsList(domainFactory, voCollection, null, new HashMap()); }
static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.PathologyResultDetailVoCollection voCollection) { return extractPathResultDetailsList(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.ocrr.orderingresults.domain.objects.PathResultDetails list from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.ocrr.orderingresults.domain.objects.PathResultDetails list from the value object collection
extractPathResultDetailsList
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/domain/PathologyResultDetailVoAssembler.java", "license": "agpl-3.0", "size": 18208 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,713,919
public static JBitmapDrawable parseImageFromDisk(InputStream is, Point imageSize, int screenWidth, boolean resize, boolean allowTrim){ try{ Log.d("ImageParser", "InWidth: "+imageSize.x); Log.d("ImageParser", "InHeight: "+imageSize.y); Log.d("ImageParser", "Width: "+screenWidth); BitmapFactory.Options opts = getResizeOpts(imageSize, screenWidth, resize); Bitmap bmp = BitmapFactory.decodeStream(new BufferedInputStream(is), null, opts); Log.d("ImageParser", "RWidth: "+bmp.getWidth()); Log.d("ImageParser", "RHeight: "+bmp.getHeight()); if (allowTrim){ bmp = trimBitmap(bmp); Log.d("ImageParser", "TWidth: "+bmp.getWidth()); Log.d("ImageParser", "THeight: "+bmp.getHeight()); imageSize.x = bmp.getWidth(); imageSize.y = bmp.getHeight(); } JBitmapDrawable b = new JBitmapDrawable(bmp); if (imageSize.x == 0 || imageSize.y == 0){ imageSize.x = b.getWidth(); imageSize.y = b.getHeight(); } b.setDimensions(imageSize.x, imageSize.y); return b; }catch(OutOfMemoryError e){ System.out.println("ImageParser OOM exception"); System.gc(); return null; }catch (Exception ex){ ex.printStackTrace(); return null; } }
static JBitmapDrawable function(InputStream is, Point imageSize, int screenWidth, boolean resize, boolean allowTrim){ try{ Log.d(STR, STR+imageSize.x); Log.d(STR, STR+imageSize.y); Log.d(STR, STR+screenWidth); BitmapFactory.Options opts = getResizeOpts(imageSize, screenWidth, resize); Bitmap bmp = BitmapFactory.decodeStream(new BufferedInputStream(is), null, opts); Log.d(STR, STR+bmp.getWidth()); Log.d(STR, STR+bmp.getHeight()); if (allowTrim){ bmp = trimBitmap(bmp); Log.d(STR, STR+bmp.getWidth()); Log.d(STR, STR+bmp.getHeight()); imageSize.x = bmp.getWidth(); imageSize.y = bmp.getHeight(); } JBitmapDrawable b = new JBitmapDrawable(bmp); if (imageSize.x == 0 imageSize.y == 0){ imageSize.x = b.getWidth(); imageSize.y = b.getHeight(); } b.setDimensions(imageSize.x, imageSize.y); return b; }catch(OutOfMemoryError e){ System.out.println(STR); System.gc(); return null; }catch (Exception ex){ ex.printStackTrace(); return null; } }
/** * Purpose: Parse a displayable object from a stream. * @param is InputStream to parse a file from. * Could be InputFileStream, ByteArrayInputStream, etc. * @param imageSize Height/Width of image * @return Return a JBitmapDrawable object to be displayed. * */
Purpose: Parse a displayable object from a stream
parseImageFromDisk
{ "repo_name": "koroshiya/JComic", "path": "app/src/main/java/com/koroshiya/io_utils/ImageParser.java", "license": "mit", "size": 13085 }
[ "android.graphics.Bitmap", "android.graphics.BitmapFactory", "android.graphics.Point", "android.util.Log", "com.koroshiya.controls.JBitmapDrawable", "java.io.BufferedInputStream", "java.io.InputStream" ]
import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Point; import android.util.Log; import com.koroshiya.controls.JBitmapDrawable; import java.io.BufferedInputStream; import java.io.InputStream;
import android.graphics.*; import android.util.*; import com.koroshiya.controls.*; import java.io.*;
[ "android.graphics", "android.util", "com.koroshiya.controls", "java.io" ]
android.graphics; android.util; com.koroshiya.controls; java.io;
2,815,161
EClass getTransitionType();
EClass getTransitionType();
/** * Returns the meta object for class '{@link org.ebxml.business.process.TransitionType <em>Transition Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Transition Type</em>'. * @see org.ebxml.business.process.TransitionType * @generated */
Returns the meta object for class '<code>org.ebxml.business.process.TransitionType Transition Type</code>'.
getTransitionType
{ "repo_name": "GRA-UML/tool", "path": "plugins/org.ijis.gra.ebxml.ebBPSS/src/main/java/org/ebxml/business/process/ProcessPackage.java", "license": "epl-1.0", "size": 274455 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,355,898
public static BigDecimal getAppointmentRequestedStandardHoursTotal(List<PendingBudgetConstructionAppointmentFunding> AppointmentFundings) { return getStandarHours(getAppointmentRequestedTimePercentTotal(AppointmentFundings)); }
static BigDecimal function(List<PendingBudgetConstructionAppointmentFunding> AppointmentFundings) { return getStandarHours(getAppointmentRequestedTimePercentTotal(AppointmentFundings)); }
/** * calcaulte the total requested standard hours for the given appointment funding lines * * @param AppointmentFundings the given appointment funding lines * @return the total requested standard hours for the given appointment funding lines */
calcaulte the total requested standard hours for the given appointment funding lines
getAppointmentRequestedStandardHoursTotal
{ "repo_name": "UniversityOfHawaii/kfs", "path": "kfs-bc/src/main/java/org/kuali/kfs/module/bc/util/SalarySettingCalculator.java", "license": "agpl-3.0", "size": 14523 }
[ "java.math.BigDecimal", "java.util.List", "org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding" ]
import java.math.BigDecimal; import java.util.List; import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding;
import java.math.*; import java.util.*; import org.kuali.kfs.module.bc.businessobject.*;
[ "java.math", "java.util", "org.kuali.kfs" ]
java.math; java.util; org.kuali.kfs;
2,739,680
@Test public void testParseFetcherConf1() { FetcherConfiguration fetcherConf = new FetcherConfiguration(document1.getDocumentElement()); assertEquals(fetcherConf.getFetchersConfigurationData().size(), 2); }
void function() { FetcherConfiguration fetcherConf = new FetcherConfiguration(document1.getDocumentElement()); assertEquals(fetcherConf.getFetchersConfigurationData().size(), 2); }
/** * Correctly configured fetcher */
Correctly configured fetcher
testParseFetcherConf1
{ "repo_name": "qubole/dr-elephant", "path": "test/com/linkedin/drelephant/configurations/fetcher/FetcherConfigurationTest.java", "license": "apache-2.0", "size": 5134 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,917,844
@ApiModelProperty(value = "Name of branding theme") public String getName() { return name; }
@ApiModelProperty(value = STR) String function() { return name; }
/** * Name of branding theme * * @return name */
Name of branding theme
getName
{ "repo_name": "SidneyAllen/Xero-Java", "path": "src/main/java/com/xero/models/accounting/BrandingTheme.java", "license": "mit", "size": 6116 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,805,165
public void delete(DataSet entity);
void function(DataSet entity);
/** * Deletes the given DataSet. */
Deletes the given DataSet
delete
{ "repo_name": "CBSti/csv2DB", "path": "src/main/java/de/peterspan/csv2db/domain/dao/IDBOperationsBase.java", "license": "gpl-3.0", "size": 4316 }
[ "de.peterspan.csv2db.domain.entities.DataSet" ]
import de.peterspan.csv2db.domain.entities.DataSet;
import de.peterspan.csv2db.domain.entities.*;
[ "de.peterspan.csv2db" ]
de.peterspan.csv2db;
516,249
public HttpBackOffUnsuccessfulResponseHandler setSleeper(Sleeper sleeper) { this.sleeper = Preconditions.checkNotNull(sleeper); return this; } /** * {@inheritDoc}
HttpBackOffUnsuccessfulResponseHandler function(Sleeper sleeper) { this.sleeper = Preconditions.checkNotNull(sleeper); return this; } /** * {@inheritDoc}
/** * Sets the sleeper. * * <p> * The default value is {@link Sleeper#DEFAULT}. * </p> * * <p> * Overriding is only supported for the purpose of calling the super implementation and changing * the return type, but nothing else. * </p> */
Sets the sleeper. The default value is <code>Sleeper#DEFAULT</code>. Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setSleeper
{ "repo_name": "veraicon/google-http-java-client", "path": "google-http-client/src/main/java/com/google/api/client/http/HttpBackOffUnsuccessfulResponseHandler.java", "license": "apache-2.0", "size": 5378 }
[ "com.google.api.client.util.Preconditions", "com.google.api.client.util.Sleeper" ]
import com.google.api.client.util.Preconditions; import com.google.api.client.util.Sleeper;
import com.google.api.client.util.*;
[ "com.google.api" ]
com.google.api;
130,375
@SuppressWarnings("rawtypes") public void loadMetadata() throws FileNotFoundException, IOException, SPSSFileException { long filePointer; int recordType; if (isMetadataLoaded) throw new SPSSFileException("Metadata is already loaded"); int varIndex = 0; seek(0); // Read the Type 1 record (info) infoRecord = new SPSSRecordType1(); infoRecord.read(this); log(infoRecord.toString()); // Init Type 2 records map (variables) (need "linked" hash map to retain // natural order) variableMap = new LinkedHashMap<Integer, SPSSVariable>(); variableShortNameMap = new LinkedHashMap<String, SPSSVariable>(); // Read Type 2 records (at least one) // This was changed from for(int i=0; i < // this.infoRecord.OBSperObservation; i++) { // to work the open source SPSSWriter who does not set OBSPerObservation int count = 0; do { // log("reading variableRecord record "+(i+1)+" of " + // this.info.OBSperObservation); SPSSRecordType2 type2Record = new SPSSRecordType2(); type2Record.read(this); // ignore string continuation records (variableTypeCode = -1) if (type2Record.variableTypeCode >= 0) { log(type2Record.toString()); // create a new variable SPSSVariable var; if (type2Record.variableTypeCode == 0) { var = new SPSSNumericVariable(this); } else { var = new SPSSStringVariable(this); } // saves this record in the variable var.variableRecord = type2Record; // initialize the variable name var.variableShortName = type2Record.name; var.variableName = type2Record.name; // add variableMap to dictionary variableMap.put(count, var); var.variableNumber = variableMap.size(); // add missing values as categories if (type2Record.missingValueFormatCode > 0) { // 1-3 --> discrete missing value codes (up to three) for (int j = 0; j < type2Record.missingValueFormatCode; j++) { // if the value does not exist as a regular category, we // need to create the catgry SPSSVariableCategory cat = var.addCategory(type2Record.missingValue[j], ""); cat.isMissing = true; } } else if (type2Record.missingValueFormatCode <= -2) { // -2 --> range of missing value codes // Note1: This is only allowed for numeric variable // Note2: We assume that the range ius made of integral // values and increments by 1!! int from = (int) SPSSUtils.byte8ToDouble(type2Record.missingValue[0]); int to = (int) SPSSUtils.byte8ToDouble(type2Record.missingValue[1]); for (int j = from; j <= to; j++) { SPSSVariableCategory cat = ((SPSSNumericVariable) var).addCategory((double) j, ""); cat.isMissing = true; } if (type2Record.missingValueFormatCode == -3) { // -3 --> an extra discrete value is also specified SPSSVariableCategory cat = var.addCategory(type2Record.missingValue[2], ""); cat.isMissing = true; } } } // read next record type count++; filePointer = getFilePointer(); recordType = readSPSSInt(); seek(filePointer); } while (recordType == 2); if (infoRecord.OBSperObservation == -1) { // SPSSWriter does not seem to set this value in the // Info Record so set it here... infoRecord.OBSperObservation = count; } // log log("\n# VARIABLES: " + variableMap.size()); // Loop over other records until we find the record type 999 do { // get filePointer and read the record type filePointer = getFilePointer(); recordType = readSPSSInt(); switch (recordType) { case 3: // Value label sets (and associated variableMap index record // type 4) // rewind seek(filePointer); // read type 3 SPSSRecordType3 record3 = new SPSSRecordType3(); record3.read(this); log(record3.toString()); // read type 4 record (that must follow type 3!) SPSSRecordType4 record4 = new SPSSRecordType4(); record4.read(this); log(record4.toString()); // associate this value label set with variableMap(s) (usually // only one variable) for (int i = 0; i < record4.numberOfVariables; i++) { SPSSVariable var = variableMap.get(record4.variableIndex[i] - 1); // SPSS // variableMap // index // is // 1-based var.valueLabelRecord = record3; // add each category to the variable list Iterator<?> catIterator = record3.valueLabel.keySet().iterator(); while (catIterator.hasNext()) { byte[] key = (byte[]) catIterator.next(); var.addCategory(key, record3.valueLabel.get(key)); } } break; case 6: // rewind seek(filePointer); // read SPSSRecordType6 record6 = new SPSSRecordType6(); record6.read(this); log(record6.toString()); break; case 7: // read Subtype int subrecordType; subrecordType = readSPSSInt(); // rewind seek(filePointer); switch (subrecordType) { case 3: integerInformationRecord = new SPSSRecordType7Subtype3(); integerInformationRecord.read(this); log(integerInformationRecord.toString()); break; case 4: floatInformationRecord = new SPSSRecordType7Subtype4(); floatInformationRecord.read(this); log(floatInformationRecord.toString()); break; case 5: variableSetsInformationRecord = new SPSSRecordType7Subtype5(); variableSetsInformationRecord.read(this); log(variableSetsInformationRecord.toString()); break; case 11: // Variable display parameters variableDisplayParamsRecord = new SPSSRecordType7Subtype11(); variableDisplayParamsRecord.read(this); log(variableDisplayParamsRecord.toString()); // update variables varIndex = 0; for (SPSSRecordType7Subtype11.VariableDisplayParams params : variableDisplayParamsRecord.variableDisplayParams) { getVariable(varIndex).measure = params.measure; getVariable(varIndex).displayWidth = params.width; getVariable(varIndex).alignment = params.alignment; varIndex++; } break; case 13: // Long variable names longVariableNamesRecord = new SPSSRecordType7Subtype13(); longVariableNamesRecord.read(this); log(longVariableNamesRecord.toString()); // iterate through all variables and remove the ones that // are in the map SPSSVariable currentVar = null; int deletedCount = 0; Iterator<?> it = variableMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); SPSSVariable var = (SPSSVariable) entry.getValue(); String shortName = var.getShortName(); String longName = longVariableNamesRecord.nameMap.get(shortName); if (longName != null && !longName.isEmpty()) { currentVar = var; var.variableName = longName; var.variableNumber -= deletedCount; variableShortNameMap.put(shortName, var); } else { // this must be a segment variable of a string // variable stored in currentVar if (currentVar instanceof SPSSStringVariable) { ((SPSSStringVariable) currentVar).segments.add(var); it.remove(); deletedCount++; } else { throw new SPSSFileException("Variable " + var.getName() + " is not in the variable dictionary and is not a segment of a string variable."); } } } break; case 14: veryLongStringVariableRecord = new SPSSRecordType7Subtype14(); veryLongStringVariableRecord.read(this); log(veryLongStringVariableRecord.toString()); // Correct variable lengths for (Map.Entry<String, Integer> entry : veryLongStringVariableRecord.entries()) { SPSSVariable variable = variableShortNameMap.get(entry.getKey()); if (variable != null && variable instanceof SPSSStringVariable) { ((SPSSStringVariable) variable).setLength(entry.getValue()); } } break; case 21: // Long string value labels SPSSRecordType7Subtype21 recordType7Subtype21 = new SPSSRecordType7Subtype21(); recordType7Subtype21.read(this); log(recordType7Subtype21.toString()); for (SPSSRecordType7Subtype21.Variable variable : recordType7Subtype21.getVariables()) { // associate this value label set with variableMap(s) // (usually only one variable) SPSSVariable var = getVariableByName(variable.getName()); if (var == null) { throw new SPSSFileException("Invalid variable name " + variable.getName()); } // add each category to the variable list for (SPSSRecordType7Subtype21.Label label : variable.getLabels()) { var.addCategory(label.getValue().getBytes(), label.getLabel()); } } break; default: // generic type 7 SPSSRecordType7 record7 = new SPSSRecordType7(); record7.read(this); log(record7.toString()); break; } break; case 999: // end of dictionnary // record type 999 contains a single integer equal to 0 log("\nRECORD TYPE 999 - START OF DATA"); log("location " + getFilePointer()); if (readSPSSInt() != 0) throw new SPSSFileException("Error reading record type 999: Non-zero value found."); // This location s where the data starts dataStartPosition = getFilePointer(); break; default: throw new SPSSFileException("Read error: invalid record type [" + recordType + "]"); } } while (recordType != 999); isMetadataLoaded = true; }
@SuppressWarnings(STR) void function() throws FileNotFoundException, IOException, SPSSFileException { long filePointer; int recordType; if (isMetadataLoaded) throw new SPSSFileException(STR); int varIndex = 0; seek(0); infoRecord = new SPSSRecordType1(); infoRecord.read(this); log(infoRecord.toString()); variableMap = new LinkedHashMap<Integer, SPSSVariable>(); variableShortNameMap = new LinkedHashMap<String, SPSSVariable>(); int count = 0; do { SPSSRecordType2 type2Record = new SPSSRecordType2(); type2Record.read(this); if (type2Record.variableTypeCode >= 0) { log(type2Record.toString()); SPSSVariable var; if (type2Record.variableTypeCode == 0) { var = new SPSSNumericVariable(this); } else { var = new SPSSStringVariable(this); } var.variableRecord = type2Record; var.variableShortName = type2Record.name; var.variableName = type2Record.name; variableMap.put(count, var); var.variableNumber = variableMap.size(); if (type2Record.missingValueFormatCode > 0) { for (int j = 0; j < type2Record.missingValueFormatCode; j++) { SPSSVariableCategory cat = var.addCategory(type2Record.missingValue[j], STRSTRSTR\n# VARIABLES: STRVariable STR is not in the variable dictionary and is not a segment of a string variable.STRInvalid variable name STR\nRECORD TYPE 999 - START OF DATASTRlocation STRError reading record type 999: Non-zero value found.STRRead error: invalid record type [STR]"); } } while (recordType != 999); isMetadataLoaded = true; }
/** * Loads the dictionary and other SPSS metadata from the file * * @throws FileNotFoundException * @throws IOException * @throws SPSSFileException */
Loads the dictionary and other SPSS metadata from the file
loadMetadata
{ "repo_name": "mikera/clj-spss", "path": "src/main/java/org/opendatafoundation/data/spss/SPSSFile.java", "license": "lgpl-3.0", "size": 61082 }
[ "java.io.FileNotFoundException", "java.io.IOException", "java.util.LinkedHashMap" ]
import java.io.FileNotFoundException; import java.io.IOException; import java.util.LinkedHashMap;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,887,835
private void newListStyle(String name, String[] specArray, String spacing, boolean showAllLevels) { Pattern numFormatPattern = Pattern.compile("([1IiAa])"); Pattern cssLengthPattern = Pattern.compile("([^a-z]+)\\s*([a-z]+)?"); String numPrefix = ""; String numSuffix = ""; String numberFormat = ""; Matcher m; double cssLengthNum; String cssLengthUnits; int displayLevels; OdfTextListLevelStyleNumber number; OdfTextListLevelStyleBullet bullet; TextListLevelStyleElementBase styleItem; this.setStyleNameAttribute(name); // split up the spacing into length and units m = cssLengthPattern.matcher(spacing); if (m.find()) { try { cssLengthNum = Double.parseDouble(m.group(1)); } catch (NumberFormatException oops) { cssLengthNum = 0.0; } cssLengthUnits = (m.group(2) == null) ? "" : m.group(2); } else { cssLengthNum = 0; cssLengthUnits = ""; } for (int i = 0; i < Math.min(specArray.length, MAX_LIST_LEVEL); i++) { specArray[i] = specArray[i].trim(); m = numFormatPattern.matcher( specArray[i] ); if (m.find()) // if it has 1, I, i, A, or a, it's a numbering style { numberFormat = m.group(1); numPrefix = specArray[i].substring( 0, m.start(1) ); numSuffix = specArray[i].substring( m.end(1) ); displayLevels = (showAllLevels) ? (i+1) : 1; number = new OdfTextListLevelStyleNumber( (OdfFileDom)this.ownerDocument); number.setStyleNumPrefixAttribute(numPrefix); number.setStyleNumFormatAttribute(numberFormat); number.setStyleNumSuffixAttribute(numSuffix); number.setTextDisplayLevelsAttribute( displayLevels ); styleItem = number; } else // it's a bullet style { bullet = new OdfTextListLevelStyleBullet( (OdfFileDom)this.ownerDocument); bullet.setStyleNumPrefixAttribute(""); bullet.setStyleNumSuffixAttribute(""); if (!specArray[i].equals("")) { bullet.setTextBulletCharAttribute(specArray[i].substring(0,1)); } else { bullet.setTextBulletCharAttribute(""); } styleItem = bullet; } styleItem.setTextLevelAttribute(i+1); styleItem.setProperty(OdfListLevelProperties.SpaceBefore, Double.toString(cssLengthNum * (i+1)) + cssLengthUnits); styleItem.setProperty(OdfListLevelProperties.MinLabelWidth, Double.toString(cssLengthNum) + cssLengthUnits); this.appendChild(styleItem); } }
void function(String name, String[] specArray, String spacing, boolean showAllLevels) { Pattern numFormatPattern = Pattern.compile(STR); Pattern cssLengthPattern = Pattern.compile(STR); String numPrefix = STRSTRSTRSTRSTRSTRSTRSTR"); } styleItem = bullet; } styleItem.setTextLevelAttribute(i+1); styleItem.setProperty(OdfListLevelProperties.SpaceBefore, Double.toString(cssLengthNum * (i+1)) + cssLengthUnits); styleItem.setProperty(OdfListLevelProperties.MinLabelWidth, Double.toString(cssLengthNum) + cssLengthUnits); this.appendChild(styleItem); } }
/** * Creates the OdfTextListStyle element. * This is a utility routine called by the constructors. * @param name the <code>style:name</code> of this list style * @param specArray specifications for each level of the list * @param spacing a CSS length that gives the amount of space before * a label and the minimum label width * @param showAllLevels if true, display all levels of a numbered list item */
Creates the OdfTextListStyle element. This is a utility routine called by the constructors
newListStyle
{ "repo_name": "jbjonesjr/geoproponis", "path": "external/odfdom-java-0.8.10-incubating-sources/org/odftoolkit/odfdom/incubator/doc/text/OdfTextListStyle.java", "license": "gpl-2.0", "size": 9009 }
[ "java.util.regex.Pattern", "org.odftoolkit.odfdom.dom.style.props.OdfListLevelProperties" ]
import java.util.regex.Pattern; import org.odftoolkit.odfdom.dom.style.props.OdfListLevelProperties;
import java.util.regex.*; import org.odftoolkit.odfdom.dom.style.props.*;
[ "java.util", "org.odftoolkit.odfdom" ]
java.util; org.odftoolkit.odfdom;
2,451,774
public void removeAllFather() { Connection con = getConnection(); try { ContactDAO.removeAllFather(con, pk); } catch (Exception re) { throw new ContactRuntimeException("ContactEJB.removeAllFather()", SilverpeasRuntimeException.ERROR, "contact.EX_CONTACT_REMOVE_FROM_ALLFATHERS_FAILED", re); } finally { closeConnection(con); } }
void function() { Connection con = getConnection(); try { ContactDAO.removeAllFather(con, pk); } catch (Exception re) { throw new ContactRuntimeException(STR, SilverpeasRuntimeException.ERROR, STR, re); } finally { closeConnection(con); } }
/** * Remove all fathers to this contact - this contact will be linked to no Node * @exception java.sql.SQLException * @since 1.0 */
Remove all fathers to this contact - this contact will be linked to no Node
removeAllFather
{ "repo_name": "stephaneperry/Silverpeas-Core", "path": "ejb-core/contact/src/main/java/com/stratelia/webactiv/util/contact/ejb/ContactEJB.java", "license": "agpl-3.0", "size": 12878 }
[ "com.stratelia.webactiv.util.contact.model.ContactRuntimeException", "com.stratelia.webactiv.util.exception.SilverpeasRuntimeException", "java.sql.Connection" ]
import com.stratelia.webactiv.util.contact.model.ContactRuntimeException; import com.stratelia.webactiv.util.exception.SilverpeasRuntimeException; import java.sql.Connection;
import com.stratelia.webactiv.util.contact.model.*; import com.stratelia.webactiv.util.exception.*; import java.sql.*;
[ "com.stratelia.webactiv", "java.sql" ]
com.stratelia.webactiv; java.sql;
1,290,610
HRegionLocation relocateRegion(final TableName tableName, final byte [] row) throws IOException;
HRegionLocation relocateRegion(final TableName tableName, final byte [] row) throws IOException;
/** * Find the location of the region of <i>tableName</i> that <i>row</i> * lives in, ignoring any value that might be in the cache. * @param tableName name of the table <i>row</i> is in * @param row row key you're trying to find the region of * @return HRegionLocation that describes where to find the region in * question * @throws IOException if a remote or network exception occurs */
Find the location of the region of tableName that row lives in, ignoring any value that might be in the cache
relocateRegion
{ "repo_name": "intel-hadoop/hbase-rhino", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClusterConnection.java", "license": "apache-2.0", "size": 7832 }
[ "java.io.IOException", "org.apache.hadoop.hbase.HRegionLocation", "org.apache.hadoop.hbase.TableName" ]
import java.io.IOException; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.TableName;
import java.io.*; import org.apache.hadoop.hbase.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
86,497
private void fakePassTestRunBatch(TestBatch batch) { for (TestIdentifier test : batch.tests) { CLog.d("Marking '%s' invocation in config '%s' as passed without running", test.toString(), batch.config.getId()); mInstanceListerner.skipTest(test); } }
void function(TestBatch batch) { for (TestIdentifier test : batch.tests) { CLog.d(STR, test.toString(), batch.config.getId()); mInstanceListerner.skipTest(test); } }
/** * Pass given batch tests without running it */
Pass given batch tests without running it
fakePassTestRunBatch
{ "repo_name": "chadversary/deqp", "path": "android/cts/runner/src/com/drawelements/deqp/runner/DeqpTestRunner.java", "license": "apache-2.0", "size": 81735 }
[ "com.android.ddmlib.testrunner.TestIdentifier", "com.android.tradefed.log.LogUtil" ]
import com.android.ddmlib.testrunner.TestIdentifier; import com.android.tradefed.log.LogUtil;
import com.android.ddmlib.testrunner.*; import com.android.tradefed.log.*;
[ "com.android.ddmlib", "com.android.tradefed" ]
com.android.ddmlib; com.android.tradefed;
2,379,164
public String getEndDate(String dateFormat){ DateFormat df = new SimpleDateFormat(dateFormat,Locale.getDefault()); String date = df.format(end); return date; }
String function(String dateFormat){ DateFormat df = new SimpleDateFormat(dateFormat,Locale.getDefault()); String date = df.format(end); return date; }
/** * Get the end date of the event * * @return end date */
Get the end date of the event
getEndDate
{ "repo_name": "ur13l/Guanajoven", "path": "extendedCalendarView/src/main/java/com/tyczj/extendedcalendarview/Event.java", "license": "gpl-3.0", "size": 2130 }
[ "java.text.DateFormat", "java.text.SimpleDateFormat", "java.util.Locale" ]
import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,584,135
@RequestMapping(value = "", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public PagedResources<TaskExecutionResource> list(Pageable pageable, PagedResourcesAssembler<TaskExecution> assembler) { Page page = explorer.findAll(pageable); return assembler.toResource(page, taskAssembler); }
@RequestMapping(value = "", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) PagedResources<TaskExecutionResource> function(Pageable pageable, PagedResourcesAssembler<TaskExecution> assembler) { Page page = explorer.findAll(pageable); return assembler.toResource(page, taskAssembler); }
/** * Return a page-able list of {@link TaskExecutionResource} defined tasks. * * @param pageable page-able collection of {@code TaskExecution}s. * @param assembler for the {@link TaskExecution}s * @return a list of task executions */
Return a page-able list of <code>TaskExecutionResource</code> defined tasks
list
{ "repo_name": "pperalta/spring-cloud-dataflow", "path": "spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/TaskExecutionController.java", "license": "apache-2.0", "size": 5368 }
[ "org.springframework.cloud.dataflow.rest.resource.TaskExecutionResource", "org.springframework.cloud.task.repository.TaskExecution", "org.springframework.data.domain.Page", "org.springframework.data.domain.Pageable", "org.springframework.data.web.PagedResourcesAssembler", "org.springframework.hateoas.PagedResources", "org.springframework.http.HttpStatus", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.ResponseStatus" ]
import org.springframework.cloud.dataflow.rest.resource.TaskExecutionResource; import org.springframework.cloud.task.repository.TaskExecution; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PagedResourcesAssembler; import org.springframework.hateoas.PagedResources; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.cloud.dataflow.rest.resource.*; import org.springframework.cloud.task.repository.*; import org.springframework.data.domain.*; import org.springframework.data.web.*; import org.springframework.hateoas.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "org.springframework.cloud", "org.springframework.data", "org.springframework.hateoas", "org.springframework.http", "org.springframework.web" ]
org.springframework.cloud; org.springframework.data; org.springframework.hateoas; org.springframework.http; org.springframework.web;
2,778,797
boolean seek(Device device, String targetPosition);
boolean seek(Device device, String targetPosition);
/** * Seek the playing video to a target position. * * @param device * The device be controlled. * @param targetPosition * Target position we want to set. * @return */
Seek the playing video to a target position
seek
{ "repo_name": "lxxgreat/VideoPlayer", "path": "app/src/main/java/com/shane/android/videoplayer/interf/IController.java", "license": "mit", "size": 3180 }
[ "org.cybergarage.upnp.Device" ]
import org.cybergarage.upnp.Device;
import org.cybergarage.upnp.*;
[ "org.cybergarage.upnp" ]
org.cybergarage.upnp;
1,939,421
public final Iterator<String> getCertPathEncodings() { return spiImpl.engineGetCertPathEncodings(); }
final Iterator<String> function() { return spiImpl.engineGetCertPathEncodings(); }
/** * Returns an {@code Iterator} over the supported {@code CertPath} encodings * (as Strings). The first element is the default encoding scheme to apply. * * @return an iterator over supported {@link CertPath} encodings (as * Strings). */
Returns an Iterator over the supported CertPath encodings (as Strings). The first element is the default encoding scheme to apply
getCertPathEncodings
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/security/src/main/java/common/java/security/cert/CertificateFactory.java", "license": "gpl-2.0", "size": 12265 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,504,877
@Override public Object eval(EventWrapper inWrapper) throws IOException { Number lowerBound = (Number) mPrevSize.eval(inWrapper); long lowerBoundMillis = -1L * lowerBound.longValue() * mPrevScale.getMultiplier(); Number upperBound = (Number) mAfterSize.eval(inWrapper); long upperBoundMillis = upperBound.longValue() * mAfterScale.getMultiplier(); return new TimeSpan(lowerBoundMillis, upperBoundMillis, true); }
Object function(EventWrapper inWrapper) throws IOException { Number lowerBound = (Number) mPrevSize.eval(inWrapper); long lowerBoundMillis = -1L * lowerBound.longValue() * mPrevScale.getMultiplier(); Number upperBound = (Number) mAfterSize.eval(inWrapper); long upperBoundMillis = upperBound.longValue() * mAfterScale.getMultiplier(); return new TimeSpan(lowerBoundMillis, upperBoundMillis, true); }
/** * Return a relative TimeSpan interval describing the number of milliseconds * prior which this timespan encompasses. */
Return a relative TimeSpan interval describing the number of milliseconds prior which this timespan encompasses
eval
{ "repo_name": "flumebase/flumebase", "path": "src/main/java/com/odiago/flumebase/parser/RangeSpec.java", "license": "apache-2.0", "size": 4263 }
[ "com.odiago.flumebase.exec.EventWrapper", "com.odiago.flumebase.lang.TimeSpan", "java.io.IOException" ]
import com.odiago.flumebase.exec.EventWrapper; import com.odiago.flumebase.lang.TimeSpan; import java.io.IOException;
import com.odiago.flumebase.exec.*; import com.odiago.flumebase.lang.*; import java.io.*;
[ "com.odiago.flumebase", "java.io" ]
com.odiago.flumebase; java.io;
2,769,402
public void paint(java.awt.Graphics g) { Debug.message("dted", getName() + "|DTEDLayer.paint()"); super.paint(g); if (location != null) location.render(g); location = null; }
void function(java.awt.Graphics g) { Debug.message("dted", getName() + STR); super.paint(g); if (location != null) location.render(g); location = null; }
/** * Paints the layer. * * @param g the Graphics context for painting */
Paints the layer
paint
{ "repo_name": "d2fn/passage", "path": "src/main/java/com/bbn/openmap/layer/dted/DTEDLayer.java", "license": "mit", "size": 30813 }
[ "com.bbn.openmap.util.Debug" ]
import com.bbn.openmap.util.Debug;
import com.bbn.openmap.util.*;
[ "com.bbn.openmap" ]
com.bbn.openmap;
2,373,130
protected void setCallbackState(int state, IOException ioe) { this.callback_state = state; this.readException = ioe; }
void function(int state, IOException ioe) { this.callback_state = state; this.readException = ioe; }
/** * Set the state of the read-ahead callback to the input value, along with * saving the exception (if non-null) in an error situation. * * @param state * @param ioe */
Set the state of the read-ahead callback to the input value, along with saving the exception (if non-null) in an error situation
setCallbackState
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java", "license": "epl-1.0", "size": 108351 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
80,034
public static String getBaseDocUrl() { return BaseMessages.getString( PKG, "Const.BaseDocUrl" ); }
static String function() { return BaseMessages.getString( PKG, STR ); }
/** * Provides the base documentation url (top-level help) * * @return the fully qualified base documentation URL */
Provides the base documentation url (top-level help)
getBaseDocUrl
{ "repo_name": "e-cuellar/pentaho-kettle", "path": "core/src/main/java/org/pentaho/di/core/Const.java", "license": "apache-2.0", "size": 121114 }
[ "org.pentaho.di.i18n.BaseMessages" ]
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.i18n.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,793,574
@Test public void testModelImmutableSchemaCannotContainMaterialization() throws Exception { CalciteAssert.model("{\n" + " version: '1.0',\n" + " defaultSchema: 'adhoc',\n" + " schemas: [\n" + " {\n" + " name: 'empty'\n" + " },\n" + " {\n" + " name: 'adhoc',\n" + " type: 'custom',\n" + " factory: '" + JdbcTest.MySchemaFactory.class.getName() + "',\n" + " operand: {\n" + " 'tableName': 'ELVIS',\n" + " 'mutable': false\n" + " },\n" + " materializations: [\n" + " {\n" + " table: 'v',\n" + " sql: 'values (1)'\n" + " }\n" + " ]\n" + " }\n" + " ]\n" + "}") .connectThrows("Cannot define materialization; parent schema 'adhoc' " + "is not a SemiMutableSchema"); }
@Test void function() throws Exception { CalciteAssert.model("{\n" + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + JdbcTest.MySchemaFactory.class.getName() + "',\n" + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + "}") .connectThrows(STR + STR); }
/** Tests that an immutable schema in a model cannot contain a * materialization. */
Tests that an immutable schema in a model cannot contain a
testModelImmutableSchemaCannotContainMaterialization
{ "repo_name": "joshelser/incubator-calcite", "path": "core/src/test/java/org/apache/calcite/test/ModelTest.java", "license": "apache-2.0", "size": 11413 }
[ "org.junit.Test" ]
import org.junit.Test;
import org.junit.*;
[ "org.junit" ]
org.junit;
710,423
public static Credential authorize() throws IOException { // Load client secrets. InputStream in = GoogleAuthHelper.class.getResourceAsStream("/client_secret.json"); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in)); // Build flow and trigger user authorization request. GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(httpTransport, JSON_FACTORY, clientSecrets, scopesAPI).setAccessType("offline").build(); return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); }
static Credential function() throws IOException { InputStream in = GoogleAuthHelper.class.getResourceAsStream(STR); GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in)); GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(httpTransport, JSON_FACTORY, clientSecrets, scopesAPI).setAccessType(STR).build(); return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user"); }
/** * Creates an authorized Credential object. * @return an authorized Credential object. * @throws IOException */
Creates an authorized Credential object
authorize
{ "repo_name": "vzwingma/automationManager", "path": "emailsWorkerBundle/src/main/java/com/terrier/utilities/automation/bundles/emails/worker/business/api/GoogleAuthHelper.java", "license": "gpl-2.0", "size": 3261 }
[ "com.google.api.client.auth.oauth2.Credential", "com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp", "com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver", "com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow", "com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets", "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader" ]
import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp; import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver; import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow; import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader;
import com.google.api.client.auth.oauth2.*; import com.google.api.client.extensions.java6.auth.oauth2.*; import com.google.api.client.extensions.jetty.auth.oauth2.*; import com.google.api.client.googleapis.auth.oauth2.*; import java.io.*;
[ "com.google.api", "java.io" ]
com.google.api; java.io;
1,839,871
public void testSwitchHistoricalRebalanceToFull( IgniteInClosure<IgniteEx> corruptWalClo, boolean needClientStart ) throws Exception { backups = 3; IgniteEx supplier1 = startGrid(0); IgniteEx supplier2 = startGrid(1); IgniteEx demander = startGrid(2); supplier1.cluster().state(ACTIVE); String supplier1Name = supplier1.localNode().consistentId().toString(); String supplier2Name = supplier2.localNode().consistentId().toString(); String demanderName = demander.localNode().consistentId().toString(); String cacheName1 = "test-cache-1"; String cacheName2 = "test-cache-2"; // Cache resides on supplier1 and demander nodes. IgniteCache<Integer, IndexedObject> c1 = supplier1.getOrCreateCache( new CacheConfiguration<Integer, IndexedObject>(cacheName1) .setBackups(backups) .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT)) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setRebalanceOrder(10) .setNodeFilter(n -> n.consistentId().equals(supplier1Name) || n.consistentId().equals(demanderName))); // Cache resides on supplier2 and demander nodes. IgniteCache<Integer, IndexedObject> c2 = supplier1.getOrCreateCache( new CacheConfiguration<Integer, IndexedObject>("test-cache-2") .setBackups(backups) .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT)) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setRebalanceOrder(20) .setNodeFilter(n -> n.consistentId().equals(supplier2Name) || n.consistentId().equals(demanderName))); // Fill initial data. final int entryCnt = PARTS_CNT * 200; final int preloadEntryCnt = PARTS_CNT * 400; for (int k = 0; k < preloadEntryCnt; k++) { c1.put(k, new IndexedObject(k)); c2.put(k, new IndexedObject(k)); } forceCheckpoint(); stopGrid(2); // Rewrite data to trigger further rebalance. for (int i = 0; i < entryCnt; i++) { c1.put(i, new IndexedObject(i)); c2.put(i, new IndexedObject(i)); } // Delay rebalance process for specified groups. blockMsgPred = (node, msg) -> { if (msg instanceof GridDhtPartitionDemandMessage) { GridDhtPartitionDemandMessage msg0 = (GridDhtPartitionDemandMessage)msg; return msg0.groupId() == CU.cacheId(cacheName1) || msg0.groupId() == CU.cacheId(cacheName2); } return false; }; Queue<RecordedDemandMessage> recorderedMsgs = new ConcurrentLinkedQueue<>(); // Record demand messages for specified groups. recordMsgPred = (node, msg) -> { if (msg instanceof GridDhtPartitionDemandMessage) { GridDhtPartitionDemandMessage msg0 = (GridDhtPartitionDemandMessage)msg; if (msg0.groupId() == CU.cacheId(cacheName1) || msg0.groupId() == CU.cacheId(cacheName2)) { recorderedMsgs.add(new RecordedDemandMessage( node.id(), msg0.groupId(), msg0.partitions().hasFull(), msg0.partitions().hasHistorical())); } } return false; }; // Delay rebalance process for specified group from supplier2. TestRecordingCommunicationSpi supplierSpi2 = TestRecordingCommunicationSpi.spi(supplier2); supplierSpi2.blockMessages((node, msg) -> { if (msg instanceof GridDhtPartitionSupplyMessage) { GridDhtPartitionSupplyMessage msg0 = (GridDhtPartitionSupplyMessage)msg; return node.consistentId().equals(demanderName) && msg0.groupId() == CU.cacheId(cacheName2); } return false; }); // Corrupt WAL on supplier1 corruptWalClo.apply(supplier1); // Trigger rebalance process from suppliers. IgniteEx restartedDemander = startGrid(2); recordMsgPred = null; blockMsgPred = null; TestRecordingCommunicationSpi demanderSpi = TestRecordingCommunicationSpi.spi(grid(2)); // Wait until demander starts historical rebalancning. demanderSpi.waitForBlocked(); final IgniteInternalFuture<Boolean> preloadFut1 = restartedDemander.cachex(cacheName1).context().group() .preloader().rebalanceFuture(); final IgniteInternalFuture<Boolean> preloadFut2 = restartedDemander.cachex(cacheName2).context().group() .preloader().rebalanceFuture(); if (needClientStart) startClientGrid(3); // Unblock messages and start tracking demand and supply messages. demanderSpi.stopBlock(); // Wait until rebalancing will be cancelled for both suppliers. GridTestUtils.waitForCondition(() -> preloadFut1.isDone() && preloadFut2.isDone(), getTestTimeout()); Assert.assertEquals( "Rebalance should be cancelled on demander node: " + preloadFut1, false, preloadFut1.get()); Assert.assertEquals( "Rebalance should be cancelled on demander node: " + preloadFut2, false, preloadFut2.get()); // Unblock supply messages from supplier2 supplierSpi2.stopBlock(); awaitPartitionMapExchange(true, true, null); // Check data consistency. assertPartitionsSame(idleVerify(restartedDemander, cacheName2, cacheName1)); // Check that historical rebalance switched to full for supplier1 and it is still historical for supplier2. IgnitePredicate<RecordedDemandMessage> histPred = (msg) -> msg.hasHistorical() && !msg.hasFull(); IgnitePredicate<RecordedDemandMessage> fullPred = (msg) -> !msg.hasHistorical() && msg.hasFull(); // Supplier1 List<RecordedDemandMessage> demandMsgsForSupplier1 = recorderedMsgs.stream() // Filter messages correspond to the supplier1 .filter(msg -> msg.groupId() == CU.cacheId(cacheName1)) // Filter out intermediate messages .filter(msg -> msg.hasFull() || msg.hasHistorical()) .collect(toList()); assertEquals("There should only two demand messages.", 2, demandMsgsForSupplier1.size()); assertTrue( "The first message should require historical rebalance [msg=" + demandMsgsForSupplier1.get(0) + ']', histPred.apply(demandMsgsForSupplier1.get(0))); assertTrue( "The second message should require full rebalance [msg=" + demandMsgsForSupplier1.get(0) + ']', fullPred.apply(demandMsgsForSupplier1.get(1))); // Supplier2 List<RecordedDemandMessage> demandMsgsForSupplier2 = recorderedMsgs.stream() // Filter messages correspond to the supplier2 .filter(msg -> msg.groupId() == CU.cacheId(cacheName2)) // Filter out intermediate messages .filter(msg -> msg.hasFull() || msg.hasHistorical()) .collect(toList()); assertEquals("There should only two demand messages.", 2, demandMsgsForSupplier2.size()); assertTrue( "Both messages should require historical rebalance [" + "msg=" + demandMsgsForSupplier2.get(0) + ", msg=" + demandMsgsForSupplier2.get(1) + ']', histPred.apply(demandMsgsForSupplier2.get(0)) && histPred.apply(demandMsgsForSupplier2.get(1))); }
void function( IgniteInClosure<IgniteEx> corruptWalClo, boolean needClientStart ) throws Exception { backups = 3; IgniteEx supplier1 = startGrid(0); IgniteEx supplier2 = startGrid(1); IgniteEx demander = startGrid(2); supplier1.cluster().state(ACTIVE); String supplier1Name = supplier1.localNode().consistentId().toString(); String supplier2Name = supplier2.localNode().consistentId().toString(); String demanderName = demander.localNode().consistentId().toString(); String cacheName1 = STR; String cacheName2 = STR; IgniteCache<Integer, IndexedObject> c1 = supplier1.getOrCreateCache( new CacheConfiguration<Integer, IndexedObject>(cacheName1) .setBackups(backups) .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT)) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setRebalanceOrder(10) .setNodeFilter(n -> n.consistentId().equals(supplier1Name) n.consistentId().equals(demanderName))); IgniteCache<Integer, IndexedObject> c2 = supplier1.getOrCreateCache( new CacheConfiguration<Integer, IndexedObject>(STR) .setBackups(backups) .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT)) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setRebalanceOrder(20) .setNodeFilter(n -> n.consistentId().equals(supplier2Name) n.consistentId().equals(demanderName))); final int entryCnt = PARTS_CNT * 200; final int preloadEntryCnt = PARTS_CNT * 400; for (int k = 0; k < preloadEntryCnt; k++) { c1.put(k, new IndexedObject(k)); c2.put(k, new IndexedObject(k)); } forceCheckpoint(); stopGrid(2); for (int i = 0; i < entryCnt; i++) { c1.put(i, new IndexedObject(i)); c2.put(i, new IndexedObject(i)); } blockMsgPred = (node, msg) -> { if (msg instanceof GridDhtPartitionDemandMessage) { GridDhtPartitionDemandMessage msg0 = (GridDhtPartitionDemandMessage)msg; return msg0.groupId() == CU.cacheId(cacheName1) msg0.groupId() == CU.cacheId(cacheName2); } return false; }; Queue<RecordedDemandMessage> recorderedMsgs = new ConcurrentLinkedQueue<>(); recordMsgPred = (node, msg) -> { if (msg instanceof GridDhtPartitionDemandMessage) { GridDhtPartitionDemandMessage msg0 = (GridDhtPartitionDemandMessage)msg; if (msg0.groupId() == CU.cacheId(cacheName1) msg0.groupId() == CU.cacheId(cacheName2)) { recorderedMsgs.add(new RecordedDemandMessage( node.id(), msg0.groupId(), msg0.partitions().hasFull(), msg0.partitions().hasHistorical())); } } return false; }; TestRecordingCommunicationSpi supplierSpi2 = TestRecordingCommunicationSpi.spi(supplier2); supplierSpi2.blockMessages((node, msg) -> { if (msg instanceof GridDhtPartitionSupplyMessage) { GridDhtPartitionSupplyMessage msg0 = (GridDhtPartitionSupplyMessage)msg; return node.consistentId().equals(demanderName) && msg0.groupId() == CU.cacheId(cacheName2); } return false; }); corruptWalClo.apply(supplier1); IgniteEx restartedDemander = startGrid(2); recordMsgPred = null; blockMsgPred = null; TestRecordingCommunicationSpi demanderSpi = TestRecordingCommunicationSpi.spi(grid(2)); demanderSpi.waitForBlocked(); final IgniteInternalFuture<Boolean> preloadFut1 = restartedDemander.cachex(cacheName1).context().group() .preloader().rebalanceFuture(); final IgniteInternalFuture<Boolean> preloadFut2 = restartedDemander.cachex(cacheName2).context().group() .preloader().rebalanceFuture(); if (needClientStart) startClientGrid(3); demanderSpi.stopBlock(); GridTestUtils.waitForCondition(() -> preloadFut1.isDone() && preloadFut2.isDone(), getTestTimeout()); Assert.assertEquals( STR + preloadFut1, false, preloadFut1.get()); Assert.assertEquals( STR + preloadFut2, false, preloadFut2.get()); supplierSpi2.stopBlock(); awaitPartitionMapExchange(true, true, null); assertPartitionsSame(idleVerify(restartedDemander, cacheName2, cacheName1)); IgnitePredicate<RecordedDemandMessage> histPred = (msg) -> msg.hasHistorical() && !msg.hasFull(); IgnitePredicate<RecordedDemandMessage> fullPred = (msg) -> !msg.hasHistorical() && msg.hasFull(); List<RecordedDemandMessage> demandMsgsForSupplier1 = recorderedMsgs.stream() .filter(msg -> msg.groupId() == CU.cacheId(cacheName1)) .filter(msg -> msg.hasFull() msg.hasHistorical()) .collect(toList()); assertEquals(STR, 2, demandMsgsForSupplier1.size()); assertTrue( STR + demandMsgsForSupplier1.get(0) + ']', histPred.apply(demandMsgsForSupplier1.get(0))); assertTrue( STR + demandMsgsForSupplier1.get(0) + ']', fullPred.apply(demandMsgsForSupplier1.get(1))); List<RecordedDemandMessage> demandMsgsForSupplier2 = recorderedMsgs.stream() .filter(msg -> msg.groupId() == CU.cacheId(cacheName2)) .filter(msg -> msg.hasFull() msg.hasHistorical()) .collect(toList()); assertEquals(STR, 2, demandMsgsForSupplier2.size()); assertTrue( STR + "msg=" + demandMsgsForSupplier2.get(0) + STR + demandMsgsForSupplier2.get(1) + ']', histPred.apply(demandMsgsForSupplier2.get(0)) && histPred.apply(demandMsgsForSupplier2.get(1))); }
/** * Tests that demander switches to full rebalance if the previously chosen supplier for a group has failed * to perform historical rebalance due to an unexpected error. * * @param corruptWalClo Closure that corrupts wal iterating on supplier node. * @param needClientStart {@code true} if client node should join the cluster between * the demand message sent and the supply message received. * @throws Exception If failed */
Tests that demander switches to full rebalance if the previously chosen supplier for a group has failed to perform historical rebalance due to an unexpected error
testSwitchHistoricalRebalanceToFull
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRebalanceTest.java", "license": "apache-2.0", "size": 55599 }
[ "java.util.List", "java.util.Queue", "java.util.concurrent.ConcurrentLinkedQueue", "org.apache.ignite.IgniteCache", "org.apache.ignite.cache.CacheWriteSynchronizationMode", "org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction", "org.apache.ignite.configuration.CacheConfiguration", "org.apache.ignite.internal.IgniteEx", "org.apache.ignite.internal.IgniteInternalFuture", "org.apache.ignite.internal.TestRecordingCommunicationSpi", "org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage", "org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage", "org.apache.ignite.internal.util.typedef.internal.CU", "org.apache.ignite.lang.IgniteInClosure", "org.apache.ignite.lang.IgnitePredicate", "org.apache.ignite.testframework.GridTestUtils", "org.junit.Assert" ]
import java.util.List; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.TestRecordingCommunicationSpi; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionDemandMessage; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionSupplyMessage; import org.apache.ignite.internal.util.typedef.internal.CU; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.testframework.GridTestUtils; import org.junit.Assert;
import java.util.*; import java.util.concurrent.*; import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.apache.ignite.cache.affinity.rendezvous.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.apache.ignite.testframework.*; import org.junit.*;
[ "java.util", "org.apache.ignite", "org.junit" ]
java.util; org.apache.ignite; org.junit;
119,810
public Path getTezDir(Path scratchDir) { return new Path(scratchDir, TEZ_DIR); }
Path function(Path scratchDir) { return new Path(scratchDir, TEZ_DIR); }
/** * Gets the tez dir that belongs to the hive scratch dir */
Gets the tez dir that belongs to the hive scratch dir
getTezDir
{ "repo_name": "vergilchiu/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java", "license": "apache-2.0", "size": 56122 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,799,164
public void explode(){ ArrayList<PhysicalEntity> entities= target.getEntities(); for(int i=0;i<entities.size();i++){ if(entities.get(i) instanceof AliveEnemyUnit){ ((AliveEnemyUnit) entities.get(i)).damage(power); } } }
void function(){ ArrayList<PhysicalEntity> entities= target.getEntities(); for(int i=0;i<entities.size();i++){ if(entities.get(i) instanceof AliveEnemyUnit){ ((AliveEnemyUnit) entities.get(i)).damage(power); } } }
/** * Explodes in the target and causes damage for the entities in that cell */
Explodes in the target and causes damage for the entities in that cell
explode
{ "repo_name": "altostratous/borooj", "path": "src/logic/controllers/Missile.java", "license": "gpl-2.0", "size": 1584 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
225,101
public void buttonSendName(View v) { if (name != null) { connectBluetooth.write(name); buttonSelectRounds.setVisibility(View.VISIBLE); buttonSendName.setVisibility(View.GONE); } else { g.showToast("Please enter a username!"); } }
void function(View v) { if (name != null) { connectBluetooth.write(name); buttonSelectRounds.setVisibility(View.VISIBLE); buttonSendName.setVisibility(View.GONE); } else { g.showToast(STR); } }
/** * Sends the name entered in the Loginscreen to iPlay. */
Sends the name entered in the Loginscreen to iPlay
buttonSendName
{ "repo_name": "noodle-/BluetoothRemote", "path": "app/src/main/java/com/hszuyd/bluetoothremote/TribotActivity.java", "license": "gpl-3.0", "size": 6657 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
1,153,224
boolean activationUp(int n) { Exception lastException = null; try { net.jini.activation.ActivationGroup.getSystem(); return true; } catch (ActivationException e) { lastException = e; } for(int i=0; i<n; i++) { try { net.jini.activation.ActivationGroup.getSystem(); return true; } catch (ActivationException e) { lastException = e; } try { Thread.sleep(1000); // wait 1 second } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (lastException != null) { logger.log(Level.SEVERE, "Act System wouldn't start", lastException); } return false; }
boolean activationUp(int n) { Exception lastException = null; try { net.jini.activation.ActivationGroup.getSystem(); return true; } catch (ActivationException e) { lastException = e; } for(int i=0; i<n; i++) { try { net.jini.activation.ActivationGroup.getSystem(); return true; } catch (ActivationException e) { lastException = e; } try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (lastException != null) { logger.log(Level.SEVERE, STR, lastException); } return false; }
/** * Tests for the existence of the ActivationSystem. This method * will always make at least one attempt to verify the existence of a * a running ActivationSystem. * * @param n <code>int</code> value representing the number of additional * attempts (beyond the initial attempt) to wait for the * activation system to come up. This values translates * directly to the number of seconds to wait for the * activation system. * * @return <code>true</code> if the activation system is up and running; * <code>false</code> otherwise */
Tests for the existence of the ActivationSystem. This method will always make at least one attempt to verify the existence of a a running ActivationSystem
activationUp
{ "repo_name": "pfirmstone/river-internet", "path": "qa/src/org/apache/river/qa/harness/QAConfig.java", "license": "apache-2.0", "size": 110034 }
[ "java.rmi.activation.ActivationException", "java.rmi.activation.ActivationGroup", "java.util.logging.Level" ]
import java.rmi.activation.ActivationException; import java.rmi.activation.ActivationGroup; import java.util.logging.Level;
import java.rmi.activation.*; import java.util.logging.*;
[ "java.rmi", "java.util" ]
java.rmi; java.util;
1,650,268
void registerDataSetObserver(DataSetObserver observer); /** * Unregister an observer that has previously been registered with * {@link #registerDataSetObserver(DataSetObserver)}
void registerDataSetObserver(DataSetObserver observer); /** * Unregister an observer that has previously been registered with * {@link #registerDataSetObserver(DataSetObserver)}
/** * Register an observer that is called when changes happen to this data set. * * @param observer gets notified when the data set changes. */
Register an observer that is called when changes happen to this data set
registerDataSetObserver
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/QuickSearchBox/src/com/android/quicksearchbox/SuggestionCursor.java", "license": "gpl-2.0", "size": 2422 }
[ "android.database.DataSetObserver" ]
import android.database.DataSetObserver;
import android.database.*;
[ "android.database" ]
android.database;
2,722,018
int deleteByExample(ItemConversionExample example);
int deleteByExample(ItemConversionExample example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table item_conversion * * @mbggenerated Mon Jul 27 08:50:25 ICT 2015 */
This method was generated by MyBatis Generator. This method corresponds to the database table item_conversion
deleteByExample
{ "repo_name": "punyararj/his-interface-core", "path": "HISIF_CORE/src/com/healthcare/db/client/ItemConversionMapper.java", "license": "gpl-3.0", "size": 3300 }
[ "com.healthcare.db.model.ItemConversionExample" ]
import com.healthcare.db.model.ItemConversionExample;
import com.healthcare.db.model.*;
[ "com.healthcare.db" ]
com.healthcare.db;
998,176
public static int getAlphaNumCount(final Buffer buffer) throws IndexOutOfBoundsException, IOException { boolean done = false; int count = 0; final int index = buffer.getReaderIndex(); while (buffer.hasReadableBytes() && !done) { final byte b = buffer.readByte(); if (isAlphaNum(b)) { ++count; } else { done = true; } } buffer.setReaderIndex(index); return count; }
static int function(final Buffer buffer) throws IndexOutOfBoundsException, IOException { boolean done = false; int count = 0; final int index = buffer.getReaderIndex(); while (buffer.hasReadableBytes() && !done) { final byte b = buffer.readByte(); if (isAlphaNum(b)) { ++count; } else { done = true; } } buffer.setReaderIndex(index); return count; }
/** * Helper method that counts the number of bytes that are considered part of * the next alphanum block. * * @param buffer * @return a count of the number of bytes the next alphaum contains or zero * if none is found. * @throws IndexOutOfBoundsException * @throws IOException */
Helper method that counts the number of bytes that are considered part of the next alphanum block
getAlphaNumCount
{ "repo_name": "aboutsip/pkts", "path": "pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java", "license": "mit", "size": 86189 }
[ "io.pkts.buffer.Buffer", "java.io.IOException" ]
import io.pkts.buffer.Buffer; import java.io.IOException;
import io.pkts.buffer.*; import java.io.*;
[ "io.pkts.buffer", "java.io" ]
io.pkts.buffer; java.io;
2,310,505
@Schema(description = "User last name") public String getLastName() { return lastName; }
@Schema(description = STR) String function() { return lastName; }
/** * User last name * @return lastName **/
User last name
getLastName
{ "repo_name": "iterate-ch/cyberduck", "path": "dracoon/src/main/java/ch/cyberduck/core/sds/io/swagger/client/model/UpdateUserAccountRequest.java", "license": "gpl-3.0", "size": 8522 }
[ "io.swagger.v3.oas.annotations.media.Schema" ]
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.*;
[ "io.swagger.v3" ]
io.swagger.v3;
1,454,034
Node getNodeVersion(String label);
Node getNodeVersion(String label);
/** * Get the node for this object at the version provided. * @param label the label * @return the node for this object at the version provided */
Get the node for this object at the version provided
getNodeVersion
{ "repo_name": "ajs6f/fcrepo4", "path": "fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/models/FedoraResource.java", "license": "apache-2.0", "size": 7827 }
[ "javax.jcr.Node" ]
import javax.jcr.Node;
import javax.jcr.*;
[ "javax.jcr" ]
javax.jcr;
1,005,754
protected static void throwException(final Throwable throwable) throws IOException, MPDException { if (throwable instanceof MPDException) { throw new MPDException(throwable); } else { throw new IOException(throwable); } } /** * Attempts to cancel execution of this task. * * <p>This attempt will fail if the task has already completed, has already been cancelled, or * could not be cancelled for some other reason. If successful, and this task has not started * when {@code cancel} is called, this task should never run. If the task has already started, * then the {@code mayInterruptIfRunning} parameter determines whether the thread executing * this task should be interrupted in an attempt to stop the task.</p> * * <p>After this method returns, subsequent calls to {@link #isDone} will always return * {@code true}. Subsequent calls to {@link #isCancelled} will always return {@code true}
static void function(final Throwable throwable) throws IOException, MPDException { if (throwable instanceof MPDException) { throw new MPDException(throwable); } else { throw new IOException(throwable); } } /** * Attempts to cancel execution of this task. * * <p>This attempt will fail if the task has already completed, has already been cancelled, or * could not be cancelled for some other reason. If successful, and this task has not started * when {@code cancel} is called, this task should never run. If the task has already started, * then the {@code mayInterruptIfRunning} parameter determines whether the thread executing * this task should be interrupted in an attempt to stop the task.</p> * * <p>After this method returns, subsequent calls to {@link #isDone} will always return * {@code true}. Subsequent calls to {@link #isCancelled} will always return {@code true}
/** * Wraps and throws an exception, based one the instance of the {@code Throwable} instance * origin. * * @param throwable The throwable to throw. * @throws IOException Thrown upon a communication error with the server. * @throws MPDException Thrown if an error occurs as a result of command execution. */
Wraps and throws an exception, based one the instance of the Throwable instance origin
throwException
{ "repo_name": "hurzl/dmix", "path": "JMPDComm/src/main/java/com/anpmech/mpd/concurrent/MPDFuture.java", "license": "apache-2.0", "size": 7616 }
[ "com.anpmech.mpd.exception.MPDException", "java.io.IOException" ]
import com.anpmech.mpd.exception.MPDException; import java.io.IOException;
import com.anpmech.mpd.exception.*; import java.io.*;
[ "com.anpmech.mpd", "java.io" ]
com.anpmech.mpd; java.io;
998,339
static int versionCommentCheck(String stmt, int offset) { int length = offset + _VERSION_COMMENT.length; if (stmt.length() >= length && ParseUtil.compare(stmt, offset, _VERSION_COMMENT)) { if (stmt.length() > length && stmt.charAt(length) != ' ') { return OTHER; } else { return VERSION_COMMENT; } } return OTHER; }
static int versionCommentCheck(String stmt, int offset) { int length = offset + _VERSION_COMMENT.length; if (stmt.length() >= length && ParseUtil.compare(stmt, offset, _VERSION_COMMENT)) { if (stmt.length() > length && stmt.charAt(length) != ' ') { return OTHER; } else { return VERSION_COMMENT; } } return OTHER; }
/** * SELECT @@VERSION_COMMENT */
SELECT @@VERSION_COMMENT
versionCommentCheck
{ "repo_name": "mingfly/opencloudb", "path": "src/main/java/org/opencloudb/server/parser/ServerParseSelect.java", "license": "apache-2.0", "size": 14849 }
[ "org.opencloudb.paser.util.ParseUtil" ]
import org.opencloudb.paser.util.ParseUtil;
import org.opencloudb.paser.util.*;
[ "org.opencloudb.paser" ]
org.opencloudb.paser;
669,958
public final native void scrollIntoView(CMPixelRangeOverlay what) ;
final native void function(CMPixelRangeOverlay what) ;
/** * Scroll the given rectangular zone into view. */
Scroll the given rectangular zone into view
scrollIntoView
{ "repo_name": "riuvshin/che-plugins", "path": "plugin-codemirror/che-plugin-codemirror-jso/src/main/java/org/eclipse/che/ide/editor/codemirrorjso/client/CMEditorOverlay.java", "license": "epl-1.0", "size": 20846 }
[ "org.eclipse.che.ide.editor.codemirrorjso.client.scroll.CMPixelRangeOverlay" ]
import org.eclipse.che.ide.editor.codemirrorjso.client.scroll.CMPixelRangeOverlay;
import org.eclipse.che.ide.editor.codemirrorjso.client.scroll.*;
[ "org.eclipse.che" ]
org.eclipse.che;
742,155
private void propagateProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target) { if (orgin.isDefault(key.fKey)) { if (!target.isDefault(key.fKey)) target.setToDefault(key.fKey); return; } TypeDescriptor d= key.fDescriptor; if (BOOLEAN == d) { boolean originValue= orgin.getBoolean(key.fKey); boolean targetValue= target.getBoolean(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (DOUBLE == d) { double originValue= orgin.getDouble(key.fKey); double targetValue= target.getDouble(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (FLOAT == d) { float originValue= orgin.getFloat(key.fKey); float targetValue= target.getFloat(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (INT == d) { int originValue= orgin.getInt(key.fKey); int targetValue= target.getInt(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (LONG == d) { long originValue= orgin.getLong(key.fKey); long targetValue= target.getLong(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (STRING == d) { String originValue= orgin.getString(key.fKey); String targetValue= target.getString(key.fKey); if (targetValue != null && originValue != null && !targetValue.equals(originValue)) target.setValue(key.fKey, originValue); } }
void function(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target) { if (orgin.isDefault(key.fKey)) { if (!target.isDefault(key.fKey)) target.setToDefault(key.fKey); return; } TypeDescriptor d= key.fDescriptor; if (BOOLEAN == d) { boolean originValue= orgin.getBoolean(key.fKey); boolean targetValue= target.getBoolean(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (DOUBLE == d) { double originValue= orgin.getDouble(key.fKey); double targetValue= target.getDouble(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (FLOAT == d) { float originValue= orgin.getFloat(key.fKey); float targetValue= target.getFloat(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (INT == d) { int originValue= orgin.getInt(key.fKey); int targetValue= target.getInt(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (LONG == d) { long originValue= orgin.getLong(key.fKey); long targetValue= target.getLong(key.fKey); if (targetValue != originValue) target.setValue(key.fKey, originValue); } else if (STRING == d) { String originValue= orgin.getString(key.fKey); String targetValue= target.getString(key.fKey); if (targetValue != null && originValue != null && !targetValue.equals(originValue)) target.setValue(key.fKey, originValue); } }
/** * Propagates the given overlay key from the orgin to the target preference store. * * @param orgin the source preference store * @param key the overlay key * @param target the preference store to which the key is propagated */
Propagates the given overlay key from the orgin to the target preference store
propagateProperty
{ "repo_name": "andriusvelykis/isabelle-eclipse", "path": "isabelle.eclipse.ui/src/isabelle/eclipse/ui/preferences/OverlayPreferenceStore.java", "license": "epl-1.0", "size": 14565 }
[ "org.eclipse.jface.preference.IPreferenceStore" ]
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,787,586
public void glGetBufferSubData(int target, long offset, ByteBuffer data);
void function(int target, long offset, ByteBuffer data);
/** * <p><a target="_blank" href="http://docs.gl/gl4/glGetBufferSubData">Reference Page</a></p> * <p> * Returns a subset of a buffer object's data store. * * @param target the target buffer object. * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes. * @param data a pointer to the location where buffer object data is returned. */
Reference Page Returns a subset of a buffer object's data store
glGetBufferSubData
{ "repo_name": "zzuegg/jmonkeyengine", "path": "jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java", "license": "bsd-3-clause", "size": 69318 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,666,943
public void endCDATA(Augmentations augs) throws XNIException { // call handlers fInCDATA = false; if (fDocumentHandler != null) { fDocumentHandler.endCDATA(augs); } } // endCDATA()
void function(Augmentations augs) throws XNIException { fInCDATA = false; if (fDocumentHandler != null) { fDocumentHandler.endCDATA(augs); } }
/** * The end of a CDATA section. * * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */
The end of a CDATA section
endCDATA
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.xml/src/main/resources/META-INF/modules/java.xml/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java", "license": "apache-2.0", "size": 193373 }
[ "com.sun.org.apache.xerces.internal.xni.Augmentations", "com.sun.org.apache.xerces.internal.xni.XNIException" ]
import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XNIException;
import com.sun.org.apache.xerces.internal.xni.*;
[ "com.sun.org" ]
com.sun.org;
679,219
@Transactional (rollbackFor=Exception.class) public void updateUserAuth(UserAuth userAuth);
@Transactional (rollbackFor=Exception.class) void function(UserAuth userAuth);
/** * Updates the UserAuth attributes form Person * * @author dan.damian * * @param username * @return */
Updates the UserAuth attributes form Person
updateUserAuth
{ "repo_name": "CodeSphere/termitaria", "path": "TermitariaOM/JavaSource/ro/cs/om/model/dao/IDaoPerson.java", "license": "agpl-3.0", "size": 11283 }
[ "org.springframework.transaction.annotation.Transactional", "ro.cs.om.web.security.UserAuth" ]
import org.springframework.transaction.annotation.Transactional; import ro.cs.om.web.security.UserAuth;
import org.springframework.transaction.annotation.*; import ro.cs.om.web.security.*;
[ "org.springframework.transaction", "ro.cs.om" ]
org.springframework.transaction; ro.cs.om;
2,491,920
public List<MasterType_d0e5_a1> getMasters() { return m_masterList; }
List<MasterType_d0e5_a1> function() { return m_masterList; }
/** * Get the embedded list of Master elements. * @return list of items. */
Get the embedded list of Master elements
getMasters
{ "repo_name": "lolkedijkstra/xml2j-gen", "path": "samples/discogs/masters_rd/src/main/java/com/xml2j/discogs/masters_rd/MastersType.java", "license": "mit", "size": 3614 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
281,508
@Test(groups = "unit") public void sessionRead_LegitimateNotFound() { long lsn = 651175; long globalCommittedLsn = 651174; String partitionKeyRangeId = "73"; NotFoundException foundException = new NotFoundException(); foundException.getResponseHeaders().put(HttpConstants.HttpHeaders.SESSION_TOKEN, partitionKeyRangeId + ":-1#" + lsn); foundException.getResponseHeaders().put(WFConstants.BackendHeaders.LSN, Long.toString(lsn)); foundException.getResponseHeaders().put(WFConstants.BackendHeaders.LOCAL_LSN, Long.toString(lsn)); foundException.getResponseHeaders().put(WFConstants.BackendHeaders.GLOBAL_COMMITTED_LSN, Long.toString(globalCommittedLsn)); TransportClientWrapper transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .SequentialBuilder() .then(foundException) // 1st replica read returns not found .then(foundException) // 2nd replica read returns not found .then(foundException) // 3rd replica read returns not found .then(foundException) // 4th replica read returns not found .build(); Uri primaryUri = Uri.create("primary"); Uri secondaryUri1 = Uri.create("secondary1"); Uri secondaryUri2 = Uri.create("secondary2"); Uri secondaryUri3 = Uri.create("secondary3"); AddressSelectorWrapper addressSelectorWrapper = AddressSelectorWrapper.Builder.Simple.create() .withPrimary(primaryUri) .withSecondary(ImmutableList.of(secondaryUri1, secondaryUri2, secondaryUri3)) .build(); ISessionContainer sessionContainer = Mockito.mock(ISessionContainer.class); StoreReader storeReader = new StoreReader(transportClientWrapper.transportClient, addressSelectorWrapper.addressSelector, sessionContainer); TimeoutHelper timeoutHelper = Mockito.mock(TimeoutHelper.class); RxDocumentServiceRequest dsr = RxDocumentServiceRequest.createFromName(mockDiagnosticsClientContext(), OperationType.Read, "/dbs/db/colls/col/docs/docId", ResourceType.Document); dsr.getHeaders().put(HttpConstants.HttpHeaders.CONSISTENCY_LEVEL, ConsistencyLevel.SESSION.toString()); dsr.requestContext = new DocumentServiceRequestContext(); Utils.ValueHolder<ISessionToken> sessionToken = Utils.ValueHolder.initialize(null); dsr.requestContext.sessionToken = sessionToken.v; dsr.requestContext.timeoutHelper = timeoutHelper; dsr.requestContext.resolvedPartitionKeyRange = partitionKeyRangeWithId(partitionKeyRangeId); dsr.requestContext.requestChargeTracker = new RequestChargeTracker(); assertThat(VectorSessionToken.tryCreate("-1#" + (lsn - 1) , sessionToken)).isTrue(); Mockito.doReturn(sessionToken.v).when(sessionContainer).resolvePartitionLocalSessionToken(Mockito.eq(dsr), Mockito.anyString()); Mono<List<StoreResult>> readResult = storeReader.readMultipleReplicaAsync( dsr, true, 1, true, true, ReadMode.Any, true, false); MultiStoreResultValidator validator = MultiStoreResultValidator.create() .withSize(1) .validateEachWith(StoreResultValidator.create() .isValid() .withException(FailureValidator.builder().instanceOf(NotFoundException.class).build()) .build()) .build(); validateSuccess(readResult, validator); }
@Test(groups = "unit") void function() { long lsn = 651175; long globalCommittedLsn = 651174; String partitionKeyRangeId = "73"; NotFoundException foundException = new NotFoundException(); foundException.getResponseHeaders().put(HttpConstants.HttpHeaders.SESSION_TOKEN, partitionKeyRangeId + ":-1#" + lsn); foundException.getResponseHeaders().put(WFConstants.BackendHeaders.LSN, Long.toString(lsn)); foundException.getResponseHeaders().put(WFConstants.BackendHeaders.LOCAL_LSN, Long.toString(lsn)); foundException.getResponseHeaders().put(WFConstants.BackendHeaders.GLOBAL_COMMITTED_LSN, Long.toString(globalCommittedLsn)); TransportClientWrapper transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .SequentialBuilder() .then(foundException) .then(foundException) .then(foundException) .then(foundException) .build(); Uri primaryUri = Uri.create(STR); Uri secondaryUri1 = Uri.create(STR); Uri secondaryUri2 = Uri.create(STR); Uri secondaryUri3 = Uri.create(STR); AddressSelectorWrapper addressSelectorWrapper = AddressSelectorWrapper.Builder.Simple.create() .withPrimary(primaryUri) .withSecondary(ImmutableList.of(secondaryUri1, secondaryUri2, secondaryUri3)) .build(); ISessionContainer sessionContainer = Mockito.mock(ISessionContainer.class); StoreReader storeReader = new StoreReader(transportClientWrapper.transportClient, addressSelectorWrapper.addressSelector, sessionContainer); TimeoutHelper timeoutHelper = Mockito.mock(TimeoutHelper.class); RxDocumentServiceRequest dsr = RxDocumentServiceRequest.createFromName(mockDiagnosticsClientContext(), OperationType.Read, STR, ResourceType.Document); dsr.getHeaders().put(HttpConstants.HttpHeaders.CONSISTENCY_LEVEL, ConsistencyLevel.SESSION.toString()); dsr.requestContext = new DocumentServiceRequestContext(); Utils.ValueHolder<ISessionToken> sessionToken = Utils.ValueHolder.initialize(null); dsr.requestContext.sessionToken = sessionToken.v; dsr.requestContext.timeoutHelper = timeoutHelper; dsr.requestContext.resolvedPartitionKeyRange = partitionKeyRangeWithId(partitionKeyRangeId); dsr.requestContext.requestChargeTracker = new RequestChargeTracker(); assertThat(VectorSessionToken.tryCreate("-1#" + (lsn - 1) , sessionToken)).isTrue(); Mockito.doReturn(sessionToken.v).when(sessionContainer).resolvePartitionLocalSessionToken(Mockito.eq(dsr), Mockito.anyString()); Mono<List<StoreResult>> readResult = storeReader.readMultipleReplicaAsync( dsr, true, 1, true, true, ReadMode.Any, true, false); MultiStoreResultValidator validator = MultiStoreResultValidator.create() .withSize(1) .validateEachWith(StoreResultValidator.create() .isValid() .withException(FailureValidator.builder().instanceOf(NotFoundException.class).build()) .build()) .build(); validateSuccess(readResult, validator); }
/** * Reading with session consistency, replicas have session token with higher than requested and return not found */
Reading with session consistency, replicas have session token with higher than requested and return not found
sessionRead_LegitimateNotFound
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/directconnectivity/StoreReaderTest.java", "license": "mit", "size": 50092 }
[ "com.azure.cosmos.ConsistencyLevel", "com.azure.cosmos.implementation.DocumentServiceRequestContext", "com.azure.cosmos.implementation.FailureValidator", "com.azure.cosmos.implementation.HttpConstants", "com.azure.cosmos.implementation.ISessionContainer", "com.azure.cosmos.implementation.ISessionToken", "com.azure.cosmos.implementation.NotFoundException", "com.azure.cosmos.implementation.OperationType", "com.azure.cosmos.implementation.RequestChargeTracker", "com.azure.cosmos.implementation.ResourceType", "com.azure.cosmos.implementation.RxDocumentServiceRequest", "com.azure.cosmos.implementation.Utils", "com.azure.cosmos.implementation.VectorSessionToken", "com.azure.cosmos.implementation.guava25.collect.ImmutableList", "java.util.List", "org.assertj.core.api.Assertions", "org.mockito.Mockito", "org.testng.annotations.Test" ]
import com.azure.cosmos.ConsistencyLevel; import com.azure.cosmos.implementation.DocumentServiceRequestContext; import com.azure.cosmos.implementation.FailureValidator; import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ISessionContainer; import com.azure.cosmos.implementation.ISessionToken; import com.azure.cosmos.implementation.NotFoundException; import com.azure.cosmos.implementation.OperationType; import com.azure.cosmos.implementation.RequestChargeTracker; import com.azure.cosmos.implementation.ResourceType; import com.azure.cosmos.implementation.RxDocumentServiceRequest; import com.azure.cosmos.implementation.Utils; import com.azure.cosmos.implementation.VectorSessionToken; import com.azure.cosmos.implementation.guava25.collect.ImmutableList; import java.util.List; import org.assertj.core.api.Assertions; import org.mockito.Mockito; import org.testng.annotations.Test;
import com.azure.cosmos.*; import com.azure.cosmos.implementation.*; import com.azure.cosmos.implementation.guava25.collect.*; import java.util.*; import org.assertj.core.api.*; import org.mockito.*; import org.testng.annotations.*;
[ "com.azure.cosmos", "java.util", "org.assertj.core", "org.mockito", "org.testng.annotations" ]
com.azure.cosmos; java.util; org.assertj.core; org.mockito; org.testng.annotations;
997,762
@Override protected void writeTo(XML xml, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { String charset = ConvertersConfigurationHolder.getConverterConfiguration(XML.class).getEncoding(); Writer writer = new OutputStreamWriter(entityStream, charset == null ? DEFAULT_CHARSET : charset); xml.render(writer); }
void function(XML xml, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { String charset = ConvertersConfigurationHolder.getConverterConfiguration(XML.class).getEncoding(); Writer writer = new OutputStreamWriter(entityStream, charset == null ? DEFAULT_CHARSET : charset); xml.render(writer); }
/** * Renders the <code>xml</code> object to the response's * <code>entityStream</code> using the encoding set by the Grails * application. * * @param xml * XML object. * @param httpHeaders * HTTP headers * @param entityStream * XML response entity stream. */
Renders the <code>xml</code> object to the response's <code>entityStream</code> using the encoding set by the Grails application
writeTo
{ "repo_name": "krasserm/grails-jaxrs", "path": "src/java/org/grails/jaxrs/provider/XMLWriter.java", "license": "apache-2.0", "size": 2809 }
[ "java.io.IOException", "java.io.OutputStream", "java.io.OutputStreamWriter", "java.io.Writer", "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.MultivaluedMap", "org.codehaus.groovy.grails.web.converters.configuration.ConvertersConfigurationHolder" ]
import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MultivaluedMap; import org.codehaus.groovy.grails.web.converters.configuration.ConvertersConfigurationHolder;
import java.io.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.codehaus.groovy.grails.web.converters.configuration.*;
[ "java.io", "javax.ws", "org.codehaus.groovy" ]
java.io; javax.ws; org.codehaus.groovy;
2,914,882
protected String getOrganismConstraint() { String organismIdsString = getOrganismIdsString(); if (StringUtils.isEmpty(organismIdsString)) { return ""; } return "feature.organism_id IN (" + organismIdsString + ")"; }
String function() { String organismIdsString = getOrganismIdsString(); if (StringUtils.isEmpty(organismIdsString)) { return STRfeature.organism_id IN (STR)"; }
/** * Return some SQL that can be included in the WHERE part of query that restricts features * by organism. "organism_id" must be selected. * @return the SQL */
Return some SQL that can be included in the WHERE part of query that restricts features by organism. "organism_id" must be selected
getOrganismConstraint
{ "repo_name": "JoeCarlson/intermine", "path": "bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/StockProcessor.java", "license": "lgpl-2.1", "size": 8048 }
[ "org.apache.commons.lang.StringUtils" ]
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
1,674,193
public static int compareTwoDatesWithoutTimeValue(Date d1, Date d2) { if ((d1==null) && (d2==null)) { return 0; } if (d1==null) { return -1; } if (d2==null) { return 1; } return getZeroTimeDate(d1).compareTo(getZeroTimeDate(d2)); }
static int function(Date d1, Date d2) { if ((d1==null) && (d2==null)) { return 0; } if (d1==null) { return -1; } if (d2==null) { return 1; } return getZeroTimeDate(d1).compareTo(getZeroTimeDate(d2)); }
/** * This method compare only the date values: 2015-07-17 (Discards time values). * @param d1 * @param d2 * @return */
This method compare only the date values: 2015-07-17 (Discards time values)
compareTwoDatesWithoutTimeValue
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/util/DateTimeUtils.java", "license": "gpl-3.0", "size": 26707 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
953,602
EReference getPVPH_StrVal();
EReference getPVPH_StrVal();
/** * Returns the meta object for the reference '{@link gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getStrVal <em>Str Val</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Str Val</em>'. * @see gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getStrVal() * @see #getPVPH() * @generated */
Returns the meta object for the reference '<code>gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getStrVal Str Val</code>'.
getPVPH_StrVal
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/substationStandard/LNNodes/LNGroupP/LNGroupPPackage.java", "license": "mit", "size": 291175 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
555,241
private void addNewSearchField() { try { final Box searchFieldBox = Box.createHorizontalBox(); final SearchField newSearchField = searchFieldType.newInstance(); if ( !searchFieldList.isEmpty() ) // If not the first, we have to set the size of display label newSearchField.displayLabel.setPreferredSize( new Dimension( searchFieldList.get( 0 ).displayLabel.getPreferredSize().width, newSearchField.displayLabel.getPreferredSize().height ) ); searchFieldList.add( newSearchField ); searchFieldBox.add( newSearchField.uiComponent ); searchFieldBox.add( Box.createHorizontalStrut( 6 ) );
void function() { try { final Box searchFieldBox = Box.createHorizontalBox(); final SearchField newSearchField = searchFieldType.newInstance(); if ( !searchFieldList.isEmpty() ) newSearchField.displayLabel.setPreferredSize( new Dimension( searchFieldList.get( 0 ).displayLabel.getPreferredSize().width, newSearchField.displayLabel.getPreferredSize().height ) ); searchFieldList.add( newSearchField ); searchFieldBox.add( newSearchField.uiComponent ); searchFieldBox.add( Box.createHorizontalStrut( 6 ) );
/** * Adds a new search field to this group. */
Adds a new search field to this group
addNewSearchField
{ "repo_name": "icza/sc2gears", "path": "src/hu/belicza/andras/sc2gears/ui/moduls/replaysearch/SearchFieldGroup.java", "license": "apache-2.0", "size": 8795 }
[ "java.awt.Dimension", "javax.swing.Box" ]
import java.awt.Dimension; import javax.swing.Box;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,013,138