method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ConfigDescription.class)) { case org_eclipse_smarthome_schemas_config_description_v1__0SimplifiedPackage.CONFIG_DESCRIPTION__URI: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case org_eclipse_smarthome_schemas_config_description_v1__0SimplifiedPackage.CONFIG_DESCRIPTION__PARAMETER_GROUPS: case org_eclipse_smarthome_schemas_config_description_v1__0SimplifiedPackage.CONFIG_DESCRIPTION__PARAMETERS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ConfigDescription.class)) { case org_eclipse_smarthome_schemas_config_description_v1__0SimplifiedPackage.CONFIG_DESCRIPTION__URI: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case org_eclipse_smarthome_schemas_config_description_v1__0SimplifiedPackage.CONFIG_DESCRIPTION__PARAMETER_GROUPS: case org_eclipse_smarthome_schemas_config_description_v1__0SimplifiedPackage.CONFIG_DESCRIPTION__PARAMETERS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "patrickneubauer/XMLIntellEdit", "path": "xmlintelledit/classes.edit/src/org_eclipse_smarthome_schemas_config_description_v1__0Simplified/provider/ConfigDescriptionItemProvider.java", "license": "mit", "size": 7381 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,928,658
private void updateNamed(boolean useSameEm) { EntityManager em = emf.createEntityManager(); String updateQuery = "Update StudentHBaseShortWrapper s SET s.name='Vivek' where s.name='Amresh'"; Query q = em.createQuery(updateQuery); q.executeUpdate(); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseShortWrapper newStudent = em.find(StudentHBaseShortWrapper.class, getRandomValue(Short.class)); Assert.assertNotNull(newStudent); Assert.assertEquals(getRandomValue(short.class), newStudent.getAge()); Assert.assertEquals("Vivek", newStudent.getName()); em.close(); }
void function(boolean useSameEm) { EntityManager em = emf.createEntityManager(); String updateQuery = STR; Query q = em.createQuery(updateQuery); q.executeUpdate(); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseShortWrapper newStudent = em.find(StudentHBaseShortWrapper.class, getRandomValue(Short.class)); Assert.assertNotNull(newStudent); Assert.assertEquals(getRandomValue(short.class), newStudent.getAge()); Assert.assertEquals("Vivek", newStudent.getName()); em.close(); }
/** * Update named. * * @param useSameEm * the use same em */
Update named
updateNamed
{ "repo_name": "impetus-opensource/Kundera", "path": "src/kundera-hbase/kundera-hbase-v2/src/test/java/com/impetus/client/hbase/crud/datatypes/StudentHBaseShortWrapperTest.java", "license": "apache-2.0", "size": 18529 }
[ "com.impetus.client.hbase.crud.datatypes.entities.StudentHBaseShortWrapper", "javax.persistence.EntityManager", "javax.persistence.Query", "junit.framework.Assert" ]
import com.impetus.client.hbase.crud.datatypes.entities.StudentHBaseShortWrapper; import javax.persistence.EntityManager; import javax.persistence.Query; import junit.framework.Assert;
import com.impetus.client.hbase.crud.datatypes.entities.*; import javax.persistence.*; import junit.framework.*;
[ "com.impetus.client", "javax.persistence", "junit.framework" ]
com.impetus.client; javax.persistence; junit.framework;
429,808
private void updateClientNodes(UUID leftNodeId) { for (Map.Entry<String, CachePredicate> entry : registeredCaches.entrySet()) { CachePredicate pred = entry.getValue(); pred.onNodeLeft(leftNodeId); } }
void function(UUID leftNodeId) { for (Map.Entry<String, CachePredicate> entry : registeredCaches.entrySet()) { CachePredicate pred = entry.getValue(); pred.onNodeLeft(leftNodeId); } }
/** * Called from discovery thread. * * @param leftNodeId Left node ID. */
Called from discovery thread
updateClientNodes
{ "repo_name": "chandresh-pancholi/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java", "license": "apache-2.0", "size": 138014 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,203,912
@Test public void testSetRequiresComponents() { System.out.println("setRequiresComponents"); ArrayList<Descriptor> requires = null; Descriptor instance = new Descriptor(); instance.setRequiresComponents(requires); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
void function() { System.out.println(STR); ArrayList<Descriptor> requires = null; Descriptor instance = new Descriptor(); instance.setRequiresComponents(requires); fail(STR); }
/** * Test of Descriptor#setRequiresComponents method. */
Test of Descriptor#setRequiresComponents method
testSetRequiresComponents
{ "repo_name": "willfurnass/seme", "path": "seme-framework/src/test/java/gov/sandia/seme/framework/DescriptorTest.java", "license": "apache-2.0", "size": 15658 }
[ "java.util.ArrayList", "org.junit.Assert" ]
import java.util.ArrayList; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
2,545,977
public final void selectWindow(final String windowName) { // app test are not compatible with window if (SeleniumTestsContextManager.getThreadContext().getTestType().family() == TestType.APP) { throw new ScenarioException("Application are not compatible with Windows"); } if (windowName == null) { driver.switchTo().defaultContent(); } else { driver.switchTo().window(windowName); } }
final void function(final String windowName) { if (SeleniumTestsContextManager.getThreadContext().getTestType().family() == TestType.APP) { throw new ScenarioException(STR); } if (windowName == null) { driver.switchTo().defaultContent(); } else { driver.switchTo().window(windowName); } }
/** * If current window is closed then use driver.switchTo.window(handle). * * @param windowName */
If current window is closed then use driver.switchTo.window(handle)
selectWindow
{ "repo_name": "bhecquet/seleniumRobot", "path": "core/src/main/java/com/seleniumtests/uipage/BasePage.java", "license": "apache-2.0", "size": 4467 }
[ "com.seleniumtests.core.SeleniumTestsContextManager", "com.seleniumtests.customexception.ScenarioException", "com.seleniumtests.driver.TestType" ]
import com.seleniumtests.core.SeleniumTestsContextManager; import com.seleniumtests.customexception.ScenarioException; import com.seleniumtests.driver.TestType;
import com.seleniumtests.core.*; import com.seleniumtests.customexception.*; import com.seleniumtests.driver.*;
[ "com.seleniumtests.core", "com.seleniumtests.customexception", "com.seleniumtests.driver" ]
com.seleniumtests.core; com.seleniumtests.customexception; com.seleniumtests.driver;
2,093,047
public static void sendShutdown(final String host, final int port) { try (Socket server = new Socket(host, port);) { System.out.println(String.format("Shutdown connected to server at: %s/%s:%d", server.getInetAddress().getHostName(), server.getInetAddress().getHostAddress(), server.getPort())); ObjectOutputStream out = new ObjectOutputStream(server.getOutputStream()); server.shutdownInput(); final ShutdownCommand command = new ShutdownCommand(); sendCommand(out, command); server.close(); } catch (final IOException ex) { logger.error("Connect and send quit command.", ex); } }
static void function(final String host, final int port) { try (Socket server = new Socket(host, port);) { System.out.println(String.format(STR, server.getInetAddress().getHostName(), server.getInetAddress().getHostAddress(), server.getPort())); ObjectOutputStream out = new ObjectOutputStream(server.getOutputStream()); server.shutdownInput(); final ShutdownCommand command = new ShutdownCommand(); sendCommand(out, command); server.close(); } catch (final IOException ex) { logger.error(STR, ex); } }
/** * Send the shutdown command to the server, this is done on a separate * connection to the server. * * @param host the host for the server. * @param port the port for the server. * */
Send the shutdown command to the server, this is done on a separate connection to the server
sendShutdown
{ "repo_name": "bkstamm67/java", "path": "old/session2/assignment9/net/client/InvoiceClient.java", "license": "mit", "size": 7476 }
[ "com.scg.net.cmd.ShutdownCommand", "java.io.IOException", "java.io.ObjectOutputStream", "java.net.Socket" ]
import com.scg.net.cmd.ShutdownCommand; import java.io.IOException; import java.io.ObjectOutputStream; import java.net.Socket;
import com.scg.net.cmd.*; import java.io.*; import java.net.*;
[ "com.scg.net", "java.io", "java.net" ]
com.scg.net; java.io; java.net;
1,195,453
private static ImageView createImage(Context c, Drawable drawable) { ImageView iv = new ImageView(c); iv.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT)); iv.setImageDrawable(drawable); iv.setScaleType(ScaleType.CENTER); iv.setPadding(0, 0, 0, 0); return iv; }
static ImageView function(Context c, Drawable drawable) { ImageView iv = new ImageView(c); iv.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,TableRow.LayoutParams.WRAP_CONTENT)); iv.setImageDrawable(drawable); iv.setScaleType(ScaleType.CENTER); iv.setPadding(0, 0, 0, 0); return iv; }
/** * Utility function to create an image and set defaults * @param c * @return */
Utility function to create an image and set defaults
createImage
{ "repo_name": "chrispbailey/ToDo-List-Widget", "path": "src/org/chrisbailey/todo/activities/ToDoActivity.java", "license": "gpl-3.0", "size": 14186 }
[ "android.content.Context", "android.graphics.drawable.Drawable", "android.widget.ImageView", "android.widget.TableRow" ]
import android.content.Context; import android.graphics.drawable.Drawable; import android.widget.ImageView; import android.widget.TableRow;
import android.content.*; import android.graphics.drawable.*; import android.widget.*;
[ "android.content", "android.graphics", "android.widget" ]
android.content; android.graphics; android.widget;
525,229
@Override public BoundStatement generateAndGetBoundStatement() { return getInternalBoundStatementWrapper().getBoundStatement(); }
BoundStatement function() { return getInternalBoundStatementWrapper().getBoundStatement(); }
/*************************************************************************************** * Utility API * ***************************************************************************************/
Utility API
generateAndGetBoundStatement
{ "repo_name": "doanduyhai/Achilles", "path": "achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/query/select/AbstractSelectWhereTypeMap.java", "license": "apache-2.0", "size": 7460 }
[ "com.datastax.driver.core.BoundStatement" ]
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.*;
[ "com.datastax.driver" ]
com.datastax.driver;
666,288
@Override public User getUser(String login, String password) throws ServiceException, ServiceLoginException { User user; try { user = userDAO.getUser(login, password); checkNullUser(user); logger.debug(SUCCESSFUL_TRANSACTION); } catch (DaoException e) { logger.debug(TRANSACTION_FAILED, e); throw new ServiceException(e.getMessage()); } return user; }
User function(String login, String password) throws ServiceException, ServiceLoginException { User user; try { user = userDAO.getUser(login, password); checkNullUser(user); logger.debug(SUCCESSFUL_TRANSACTION); } catch (DaoException e) { logger.debug(TRANSACTION_FAILED, e); throw new ServiceException(e.getMessage()); } return user; }
/** * Returns the user from the DB matching the given login and password * * @param login - login of the user to be returned * @param password - password of the user to be returned * @return The user from the DB matching the given login and password * @throws DaoException If something fails at DB level */
Returns the user from the DB matching the given login and password
getUser
{ "repo_name": "alexeykish/aircompany-spring", "path": "services/src/main/java/by/pvt/kish/aircompany/services/impl/UserService.java", "license": "gpl-3.0", "size": 4475 }
[ "by.pvt.kish.aircompany.exceptions.DaoException", "by.pvt.kish.aircompany.exceptions.ServiceException", "by.pvt.kish.aircompany.exceptions.ServiceLoginException", "by.pvt.kish.aircompany.pojos.User", "by.pvt.kish.aircompany.utils.ServiceUtils" ]
import by.pvt.kish.aircompany.exceptions.DaoException; import by.pvt.kish.aircompany.exceptions.ServiceException; import by.pvt.kish.aircompany.exceptions.ServiceLoginException; import by.pvt.kish.aircompany.pojos.User; import by.pvt.kish.aircompany.utils.ServiceUtils;
import by.pvt.kish.aircompany.exceptions.*; import by.pvt.kish.aircompany.pojos.*; import by.pvt.kish.aircompany.utils.*;
[ "by.pvt.kish" ]
by.pvt.kish;
2,864,995
public void enforce(OptionsParser parser, @Nullable String command) throws OptionsParsingException { if (invocationPolicy == null || invocationPolicy.getFlagPoliciesCount() == 0) { return; } // The effective policy returned is expanded, filtered for applicable commands, and cleaned of // redundancies and conflicts. List<FlagPolicyWithContext> effectivePolicies = getEffectivePolicies(invocationPolicy, parser, command, loglevel); for (FlagPolicyWithContext flagPolicy : effectivePolicies) { String flagName = flagPolicy.policy.getFlagName(); OptionValueDescription valueDescription; try { valueDescription = parser.getOptionValueDescription(flagName); } catch (IllegalArgumentException e) { // This flag doesn't exist. We are deliberately lenient if the flag policy has a flag // we don't know about. This is for better future proofing so that as new flags are added, // new policies can use the new flags without worrying about older versions of Bazel. logger.log( loglevel, String.format("Flag '%s' specified by invocation policy does not exist", flagName)); continue; } // getOptionDescription() will return null if the option does not exist, however // getOptionValueDescription() above would have thrown an IllegalArgumentException if that // were the case. Verify.verifyNotNull(flagPolicy.description); switch (flagPolicy.policy.getOperationCase()) { case SET_VALUE: applySetValueOperation(parser, flagPolicy, valueDescription, loglevel); break; case USE_DEFAULT: applyUseDefaultOperation( parser, "UseDefault", flagPolicy.description.getOptionDefinition(), loglevel); break; case ALLOW_VALUES: AllowValues allowValues = flagPolicy.policy.getAllowValues(); FilterValueOperation.AllowValueOperation allowValueOperation = new FilterValueOperation.AllowValueOperation(loglevel); allowValueOperation.apply( parser, flagPolicy.origin, allowValues.getAllowedValuesList(), allowValues.hasNewValue() ? allowValues.getNewValue() : null, allowValues.hasUseDefault(), valueDescription, flagPolicy.description); break; case DISALLOW_VALUES: DisallowValues disallowValues = flagPolicy.policy.getDisallowValues(); FilterValueOperation.DisallowValueOperation disallowValueOperation = new FilterValueOperation.DisallowValueOperation(loglevel); disallowValueOperation.apply( parser, flagPolicy.origin, disallowValues.getDisallowedValuesList(), disallowValues.hasNewValue() ? disallowValues.getNewValue() : null, disallowValues.hasUseDefault(), valueDescription, flagPolicy.description); break; case OPERATION_NOT_SET: throw new PolicyOperationNotSetException(flagName); default: logger.warning( String.format( "Unknown operation '%s' from invocation policy for flag '%s'", flagPolicy.policy.getOperationCase(), flagName)); break; } } } private static class PolicyOperationNotSetException extends OptionsParsingException { PolicyOperationNotSetException(String flagName) { super(String.format("Flag policy for flag '%s' does not " + "have an operation", flagName)); } }
void function(OptionsParser parser, @Nullable String command) throws OptionsParsingException { if (invocationPolicy == null invocationPolicy.getFlagPoliciesCount() == 0) { return; } List<FlagPolicyWithContext> effectivePolicies = getEffectivePolicies(invocationPolicy, parser, command, loglevel); for (FlagPolicyWithContext flagPolicy : effectivePolicies) { String flagName = flagPolicy.policy.getFlagName(); OptionValueDescription valueDescription; try { valueDescription = parser.getOptionValueDescription(flagName); } catch (IllegalArgumentException e) { logger.log( loglevel, String.format(STR, flagName)); continue; } Verify.verifyNotNull(flagPolicy.description); switch (flagPolicy.policy.getOperationCase()) { case SET_VALUE: applySetValueOperation(parser, flagPolicy, valueDescription, loglevel); break; case USE_DEFAULT: applyUseDefaultOperation( parser, STR, flagPolicy.description.getOptionDefinition(), loglevel); break; case ALLOW_VALUES: AllowValues allowValues = flagPolicy.policy.getAllowValues(); FilterValueOperation.AllowValueOperation allowValueOperation = new FilterValueOperation.AllowValueOperation(loglevel); allowValueOperation.apply( parser, flagPolicy.origin, allowValues.getAllowedValuesList(), allowValues.hasNewValue() ? allowValues.getNewValue() : null, allowValues.hasUseDefault(), valueDescription, flagPolicy.description); break; case DISALLOW_VALUES: DisallowValues disallowValues = flagPolicy.policy.getDisallowValues(); FilterValueOperation.DisallowValueOperation disallowValueOperation = new FilterValueOperation.DisallowValueOperation(loglevel); disallowValueOperation.apply( parser, flagPolicy.origin, disallowValues.getDisallowedValuesList(), disallowValues.hasNewValue() ? disallowValues.getNewValue() : null, disallowValues.hasUseDefault(), valueDescription, flagPolicy.description); break; case OPERATION_NOT_SET: throw new PolicyOperationNotSetException(flagName); default: logger.warning( String.format( STR, flagPolicy.policy.getOperationCase(), flagName)); break; } } } private static class PolicyOperationNotSetException extends OptionsParsingException { PolicyOperationNotSetException(String flagName) { super(String.format(STR + STR, flagName)); } }
/** * Applies this OptionsPolicyEnforcer's policy to the given OptionsParser. * * @param parser The OptionsParser to enforce policy on. * @param command The current blaze command, for flag policies that apply to only specific * commands. Such policies will be enforced only if they contain this command or a command * they inherit from * @throws OptionsParsingException if any flag policy is invalid. */
Applies this OptionsPolicyEnforcer's policy to the given OptionsParser
enforce
{ "repo_name": "damienmg/bazel", "path": "src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java", "license": "apache-2.0", "size": 36422 }
[ "com.google.common.base.Verify", "com.google.devtools.build.lib.runtime.proto.InvocationPolicyOuterClass", "java.util.List", "javax.annotation.Nullable" ]
import com.google.common.base.Verify; import com.google.devtools.build.lib.runtime.proto.InvocationPolicyOuterClass; import java.util.List; import javax.annotation.Nullable;
import com.google.common.base.*; import com.google.devtools.build.lib.runtime.proto.*; import java.util.*; import javax.annotation.*;
[ "com.google.common", "com.google.devtools", "java.util", "javax.annotation" ]
com.google.common; com.google.devtools; java.util; javax.annotation;
968,520
public OneResponse chown(int uid, int gid) { return chown(client, id, uid, gid); }
OneResponse function(int uid, int gid) { return chown(client, id, uid, gid); }
/** * Changes the owner/group * * @param uid The new owner user ID. Set it to -1 to leave the current one. * @param gid The new group ID. Set it to -1 to leave the current one. * @return If an error occurs the error message contains the reason. */
Changes the owner/group
chown
{ "repo_name": "dberzano/opennebula-torino", "path": "src/oca/java/src/org/opennebula/client/template/Template.java", "license": "apache-2.0", "size": 14929 }
[ "org.opennebula.client.OneResponse" ]
import org.opennebula.client.OneResponse;
import org.opennebula.client.*;
[ "org.opennebula.client" ]
org.opennebula.client;
1,158,028
public List<ServerName> getRegionServers() { return regionServers; }
List<ServerName> function() { return regionServers; }
/** * Get a list of all the addresses of all the region servers * for this peer cluster * @return list of addresses */
Get a list of all the addresses of all the region servers for this peer cluster
getRegionServers
{ "repo_name": "ddraj/hbase-mttr", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeer.java", "license": "apache-2.0", "size": 6375 }
[ "java.util.List", "org.apache.hadoop.hbase.ServerName" ]
import java.util.List; import org.apache.hadoop.hbase.ServerName;
import java.util.*; import org.apache.hadoop.hbase.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
931,627
public void test_parallelSort$JII() { // This will result in single thread sort assertTrue(256 <= Arrays.MIN_ARRAY_SORT_GRAN); test_parallelSort$JII(256); // This should trigger true parallel sort if (ForkJoinPool.getCommonPoolParallelism() > 1) { assertTrue(256 * 64 > Arrays.MIN_ARRAY_SORT_GRAN); test_parallelSort$JII(256 * 64); } }
public void test_parallelSort$JII() { assertTrue(256 <= Arrays.MIN_ARRAY_SORT_GRAN); test_parallelSort$JII(256); if (ForkJoinPool.getCommonPoolParallelism() > 1) { assertTrue(256 * 64 > Arrays.MIN_ARRAY_SORT_GRAN); test_parallelSort$JII(256 * 64); } }
/** * java.util.Arrays#parallelSort(long[], int, int) */
java.util.Arrays#parallelSort(long[], int, int)
test_parallelSort$JII
{ "repo_name": "mirego/j2objc", "path": "jre_emul/android/platform/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ArraysTest.java", "license": "apache-2.0", "size": 207868 }
[ "java.util.Arrays", "java.util.concurrent.ForkJoinPool" ]
import java.util.Arrays; import java.util.concurrent.ForkJoinPool;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,183,408
@GET @Path("{subscription:\\d+}/database-lookup") @Consumes(MediaType.APPLICATION_JSON) public QuoteDatabaseLookup lookup(@PathParam("subscription") final int subscription, @BeanParam final QuoteDatabaseQuery query) { return lookupInternal(subscription, query); }
@Path(STR) @Consumes(MediaType.APPLICATION_JSON) QuoteDatabaseLookup function(@PathParam(STR) final int subscription, @BeanParam final QuoteDatabaseQuery query) { return lookupInternal(subscription, query); }
/** * Return the database prices matching to the criteria. * * @param subscription The subscription identifier. * @param query The criteria. * @return The best database price matching to the criteria. */
Return the database prices matching to the criteria
lookup
{ "repo_name": "ligoj/plugin-prov", "path": "src/main/java/org/ligoj/app/plugin/prov/quote/database/ProvQuoteDatabaseResource.java", "license": "mit", "size": 9058 }
[ "javax.ws.rs.BeanParam", "javax.ws.rs.Consumes", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.MediaType" ]
import javax.ws.rs.BeanParam; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType;
import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "javax.ws" ]
javax.ws;
1,693,475
@Test public void testGet() { // Test some arbitrary values for (int i = 1; i <= 5; i++) { assertEquals(i, intArray.get(i - 1)); } assertEquals(1.1, doubleArray.get(0)); assertEquals(2.2, doubleArray.get(1)); assertEquals(3.3, doubleArray.get(2)); assertEquals(4.4, doubleArray.get(3)); assertEquals(5.5, doubleArray.get(4)); assertEquals("one", collectionArray.get(0)); assertEquals("two", collectionArray.get(1)); assertEquals("three", collectionArray.get(2)); assertEquals("one", objArray.get(0)); assertEquals(2, objArray.get(1)); assertEquals(0, Double.compare(3.0, (Float) objArray.get(2))); assertEquals(num, objArray.get(3)); }
void function() { for (int i = 1; i <= 5; i++) { assertEquals(i, intArray.get(i - 1)); } assertEquals(1.1, doubleArray.get(0)); assertEquals(2.2, doubleArray.get(1)); assertEquals(3.3, doubleArray.get(2)); assertEquals(4.4, doubleArray.get(3)); assertEquals(5.5, doubleArray.get(4)); assertEquals("one", collectionArray.get(0)); assertEquals("two", collectionArray.get(1)); assertEquals("three", collectionArray.get(2)); assertEquals("one", objArray.get(0)); assertEquals(2, objArray.get(1)); assertEquals(0, Double.compare(3.0, (Float) objArray.get(2))); assertEquals(num, objArray.get(3)); }
/** * Test get() - gets the object stored at a given index. */
Test get() - gets the object stored at a given index
testGet
{ "repo_name": "spepping/fop-cs", "path": "test/java/org/apache/fop/pdf/PDFArrayTestCase.java", "license": "apache-2.0", "size": 7883 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,892,471
public Materialized<K, V, S> withCachingDisabled() { cachingEnabled = false; return this; } /** * Configure retention period for window and session stores. Ignored for key/value stores. * * Overridden by pre-configured store suppliers * ({@link Materialized#as(SessionBytesStoreSupplier)} or {@link Materialized#as(WindowBytesStoreSupplier)}). * * Note that the retention period must be at least long enough to contain the windowed data's entire life cycle, * from window-start through window-end, and for the entire grace period. * * @param retention the retention time * @return itself * @throws IllegalArgumentException if retention is negative or can't be represented as {@code long milliseconds}
Materialized<K, V, S> function() { cachingEnabled = false; return this; } /** * Configure retention period for window and session stores. Ignored for key/value stores. * * Overridden by pre-configured store suppliers * ({@link Materialized#as(SessionBytesStoreSupplier)} or {@link Materialized#as(WindowBytesStoreSupplier)}). * * Note that the retention period must be at least long enough to contain the windowed data's entire life cycle, * from window-start through window-end, and for the entire grace period. * * @param retention the retention time * @return itself * @throws IllegalArgumentException if retention is negative or can't be represented as {@code long milliseconds}
/** * Disable caching for the materialized {@link StateStore}. * @return itself */
Disable caching for the materialized <code>StateStore</code>
withCachingDisabled
{ "repo_name": "KevinLiLu/kafka", "path": "streams/src/main/java/org/apache/kafka/streams/kstream/Materialized.java", "license": "apache-2.0", "size": 11174 }
[ "org.apache.kafka.streams.state.SessionBytesStoreSupplier", "org.apache.kafka.streams.state.WindowBytesStoreSupplier" ]
import org.apache.kafka.streams.state.SessionBytesStoreSupplier; import org.apache.kafka.streams.state.WindowBytesStoreSupplier;
import org.apache.kafka.streams.state.*;
[ "org.apache.kafka" ]
org.apache.kafka;
1,568,343
public boolean equals(SNumber o) { SNumber num1 = (_numValue != null) ? _numValue : _numDefValue; if ((num1 == null) || (o == null)) { return (num1 == o) ? true : false; } return _numValue.equals(o); }
boolean function(SNumber o) { SNumber num1 = (_numValue != null) ? _numValue : _numDefValue; if ((num1 == null) (o == null)) { return (num1 == o) ? true : false; } return _numValue.equals(o); }
/** * Tests whether this object is equal to the specified object * * @param o the object to test * * @return <code>true</code> if this object is the same as the specified object; <code>false</code> otherwise */
Tests whether this object is equal to the specified object
equals
{ "repo_name": "appnativa/rare", "path": "source/spot/src/com/appnativa/spot/SPOTReal.java", "license": "gpl-3.0", "size": 18032 }
[ "com.appnativa.util.SNumber" ]
import com.appnativa.util.SNumber;
import com.appnativa.util.*;
[ "com.appnativa.util" ]
com.appnativa.util;
1,121,241
public void testBadTypeDefInterfaceAndStructuralTyping5() throws Exception { JSDocInfo jsdoc = parse("@record*/"); assertThat(jsdoc.isInterface()).isTrue(); }
void function() throws Exception { JSDocInfo jsdoc = parse(STR); assertThat(jsdoc.isInterface()).isTrue(); }
/** * test structural interface matching */
test structural interface matching
testBadTypeDefInterfaceAndStructuralTyping5
{ "repo_name": "LorenzoDV/closure-compiler", "path": "test/com/google/javascript/jscomp/parsing/JsDocInfoParserTest.java", "license": "apache-2.0", "size": 163459 }
[ "com.google.common.truth.Truth", "com.google.javascript.rhino.JSDocInfo" ]
import com.google.common.truth.Truth; import com.google.javascript.rhino.JSDocInfo;
import com.google.common.truth.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
1,028,221
private Element createNetworkCapacityElement(NetworkDemand networkDemand) { Guard.check(networkDemand); log_.debug("Creating network capacity node"); Element networkCapacity = document_.createElement("network_capacity"); Element rxCapacity = createElementWithContent("rx_capacity", String.valueOf(networkDemand.getRxBytes())); Element txCapacity = createElementWithContent("tx_capacity", String.valueOf(networkDemand.getTxBytes())); networkCapacity.appendChild(rxCapacity); networkCapacity.appendChild(txCapacity); return networkCapacity; }
Element function(NetworkDemand networkDemand) { Guard.check(networkDemand); log_.debug(STR); Element networkCapacity = document_.createElement(STR); Element rxCapacity = createElementWithContent(STR, String.valueOf(networkDemand.getRxBytes())); Element txCapacity = createElementWithContent(STR, String.valueOf(networkDemand.getTxBytes())); networkCapacity.appendChild(rxCapacity); networkCapacity.appendChild(txCapacity); return networkCapacity; }
/** * Creates network capacity node. * * @param networkDemand The network demand * @return The element */
Creates network capacity node
createNetworkCapacityElement
{ "repo_name": "snoozesoftware/snoozeclient", "path": "src/main/java/org/inria/myriads/snoozeclient/database/api/impl/ClientXMLRepository.java", "license": "gpl-2.0", "size": 49726 }
[ "org.inria.myriads.snoozecommon.communication.virtualcluster.monitoring.NetworkDemand", "org.inria.myriads.snoozecommon.guard.Guard", "org.w3c.dom.Element" ]
import org.inria.myriads.snoozecommon.communication.virtualcluster.monitoring.NetworkDemand; import org.inria.myriads.snoozecommon.guard.Guard; import org.w3c.dom.Element;
import org.inria.myriads.snoozecommon.communication.virtualcluster.monitoring.*; import org.inria.myriads.snoozecommon.guard.*; import org.w3c.dom.*;
[ "org.inria.myriads", "org.w3c.dom" ]
org.inria.myriads; org.w3c.dom;
2,550,138
protected void showFocus() { if (getHostFigure() instanceof WrappingLabel) { ((WrappingLabel) getHostFigure()).setFocus(true); } else { hideFocus(); addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); refreshFocusFeedback(); } }
void function() { if (getHostFigure() instanceof WrappingLabel) { ((WrappingLabel) getHostFigure()).setFocus(true); } else { hideFocus(); addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); refreshFocusFeedback(); } }
/** * Show focus. * * @generated */
Show focus
showFocus
{ "repo_name": "albertfdp/petrinet", "path": "src/dk.dtu.se2.geometry.diagram/src/geometry/diagram/edit/policies/GeometryTextNonResizableEditPolicy.java", "license": "mit", "size": 6601 }
[ "org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel" ]
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.draw2d.ui.figures.*;
[ "org.eclipse.gmf" ]
org.eclipse.gmf;
1,176,041
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<JobExecutionInner> listByJobExecution( String resourceGroupName, String serverName, String jobAgentName, String jobName, UUID jobExecutionId);
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<JobExecutionInner> listByJobExecution( String resourceGroupName, String serverName, String jobAgentName, String jobName, UUID jobExecutionId);
/** * Lists the step executions of a job execution. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value * from the Azure Resource Manager API or the portal. * @param serverName The name of the server. * @param jobAgentName The name of the job agent. * @param jobName The name of the job to get. * @param jobExecutionId The id of the job execution. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of job executions. */
Lists the step executions of a job execution
listByJobExecution
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/fluent/JobStepExecutionsClient.java", "license": "mit", "size": 11457 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedIterable", "com.azure.resourcemanager.sql.fluent.models.JobExecutionInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.sql.fluent.models.JobExecutionInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.sql.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
620,412
@Test public void testSuspendOneXAConnection() throws Exception { IPhynixxXAConnection<ITestConnection> xaCon = factory1.getXAConnection(); this.getTransactionManager().begin(); ITestConnection outCon = xaCon.getConnection(); outCon.act(1); Transaction tx = this.getTransactionManager().suspend(); this.getTransactionManager().begin(); // associate connection to current transactional branch ITestConnection innerCon = xaCon.getConnection(); innerCon.act(1); this.getTransactionManager().commit(); this.getTransactionManager().resume(tx); this.getTransactionManager().rollback(); // different transactional branches Assert.assertTrue(outCon.getConnectionId() != innerCon.getConnectionId()); log.info(TestConnectionStatusManager.toDebugString()); TestStatusStack statusStack1 = TestConnectionStatusManager.getStatusStack(outCon.getConnectionId()); TestCase.assertTrue(statusStack1 != null); TestCase.assertTrue(statusStack1.isRolledback()); TestCase.assertFalse(statusStack1.isCommitted()); TestCase.assertTrue(statusStack1.isReleased()); TestStatusStack statusStack2 = TestConnectionStatusManager.getStatusStack(innerCon.getConnectionId()); TestCase.assertTrue(statusStack2 != null); TestCase.assertTrue(statusStack2.isCommitted()); // one-phase commit -> no prepare TestCase.assertTrue(!statusStack2.isPrepared()); TestCase.assertFalse(statusStack2.isRolledback()); TestCase.assertTrue(statusStack2.isReleased()); }
void function() throws Exception { IPhynixxXAConnection<ITestConnection> xaCon = factory1.getXAConnection(); this.getTransactionManager().begin(); ITestConnection outCon = xaCon.getConnection(); outCon.act(1); Transaction tx = this.getTransactionManager().suspend(); this.getTransactionManager().begin(); ITestConnection innerCon = xaCon.getConnection(); innerCon.act(1); this.getTransactionManager().commit(); this.getTransactionManager().resume(tx); this.getTransactionManager().rollback(); Assert.assertTrue(outCon.getConnectionId() != innerCon.getConnectionId()); log.info(TestConnectionStatusManager.toDebugString()); TestStatusStack statusStack1 = TestConnectionStatusManager.getStatusStack(outCon.getConnectionId()); TestCase.assertTrue(statusStack1 != null); TestCase.assertTrue(statusStack1.isRolledback()); TestCase.assertFalse(statusStack1.isCommitted()); TestCase.assertTrue(statusStack1.isReleased()); TestStatusStack statusStack2 = TestConnectionStatusManager.getStatusStack(innerCon.getConnectionId()); TestCase.assertTrue(statusStack2 != null); TestCase.assertTrue(statusStack2.isCommitted()); TestCase.assertTrue(!statusStack2.isPrepared()); TestCase.assertFalse(statusStack2.isRolledback()); TestCase.assertTrue(statusStack2.isReleased()); }
/** * * Suspending one XAConnection opens a second transactional branch and * therefore a second physical connection. * * remember: the connection are associated to a TX by the call of * xaConn.getConnection * * @throws Exception */
Suspending one XAConnection opens a second transactional branch and therefore a second physical connection. remember: the connection are associated to a TX by the call of xaConn.getConnection
testSuspendOneXAConnection
{ "repo_name": "csc19601128/Phynixx", "path": "phynixx/phynixx-xa/src/test/java/org/csc/phynixx/xa/JotmIntegrationTest.java", "license": "apache-2.0", "size": 45549 }
[ "javax.transaction.Transaction", "junit.framework.TestCase", "org.csc.phynixx.phynixx.testconnection.ITestConnection", "org.csc.phynixx.phynixx.testconnection.TestConnectionStatusManager", "org.csc.phynixx.phynixx.testconnection.TestStatusStack", "org.junit.Assert" ]
import javax.transaction.Transaction; import junit.framework.TestCase; import org.csc.phynixx.phynixx.testconnection.ITestConnection; import org.csc.phynixx.phynixx.testconnection.TestConnectionStatusManager; import org.csc.phynixx.phynixx.testconnection.TestStatusStack; import org.junit.Assert;
import javax.transaction.*; import junit.framework.*; import org.csc.phynixx.phynixx.testconnection.*; import org.junit.*;
[ "javax.transaction", "junit.framework", "org.csc.phynixx", "org.junit" ]
javax.transaction; junit.framework; org.csc.phynixx; org.junit;
1,677,692
public synchronized void updateShort(int columnIndex, short x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setShort(columnIndex, x); } else { this.inserter.setShort(columnIndex, x); this.thisRow.setColumnValue(columnIndex - 1, this.inserter .getBytesRepresentation(columnIndex - 1)); } }
synchronized void function(int columnIndex, short x) throws SQLException { if (!this.onInsertRow) { if (!this.doingUpdates) { this.doingUpdates = true; syncUpdate(); } this.updater.setShort(columnIndex, x); } else { this.inserter.setShort(columnIndex, x); this.thisRow.setColumnValue(columnIndex - 1, this.inserter .getBytesRepresentation(columnIndex - 1)); } }
/** * JDBC 2.0 Update a column with a short value. The updateXXX() methods are * used to update column values in the current row, or the insert row. The * updateXXX() methods do not update the underlying database, instead the * updateRow() or insertRow() methods are called to update the database. * * @param columnIndex * the first column is 1, the second is 2, ... * @param x * the new column value * * @exception SQLException * if a database-access error occurs */
JDBC 2.0 Update a column with a short value. The updateXXX() methods are used to update column values in the current row, or the insert row. The updateXXX() methods do not update the underlying database, instead the updateRow() or insertRow() methods are called to update the database
updateShort
{ "repo_name": "shubhanshu-gupta/Apache-Solr", "path": "example/solr/collection1/lib/mysql-connector-java-5.1.32/src/com/mysql/jdbc/UpdatableResultSet.java", "license": "apache-2.0", "size": 81419 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,816,691
private String doBackwardPathOnly(final FedoraResource resource) { String path = reverse.convert(getPath(resource)); if (path != null) { if (resource instanceof NonRdfSourceDescription) { path = path + "/" + FCR_METADATA; } if (path.endsWith(JCR_CONTENT)) { path = replaceOnce(path, "/" + JCR_CONTENT, EMPTY); } return path; } throw new RepositoryRuntimeException("Unable to process reverse chain for resource " + resource); }
String function(final FedoraResource resource) { String path = reverse.convert(getPath(resource)); if (path != null) { if (resource instanceof NonRdfSourceDescription) { path = path + "/" + FCR_METADATA; } if (path.endsWith(JCR_CONTENT)) { path = replaceOnce(path, "/" + JCR_CONTENT, EMPTY); } return path; } throw new RepositoryRuntimeException(STR + resource); }
/** * Get only the resource path to this resource, before embedding it in a full URI * @param resource * @return */
Get only the resource path to this resource, before embedding it in a full URI
doBackwardPathOnly
{ "repo_name": "nianma/fcrepo4", "path": "fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverter.java", "license": "apache-2.0", "size": 17229 }
[ "org.apache.commons.lang3.StringUtils", "org.fcrepo.kernel.api.exception.RepositoryRuntimeException", "org.fcrepo.kernel.api.models.FedoraResource", "org.fcrepo.kernel.api.models.NonRdfSourceDescription" ]
import org.apache.commons.lang3.StringUtils; import org.fcrepo.kernel.api.exception.RepositoryRuntimeException; import org.fcrepo.kernel.api.models.FedoraResource; import org.fcrepo.kernel.api.models.NonRdfSourceDescription;
import org.apache.commons.lang3.*; import org.fcrepo.kernel.api.exception.*; import org.fcrepo.kernel.api.models.*;
[ "org.apache.commons", "org.fcrepo.kernel" ]
org.apache.commons; org.fcrepo.kernel;
1,911,746
protected boolean isPersisted(Resource resource) { boolean result = false; try { InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); if (stream != null) { result = true; stream.close(); } } catch (IOException e) { // Ignore } return result; }
boolean function(Resource resource) { boolean result = false; try { InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); if (stream != null) { result = true; stream.close(); } } catch (IOException e) { } return result; }
/** * This returns whether something has been persisted to the URI of the specified resource. * The implementation uses the URI converter from the editor's resource set to try to open an input stream. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns whether something has been persisted to the URI of the specified resource. The implementation uses the URI converter from the editor's resource set to try to open an input stream.
isPersisted
{ "repo_name": "occiware/Multi-Cloud-Studio", "path": "plugins/org.eclipse.cmf.occi.multicloud.elasticocci.editor/src-gen/org/eclipse/cmf/occi/multicloud/elasticocci/presentation/ElasticocciEditor.java", "license": "epl-1.0", "size": 55123 }
[ "java.io.IOException", "java.io.InputStream", "org.eclipse.emf.ecore.resource.Resource" ]
import java.io.IOException; import java.io.InputStream; import org.eclipse.emf.ecore.resource.Resource;
import java.io.*; import org.eclipse.emf.ecore.resource.*;
[ "java.io", "org.eclipse.emf" ]
java.io; org.eclipse.emf;
1,963,049
static List<HRegionInfo> getRegionInfos(final GetOnlineRegionResponse proto) { if (proto == null) return null; List<HRegionInfo> regionInfos = new ArrayList<HRegionInfo>(); for (RegionInfo regionInfo: proto.getRegionInfoList()) { regionInfos.add(HRegionInfo.convert(regionInfo)); } return regionInfos; }
static List<HRegionInfo> getRegionInfos(final GetOnlineRegionResponse proto) { if (proto == null) return null; List<HRegionInfo> regionInfos = new ArrayList<HRegionInfo>(); for (RegionInfo regionInfo: proto.getRegionInfoList()) { regionInfos.add(HRegionInfo.convert(regionInfo)); } return regionInfos; }
/** * Get the list of region info from a GetOnlineRegionResponse * * @param proto the GetOnlineRegionResponse * @return the list of region info or null if <code>proto</code> is null */
Get the list of region info from a GetOnlineRegionResponse
getRegionInfos
{ "repo_name": "Jackygq1982/hbase_src", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java", "license": "apache-2.0", "size": 107497 }
[ "java.util.ArrayList", "java.util.List", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.protobuf.generated.AdminProtos", "org.apache.hadoop.hbase.protobuf.generated.HBaseProtos" ]
import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.protobuf.generated.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
273,387
protected Object[] createItemArray(XYZDataset dataset, int series, int item) { Object[] result = new Object[4]; result[0] = dataset.getSeriesKey(series).toString(); Number x = dataset.getX(series, item); DateFormat xf = getXDateFormat(); if (xf != null) { result[1] = xf.format(x); } else { result[1] = getXFormat().format(x); } Number y = dataset.getY(series, item); DateFormat yf = getYDateFormat(); if (yf != null) { result[2] = yf.format(y); } else { result[2] = getYFormat().format(y); } Number z = dataset.getZ(series, item); if (this.zDateFormat != null) { result[3] = this.zDateFormat.format(z); } else { result[3] = this.zFormat.format(z); } return result; }
Object[] function(XYZDataset dataset, int series, int item) { Object[] result = new Object[4]; result[0] = dataset.getSeriesKey(series).toString(); Number x = dataset.getX(series, item); DateFormat xf = getXDateFormat(); if (xf != null) { result[1] = xf.format(x); } else { result[1] = getXFormat().format(x); } Number y = dataset.getY(series, item); DateFormat yf = getYDateFormat(); if (yf != null) { result[2] = yf.format(y); } else { result[2] = getYFormat().format(y); } Number z = dataset.getZ(series, item); if (this.zDateFormat != null) { result[3] = this.zDateFormat.format(z); } else { result[3] = this.zFormat.format(z); } return result; }
/** * Creates the array of items that can be passed to the * {@link MessageFormat} class for creating labels. * * @param dataset the dataset (<code>null</code> not permitted). * @param series the series (zero-based index). * @param item the item (zero-based index). * * @return The items (never <code>null</code>). */
Creates the array of items that can be passed to the <code>MessageFormat</code> class for creating labels
createItemArray
{ "repo_name": "SpoonLabs/astor", "path": "examples/chart_11/source/org/jfree/chart/labels/BubbleXYItemLabelGenerator.java", "license": "gpl-2.0", "size": 9010 }
[ "java.text.DateFormat", "org.jfree.data.xy.XYZDataset" ]
import java.text.DateFormat; import org.jfree.data.xy.XYZDataset;
import java.text.*; import org.jfree.data.xy.*;
[ "java.text", "org.jfree.data" ]
java.text; org.jfree.data;
1,623,681
private void setParameters(double[] parameters) { JodaBeanUtils.notNull(parameters, "parameters"); this._parameters = parameters; }
void function(double[] parameters) { JodaBeanUtils.notNull(parameters, STR); this._parameters = parameters; }
/** * Sets the array with the four parameters used to describe the function. * The parameters are beta0, beta1, beta2 and lambda (in that order). * @param parameters the new value of the property, not null */
Sets the array with the four parameters used to describe the function. The parameters are beta0, beta1, beta2 and lambda (in that order)
setParameters
{ "repo_name": "McLeodMoores/starling", "path": "projects/analytics/src/main/java/com/opengamma/analytics/math/curve/DoublesCurveNelsonSiegel.java", "license": "apache-2.0", "size": 10690 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,463,726
public static SequenceFile.Writer createSequenceWriter(JobConf jc, FileSystem fs, Path file, Class<?> keyClass, Class<?> valClass, boolean isCompressed, Progressable progressable) throws IOException { CompressionCodec codec = null; CompressionType compressionType = CompressionType.NONE; Class codecClass = null; if (isCompressed) { compressionType = SequenceFileOutputFormat.getOutputCompressionType(jc); codecClass = FileOutputFormat.getOutputCompressorClass(jc, DefaultCodec.class); codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, jc); } return SequenceFile.createWriter(fs, jc, file, keyClass, valClass, compressionType, codec, progressable); }
static SequenceFile.Writer function(JobConf jc, FileSystem fs, Path file, Class<?> keyClass, Class<?> valClass, boolean isCompressed, Progressable progressable) throws IOException { CompressionCodec codec = null; CompressionType compressionType = CompressionType.NONE; Class codecClass = null; if (isCompressed) { compressionType = SequenceFileOutputFormat.getOutputCompressionType(jc); codecClass = FileOutputFormat.getOutputCompressorClass(jc, DefaultCodec.class); codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, jc); } return SequenceFile.createWriter(fs, jc, file, keyClass, valClass, compressionType, codec, progressable); }
/** * Create a sequencefile output stream based on job configuration Uses user supplied compression * flag (rather than obtaining it from the Job Configuration). * * @param jc * Job configuration * @param fs * File System to create file in * @param file * Path to be created * @param keyClass * Java Class for key * @param valClass * Java Class for value * @return output stream over the created sequencefile */
Create a sequencefile output stream based on job configuration Uses user supplied compression flag (rather than obtaining it from the Job Configuration)
createSequenceWriter
{ "repo_name": "WANdisco/amplab-hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java", "license": "apache-2.0", "size": 137553 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path", "org.apache.hadoop.io.SequenceFile", "org.apache.hadoop.io.compress.CompressionCodec", "org.apache.hadoop.io.compress.DefaultCodec", "org.apache.hadoop.mapred.FileOutputFormat", "org.apache.hadoop.mapred.JobConf", "org.apache.hadoop.mapred.SequenceFileOutputFormat", "org.apache.hadoop.util.Progressable", "org.apache.hadoop.util.ReflectionUtils" ]
import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.compress.CompressionCodec; import org.apache.hadoop.io.compress.DefaultCodec; import org.apache.hadoop.mapred.FileOutputFormat; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.SequenceFileOutputFormat; import org.apache.hadoop.util.Progressable; import org.apache.hadoop.util.ReflectionUtils;
import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; import org.apache.hadoop.io.compress.*; import org.apache.hadoop.mapred.*; import org.apache.hadoop.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,089,235
protected ModelOperation createInstanceOperation_AddElementList(Element element, boolean interfaceOnly) { String elementName = ModelLayerHelper.getElementNameCapped(element); String elementNameUncapped = ModelLayerHelper.getElementTypeLocalPartUncapped(element); String elementClassName = ModelLayerHelper.getElementClassName(element); boolean twoWaySelfReferencing = ElementUtil.isTwoWaySelfReferencing(element); ModelOperation modelOperation = new ModelOperation(); modelOperation.setName("add"+elementName+"Records"); modelOperation.setModifiers(Modifier.PUBLIC); if (twoWaySelfReferencing) modelOperation.addParameter(createParameter("Long", "parentId")); modelOperation.addParameter(createParameter(elementClassName, elementNameUncapped+"List", "collection")); modelOperation.addImportedClass("java.util.Collection"); modelOperation.setResultType("List<Long>"); if (interfaceOnly == false) { provider.setElement(element); modelOperation.addAnnotation(AnnotationUtil.createOverrideAnnotation()); provider.generateSourceCode_AddElementList(modelOperation, element); } return modelOperation; }
ModelOperation function(Element element, boolean interfaceOnly) { String elementName = ModelLayerHelper.getElementNameCapped(element); String elementNameUncapped = ModelLayerHelper.getElementTypeLocalPartUncapped(element); String elementClassName = ModelLayerHelper.getElementClassName(element); boolean twoWaySelfReferencing = ElementUtil.isTwoWaySelfReferencing(element); ModelOperation modelOperation = new ModelOperation(); modelOperation.setName("add"+elementName+STR); modelOperation.setModifiers(Modifier.PUBLIC); if (twoWaySelfReferencing) modelOperation.addParameter(createParameter("Long", STR)); modelOperation.addParameter(createParameter(elementClassName, elementNameUncapped+"List", STR)); modelOperation.addImportedClass(STR); modelOperation.setResultType(STR); if (interfaceOnly == false) { provider.setElement(element); modelOperation.addAnnotation(AnnotationUtil.createOverrideAnnotation()); provider.generateSourceCode_AddElementList(modelOperation, element); } return modelOperation; }
/** * AddElementList operation * ------------------------ */
AddElementList operation ------------------------
createInstanceOperation_AddElementList
{ "repo_name": "tfisher1226/ARIES", "path": "nam/nam-engine/src/main/java/aries/codegen/AbstractManagementBeanBuilder.java", "license": "apache-2.0", "size": 61221 }
[ "java.lang.reflect.Modifier", "java.util.List" ]
import java.lang.reflect.Modifier; import java.util.List;
import java.lang.reflect.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
196,038
public void writeEndWiki() throws IOException { super.writeEndWiki(); if (revisions % interval != 0) showProgress(); }
void function() throws IOException { super.writeEndWiki(); if (revisions % interval != 0) showProgress(); }
/** * If we didn't just show a progress report on the last revision, * show the final results. * @throws IOException */
If we didn't just show a progress report on the last revision, show the final results
writeEndWiki
{ "repo_name": "taolee/XmlDataAnalysisToolsets", "path": "DataAnalysis_SoftwareEngineering/bugc/src/org/honeywell/acs/bugcompiler/ProgressFilter.java", "license": "bsd-3-clause", "size": 3098 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,558,426
@Override public Iterator<Map.Entry<K, V>> iterator() { return entrySet().iterator(); }
Iterator<Map.Entry<K, V>> function() { return entrySet().iterator(); }
/** * Possible problem here: modification through {@link Entry#setValue(Object) */
Possible problem here: modification through {@link Entry#setValue(Object)
iterator
{ "repo_name": "happyspace/goclipse", "path": "plugin_tooling/src-util/melnorme/utilbox/collections/HashMap2.java", "license": "epl-1.0", "size": 1716 }
[ "java.util.Iterator", "java.util.Map" ]
import java.util.Iterator; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,420,525
Collection<Rule> findByRepository(String repository);
Collection<Rule> findByRepository(String repository);
/** * Get the rules of the given repository. Returns an empty collection if the * repository does not exist. */
Get the rules of the given repository. Returns an empty collection if the repository does not exist
findByRepository
{ "repo_name": "lbndev/sonarqube", "path": "sonar-plugin-api/src/main/java/org/sonar/api/batch/rule/Rules.java", "license": "lgpl-3.0", "size": 1654 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
118,838
protected static String decode(String str) { if (str == null) { throw new IllegalArgumentException("str must not be null"); //$NON-NLS-1$ } str = str.replace(URL_ENCODED_SPACE, "+"); //$NON-NLS-1$ try { return URLDecoder.decode(str, UTF_8); } catch (UnsupportedEncodingException e) { String msg = String.format("An encoding error occurred during the %s encoding of string \"%s\". The exception message is \"%s\".", UTF_8, str, e.getMessage()); //$NON-NLS-1$ throw new RuntimeException(msg, e); } }
static String function(String str) { if (str == null) { throw new IllegalArgumentException(STR); } str = str.replace(URL_ENCODED_SPACE, "+"); try { return URLDecoder.decode(str, UTF_8); } catch (UnsupportedEncodingException e) { String msg = String.format(STR%s\STR%s\".", UTF_8, str, e.getMessage()); throw new RuntimeException(msg, e); } }
/** * Decodes any encoded characters considered illegal in URIs to their unescaped equivalents. * * @param str * The string to escape. Must not be <code>null</code>. * * @return The new string with unescaped characters. If the source contains no illegal characters, the original is returned. If decoding errors are * encountered (which can't be imagined), the error message is returned. */
Decodes any encoded characters considered illegal in URIs to their unescaped equivalents
decode
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.security.oauth/src/com/ibm/ws/security/oauth20/web/AbstractOidcEndpointServices.java", "license": "epl-1.0", "size": 32701 }
[ "java.io.UnsupportedEncodingException", "java.net.URLDecoder" ]
import java.io.UnsupportedEncodingException; import java.net.URLDecoder;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
723,288
public static MultivaluedMap<String, String> decode(MultivaluedMap<String, String> map) { MultivaluedMapImpl<String, String> decoded = new MultivaluedMapImpl<String, String>(); for (Map.Entry<String, List<String>> entry : map.entrySet()) { List<String> values = entry.getValue(); for (String value : values) { try { decoded.add(URLDecoder.decode(entry.getKey(), UTF_8), URLDecoder.decode(value, UTF_8)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } } return decoded; }
static MultivaluedMap<String, String> function(MultivaluedMap<String, String> map) { MultivaluedMapImpl<String, String> decoded = new MultivaluedMapImpl<String, String>(); for (Map.Entry<String, List<String>> entry : map.entrySet()) { List<String> values = entry.getValue(); for (String value : values) { try { decoded.add(URLDecoder.decode(entry.getKey(), UTF_8), URLDecoder.decode(value, UTF_8)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } } return decoded; }
/** * decode an encoded map */
decode an encoded map
decode
{ "repo_name": "mwunderlich/dkpro-lab", "path": "dkpro-lab-core/src/main/java/de/tudarmstadt/ukp/dkpro/lab/resteasy/Encode.java", "license": "apache-2.0", "size": 15200 }
[ "java.io.UnsupportedEncodingException", "java.net.URLDecoder", "java.util.List", "java.util.Map", "javax.ws.rs.core.MultivaluedMap" ]
import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.List; import java.util.Map; import javax.ws.rs.core.MultivaluedMap;
import java.io.*; import java.net.*; import java.util.*; import javax.ws.rs.core.*;
[ "java.io", "java.net", "java.util", "javax.ws" ]
java.io; java.net; java.util; javax.ws;
1,245,642
protected StartupStorageCommand createStartUpStorageCommand(Connection conn, SR sr) throws XenAPIException, XmlRpcException { configureStorageNameAndDescription(conn, sr); StoragePoolInfo storagePoolInfo = createStoragePoolInfo(conn, sr); StartupStorageCommand cmd = new StartupStorageCommand(); cmd.setPoolInfo(storagePoolInfo); cmd.setGuid(_host.getUuid()); cmd.setDataCenter(Long.toString(_dcId)); cmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); String.format("StartUp command created for local storage [%s] of type [%s] on host [%s]", storagePoolInfo.getUuid(), storagePoolInfo.getPoolType(), _host.getUuid()); return cmd; }
StartupStorageCommand function(Connection conn, SR sr) throws XenAPIException, XmlRpcException { configureStorageNameAndDescription(conn, sr); StoragePoolInfo storagePoolInfo = createStoragePoolInfo(conn, sr); StartupStorageCommand cmd = new StartupStorageCommand(); cmd.setPoolInfo(storagePoolInfo); cmd.setGuid(_host.getUuid()); cmd.setDataCenter(Long.toString(_dcId)); cmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); String.format(STR, storagePoolInfo.getUuid(), storagePoolInfo.getPoolType(), _host.getUuid()); return cmd; }
/** * This method creates the StartUp storage command for the local SR. * We will configure 'name-label' and 'description' using {@link #configureStorageNameAndDescription(Connection, SR)}. * Then, we will create the POJO {@link StoragePoolInfo} with SR's information using method {@link #createStoragePoolInfo(Connection, SR)}. */
This method creates the StartUp storage command for the local SR. We will configure 'name-label' and 'description' using <code>#configureStorageNameAndDescription(Connection, SR)</code>. Then, we will create the POJO <code>StoragePoolInfo</code> with SR's information using method <code>#createStoragePoolInfo(Connection, SR)</code>
createStartUpStorageCommand
{ "repo_name": "GabrielBrascher/cloudstack", "path": "plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java", "license": "apache-2.0", "size": 251237 }
[ "com.cloud.agent.api.StartupStorageCommand", "com.cloud.agent.api.StoragePoolInfo", "com.cloud.storage.Storage", "com.xensource.xenapi.Connection", "com.xensource.xenapi.Types", "org.apache.xmlrpc.XmlRpcException" ]
import com.cloud.agent.api.StartupStorageCommand; import com.cloud.agent.api.StoragePoolInfo; import com.cloud.storage.Storage; import com.xensource.xenapi.Connection; import com.xensource.xenapi.Types; import org.apache.xmlrpc.XmlRpcException;
import com.cloud.agent.api.*; import com.cloud.storage.*; import com.xensource.xenapi.*; import org.apache.xmlrpc.*;
[ "com.cloud.agent", "com.cloud.storage", "com.xensource.xenapi", "org.apache.xmlrpc" ]
com.cloud.agent; com.cloud.storage; com.xensource.xenapi; org.apache.xmlrpc;
1,586,049
private String generateDate() { Date today = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MMMM/yy HH:mm:ss"); String dateNow = dateFormat.format(today); return dateNow; }
String function() { Date today = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat(STR); String dateNow = dateFormat.format(today); return dateNow; }
/** * Generates the date and time that the Parcel was scanned by our hub. * @return The current date as a string `dd-MM-yy_HH-mm-SS` */
Generates the date and time that the Parcel was scanned by our hub
generateDate
{ "repo_name": "SpaceKatt/cs143_project-two_parcelhub", "path": "src/parcelhub/objects/Parcel.java", "license": "gpl-3.0", "size": 8687 }
[ "java.text.SimpleDateFormat", "java.util.Date" ]
import java.text.SimpleDateFormat; import java.util.Date;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
2,394,503
public boolean isValid() { Validate.notEmpty(vehicles, "vehicles must be defined"); for (Vehicle v : vehicles) { if (!v.isValid()) { return false; } } return true; } //----------------------------- Overrides --------------------------------//
boolean function() { Validate.notEmpty(vehicles, STR); for (Vehicle v : vehicles) { if (!v.isValid()) { return false; } } return true; }
/** * Check if the solution is valid. * @return true if it's valid, false otherwise. */
Check if the solution is valid
isValid
{ "repo_name": "atzeinicola/jvrp", "path": "src/main/java/it/unica/informatica/ro/vrp/problem/Solution.java", "license": "gpl-2.0", "size": 1986 }
[ "it.unica.informatica.ro.vrp.problem.model.Vehicle", "org.apache.commons.lang.Validate" ]
import it.unica.informatica.ro.vrp.problem.model.Vehicle; import org.apache.commons.lang.Validate;
import it.unica.informatica.ro.vrp.problem.model.*; import org.apache.commons.lang.*;
[ "it.unica.informatica", "org.apache.commons" ]
it.unica.informatica; org.apache.commons;
1,926,796
@Public @InterfaceStability.Unstable public void setResourceValue(String resource, long value) throws ResourceNotFoundException { if (resource.equals(ResourceInformation.MEMORY_URI)) { this.setMemorySize(value); return; } if (resource.equals(ResourceInformation.VCORES_URI)) { if (value > Integer.MAX_VALUE) { value = (long) Integer.MAX_VALUE; } this.setVirtualCores((int)value); return; } ResourceInformation storedResourceInfo = getResourceInformation(resource); storedResourceInfo.setValue(value); }
@InterfaceStability.Unstable void function(String resource, long value) throws ResourceNotFoundException { if (resource.equals(ResourceInformation.MEMORY_URI)) { this.setMemorySize(value); return; } if (resource.equals(ResourceInformation.VCORES_URI)) { if (value > Integer.MAX_VALUE) { value = (long) Integer.MAX_VALUE; } this.setVirtualCores((int)value); return; } ResourceInformation storedResourceInfo = getResourceInformation(resource); storedResourceInfo.setValue(value); }
/** * Set the value of a resource in the ResourceInformation object. The unit of * the value is assumed to be the one in the ResourceInformation object. * * @param resource the resource for which the value is provided. * @param value the value to set * @throws ResourceNotFoundException if the resource is not found */
Set the value of a resource in the ResourceInformation object. The unit of the value is assumed to be the one in the ResourceInformation object
setResourceValue
{ "repo_name": "szegedim/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java", "license": "apache-2.0", "size": 17970 }
[ "org.apache.hadoop.classification.InterfaceStability", "org.apache.hadoop.yarn.exceptions.ResourceNotFoundException" ]
import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.yarn.exceptions.ResourceNotFoundException;
import org.apache.hadoop.classification.*; import org.apache.hadoop.yarn.exceptions.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,691,952
public List<Integer> getInNeighbors(int v) { List<Integer> inNeighbors = new ArrayList<Integer>(); for (int u : adjListsMap.keySet()) { //iterate through all edges in u's adjacency list and //add u to the inNeighbor list of v whenever an edge //with startpoint u has endpoint v. for (int w : adjListsMap.get(u)) { if (v == w) { inNeighbors.add(u); } } } return inNeighbors; }
List<Integer> function(int v) { List<Integer> inNeighbors = new ArrayList<Integer>(); for (int u : adjListsMap.keySet()) { for (int w : adjListsMap.get(u)) { if (v == w) { inNeighbors.add(u); } } } return inNeighbors; }
/** * Implement the abstract method for finding all in-neighbors of a vertex. If there are multiple edges from another * vertex to this one, the neighbor appears once in the list for each of these edges. * * @param v the index of vertex. * * @return List<Integer> a list of indices of vertices. */
Implement the abstract method for finding all in-neighbors of a vertex. If there are multiple edges from another vertex to this one, the neighbor appears once in the list for each of these edges
getInNeighbors
{ "repo_name": "devinmcgloin/UCSDGraphs", "path": "src/main/java/basicgraph/GraphAdjList.java", "license": "apache-2.0", "size": 3599 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
21,684
@Test public void overridesIndicesInOriginal() { final YamlSequence expected = Yaml .createYamlSequenceBuilder() .add("fourth") .add("fifth") .add("third") .build(); final YamlSequence original = Yaml .createYamlSequenceBuilder() .add("first") .add("second") .add("third") .build(); final YamlSequence changed = Yaml .createYamlSequenceBuilder() .add("fourth") .add("fifth") .build(); MatcherAssert.assertThat( new MergedYamlSequence(original, changed, true), Matchers.equalTo(expected) ); MatcherAssert.assertThat( new MergedYamlSequence(original, ()->changed, true), Matchers.equalTo(expected) ); }
void function() { final YamlSequence expected = Yaml .createYamlSequenceBuilder() .add(STR) .add("fifth") .add("third") .build(); final YamlSequence original = Yaml .createYamlSequenceBuilder() .add("first") .add(STR) .add("third") .build(); final YamlSequence changed = Yaml .createYamlSequenceBuilder() .add(STR) .add("fifth") .build(); MatcherAssert.assertThat( new MergedYamlSequence(original, changed, true), Matchers.equalTo(expected) ); MatcherAssert.assertThat( new MergedYamlSequence(original, ()->changed, true), Matchers.equalTo(expected) ); }
/** * It can override the values at the same indices. */
It can override the values at the same indices
overridesIndicesInOriginal
{ "repo_name": "decorators-squad/camel", "path": "src/test/java/com/amihaiemil/eoyaml/extensions/MergedYamlSequenceTest.java", "license": "bsd-3-clause", "size": 6654 }
[ "com.amihaiemil.eoyaml.Yaml", "com.amihaiemil.eoyaml.YamlSequence", "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers" ]
import com.amihaiemil.eoyaml.Yaml; import com.amihaiemil.eoyaml.YamlSequence; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers;
import com.amihaiemil.eoyaml.*; import org.hamcrest.*;
[ "com.amihaiemil.eoyaml", "org.hamcrest" ]
com.amihaiemil.eoyaml; org.hamcrest;
291,775
public static long sizeOfRelocatingShards(RoutingNode node, ClusterInfo clusterInfo, boolean subtractShardsMovingAway, String dataPath) { long totalSize = 0; for (ShardRouting routing : node.shardsWithState(ShardRoutingState.RELOCATING, ShardRoutingState.INITIALIZING)) { String actualPath = clusterInfo.getDataPath(routing); if (dataPath.equals(actualPath)) { if (routing.initializing() && routing.relocatingNodeId() != null) { totalSize += getShardSize(routing, clusterInfo); } else if (subtractShardsMovingAway && routing.relocating()) { totalSize -= getShardSize(routing, clusterInfo); } } } return totalSize; }
static long function(RoutingNode node, ClusterInfo clusterInfo, boolean subtractShardsMovingAway, String dataPath) { long totalSize = 0; for (ShardRouting routing : node.shardsWithState(ShardRoutingState.RELOCATING, ShardRoutingState.INITIALIZING)) { String actualPath = clusterInfo.getDataPath(routing); if (dataPath.equals(actualPath)) { if (routing.initializing() && routing.relocatingNodeId() != null) { totalSize += getShardSize(routing, clusterInfo); } else if (subtractShardsMovingAway && routing.relocating()) { totalSize -= getShardSize(routing, clusterInfo); } } } return totalSize; }
/** * Returns the size of all shards that are currently being relocated to * the node, but may not be finished transfering yet. * * If subtractShardsMovingAway is set then the size of shards moving away is subtracted from the total size * of all shards */
Returns the size of all shards that are currently being relocated to the node, but may not be finished transfering yet. If subtractShardsMovingAway is set then the size of shards moving away is subtracted from the total size of all shards
sizeOfRelocatingShards
{ "repo_name": "weipinghe/elasticsearch", "path": "core/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java", "license": "apache-2.0", "size": 33937 }
[ "org.elasticsearch.cluster.ClusterInfo", "org.elasticsearch.cluster.routing.RoutingNode", "org.elasticsearch.cluster.routing.ShardRouting", "org.elasticsearch.cluster.routing.ShardRoutingState" ]
import org.elasticsearch.cluster.ClusterInfo; import org.elasticsearch.cluster.routing.RoutingNode; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState;
import org.elasticsearch.cluster.*; import org.elasticsearch.cluster.routing.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
1,802,485
private final Query getAfterDateJavaQuery() { final Query query; query = entityManager.createQuery(findAfterDateJava); query.setParameter("date", date); return query; }
final Query function() { final Query query; query = entityManager.createQuery(findAfterDateJava); query.setParameter("date", date); return query; }
/** * Returns the query for the test. * * @return the query for the test */
Returns the query for the test
getAfterDateJavaQuery
{ "repo_name": "Bernardo-MG/jpa-example", "path": "src/test/java/com/bernardomg/example/jpa/test/integration/temporal/date/ITDateEntityQueryJpql.java", "license": "mit", "size": 11746 }
[ "javax.persistence.Query" ]
import javax.persistence.Query;
import javax.persistence.*;
[ "javax.persistence" ]
javax.persistence;
2,891,193
EClass getImport();
EClass getImport();
/** * Returns the meta object for class '{@link com.euclideanspace.spad.editor.Import <em>Import</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Import</em>'. * @see com.euclideanspace.spad.editor.Import * @generated */
Returns the meta object for class '<code>com.euclideanspace.spad.editor.Import Import</code>'.
getImport
{ "repo_name": "martinbaker/euclideanspace", "path": "com.euclideanspace.spad/src-gen/com/euclideanspace/spad/editor/EditorPackage.java", "license": "agpl-3.0", "size": 593321 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,228,591
protected void addFindingsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Node_findings_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Node_findings_feature", "_UI_Node_type"), AssessmentPackage.Literals.NODE__FINDINGS, true, false, true, null, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), AssessmentPackage.Literals.NODE__FINDINGS, true, false, true, null, null, null)); }
/** * This adds a property descriptor for the Findings feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Findings feature.
addFindingsPropertyDescriptor
{ "repo_name": "CoastalHacking/semiotics-main", "path": "bundles/io.opensemantics.semiotics.model.assessment.edit/src-gen/io/opensemantics/semiotics/model/assessment/provider/NodeItemProvider.java", "license": "apache-2.0", "size": 10772 }
[ "io.opensemantics.semiotics.model.assessment.AssessmentPackage", "org.eclipse.emf.edit.provider.ComposeableAdapterFactory" ]
import io.opensemantics.semiotics.model.assessment.AssessmentPackage; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import io.opensemantics.semiotics.model.assessment.*; import org.eclipse.emf.edit.provider.*;
[ "io.opensemantics.semiotics", "org.eclipse.emf" ]
io.opensemantics.semiotics; org.eclipse.emf;
2,229,531
public void printToLog() { log.atInfo().log("Daemon Port :" + mConfigProto.getDaemonPort()); log.atInfo().log("Keystore :" + mConfigProto.getSslKeystorePath()); log.atInfo().log("Keystore passwd : " + (isNullOrEmpty(mConfigProto.getSslKeystorePassword()) ? "<not given>" : "<given>")); log.atInfo().log("Auth clients :" + mConfigProto.getAuthClientCount()); List<Module> modules = mConfigProto.getModuleList(); log.atInfo().log("Modules : " + modules.size()); log.atInfo().log("---------------------------------"); for (Module module : modules) { log.atInfo().log(" Type : " + module.getType()); for (Channel channel : module.getChannelList()) { log.atInfo().log(" Type : " + channel.getType()); log.atInfo().log(" Addr : " + channel.getAddress()); for (Parameter param : channel.getParameterList()) { log.atInfo().log(" Param : " + param.getName() + " -> " + param.getValue()); } log.atInfo().log("---------------------------------"); } log.atInfo().log("---------------------------------"); } List<Master.Group> groups = mConfigProto.getGroupList(); log.atInfo().log("Groups defined: " + groups.size()); for (Master.Group group : groups) { log.atInfo().log(" Name : " + group.getName()); log.atInfo().log(" Triggers: " + group.getTriggerCount()); } List<KnownNode> knownNodes = mConfigProto.getKnownClientList(); log.atInfo().log("Known nodes: " + knownNodes.size()); log.atInfo().log("---------------------------------"); for (KnownNode knownNode : knownNodes) { log.atInfo().log(" MAC Addr : " + knownNode.getMacAddress()); log.atInfo().log(" Name : " + knownNode.getName()); log.atInfo().log(" Port : " + knownNode.getPort()); log.atInfo().log(" Use SSL : " + knownNode.getUseSsl()); log.atInfo().log(" Config : " + knownNode.getConfigFile()); log.atInfo().log("---------------------------------"); } }
void function() { log.atInfo().log(STR + mConfigProto.getDaemonPort()); log.atInfo().log(STR + mConfigProto.getSslKeystorePath()); log.atInfo().log(STR + (isNullOrEmpty(mConfigProto.getSslKeystorePassword()) ? STR : STR)); log.atInfo().log(STR + mConfigProto.getAuthClientCount()); List<Module> modules = mConfigProto.getModuleList(); log.atInfo().log(STR + modules.size()); log.atInfo().log(STR); for (Module module : modules) { log.atInfo().log(STR + module.getType()); for (Channel channel : module.getChannelList()) { log.atInfo().log(STR + channel.getType()); log.atInfo().log(STR + channel.getAddress()); for (Parameter param : channel.getParameterList()) { log.atInfo().log(STR + param.getName() + STR + param.getValue()); } log.atInfo().log(STR); } log.atInfo().log(STR); } List<Master.Group> groups = mConfigProto.getGroupList(); log.atInfo().log(STR + groups.size()); for (Master.Group group : groups) { log.atInfo().log(STR + group.getName()); log.atInfo().log(STR + group.getTriggerCount()); } List<KnownNode> knownNodes = mConfigProto.getKnownClientList(); log.atInfo().log(STR + knownNodes.size()); log.atInfo().log(STR); for (KnownNode knownNode : knownNodes) { log.atInfo().log(STR + knownNode.getMacAddress()); log.atInfo().log(STR + knownNode.getName()); log.atInfo().log(STR + knownNode.getPort()); log.atInfo().log(STR + knownNode.getUseSsl()); log.atInfo().log(STR + knownNode.getConfigFile()); log.atInfo().log(STR); } }
/** * Will print out the configuration to LOG. */
Will print out the configuration to LOG
printToLog
{ "repo_name": "shaeberling/winston", "path": "winston-server/src/main/java/com/s13g/winston/master/config/ConfigWrapper.java", "license": "apache-2.0", "size": 6403 }
[ "com.s13g.winston.proto.Master", "java.util.List" ]
import com.s13g.winston.proto.Master; import java.util.List;
import com.s13g.winston.proto.*; import java.util.*;
[ "com.s13g.winston", "java.util" ]
com.s13g.winston; java.util;
1,233,521
@Override public void removeByCriteriaCategoryId(int criteria_category_id) { for (CriteriaTemplate criteriaTemplate : findByCriteriaCategoryId( criteria_category_id, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(criteriaTemplate); } }
void function(int criteria_category_id) { for (CriteriaTemplate criteriaTemplate : findByCriteriaCategoryId( criteria_category_id, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(criteriaTemplate); } }
/** * Removes all the criteria templates where criteria_category_id = &#63; from the database. * * @param criteria_category_id the criteria_category_id */
Removes all the criteria templates where criteria_category_id = &#63; from the database
removeByCriteriaCategoryId
{ "repo_name": "falko0000/moduleEProc", "path": "Criterias/Criterias-service/src/main/java/tj/criterias/service/persistence/impl/CriteriaTemplatePersistenceImpl.java", "license": "lgpl-2.1", "size": 74582 }
[ "com.liferay.portal.kernel.dao.orm.QueryUtil" ]
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.*;
[ "com.liferay.portal" ]
com.liferay.portal;
1,236,326
public final String trnc(String context, String singularText, String pluralText, long n) { try { return trnInternal(bundle, context + CONTEXT_GLUE + singularText, pluralText, n); } catch (MissingResourceException e) { return (n == 1) ? singularText : pluralText; } }
final String function(String context, String singularText, String pluralText, long n) { try { return trnInternal(bundle, context + CONTEXT_GLUE + singularText, pluralText, n); } catch (MissingResourceException e) { return (n == 1) ? singularText : pluralText; } }
/** * Returns the plural form for <code>n</code> of the translation of * <code>text</code>. * * @param context * the context of the message to disambiguate it when translating * @param text * the key string to be translated. * @param pluralText * the plural form of <code>text</code>. * @param n * value that determines the plural form * @return the translated text * @since 0.9.5 */
Returns the plural form for <code>n</code> of the translation of <code>text</code>
trnc
{ "repo_name": "alejandroarturom/frostwire-desktop", "path": "lib/jars-src/gettext-commons-0_9_5/src/java/org/xnap/commons/i18n/I18n.java", "license": "gpl-3.0", "size": 17278 }
[ "java.util.MissingResourceException" ]
import java.util.MissingResourceException;
import java.util.*;
[ "java.util" ]
java.util;
1,244,302
public static CauldronBlockMat getCauldron(final int level) { return getByID(DioriteMathUtils.getInRange(level, 0, 3)); }
static CauldronBlockMat function(final int level) { return getByID(DioriteMathUtils.getInRange(level, 0, 3)); }
/** * Returns one of Cauldron sub-type based on water-level. * It will never return null. * * @param level water level. * * @return sub-type of Cauldron */
Returns one of Cauldron sub-type based on water-level. It will never return null
getCauldron
{ "repo_name": "sgdc3/Diorite", "path": "DioriteAPI/src/main/java/org/diorite/material/blocks/tools/CauldronBlockMat.java", "license": "mit", "size": 5507 }
[ "org.diorite.utils.math.DioriteMathUtils" ]
import org.diorite.utils.math.DioriteMathUtils;
import org.diorite.utils.math.*;
[ "org.diorite.utils" ]
org.diorite.utils;
1,459,317
public final class ResultCodeMonitorEntryTestCase extends LDAPSDKTestCase { @Test() public void testAllAttributes() throws Exception { final Entry e = new Entry( "dn: cn=LDAP Result Codes,cn=monitor", "objectClass: top", "objectClass: ds-monitor-entry", "objectClass: ds-ldap-result-codes-monitor-entry", "objectClass: extensibleObject", "cn: LDAP Result Codes", "all-ops-total-count: 603376", "all-ops-failed-count: 215131", "all-ops-failed-percent: 35.655", "all-ops-result-0-name: Success", "all-ops-result-0-count: 369442", "all-ops-result-0-percent: 61.229", "all-ops-result-0-average-response-time-millis: 0.526", "all-ops-result-0-total-response-time-millis: 194575.102", "all-ops-result-4-name: Size Limit Exceeded", "all-ops-result-4-count: 2", "all-ops-result-4-percent: 0.000", "all-ops-result-4-average-response-time-millis: 0.668", "all-ops-result-4-total-response-time-millis: 1.336", "all-ops-result-5-name: Compare False", "all-ops-result-5-count: 9", "all-ops-result-5-percent: 0.001", "all-ops-result-5-average-response-time-millis: 0.273", "all-ops-result-5-total-response-time-millis: 2.463", "all-ops-result-6-name: Compare True", "all-ops-result-6-count: 37", "all-ops-result-6-percent: 0.006", "all-ops-result-6-average-response-time-millis: 0.394", "all-ops-result-6-total-response-time-millis: 14.579", "all-ops-result-10-name: Referral", "all-ops-result-10-count: 91", "all-ops-result-10-percent: 0.015", "all-ops-result-10-average-response-time-millis: 0.735", "all-ops-result-10-total-response-time-millis: 66.953", "all-ops-result-14-name: SASL Bind in Progress", "all-ops-result-14-count: 18664", "all-ops-result-14-percent: 3.093", "all-ops-result-14-average-response-time-millis: 0.047", "all-ops-result-14-total-response-time-millis: 884.570", "all-ops-result-32-name: No Such Entry", "all-ops-result-32-count: 150332", "all-ops-result-32-percent: 24.915", "all-ops-result-32-average-response-time-millis: 0.245", "all-ops-result-32-total-response-time-millis: 36900.186", "all-ops-result-34-name: Invalid DN Syntax", "all-ops-result-34-count: 44349", "all-ops-result-34-percent: 7.350", "all-ops-result-34-average-response-time-millis: 0.026", "all-ops-result-34-total-response-time-millis: 1158.114", "all-ops-result-49-name: Invalid Credentials", "all-ops-result-49-count: 18696", "all-ops-result-49-percent: 3.099", "all-ops-result-49-average-response-time-millis: 0.179", "all-ops-result-49-total-response-time-millis: 3354.933", "all-ops-result-50-name: Insufficient Access Rights", "all-ops-result-50-count: 3", "all-ops-result-50-percent: 0.000", "all-ops-result-50-average-response-time-millis: 0.351", "all-ops-result-50-total-response-time-millis: 1.053", "all-ops-result-53-name: Unwilling to Perform", "all-ops-result-53-count: 3", "all-ops-result-53-percent: 0.000", "all-ops-result-53-average-response-time-millis: 0.341", "all-ops-result-53-total-response-time-millis: 1.025", "all-ops-result-65-name: Object Class Violation", "all-ops-result-65-count: 11", "all-ops-result-65-percent: 0.002", "all-ops-result-65-average-response-time-millis: 0.458", "all-ops-result-65-total-response-time-millis: 5.039", "all-ops-result-66-name: Not Allowed on Non-Leaf", "all-ops-result-66-count: 1", "all-ops-result-66-percent: 0.000", "all-ops-result-66-average-response-time-millis: 0.924", "all-ops-result-66-total-response-time-millis: 0.924", "all-ops-result-80-name: Other", "all-ops-result-80-count: 5", "all-ops-result-80-percent: 0.001", "all-ops-result-80-average-response-time-millis: 5402.056", "all-ops-result-80-total-response-time-millis: 27010.283", "all-ops-result-119-name: No Such Operation", "all-ops-result-119-count: 2", "all-ops-result-119-percent: 0.000", "all-ops-result-119-average-response-time-millis: 11.793", "all-ops-result-119-total-response-time-millis: 23.586", "all-ops-result-122-name: Assertion Failed", "all-ops-result-122-count: 1", "all-ops-result-122-percent: 0.000", "all-ops-result-122-average-response-time-millis: 1.799", "all-ops-result-122-total-response-time-millis: 1.799", "all-ops-result-123-name: Authorization Denied", "all-ops-result-123-count: 1726", "all-ops-result-123-percent: 0.286", "all-ops-result-123-average-response-time-millis: 17.574", "all-ops-result-123-total-response-time-millis: 30333.887", "all-ops-result-16654-name: No Operation", "all-ops-result-16654-count: 2", "all-ops-result-16654-percent: 0.000", "all-ops-result-16654-average-response-time-millis: 0.593", "all-ops-result-16654-total-response-time-millis: 1.187", "add-op-total-count: 636", "add-op-failed-count: 8", "add-op-failed-percent: 1.258", "add-op-result-0-name: Success", "add-op-result-0-count: 614", "add-op-result-0-percent: 96.541", "add-op-result-0-average-response-time-millis: 4.811", "add-op-result-0-total-response-time-millis: 2954.025", "add-op-result-10-name: Referral", "add-op-result-10-count: 12", "add-op-result-10-percent: 1.887", "add-op-result-10-average-response-time-millis: 0.662", "add-op-result-10-total-response-time-millis: 7.944", "add-op-result-32-name: No Such Entry", "add-op-result-32-count: 2", "add-op-result-32-percent: 0.314", "add-op-result-32-average-response-time-millis: 0.395", "add-op-result-32-total-response-time-millis: 0.790", "add-op-result-65-name: Object Class Violation", "add-op-result-65-count: 6", "add-op-result-65-percent: 0.943", "add-op-result-65-average-response-time-millis: 0.428", "add-op-result-65-total-response-time-millis: 2.572", "add-op-result-16654-name: No Operation", "add-op-result-16654-count: 2", "add-op-result-16654-percent: 0.314", "add-op-result-16654-average-response-time-millis: 0.593", "add-op-result-16654-total-response-time-millis: 1.187", "bind-op-total-count: 92421", "bind-op-failed-count: 18697", "bind-op-failed-percent: 20.230", "bind-op-result-0-name: Success", "bind-op-result-0-count: 55060", "bind-op-result-0-percent: 59.575", "bind-op-result-0-average-response-time-millis: 0.253", "bind-op-result-0-total-response-time-millis: 13978.787", "bind-op-result-14-name: SASL Bind in Progress", "bind-op-result-14-count: 18664", "bind-op-result-14-percent: 20.195", "bind-op-result-14-average-response-time-millis: 0.047", "bind-op-result-14-total-response-time-millis: 884.570", "bind-op-result-49-name: Invalid Credentials", "bind-op-result-49-count: 18696", "bind-op-result-49-percent: 20.229", "bind-op-result-49-average-response-time-millis: 0.179", "bind-op-result-49-total-response-time-millis: 3354.933", "bind-op-result-53-name: Unwilling to Perform", "bind-op-result-53-count: 1", "bind-op-result-53-percent: 0.001", "bind-op-result-53-average-response-time-millis: 0.447", "bind-op-result-53-total-response-time-millis: 0.447", "compare-op-total-count: 62", "compare-op-failed-count: 7", "compare-op-failed-percent: 11.290", "compare-op-result-5-name: Compare False", "compare-op-result-5-count: 9", "compare-op-result-5-percent: 14.516", "compare-op-result-5-average-response-time-millis: 0.273", "compare-op-result-5-total-response-time-millis: 2.463", "compare-op-result-6-name: Compare True", "compare-op-result-6-count: 37", "compare-op-result-6-percent: 59.677", "compare-op-result-6-average-response-time-millis: 0.394", "compare-op-result-6-total-response-time-millis: 14.579", "compare-op-result-10-name: Referral", "compare-op-result-10-count: 9", "compare-op-result-10-percent: 14.516", "compare-op-result-10-average-response-time-millis: 0.680", "compare-op-result-10-total-response-time-millis: 6.127", "compare-op-result-32-name: No Such Entry", "compare-op-result-32-count: 6", "compare-op-result-32-percent: 9.677", "compare-op-result-32-average-response-time-millis: 0.263", "compare-op-result-32-total-response-time-millis: 1.581", "compare-op-result-50-name: Insufficient Access Rights", "compare-op-result-50-count: 1", "compare-op-result-50-percent: 1.613", "compare-op-result-50-average-response-time-millis: 0.486", "compare-op-result-50-total-response-time-millis: 0.486", "delete-op-total-count: 313", "delete-op-failed-count: 11", "delete-op-failed-percent: 3.514", "delete-op-result-0-name: Success", "delete-op-result-0-count: 284", "delete-op-result-0-percent: 90.735", "delete-op-result-0-average-response-time-millis: 5.733", "delete-op-result-0-total-response-time-millis: 1628.376", "delete-op-result-10-name: Referral", "delete-op-result-10-count: 18", "delete-op-result-10-percent: 5.751", "delete-op-result-10-average-response-time-millis: 0.796", "delete-op-result-10-total-response-time-millis: 14.343", "delete-op-result-32-name: No Such Entry", "delete-op-result-32-count: 10", "delete-op-result-32-percent: 3.195", "delete-op-result-32-average-response-time-millis: 0.297", "delete-op-result-32-total-response-time-millis: 2.979", "delete-op-result-66-name: Not Allowed on Non-Leaf", "delete-op-result-66-count: 1", "delete-op-result-66-percent: 0.319", "delete-op-result-66-average-response-time-millis: 0.924", "delete-op-result-66-total-response-time-millis: 0.924", "extended-op-total-count: 75", "extended-op-failed-count: 7", "extended-op-failed-percent: 9.333", "extended-op-1-3-6-1-1-21-1-name: Start LDAP Transaction", "extended-op-1-3-6-1-1-21-1-total-count: 2", "extended-op-1-3-6-1-1-21-1-failed-count: 0", "extended-op-1-3-6-1-1-21-1-failed-percent: 0.000", "extended-op-1-3-6-1-1-21-1-result-0-name: Success", "extended-op-1-3-6-1-1-21-1-result-0-count: 2", "extended-op-1-3-6-1-1-21-1-result-0-percent: 100.000", "extended-op-1-3-6-1-1-21-1-result-0-average-response-time-millis: " + "1.031", "extended-op-1-3-6-1-1-21-1-result-0-total-response-time-millis: " + "2.062", "extended-op-1-3-6-1-1-21-3-name: End LDAP Transaction", "extended-op-1-3-6-1-1-21-3-total-count: 2", "extended-op-1-3-6-1-1-21-3-failed-count: 0", "extended-op-1-3-6-1-1-21-3-failed-percent: 0.000", "extended-op-1-3-6-1-1-21-3-result-0-name: Success", "extended-op-1-3-6-1-1-21-3-result-0-count: 2", "extended-op-1-3-6-1-1-21-3-result-0-percent: 100.000", "extended-op-1-3-6-1-1-21-3-result-0-average-response-time-millis: " + "3.390", "extended-op-1-3-6-1-1-21-3-result-0-total-response-time-millis: " + "6.781", "extended-op-1-3-6-1-1-8-name: Cancel", "extended-op-1-3-6-1-1-8-total-count: 2", "extended-op-1-3-6-1-1-8-failed-count: 2", "extended-op-1-3-6-1-1-8-failed-percent: 100.000", "extended-op-1-3-6-1-1-8-result-119-name: No Such Operation", "extended-op-1-3-6-1-1-8-result-119-count: 2", "extended-op-1-3-6-1-1-8-result-119-percent: 100.000", "extended-op-1-3-6-1-1-8-result-119-average-response-time-millis: " + "11.793", "extended-op-1-3-6-1-1-8-result-119-total-response-time-millis: " + "23.586", "extended-op-1-3-6-1-4-1-1466-20037-name: StartTLS", "extended-op-1-3-6-1-4-1-1466-20037-total-count: 19", "extended-op-1-3-6-1-4-1-1466-20037-failed-count: 0", "extended-op-1-3-6-1-4-1-1466-20037-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-1466-20037-result-0-name: Success", "extended-op-1-3-6-1-4-1-1466-20037-result-0-count: 19", "extended-op-1-3-6-1-4-1-1466-20037-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-1466-20037-result-0-average-response-time-" + "millis: 2.868", "extended-op-1-3-6-1-4-1-1466-20037-result-0-total-response-time-" + "millis: 54.502", "extended-op-1-3-6-1-4-1-30221-1-6-1-name: Password Policy State", "extended-op-1-3-6-1-4-1-30221-1-6-1-total-count: 3", "extended-op-1-3-6-1-4-1-30221-1-6-1-failed-count: 0", "extended-op-1-3-6-1-4-1-30221-1-6-1-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-30221-1-6-1-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-1-6-1-result-0-count: 3", "extended-op-1-3-6-1-4-1-30221-1-6-1-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-1-6-1-result-0-average-response-time-" + "millis: 0.957", "extended-op-1-3-6-1-4-1-30221-1-6-1-result-0-total-response-time-" + "millis: 2.871", "extended-op-1-3-6-1-4-1-30221-1-6-2-name: Get Connection ID", "extended-op-1-3-6-1-4-1-30221-1-6-2-total-count: 1", "extended-op-1-3-6-1-4-1-30221-1-6-2-failed-count: 0", "extended-op-1-3-6-1-4-1-30221-1-6-2-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-30221-1-6-2-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-1-6-2-result-0-count: 1", "extended-op-1-3-6-1-4-1-30221-1-6-2-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-1-6-2-result-0-average-response-time-" + "millis: 2.528", "extended-op-1-3-6-1-4-1-30221-1-6-2-result-0-total-response-time-" + "millis: 2.528", "extended-op-1-3-6-1-4-1-30221-1-6-20-name: Get Subtree " + "Accessibility Extended Request", "extended-op-1-3-6-1-4-1-30221-1-6-20-total-count: 10", "extended-op-1-3-6-1-4-1-30221-1-6-20-failed-count: 1", "extended-op-1-3-6-1-4-1-30221-1-6-20-failed-percent: 10.000", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-0-count: 9", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-0-percent: 90.000", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-0-average-response-" + "time-millis: 4.094", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-0-total-response-time-" + "millis: 36.854", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-50-name: Insufficient " + "Access Rights", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-50-count: 1", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-50-percent: 10.000", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-50-average-response-" + "time-millis: 0.418", "extended-op-1-3-6-1-4-1-30221-1-6-20-result-50-total-response-" + "time-millis: 0.418", "extended-op-1-3-6-1-4-1-30221-2-6-1-name: Start Batched Transaction", "extended-op-1-3-6-1-4-1-30221-2-6-1-total-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-1-failed-count: 0", "extended-op-1-3-6-1-4-1-30221-2-6-1-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-30221-2-6-1-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-2-6-1-result-0-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-1-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-2-6-1-result-0-average-response-time-" + "millis: 0.060", "extended-op-1-3-6-1-4-1-30221-2-6-1-result-0-total-response-time-" + "millis: 0.121", "extended-op-1-3-6-1-4-1-30221-2-6-10-name: Get Changelog Batch", "extended-op-1-3-6-1-4-1-30221-2-6-10-total-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-10-failed-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-10-failed-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-2-6-10-result-80-name: Other", "extended-op-1-3-6-1-4-1-30221-2-6-10-result-80-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-10-result-80-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-2-6-10-result-80-average-response-" + "time-millis: 4.094", "extended-op-1-3-6-1-4-1-30221-2-6-10-result-80-total-response-time-" + "millis: 8.189", "extended-op-1-3-6-1-4-1-30221-2-6-19-name: Set Subtree " + "Accessibility Extended Request", "extended-op-1-3-6-1-4-1-30221-2-6-19-total-count: 7", "extended-op-1-3-6-1-4-1-30221-2-6-19-failed-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-19-failed-percent: 28.571", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-0-count: 5", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-0-percent: 71.429", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-0-average-response-" + "time-millis: 6.249", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-0-total-response-time-" + "millis: 31.246", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-50-name: " + "Insufficient Access Rights", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-50-count: 1", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-50-percent: 14.286", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-50-average-response-" + "time-millis: 0.149", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-50-total-response-time-" + "millis: 0.149", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-53-name: Unwilling to " + "Perform", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-53-count: 1", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-53-percent: 14.286", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-53-average-response-" + "time-millis: 0.321", "extended-op-1-3-6-1-4-1-30221-2-6-19-result-53-total-response-time-" + "millis: 0.321", "extended-op-1-3-6-1-4-1-30221-2-6-2-name: End Batched Transaction", "extended-op-1-3-6-1-4-1-30221-2-6-2-total-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-2-failed-count: 0", "extended-op-1-3-6-1-4-1-30221-2-6-2-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-30221-2-6-2-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-2-6-2-result-0-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-2-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-2-6-2-result-0-average-response-" + "time-millis: 1.658", "extended-op-1-3-6-1-4-1-30221-2-6-2-result-0-total-response-time-" + "millis: 3.316", "extended-op-1-3-6-1-4-1-30221-2-6-6-name: Stream Directory Values", "extended-op-1-3-6-1-4-1-30221-2-6-6-total-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-6-failed-count: 0", "extended-op-1-3-6-1-4-1-30221-2-6-6-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-30221-2-6-6-result-0-name: Success", "extended-op-1-3-6-1-4-1-30221-2-6-6-result-0-count: 2", "extended-op-1-3-6-1-4-1-30221-2-6-6-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-30221-2-6-6-result-0-average-response-time-" + "millis: 5.830", "extended-op-1-3-6-1-4-1-30221-2-6-6-result-0-total-response-time-" + "millis: 11.660", "extended-op-1-3-6-1-4-1-4203-1-11-1-name: Password Modify", "extended-op-1-3-6-1-4-1-4203-1-11-1-total-count: 4", "extended-op-1-3-6-1-4-1-4203-1-11-1-failed-count: 0", "extended-op-1-3-6-1-4-1-4203-1-11-1-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-4203-1-11-1-result-0-name: Success", "extended-op-1-3-6-1-4-1-4203-1-11-1-result-0-count: 4", "extended-op-1-3-6-1-4-1-4203-1-11-1-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-4203-1-11-1-result-0-average-response-time-" + "millis: 3.045", "extended-op-1-3-6-1-4-1-4203-1-11-1-result-0-total-response-time-" + "millis: 12.180", "extended-op-1-3-6-1-4-1-4203-1-11-3-name: Who Am I?", "extended-op-1-3-6-1-4-1-4203-1-11-3-total-count: 17", "extended-op-1-3-6-1-4-1-4203-1-11-3-failed-count: 0", "extended-op-1-3-6-1-4-1-4203-1-11-3-failed-percent: 0.000", "extended-op-1-3-6-1-4-1-4203-1-11-3-result-0-name: Success", "extended-op-1-3-6-1-4-1-4203-1-11-3-result-0-count: 17", "extended-op-1-3-6-1-4-1-4203-1-11-3-result-0-percent: 100.000", "extended-op-1-3-6-1-4-1-4203-1-11-3-result-0-average-response-time-" + "millis: 0.056", "extended-op-1-3-6-1-4-1-4203-1-11-3-result-0-total-response-time-" + "millis: 0.963", "modify-op-total-count: 76115", "modify-op-failed-count: 46075", "modify-op-failed-percent: 60.533", "modify-op-result-0-name: Success", "modify-op-result-0-count: 30028", "modify-op-result-0-percent: 39.451", "modify-op-result-0-average-response-time-millis: 2.332", "modify-op-result-0-total-response-time-millis: 70046.701", "modify-op-result-10-name: Referral", "modify-op-result-10-count: 12", "modify-op-result-10-percent: 0.016", "modify-op-result-10-average-response-time-millis: 0.641", "modify-op-result-10-total-response-time-millis: 7.696", "modify-op-result-32-name: No Such Entry", "modify-op-result-32-count: 7", "modify-op-result-32-percent: 0.009", "modify-op-result-32-average-response-time-millis: 0.338", "modify-op-result-32-total-response-time-millis: 2.371", "modify-op-result-34-name: Invalid DN Syntax", "modify-op-result-34-count: 44336", "modify-op-result-34-percent: 58.249", "modify-op-result-34-average-response-time-millis: 0.025", "modify-op-result-34-total-response-time-millis: 1113.184", "modify-op-result-65-name: Object Class Violation", "modify-op-result-65-count: 5", "modify-op-result-65-percent: 0.007", "modify-op-result-65-average-response-time-millis: 0.493", "modify-op-result-65-total-response-time-millis: 2.467", "modify-op-result-80-name: Other", "modify-op-result-80-count: 3", "modify-op-result-80-percent: 0.004", "modify-op-result-80-average-response-time-millis: 9000.698", "modify-op-result-80-total-response-time-millis: 27002.094", "modify-op-result-123-name: Authorization Denied", "modify-op-result-123-count: 1724", "modify-op-result-123-percent: 2.265", "modify-op-result-123-average-response-time-millis: 17.594", "modify-op-result-123-total-response-time-millis: 30333.120", "modifydn-op-total-count: 52", "modifydn-op-failed-count: 5", "modifydn-op-failed-percent: 9.615", "modifydn-op-result-0-name: Success", "modifydn-op-result-0-count: 35", "modifydn-op-result-0-percent: 67.308", "modifydn-op-result-0-average-response-time-millis: 1.867", "modifydn-op-result-0-total-response-time-millis: 65.351", "modifydn-op-result-10-name: Referral", "modifydn-op-result-10-count: 12", "modifydn-op-result-10-percent: 23.077", "modifydn-op-result-10-average-response-time-millis: 0.763", "modifydn-op-result-10-total-response-time-millis: 9.166", "modifydn-op-result-32-name: No Such Entry", "modifydn-op-result-32-count: 4", "modifydn-op-result-32-percent: 7.692", "modifydn-op-result-32-average-response-time-millis: 0.300", "modifydn-op-result-32-total-response-time-millis: 1.200", "modifydn-op-result-53-name: Unwilling to Perform", "modifydn-op-result-53-count: 1", "modifydn-op-result-53-percent: 1.923", "modifydn-op-result-53-average-response-time-millis: 0.257", "modifydn-op-result-53-total-response-time-millis: 0.257", "search-op-total-count: 433702", "search-op-failed-count: 150321", "search-op-failed-percent: 34.660", "search-op-result-0-name: Success", "search-op-result-0-count: 283353", "search-op-result-0-percent: 65.334", "search-op-result-0-average-response-time-millis: 0.373", "search-op-result-0-total-response-time-millis: 105736.778", "search-op-result-4-name: Size Limit Exceeded", "search-op-result-4-count: 2", "search-op-result-4-percent: 0.000", "search-op-result-4-average-response-time-millis: 0.668", "search-op-result-4-total-response-time-millis: 1.336", "search-op-result-10-name: Referral", "search-op-result-10-count: 28", "search-op-result-10-percent: 0.006", "search-op-result-10-average-response-time-millis: 0.774", "search-op-result-10-total-response-time-millis: 21.677", "search-op-result-32-name: No Such Entry", "search-op-result-32-count: 150303", "search-op-result-32-percent: 34.656", "search-op-result-32-average-response-time-millis: 0.245", "search-op-result-32-total-response-time-millis: 36891.265", "search-op-result-34-name: Invalid DN Syntax", "search-op-result-34-count: 13", "search-op-result-34-percent: 0.003", "search-op-result-34-average-response-time-millis: 3.456", "search-op-result-34-total-response-time-millis: 44.930", "search-op-result-122-name: Assertion Failed", "search-op-result-122-count: 1", "search-op-result-122-percent: 0.000", "search-op-result-122-average-response-time-millis: 1.799", "search-op-result-122-total-response-time-millis: 1.799", "search-op-result-123-name: Authorization Denied", "search-op-result-123-count: 2", "search-op-result-123-percent: 0.000", "search-op-result-123-average-response-time-millis: 0.383", "search-op-result-123-total-response-time-millis: 0.767"); final ResultCodeMonitorEntry me = new ResultCodeMonitorEntry(e); assertNotNull(me.toString()); assertEquals(me.getMonitorClass(), "ds-ldap-result-codes-monitor-entry"); assertEquals(MonitorEntry.decode(e).getClass().getName(), ResultCodeMonitorEntry.class.getName()); assertNotNull(me.getAllOperationsResultCodeInfo()); assertEquals(me.getAllOperationsResultCodeInfo().getTotalCount(), Long.valueOf(603376L)); assertEquals(me.getAllOperationsResultCodeInfo().getFailedCount(), Long.valueOf(215131L)); assertEquals(me.getAllOperationsResultCodeInfo().getFailedPercent(), Double.valueOf("35.655")); assertFalse(me.getAllOperationsResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertEquals( me.getAllOperationsResultCodeInfo().getResultCodeInfoMap().size(), 18); assertNotNull(me.getAddOperationResultCodeInfo()); assertFalse(me.getAddOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getBindOperationResultCodeInfo()); assertFalse(me.getBindOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getCompareOperationResultCodeInfo()); assertFalse(me.getCompareOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getDeleteOperationResultCodeInfo()); assertFalse(me.getDeleteOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getExtendedOperationResultCodeInfo()); assertFalse(me.getExtendedOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getModifyOperationResultCodeInfo()); assertFalse(me.getModifyOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getModifyDNOperationResultCodeInfo()); assertFalse(me.getModifyDNOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getSearchOperationResultCodeInfo()); assertFalse(me.getSearchOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getMonitorDisplayName()); assertNotNull(me.getMonitorDescription()); final Map<String,MonitorAttribute> attrs = me.getMonitorAttributes(); assertNotNull(attrs); assertFalse(attrs.isEmpty()); }
final class ResultCodeMonitorEntryTestCase extends LDAPSDKTestCase { @Test() public void function() throws Exception { final Entry e = new Entry( STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR + "1.031", STR + "2.062", STR, STR, STR, STR, STR, STR, STR, STR + "3.390", STR + "6.781", STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR + STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR + STR, STR, STR, STR + STR, STR + STR, STR + STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR + STR, STR + STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, STR); final ResultCodeMonitorEntry me = new ResultCodeMonitorEntry(e); assertNotNull(me.toString()); assertEquals(me.getMonitorClass(), STR); assertEquals(MonitorEntry.decode(e).getClass().getName(), ResultCodeMonitorEntry.class.getName()); assertNotNull(me.getAllOperationsResultCodeInfo()); assertEquals(me.getAllOperationsResultCodeInfo().getTotalCount(), Long.valueOf(603376L)); assertEquals(me.getAllOperationsResultCodeInfo().getFailedCount(), Long.valueOf(215131L)); assertEquals(me.getAllOperationsResultCodeInfo().getFailedPercent(), Double.valueOf(STR)); assertFalse(me.getAllOperationsResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertEquals( me.getAllOperationsResultCodeInfo().getResultCodeInfoMap().size(), 18); assertNotNull(me.getAddOperationResultCodeInfo()); assertFalse(me.getAddOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getBindOperationResultCodeInfo()); assertFalse(me.getBindOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getCompareOperationResultCodeInfo()); assertFalse(me.getCompareOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getDeleteOperationResultCodeInfo()); assertFalse(me.getDeleteOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getExtendedOperationResultCodeInfo()); assertFalse(me.getExtendedOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getModifyOperationResultCodeInfo()); assertFalse(me.getModifyOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getModifyDNOperationResultCodeInfo()); assertFalse(me.getModifyDNOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getSearchOperationResultCodeInfo()); assertFalse(me.getSearchOperationResultCodeInfo().getResultCodeInfoMap(). isEmpty()); assertNotNull(me.getMonitorDisplayName()); assertNotNull(me.getMonitorDescription()); final Map<String,MonitorAttribute> attrs = me.getMonitorAttributes(); assertNotNull(attrs); assertFalse(attrs.isEmpty()); }
/** * Tests the behavior for an entry with all relevant attributes. * * @throws Exception If an unexpected problem occurs. */
Tests the behavior for an entry with all relevant attributes
testAllAttributes
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/unboundidds/monitors/ResultCodeMonitorEntryTestCase.java", "license": "gpl-2.0", "size": 34168 }
[ "com.unboundid.ldap.sdk.Entry", "com.unboundid.ldap.sdk.LDAPSDKTestCase", "java.util.Map", "org.testng.annotations.Test" ]
import com.unboundid.ldap.sdk.Entry; import com.unboundid.ldap.sdk.LDAPSDKTestCase; import java.util.Map; import org.testng.annotations.Test;
import com.unboundid.ldap.sdk.*; import java.util.*; import org.testng.annotations.*;
[ "com.unboundid.ldap", "java.util", "org.testng.annotations" ]
com.unboundid.ldap; java.util; org.testng.annotations;
2,523,164
public T[] getEnumConstants() { if (isEnum()) { try { Method m = getMethod("values"); setAccessible(m); return (T[]) m.invoke(null); } catch (NoSuchMethodException exception) { throw new Error("Enum lacks values() method"); } catch (IllegalAccessException exception) { throw new Error("Unable to access Enum class"); } catch (InvocationTargetException exception) { throw new RuntimeException( "The values method threw an exception", exception); } } else { return null; } }
T[] function() { if (isEnum()) { try { Method m = getMethod(STR); setAccessible(m); return (T[]) m.invoke(null); } catch (NoSuchMethodException exception) { throw new Error(STR); } catch (IllegalAccessException exception) { throw new Error(STR); } catch (InvocationTargetException exception) { throw new RuntimeException( STR, exception); } } else { return null; } }
/** * Returns the enumeration constants of this class, or null if this class is * not an <code>Enum</code>. * * @return an array of <code>Enum</code> constants associated with this * class, or null if this class is not an <code>enum</code>. * @since 1.5 */
Returns the enumeration constants of this class, or null if this class is not an <code>Enum</code>
getEnumConstants
{ "repo_name": "webos21/xi", "path": "java/jcl/src/java/java/lang/Class.java", "license": "apache-2.0", "size": 59769 }
[ "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method" ]
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
675,809
LargeObjectManager getLargeObjectAPI() throws SQLException;
LargeObjectManager getLargeObjectAPI() throws SQLException;
/** * This returns the LargeObject API for the current connection. * * @return LargeObject API for the current connection * @throws SQLException if something wrong happens * @since 7.3 */
This returns the LargeObject API for the current connection
getLargeObjectAPI
{ "repo_name": "AlexElin/pgjdbc", "path": "pgjdbc/src/main/java/org/postgresql/PGConnection.java", "license": "bsd-2-clause", "size": 11805 }
[ "java.sql.SQLException", "org.postgresql.largeobject.LargeObjectManager" ]
import java.sql.SQLException; import org.postgresql.largeobject.LargeObjectManager;
import java.sql.*; import org.postgresql.largeobject.*;
[ "java.sql", "org.postgresql.largeobject" ]
java.sql; org.postgresql.largeobject;
2,879,775
public CassandraTableGetResultsInner withOptions(CassandraTableGetPropertiesOptions options) { this.options = options; return this; }
CassandraTableGetResultsInner function(CassandraTableGetPropertiesOptions options) { this.options = options; return this; }
/** * Set the options value. * * @param options the options value to set * @return the CassandraTableGetResultsInner object itself. */
Set the options value
withOptions
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/cosmos/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2020_03_01/implementation/CassandraTableGetResultsInner.java", "license": "mit", "size": 2147 }
[ "com.microsoft.azure.management.cosmosdb.v2020_03_01.CassandraTableGetPropertiesOptions" ]
import com.microsoft.azure.management.cosmosdb.v2020_03_01.CassandraTableGetPropertiesOptions;
import com.microsoft.azure.management.cosmosdb.v2020_03_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,301,560
@Override public boolean equals(Object o) { if (!(o instanceof MapNode<?, ?>)) { return false; } MapNode<?, ?> other = (MapNode<?, ?>) o; return value.equals(other.value) && Objects.equal(children, other.children); }
boolean function(Object o) { if (!(o instanceof MapNode<?, ?>)) { return false; } MapNode<?, ?> other = (MapNode<?, ?>) o; return value.equals(other.value) && Objects.equal(children, other.children); }
/** * For testing purposes only. */
For testing purposes only
equals
{ "repo_name": "lossyrob/uzaygezen", "path": "uzaygezen-core/src/main/java/com/google/uzaygezen/core/MapNode.java", "license": "apache-2.0", "size": 3719 }
[ "com.google.common.base.Objects" ]
import com.google.common.base.Objects;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
117,828
interface WithTags { WithCreate withTags(Map<String, String> tags); } }
interface WithTags { WithCreate withTags(Map<String, String> tags); } }
/** * Specifies the tags property: Resource tags.. * * @param tags Resource tags. * @return the next definition stage. */
Specifies the tags property: Resource tags.
withTags
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java", "license": "mit", "size": 8230 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,230,639
public static String getWifiSsid() { WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); if (wifiInfo != null) { return wifiInfo.getSSID(); } return null; }
static String function() { WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); if (wifiInfo != null) { return wifiInfo.getSSID(); } return null; }
/** * Returns the SSID of the wifi connection, or <code>null</code> if there is no wifi. */
Returns the SSID of the wifi connection, or <code>null</code> if there is no wifi
getWifiSsid
{ "repo_name": "narakai/DemoApp2", "path": "core/src/main/java/com/clem/ipoca1/core/util/NetworkUtils.java", "license": "mit", "size": 6340 }
[ "android.content.Context", "android.net.wifi.WifiInfo", "android.net.wifi.WifiManager" ]
import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager;
import android.content.*; import android.net.wifi.*;
[ "android.content", "android.net" ]
android.content; android.net;
2,368,413
@Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object.
collectNewChildDescriptors
{ "repo_name": "peterbartha/j2eecm", "path": "edu.bme.vik.iit.j2eecm.edit/src/components/provider/ActionItemProvider.java", "license": "gpl-2.0", "size": 4206 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,555,031
public void test(TestHarness harness) { // create instance of a class Double Object o = new Exception("Exception"); // get a runtime class of an object "o" Class c = o.getClass(); harness.check(c.getName(), "java.lang.Exception"); }
void function(TestHarness harness) { Object o = new Exception(STR); Class c = o.getClass(); harness.check(c.getName(), STR); }
/** * Runs the test using the specified harness. * * @param harness the test harness (<code>null</code> not permitted). */
Runs the test using the specified harness
test
{ "repo_name": "niloc132/mauve-gwt", "path": "src/main/java/gnu/testlet/java/lang/Exception/classInfo/getName.java", "license": "gpl-2.0", "size": 1551 }
[ "gnu.testlet.TestHarness", "java.lang.Exception" ]
import gnu.testlet.TestHarness; import java.lang.Exception;
import gnu.testlet.*; import java.lang.*;
[ "gnu.testlet", "java.lang" ]
gnu.testlet; java.lang;
1,608,742
public final String getManifestProperty(String key) { Properties manifest = (Properties) artifactMap.get(MANIFEST_ENTRY); return manifest.getProperty(key); }
final String function(String key) { Properties manifest = (Properties) artifactMap.get(MANIFEST_ENTRY); return manifest.getProperty(key); }
/** * Retrieves the value to the given key from the manifest.properties * entry. * * @param key * * @return the value */
Retrieves the value to the given key from the manifest.properties entry
getManifestProperty
{ "repo_name": "Groostav/CMPT880-term-project", "path": "intruder/benchs/opennlp/opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java", "license": "apache-2.0", "size": 21908 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
1,465,703
return Arrays.asList(NATIONALITIES); }
return Arrays.asList(NATIONALITIES); }
/** * Returns with the nationalities list. */
Returns with the nationalities list
getNationalities
{ "repo_name": "TEAMMATES/teammates", "path": "src/main/java/teammates/common/util/NationalityHelper.java", "license": "gpl-2.0", "size": 5621 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
460,408
private void storeInTempFile() throws IOException { File f = createCacheFile(); if (f != null) { FileOutputStream fos = new FileOutputStream(f); fos.write(origBody); fos.close(); // remove memory cache if stored in file origBody = null; } }
void function() throws IOException { File f = createCacheFile(); if (f != null) { FileOutputStream fos = new FileOutputStream(f); fos.write(origBody); fos.close(); origBody = null; } }
/** * Helper method to store body in file if it exceeds the memory cache limit * * @throws IOException */
Helper method to store body in file if it exceeds the memory cache limit
storeInTempFile
{ "repo_name": "varh1i/jdigidoc", "path": "src/main/java/ee/sk/digidoc/DataFile.java", "license": "lgpl-2.1", "size": 52317 }
[ "java.io.File", "java.io.FileOutputStream", "java.io.IOException" ]
import java.io.File; import java.io.FileOutputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
659,918
SerializableMessage applyService(String xml, SerializableMessage msg, boolean rewriteConnections) throws CoreException;
SerializableMessage applyService(String xml, SerializableMessage msg, boolean rewriteConnections) throws CoreException;
/** * Apply the configured services to the msg. * * @param xml String XML representation of the service (or service-list) * @param msg the message. * @param rewriteConnections use {@link AdaptrisConnection#cloneForTesting()} to generate a new connection. * @return the result of applying these services. * @throws CoreException wrapping any other exception */
Apply the configured services to the msg
applyService
{ "repo_name": "adaptris/interlok", "path": "interlok-core/src/main/java/com/adaptris/core/runtime/AdapterComponentCheckerMBean.java", "license": "apache-2.0", "size": 2308 }
[ "com.adaptris.core.CoreException", "com.adaptris.interlok.types.SerializableMessage" ]
import com.adaptris.core.CoreException; import com.adaptris.interlok.types.SerializableMessage;
import com.adaptris.core.*; import com.adaptris.interlok.types.*;
[ "com.adaptris.core", "com.adaptris.interlok" ]
com.adaptris.core; com.adaptris.interlok;
2,548,521
public void visitPUTSTATIC(PUTSTATIC s) { String one = s.getReferenceType(poolGen).getClass().getName(); String two = s.getFieldName(poolGen); String three = s.getName(poolGen); String four = s.getSignature(poolGen); String five = s.getReferenceType(poolGen).getClass().getName() + ""; String six = s.getFieldType(poolGen) + ""; log.log(" instr(putstatic)a=" + one, Project.MSG_DEBUG); log.log(" instr(putstatic)b=" + two, Project.MSG_DEBUG); log.log(" instr(putstatic)c=" + three, Project.MSG_DEBUG); log.log(" instr(putstatic)d=" + four, Project.MSG_DEBUG); log.log(" instr(putstatic)e=" + five, Project.MSG_DEBUG); log.log(" instr(putstatic)f=" + six, Project.MSG_DEBUG); String className = s.getFieldName(poolGen); if ("staticField".equals(className)) { return; } if (!className.startsWith("class$") && !className.startsWith("array$")) { return; } log.log(" instr(putstatic)1=" + className, Project.MSG_DEBUG); className = className.substring(6); log.log(" instr(putstatic)2=" + className, Project.MSG_DEBUG); className = className.replace('$', '.'); log.log(" instr(putstatic)3=" + className, Project.MSG_DEBUG); design.checkClass(className); }
void function(PUTSTATIC s) { String one = s.getReferenceType(poolGen).getClass().getName(); String two = s.getFieldName(poolGen); String three = s.getName(poolGen); String four = s.getSignature(poolGen); String five = s.getReferenceType(poolGen).getClass().getName() + STRSTR instr(putstatic)a=STR instr(putstatic)b=STR instr(putstatic)c=STR instr(putstatic)d=STR instr(putstatic)e=STR instr(putstatic)f=STRstaticFieldSTRclass$STRarray$STR instr(putstatic)1=STR instr(putstatic)2=STR instr(putstatic)3=" + className, Project.MSG_DEBUG); design.checkClass(className); }
/** * Method visitPUTSTATIC. * * @param s PUTSTATIC * @see org.apache.bcel.generic.Visitor#visitPUTSTATIC(PUTSTATIC) */
Method visitPUTSTATIC
visitPUTSTATIC
{ "repo_name": "antlibs/ant-contrib", "path": "src/main/java/net/sf/antcontrib/design/InstructionVisitor.java", "license": "apache-2.0", "size": 5711 }
[ "org.apache.tools.ant.Project" ]
import org.apache.tools.ant.Project;
import org.apache.tools.ant.*;
[ "org.apache.tools" ]
org.apache.tools;
1,514,357
void write(List row);
void write(List row);
/** * Add a row to the current track. * * @param row a list of values (the size of the list should be thes * as the current track's number of columns. */
Add a row to the current track
write
{ "repo_name": "jeanlazarou/jdbcunit", "path": "src/com/ap/jdbcunit/Media.java", "license": "bsd-3-clause", "size": 2797 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,374,627
@Override @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:10:02-06:00", comment = "JAXB RI v2.2.6") public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
@Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
/** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
toString
{ "repo_name": "angecab10/travelport-uapi-tutorial", "path": "src/com/travelport/schema/air_v29_0/AirLegModifiers.java", "license": "gpl-3.0", "size": 71207 }
[ "javax.annotation.Generated", "org.apache.commons.lang.builder.ToStringBuilder", "org.apache.cxf.xjc.runtime.JAXBToStringStyle" ]
import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*;
[ "javax.annotation", "org.apache.commons", "org.apache.cxf" ]
javax.annotation; org.apache.commons; org.apache.cxf;
2,607,282
EEnum getParameterDirectionKind();
EEnum getParameterDirectionKind();
/** * Returns the meta object for enum '{@link org.dresdenocl.pivotmodel.ParameterDirectionKind <em>Parameter Direction Kind</em>}'. * <!-- begin-user-doc --> <!-- * end-user-doc --> * @return the meta object for enum '<em>Parameter Direction Kind</em>'. * @see org.dresdenocl.pivotmodel.ParameterDirectionKind * @generated */
Returns the meta object for enum '<code>org.dresdenocl.pivotmodel.ParameterDirectionKind Parameter Direction Kind</code>'.
getParameterDirectionKind
{ "repo_name": "dresden-ocl/dresdenocl", "path": "plugins/org.dresdenocl.pivotmodel/src/org/dresdenocl/pivotmodel/PivotModelPackage.java", "license": "lgpl-3.0", "size": 98285 }
[ "org.eclipse.emf.ecore.EEnum" ]
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
672,071
// package protected, for access from FastDateFormat; do not make public or protected F getDateTimeInstance(final int dateStyle, final int timeStyle, final TimeZone timeZone, final Locale locale) { return getDateTimeInstance(Integer.valueOf(dateStyle), Integer.valueOf(timeStyle), timeZone, locale); }
F getDateTimeInstance(final int dateStyle, final int timeStyle, final TimeZone timeZone, final Locale locale) { return getDateTimeInstance(Integer.valueOf(dateStyle), Integer.valueOf(timeStyle), timeZone, locale); }
/** * <p>Gets a date/time formatter instance using the specified style, * time zone and locale.</p> * * @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT * @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT * @param timeZone optional time zone, overrides time zone of * formatted date, null means use default Locale * @param locale optional locale, overrides system locale * @return a localized standard date/time formatter * @throws IllegalArgumentException if the Locale has no date/time * pattern defined */
Gets a date/time formatter instance using the specified style, time zone and locale
getDateTimeInstance
{ "repo_name": "apache/logging-log4j2", "path": "log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FormatCache.java", "license": "apache-2.0", "size": 11192 }
[ "java.util.Locale", "java.util.TimeZone" ]
import java.util.Locale; import java.util.TimeZone;
import java.util.*;
[ "java.util" ]
java.util;
2,700,430
public AudioSpectrum getAudioSpectrum();
AudioSpectrum function();
/** * Gets the audio spectrum controller for the player. * * @return AudioSpectrum object */
Gets the audio spectrum controller for the player
getAudioSpectrum
{ "repo_name": "teamfx/openjfx-10-dev-rt", "path": "modules/javafx.media/src/main/java/com/sun/media/jfxmedia/MediaPlayer.java", "license": "gpl-2.0", "size": 10664 }
[ "com.sun.media.jfxmedia.effects.AudioSpectrum" ]
import com.sun.media.jfxmedia.effects.AudioSpectrum;
import com.sun.media.jfxmedia.effects.*;
[ "com.sun.media" ]
com.sun.media;
2,430,807
public void testPp08a() { MipLibCase.assertMinMaxVal("pp08a.mps", new BigDecimal("2.74834524e+03"), null, true, null); }
void function() { MipLibCase.assertMinMaxVal(STR, new BigDecimal(STR), null, true, null); }
/** * <p> * N/A in MIPLIB 2010 * </p> * <p> * <a href="http://miplib.zib.de/miplib2003/miplib2003/pp08a.php">MIPLIB 2003</a> * </p> * <p> * LP: 2.74834524e+03 * </p> * <p> * MIP: 7.35000000e+03 * </p> */
N/A in MIPLIB 2010 MIPLIB 2003
testPp08a
{ "repo_name": "jpalves/ojAlgo", "path": "test/org/ojalgo/optimisation/integer/RelaxedLpCase.java", "license": "mit", "size": 11531 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
897,358
Optional<ReadOnlyTaskManager> readTaskManager() throws DataConversionException, IOException;
Optional<ReadOnlyTaskManager> readTaskManager() throws DataConversionException, IOException;
/** * Returns TaskManager data as a {@link ReadOnlyTaskManager}. Returns * {@code Optional.empty()} if storage file is not found. * * @throws DataConversionException * if the data in storage is not in the expected format. * @throws IOException * if there was any problem when reading from the storage. */
Returns TaskManager data as a <code>ReadOnlyTaskManager</code>. Returns Optional.empty() if storage file is not found
readTaskManager
{ "repo_name": "CS2103JAN2017-T09-B1/main", "path": "src/main/java/seedu/today/storage/TaskManagerStorage.java", "license": "mit", "size": 1745 }
[ "java.io.IOException", "java.util.Optional" ]
import java.io.IOException; import java.util.Optional;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,868,197
boolean isCatalogJanitorEnabled() throws IOException;
boolean isCatalogJanitorEnabled() throws IOException;
/** * Query on the catalog janitor state (Enabled/Disabled?). * * @throws IOException if a remote or network exception occurs */
Query on the catalog janitor state (Enabled/Disabled?)
isCatalogJanitorEnabled
{ "repo_name": "francisliu/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java", "license": "apache-2.0", "size": 106428 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,803,657
public Builder<K, V> put(K key, V value) { builderMultimap.put(checkNotNull(key), checkNotNull(value)); return this; }
Builder<K, V> function(K key, V value) { builderMultimap.put(checkNotNull(key), checkNotNull(value)); return this; }
/** * Adds a key-value mapping to the built multimap. */
Adds a key-value mapping to the built multimap
put
{ "repo_name": "mkeesey/guava-for-small-classpaths", "path": "guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMultimap.java", "license": "apache-2.0", "size": 18826 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,566,241
protected void insertDeltaTree(IJavaScriptElement element, JavaElementDelta delta) { JavaElementDelta childDelta= createDeltaTree(element, delta); if (!this.equalsAndSameParent(element, getElement())) { // handle case of two jars that can be equals but not in the same project addAffectedChild(childDelta); } }
void function(IJavaScriptElement element, JavaElementDelta delta) { JavaElementDelta childDelta= createDeltaTree(element, delta); if (!this.equalsAndSameParent(element, getElement())) { addAffectedChild(childDelta); } }
/** * Creates the delta tree for the given element and delta, and then * inserts the tree as an affected child of this node. */
Creates the delta tree for the given element and delta, and then inserts the tree as an affected child of this node
insertDeltaTree
{ "repo_name": "boniatillo-com/PhaserEditor", "path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaElementDelta.java", "license": "epl-1.0", "size": 24082 }
[ "org.eclipse.wst.jsdt.core.IJavaScriptElement" ]
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.*;
[ "org.eclipse.wst" ]
org.eclipse.wst;
2,693,789
RemoteList<AssessmentOrGroup> getTopLevelAssessments() throws RemoteException;
RemoteList<AssessmentOrGroup> getTopLevelAssessments() throws RemoteException;
/** * Returns the list all top level <code>Assessments</code> and <code>AssessmentGroups</code> of * this project. These are basically those elements that are placed on the highest hierarchy level * in the Assessment view. * * @return A list of {@link AssessmentOrGroup} representing the top level assessments and * assessment groups. * * @throws RemoteException * remote communication problem */
Returns the list all top level <code>Assessments</code> and <code>AssessmentGroups</code> of this project. These are basically those elements that are placed on the highest hierarchy level in the Assessment view
getTopLevelAssessments
{ "repo_name": "jenkinsci/piketec-tpt-plugin", "path": "src/main/java/com/piketec/tpt/api/Project.java", "license": "mit", "size": 47574 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
1,817,180
@Override protected void beforeRun() { openFiles = PyAction.getOpenFiles(); formatter = createFormatter(); }
void function() { openFiles = PyAction.getOpenFiles(); formatter = createFormatter(); }
/** * Initialize the open files and the formatter to be used. */
Initialize the open files and the formatter to be used
beforeRun
{ "repo_name": "bobwalker99/Pydev", "path": "plugins/org.python.pydev/src/org/python/pydev/ui/actions/container/PyContainerFormatterAction.java", "license": "epl-1.0", "size": 7005 }
[ "org.python.pydev.editor.actions.PyAction" ]
import org.python.pydev.editor.actions.PyAction;
import org.python.pydev.editor.actions.*;
[ "org.python.pydev" ]
org.python.pydev;
632,061
public void testDontCacheScripts() throws Exception { assertAcked(prepareCreate("cache_test_idx").addMapping("type", "date", "type=date") .setSettings(Settings.builder().put("requests.cache.enable", true).put("number_of_shards", 1).put("number_of_replicas", 1)) .get()); indexRandom(true, client().prepareIndex("cache_test_idx", "type", "1") .setSource(jsonBuilder().startObject().field("date", date(1, 1)).endObject()), client().prepareIndex("cache_test_idx", "type", "2") .setSource(jsonBuilder().startObject().field("date", date(2, 1)).endObject())); // Make sure we are starting with a clear cache assertThat(client().admin().indices().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache() .getHitCount(), equalTo(0L)); assertThat(client().admin().indices().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache() .getMissCount(), equalTo(0L)); // Test that a request using a script does not get cached Map<String, Object> params = new HashMap<>(); params.put("fieldname", "date"); SearchResponse r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(dateRange("foo").field("date") .script(new Script(ScriptType.INLINE, "native", DateScriptMocks.PlusOneMonthScript.NAME, params)) .addRange(new DateTime(2012, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC), new DateTime(2013, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC))) .get(); assertSearchResponse(r); assertThat(client().admin().indices().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache() .getHitCount(), equalTo(0L)); assertThat(client().admin().indices().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache() .getMissCount(), equalTo(0L)); // To make sure that the cache is working test that a request not using // a script is cached r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(dateRange("foo").field("date") .addRange(new DateTime(2012, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC), new DateTime(2013, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC))) .get(); assertSearchResponse(r); assertThat(client().admin().indices().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache() .getHitCount(), equalTo(0L)); assertThat(client().admin().indices().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache() .getMissCount(), equalTo(1L)); }
void function() throws Exception { assertAcked(prepareCreate(STR).addMapping("type", "date", STR) .setSettings(Settings.builder().put(STR, true).put(STR, 1).put(STR, 1)) .get()); indexRandom(true, client().prepareIndex(STR, "type", "1") .setSource(jsonBuilder().startObject().field("date", date(1, 1)).endObject()), client().prepareIndex(STR, "type", "2") .setSource(jsonBuilder().startObject().field("date", date(2, 1)).endObject())); assertThat(client().admin().indices().prepareStats(STR).setRequestCache(true).get().getTotal().getRequestCache() .getHitCount(), equalTo(0L)); assertThat(client().admin().indices().prepareStats(STR).setRequestCache(true).get().getTotal().getRequestCache() .getMissCount(), equalTo(0L)); Map<String, Object> params = new HashMap<>(); params.put(STR, "date"); SearchResponse r = client().prepareSearch(STR).setSize(0).addAggregation(dateRange("foo").field("date") .script(new Script(ScriptType.INLINE, STR, DateScriptMocks.PlusOneMonthScript.NAME, params)) .addRange(new DateTime(2012, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC), new DateTime(2013, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC))) .get(); assertSearchResponse(r); assertThat(client().admin().indices().prepareStats(STR).setRequestCache(true).get().getTotal().getRequestCache() .getHitCount(), equalTo(0L)); assertThat(client().admin().indices().prepareStats(STR).setRequestCache(true).get().getTotal().getRequestCache() .getMissCount(), equalTo(0L)); r = client().prepareSearch(STR).setSize(0).addAggregation(dateRange("foo").field("date") .addRange(new DateTime(2012, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC), new DateTime(2013, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC))) .get(); assertSearchResponse(r); assertThat(client().admin().indices().prepareStats(STR).setRequestCache(true).get().getTotal().getRequestCache() .getHitCount(), equalTo(0L)); assertThat(client().admin().indices().prepareStats(STR).setRequestCache(true).get().getTotal().getRequestCache() .getMissCount(), equalTo(1L)); }
/** * Make sure that a request using a script does not get cached and a request * not using a script does get cached. */
Make sure that a request using a script does not get cached and a request not using a script does get cached
testDontCacheScripts
{ "repo_name": "nazarewk/elasticsearch", "path": "core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java", "license": "apache-2.0", "size": 44925 }
[ "java.util.HashMap", "java.util.Map", "org.elasticsearch.action.search.SearchResponse", "org.elasticsearch.common.settings.Settings", "org.elasticsearch.script.Script", "org.elasticsearch.script.ScriptType", "org.elasticsearch.test.hamcrest.ElasticsearchAssertions", "org.hamcrest.Matchers", "org.joda.time.DateTime", "org.joda.time.DateTimeZone" ]
import java.util.HashMap; import java.util.Map; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.hamcrest.Matchers; import org.joda.time.DateTime; import org.joda.time.DateTimeZone;
import java.util.*; import org.elasticsearch.action.search.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.script.*; import org.elasticsearch.test.hamcrest.*; import org.hamcrest.*; import org.joda.time.*;
[ "java.util", "org.elasticsearch.action", "org.elasticsearch.common", "org.elasticsearch.script", "org.elasticsearch.test", "org.hamcrest", "org.joda.time" ]
java.util; org.elasticsearch.action; org.elasticsearch.common; org.elasticsearch.script; org.elasticsearch.test; org.hamcrest; org.joda.time;
1,497,065
@Input @Optional public String getEncoding() { return encoding; }
@Input String function() { return encoding; }
/** * Encoding of source files. */
Encoding of source files
getEncoding
{ "repo_name": "HenryHarper/Acquire-Reboot", "path": "gradle/src/language-scala/org/gradle/language/scala/tasks/BaseScalaCompileOptions.java", "license": "mit", "size": 5406 }
[ "org.gradle.api.tasks.Input" ]
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.*;
[ "org.gradle.api" ]
org.gradle.api;
208,163
private List<String> getZipUrlEntries(URL zipUrl, List<String> zipUrlEntries) throws IOException { if (zipUrlEntries.isEmpty()) { ZipInputStream zipIn = null; try { // Search all entries of zip url zipIn = new ZipInputStream(zipUrl.openStream()); for (ZipEntry entry; (entry = zipIn.getNextEntry()) != null; ) { zipUrlEntries.add(entry.getName()); } } finally { if (zipIn != null) { zipIn.close(); } } } return zipUrlEntries; }
List<String> function(URL zipUrl, List<String> zipUrlEntries) throws IOException { if (zipUrlEntries.isEmpty()) { ZipInputStream zipIn = null; try { zipIn = new ZipInputStream(zipUrl.openStream()); for (ZipEntry entry; (entry = zipIn.getNextEntry()) != null; ) { zipUrlEntries.add(entry.getName()); } } finally { if (zipIn != null) { zipIn.close(); } } } return zipUrlEntries; }
/** * Returns the list of entries contained in <code>zipUrl</code>. */
Returns the list of entries contained in <code>zipUrl</code>
getZipUrlEntries
{ "repo_name": "snsoffice/appviewer", "path": "exporter/com/eteks/sweethome3d/plugin/exportmap/HomeMapFileRecorder.java", "license": "gpl-3.0", "size": 17156 }
[ "java.io.IOException", "java.util.List", "java.util.zip.ZipEntry", "java.util.zip.ZipInputStream" ]
import java.io.IOException; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream;
import java.io.*; import java.util.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
935,528
public void display(ParticleColor color, Location center, List<Player> players) throws ParticleVersionException, ParticleColorException { if (!isSupported()) { throw new ParticleVersionException( "This particle effect is not supported by your server version"); } if (!hasProperty(ParticleProperty.COLORABLE)) { throw new ParticleColorException( "This particle effect is not colorable"); } if (!isColorCorrect(this, color)) { throw new ParticleColorException( "The particle color type is incorrect"); } new ParticlePacket(this, color, isLongDistance(center, players)) .sendTo(center, players); }
void function(ParticleColor color, Location center, List<Player> players) throws ParticleVersionException, ParticleColorException { if (!isSupported()) { throw new ParticleVersionException( STR); } if (!hasProperty(ParticleProperty.COLORABLE)) { throw new ParticleColorException( STR); } if (!isColorCorrect(this, color)) { throw new ParticleColorException( STR); } new ParticlePacket(this, color, isLongDistance(center, players)) .sendTo(center, players); }
/** * Displays a single particle which is colored and only visible for the * specified players * * @param color * Color of the particle * @param center * Center location of the effect * @param players * Receivers of the effect * @throws ParticleVersionException * If the particle effect is not supported by the server version * @throws ParticleColorException * If the particle effect is not colorable or the color type is * incorrect * @see ParticlePacket#ParticlePacket(ParticleEffect, ParticleColor, * boolean) * @see ParticlePacket#sendTo(Location, List) */
Displays a single particle which is colored and only visible for the specified players
display
{ "repo_name": "dobrakmato/mcRPG", "path": "src/main/java/com/darkblade12/particleeffect/ParticleEffect.java", "license": "gpl-3.0", "size": 73600 }
[ "java.util.List", "org.bukkit.Location", "org.bukkit.entity.Player" ]
import java.util.List; import org.bukkit.Location; import org.bukkit.entity.Player;
import java.util.*; import org.bukkit.*; import org.bukkit.entity.*;
[ "java.util", "org.bukkit", "org.bukkit.entity" ]
java.util; org.bukkit; org.bukkit.entity;
1,315,532
Iterable<A> values = getNullableValues(object, queryOptions); // Handle the collection of values itself being null... values = (values == null ? Collections.<A>emptyList() : values); // Check if we need to check for nulls in the collection of values... if (!componentValuesNullable) { // No need to check for nulls in the collection of values... return values; }
Iterable<A> values = getNullableValues(object, queryOptions); values = (values == null ? Collections.<A>emptyList() : values); if (!componentValuesNullable) { return values; }
/** * Returns the values of the attribute from the object, omitting any null values. * <p/> * @param object The object from which the values of the attribute are required * @param queryOptions Optional parameters supplied by the application along with the operation which is causing * this attribute to be invoked (either a query, or an update to the collection) * @return The values for the attribute */
Returns the values of the attribute from the object, omitting any null values.
getValues
{ "repo_name": "npgall/cqengine", "path": "code/src/main/java/com/googlecode/cqengine/attribute/MultiValueNullableAttribute.java", "license": "apache-2.0", "size": 6483 }
[ "java.util.Collections" ]
import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
2,896,197
@Override public String getPrimaryDomainName() throws IdentityStoreException { Domain domain = sortedDomains.first(); if (domain == null) { throw new IdentityStoreServerException("No domains registered."); } return domain.getName(); }
String function() throws IdentityStoreException { Domain domain = sortedDomains.first(); if (domain == null) { throw new IdentityStoreServerException(STR); } return domain.getName(); }
/** * Identity User Management Domain Read Operations. */
Identity User Management Domain Read Operations
getPrimaryDomainName
{ "repo_name": "wso2/carbon-identity-mgt", "path": "components/org.wso2.carbon.identity.mgt/src/main/java/org/wso2/carbon/identity/mgt/impl/IdentityStoreImpl.java", "license": "apache-2.0", "size": 80759 }
[ "org.wso2.carbon.identity.mgt.exception.IdentityStoreException", "org.wso2.carbon.identity.mgt.exception.IdentityStoreServerException" ]
import org.wso2.carbon.identity.mgt.exception.IdentityStoreException; import org.wso2.carbon.identity.mgt.exception.IdentityStoreServerException;
import org.wso2.carbon.identity.mgt.exception.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
807,996
protected long getContentLength(Node node) { String str = node.getPropertyValue(VOS.PROPERTY_URI_CONTENTLENGTH); if (str != null) return Long.parseLong(str); return 0; }
long function(Node node) { String str = node.getPropertyValue(VOS.PROPERTY_URI_CONTENTLENGTH); if (str != null) return Long.parseLong(str); return 0; }
/** * Get the current contentLength. If the property is not set, 0 is returned. * * @param node * @return content length, or 0 if not set */
Get the current contentLength. If the property is not set, 0 is returned
getContentLength
{ "repo_name": "opencadc/vos", "path": "cadc-vos-server/src/main/java/ca/nrc/cadc/vos/server/DatabaseNodePersistence.java", "license": "agpl-3.0", "size": 18052 }
[ "ca.nrc.cadc.vos.Node" ]
import ca.nrc.cadc.vos.Node;
import ca.nrc.cadc.vos.*;
[ "ca.nrc.cadc" ]
ca.nrc.cadc;
146,053
public HashMap<UUID, Rating> getRatings() { HashMap<UUID, Rating> map = new HashMap<UUID, Rating>(); if (getSettings().ratings == null) { return map; } for (Entry<UUID, Integer> entry : getSettings().ratings.entrySet()) { map.put(entry.getKey(), new Rating(entry.getValue())); } return map; }
HashMap<UUID, Rating> function() { HashMap<UUID, Rating> map = new HashMap<UUID, Rating>(); if (getSettings().ratings == null) { return map; } for (Entry<UUID, Integer> entry : getSettings().ratings.entrySet()) { map.put(entry.getKey(), new Rating(entry.getValue())); } return map; }
/** * Get the ratings associated with a plot<br> * - The rating object may contain multiple categories * @return Map of user who rated to the rating */
Get the ratings associated with a plot - The rating object may contain multiple categories
getRatings
{ "repo_name": "PiLogic/PlotSquared", "path": "src/main/java/com/intellectualcrafters/plot/object/Plot.java", "license": "gpl-3.0", "size": 28745 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,797,854
public static void setLookAndFeel( String lookAndFeelInfo, Frame frame ) { try { // skin look and feel need special handling ... if( lookAndFeelInfo.endsWith("@com.l2fprod.gui.plaf.skin.SkinLookAndFeel") ) { // determine theme package name from look and feel info string String themeName = lookAndFeelInfo.substring(0, lookAndFeelInfo.indexOf("@") ); // set skin // SkinLookAndFeel.setSkin( SkinLookAndFeel.loadThemePack( SKIN_LF_THEME_DIR + File.separator + themeName ) ); // set lf class name lookAndFeelInfo = "com.l2fprod.gui.plaf.skin.SkinLookAndFeel"; } // set look and feel from class name setLookAndFeel( (LookAndFeel)Class.forName(lookAndFeelInfo).newInstance(), frame ); } catch( Exception ex ) { logger.warning("exception raised: " + ex.getMessage() ); ex.printStackTrace(); } }
static void function( String lookAndFeelInfo, Frame frame ) { try { if( lookAndFeelInfo.endsWith(STR) ) { String themeName = lookAndFeelInfo.substring(0, lookAndFeelInfo.indexOf("@") ); lookAndFeelInfo = STR; } setLookAndFeel( (LookAndFeel)Class.forName(lookAndFeelInfo).newInstance(), frame ); } catch( Exception ex ) { logger.warning(STR + ex.getMessage() ); ex.printStackTrace(); } }
/** Sets the look and feel from an info string as used in the preferences dialog class. * * @param lookAndFeelInfo describing the look and feel to set * @param frame to set the look and feel for */
Sets the look and feel from an info string as used in the preferences dialog class
setLookAndFeel
{ "repo_name": "knocte/getittogether", "path": "src/de/axelwernicke/mypod/gui/GuiUtils.java", "license": "gpl-2.0", "size": 21505 }
[ "java.awt.Frame", "javax.swing.LookAndFeel" ]
import java.awt.Frame; import javax.swing.LookAndFeel;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,042,124
public String[] retrieveMailAccess(String userType, String userId) { String[] access = new String[2]; ContactDAO contactDAO = LdapService.getContactDAO(); List<ContactDTO> contacts = contactDAO.findContact( (ITEM_ID_PROVIDER.equals(userType) ? LDAP_PROVIDER_ID_ATT : LDAP_PATIENT_ID_ATT) + "=" + userId); if (contacts.size() > 0) { //Get mail login info List<ContactAcctDTO> accts = contactDAO.findContactAcct( contacts.get(0).getCommonName(), ContactAcctDTO.CN_MAIL); if (accts.size() > 0) { access[0] = accts.get(0).getUid(); access[1] = accts.get(0).getClearPassword(); } } return access; }
String[] function(String userType, String userId) { String[] access = new String[2]; ContactDAO contactDAO = LdapService.getContactDAO(); List<ContactDTO> contacts = contactDAO.findContact( (ITEM_ID_PROVIDER.equals(userType) ? LDAP_PROVIDER_ID_ATT : LDAP_PATIENT_ID_ATT) + "=" + userId); if (contacts.size() > 0) { List<ContactAcctDTO> accts = contactDAO.findContactAcct( contacts.get(0).getCommonName(), ContactAcctDTO.CN_MAIL); if (accts.size() > 0) { access[0] = accts.get(0).getUid(); access[1] = accts.get(0).getClearPassword(); } } return access; }
/** * Find LDAP record from userId. * * @param userId * * @return */
Find LDAP record from userId
retrieveMailAccess
{ "repo_name": "TATRC/KMR2", "path": "Services/PresentationServices/src/main/java/gov/hhs/fha/nhinc/presentationservices/helpers/MailServiceHelper.java", "license": "bsd-3-clause", "size": 11282 }
[ "gov.hhs.fha.nhinc.ldapaccess.ContactAcctDTO", "gov.hhs.fha.nhinc.ldapaccess.ContactDAO", "gov.hhs.fha.nhinc.ldapaccess.ContactDTO", "gov.hhs.fha.nhinc.ldapaccess.LdapService", "java.util.List" ]
import gov.hhs.fha.nhinc.ldapaccess.ContactAcctDTO; import gov.hhs.fha.nhinc.ldapaccess.ContactDAO; import gov.hhs.fha.nhinc.ldapaccess.ContactDTO; import gov.hhs.fha.nhinc.ldapaccess.LdapService; import java.util.List;
import gov.hhs.fha.nhinc.ldapaccess.*; import java.util.*;
[ "gov.hhs.fha", "java.util" ]
gov.hhs.fha; java.util;
2,476,601
public void setSubjectCertConstraints(Collection<Pattern> subjectCertConstraints) { if (subjectCertConstraints != null) { subjectDNPatterns.addAll(subjectCertConstraints); } }
void function(Collection<Pattern> subjectCertConstraints) { if (subjectCertConstraints != null) { subjectDNPatterns.addAll(subjectCertConstraints); } }
/** * Set the Signature Subject Cert Constraints */
Set the Signature Subject Cert Constraints
setSubjectCertConstraints
{ "repo_name": "asoldano/wss4j", "path": "ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSSecurityProperties.java", "license": "apache-2.0", "size": 35117 }
[ "java.util.Collection", "java.util.regex.Pattern" ]
import java.util.Collection; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
2,346,416
private void createAddedElements(Widget widget, Object[] elements) { if (elements.length == 1) { if (equals(elements[0], widget.getData())) { return; } } ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(widget, comparator); Item[] items = getChildren(widget); // Optimize for the empty case if (items.length == 0) { for (int i = 0; i < elements.length; i++) { createTreeItem(widget, elements[i], -1); } return; } // Optimize for no comparator if (comparator == null) { for (int i = 0; i < elements.length; i++) { Object element = elements[i]; if (itemExists(items, element)) { internalRefresh(element); } else { createTreeItem(widget, element, -1); } } return; } // As the items are sorted already we optimize for a // start position. This is the insertion position relative to the // original item array. int indexInItems = 0; // Count of elements we have added. See bug 205700 for why this is needed. int newItems = 0; elementloop: for (int i = 0; i < elements.length; i++) { Object element = elements[i]; // update the index relative to the original item array indexInItems = insertionPosition(items, comparator, indexInItems, element, parentPath); if (indexInItems == items.length) { createTreeItem(widget, element, -1); newItems++; } else { // Search for an item for the element. The comparator might // regard elements as equal when they are not. // Use a separate index variable to search within the existing // elements that compare equally, see // TreeViewerTestBug205700.testAddEquallySortedElements. int insertionIndexInItems = indexInItems; while( insertionIndexInItems < items.length && internalCompare(comparator, parentPath, element, items[insertionIndexInItems].getData()) == 0) { // As we cannot assume the sorter is consistent with // equals() - therefore we can // just check against the item prior to this index (if // any) if (items[insertionIndexInItems].getData().equals(element)) { // Found the item for the element. // Refresh the element in case it has new children. internalRefresh(element); // Do not create a new item - continue with the next element. continue elementloop; } insertionIndexInItems++; } // Did we get to the end? if (insertionIndexInItems == items.length) { createTreeItem(widget, element, -1); newItems++; } else { // InsertionIndexInItems is the index in the original array. We // need to correct by the number of new items we have // created. See bug 205700. createTreeItem(widget, element, insertionIndexInItems + newItems); newItems++; } } } }
void function(Widget widget, Object[] elements) { if (elements.length == 1) { if (equals(elements[0], widget.getData())) { return; } } ViewerComparator comparator = getComparator(); TreePath parentPath = internalGetSorterParentPath(widget, comparator); Item[] items = getChildren(widget); if (items.length == 0) { for (int i = 0; i < elements.length; i++) { createTreeItem(widget, elements[i], -1); } return; } if (comparator == null) { for (int i = 0; i < elements.length; i++) { Object element = elements[i]; if (itemExists(items, element)) { internalRefresh(element); } else { createTreeItem(widget, element, -1); } } return; } int indexInItems = 0; int newItems = 0; elementloop: for (int i = 0; i < elements.length; i++) { Object element = elements[i]; indexInItems = insertionPosition(items, comparator, indexInItems, element, parentPath); if (indexInItems == items.length) { createTreeItem(widget, element, -1); newItems++; } else { int insertionIndexInItems = indexInItems; while( insertionIndexInItems < items.length && internalCompare(comparator, parentPath, element, items[insertionIndexInItems].getData()) == 0) { if (items[insertionIndexInItems].getData().equals(element)) { internalRefresh(element); continue elementloop; } insertionIndexInItems++; } if (insertionIndexInItems == items.length) { createTreeItem(widget, element, -1); newItems++; } else { createTreeItem(widget, element, insertionIndexInItems + newItems); newItems++; } } } }
/** * Create the new elements in the parent widget. If the child already exists * do nothing. * * @param widget * @param elements * Sorted list of elements to add. */
Create the new elements in the parent widget. If the child already exists do nothing
createAddedElements
{ "repo_name": "neelance/jface4ruby", "path": "jface4ruby/src/org/eclipse/jface/viewers/AbstractTreeViewer.java", "license": "epl-1.0", "size": 91053 }
[ "org.eclipse.swt.widgets.Item", "org.eclipse.swt.widgets.Widget" ]
import org.eclipse.swt.widgets.Item; import org.eclipse.swt.widgets.Widget;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
677,634
public void testApplicationModes() throws PersistenceException, ResourceInstantiationException, IOException, ExecutionException { //load the application URL applicationURL = Files.getGateResource("gate.ac.uk/tests/jape/jape-test.xgapp"); CorpusController application = (CorpusController) PersistenceManager .loadObjectFromUrl(applicationURL); //load the test file Document testDoc = Factory.newDocument(Files.getGateResource("gate.ac.uk/tests/jape/test-doc.xml"), "UTF-8"); Corpus testCorpus = Factory.newCorpus("JAPE Test Corpus"); testCorpus.add(testDoc); //run the application application.setCorpus(testCorpus); application.execute(); //check the results AnnotationDiffer annDiff = new AnnotationDiffer(); annDiff.setSignificantFeaturesSet(null); for (String testName : new String[] { "appelt", "brill", "all", "once" }) { AnnotationSet keySet = testDoc.getAnnotations(testName); AnnotationSet responseSet = testDoc.getAnnotations(testName + "-test"); annDiff.calculateDiff(keySet, responseSet); double fMeasure = annDiff.getFMeasureStrict(1); assertEquals("Incorrect F-measure for test " + testName, (double) 1, fMeasure); } //cleanup application.setCorpus(null); Factory.deleteResource(application); testCorpus.remove(0); Factory.deleteResource(testDoc); Factory.deleteResource(testCorpus); }
void function() throws PersistenceException, ResourceInstantiationException, IOException, ExecutionException { URL applicationURL = Files.getGateResource(STR); CorpusController application = (CorpusController) PersistenceManager .loadObjectFromUrl(applicationURL); Document testDoc = Factory.newDocument(Files.getGateResource(STR), "UTF-8"); Corpus testCorpus = Factory.newCorpus(STR); testCorpus.add(testDoc); application.setCorpus(testCorpus); application.execute(); AnnotationDiffer annDiff = new AnnotationDiffer(); annDiff.setSignificantFeaturesSet(null); for (String testName : new String[] { STR, "brill", "all", "once" }) { AnnotationSet keySet = testDoc.getAnnotations(testName); AnnotationSet responseSet = testDoc.getAnnotations(testName + "-test"); annDiff.calculateDiff(keySet, responseSet); double fMeasure = annDiff.getFMeasureStrict(1); assertEquals(STR + testName, (double) 1, fMeasure); } application.setCorpus(null); Factory.deleteResource(application); testCorpus.remove(0); Factory.deleteResource(testDoc); Factory.deleteResource(testCorpus); }
/** * This test loads a saved application which runs several JAPE grammars * using different application modes on a specially prepared document. * The resulting annotations are checked against gold-standard versions * saved in the test document. * @throws IOException * @throws ResourceInstantiationException * @throws PersistenceException * @throws ExecutionException */
This test loads a saved application which runs several JAPE grammars using different application modes on a specially prepared document. The resulting annotations are checked against gold-standard versions saved in the test document
testApplicationModes
{ "repo_name": "liuhongchao/GATE_Developer_7.0", "path": "src/gate/jape/functest/TestJape.java", "license": "lgpl-3.0", "size": 8656 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
388,557
@Override public void containerItemSetChange(Container.ItemSetChangeEvent event) { // Clears the item id mapping table itemIdMapper.removeAll(); // Notify all listeners fireItemSetChange(); }
void function(Container.ItemSetChangeEvent event) { itemIdMapper.removeAll(); fireItemSetChange(); }
/** * Lets the listener know a Containers Item set has changed. * * @see com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent) */
Lets the listener know a Containers Item set has changed
containerItemSetChange
{ "repo_name": "oalles/vaadin", "path": "server/src/com/vaadin/ui/AbstractSelect.java", "license": "apache-2.0", "size": 76884 }
[ "com.vaadin.data.Container" ]
import com.vaadin.data.Container;
import com.vaadin.data.*;
[ "com.vaadin.data" ]
com.vaadin.data;
2,059,916
public String []getParameterValues(String name) { return _request.getParameterValues(name); } /** * Returns an enumeration of all form parameter names. * * <code><pre> * Enumeration e = _request.getParameterNames(); * while (e.hasMoreElements()) { * String name = (String) e.nextElement(); * out.println(name + ": " + request.getParameter(name)); * }
public String []getParameterValues(String name) { return _request.getParameterValues(name); } /** * Returns an enumeration of all form parameter names. * * <code><pre> * Enumeration e = _request.getParameterNames(); * while (e.hasMoreElements()) { * String name = (String) e.nextElement(); * out.println(name + STR + request.getParameter(name)); * }
/** * Returns all values of a form parameter. * * <p>For example, calling <code>getParameterValues("a")</code> * with the the query string <code>a=1&a=2</code> will * return ["1", "2"]. * * @param name the form parameter to return * @return an array of matching form values or null if none matches. */
Returns all values of a form parameter. For example, calling <code>getParameterValues("a")</code> with the the query string <code>a=1&a=2</code> will return ["1", "2"]
getParameterValues
{ "repo_name": "dlitz/resin", "path": "modules/servlet16/src/javax/servlet/ServletRequestWrapper.java", "license": "gpl-2.0", "size": 11442 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,409,178
public Optional<InsertColumnsSegment> getInsertColumns() { return Optional.ofNullable(insertColumns); }
Optional<InsertColumnsSegment> function() { return Optional.ofNullable(insertColumns); }
/** * Get insert columns segment. * * @return insert columns segment */
Get insert columns segment
getInsertColumns
{ "repo_name": "apache/incubator-shardingsphere", "path": "shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/dml/InsertStatement.java", "license": "apache-2.0", "size": 2660 }
[ "java.util.Optional", "org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.InsertColumnsSegment" ]
import java.util.Optional; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.InsertColumnsSegment;
import java.util.*; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.*;
[ "java.util", "org.apache.shardingsphere" ]
java.util; org.apache.shardingsphere;
1,305,258
@Test public void testGetGlobalVariables() throws Exception { TestEditorConfigurationService testEditorConfigurationService = ServiceLookUpForTest .getService(TestEditorConfigurationService.class); String key = addTestKeyToProperties(testEditorConfigurationService); Map<String, String> variables = testEditorConfigurationService.getGlobalVariables(); assertNotNull("Global Variables should be not null.", variables); assertEquals("Expecting Bar in the Global Variables.", "Bar", variables.get(key)); }
void function() throws Exception { TestEditorConfigurationService testEditorConfigurationService = ServiceLookUpForTest .getService(TestEditorConfigurationService.class); String key = addTestKeyToProperties(testEditorConfigurationService); Map<String, String> variables = testEditorConfigurationService.getGlobalVariables(); assertNotNull(STR, variables); assertEquals(STR, "Bar", variables.get(key)); }
/** * Test that global variables returns always an not empty Map. * * @throws Exception * on Test abort. */
Test that global variables returns always an not empty Map
testGetGlobalVariables
{ "repo_name": "franzbecker/test-editor", "path": "core/org.testeditor.core.test/src/org/testeditor/core/services/impl/TestEditorConfigurationServiceImplTest.java", "license": "epl-1.0", "size": 8532 }
[ "java.util.Map", "org.junit.Assert", "org.testeditor.core.services.interfaces.ServiceLookUpForTest", "org.testeditor.core.services.interfaces.TestEditorConfigurationService" ]
import java.util.Map; import org.junit.Assert; import org.testeditor.core.services.interfaces.ServiceLookUpForTest; import org.testeditor.core.services.interfaces.TestEditorConfigurationService;
import java.util.*; import org.junit.*; import org.testeditor.core.services.interfaces.*;
[ "java.util", "org.junit", "org.testeditor.core" ]
java.util; org.junit; org.testeditor.core;
2,545,454
public T caseStringTypeRef(StringTypeRef object) { return null; }
T function(StringTypeRef object) { return null; }
/** * Returns the result of interpreting the object as an instance of '<em>String Type Ref</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>String Type Ref</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */
Returns the result of interpreting the object as an instance of 'String Type Ref'. This implementation returns null; returning a non-null result will terminate the switch.
caseStringTypeRef
{ "repo_name": "tetrabox/minijava", "path": "plugins/org.tetrabox.minijava.model/src/org/tetrabox/minijava/model/miniJava/util/MiniJavaSwitch.java", "license": "epl-1.0", "size": 56459 }
[ "org.tetrabox.minijava.model.miniJava.StringTypeRef" ]
import org.tetrabox.minijava.model.miniJava.StringTypeRef;
import org.tetrabox.minijava.model.*;
[ "org.tetrabox.minijava" ]
org.tetrabox.minijava;
1,108,262
public Component getTrailingComponent() { return trailingComponent; }
Component function() { return trailingComponent; }
/** * Returns the component rendered on the right side of the table cell. * @return Component rendered on the right side of the table cell. */
Returns the component rendered on the right side of the table cell
getTrailingComponent
{ "repo_name": "altsoft/PlatypusJS", "path": "platypus-js-grid/src/main/java/com/bearsoft/gui/grid/rendering/InsettedRenderer.java", "license": "apache-2.0", "size": 5957 }
[ "java.awt.Component" ]
import java.awt.Component;
import java.awt.*;
[ "java.awt" ]
java.awt;
780,259
@Test public void whenReceiveListThenMake2DArray() { ConvertList converter = new ConvertList(); List<Integer> incomingList = new ArrayList<Integer>(); for (int i = 1; i < 19; i++) { incomingList.add(i); } int[][] arrayToCheck = new int[][] {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 0, 0}}; assertThat(converter.toArray(incomingList, 4), is(arrayToCheck)); }
void function() { ConvertList converter = new ConvertList(); List<Integer> incomingList = new ArrayList<Integer>(); for (int i = 1; i < 19; i++) { incomingList.add(i); } int[][] arrayToCheck = new int[][] {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 0, 0}}; assertThat(converter.toArray(incomingList, 4), is(arrayToCheck)); }
/** *Test toArray. */
Test toArray
whenReceiveListThenMake2DArray
{ "repo_name": "AlxKonstantin/kalekseev", "path": "chapter_003/src/test/java/ru/job4j/ConvertListTest.java", "license": "apache-2.0", "size": 2333 }
[ "java.util.ArrayList", "java.util.List", "org.hamcrest.core.Is", "org.junit.Assert" ]
import java.util.ArrayList; import java.util.List; import org.hamcrest.core.Is; import org.junit.Assert;
import java.util.*; import org.hamcrest.core.*; import org.junit.*;
[ "java.util", "org.hamcrest.core", "org.junit" ]
java.util; org.hamcrest.core; org.junit;
759,543
private ImmutableNode createWithNewAttributes(final Map<String, Object> newAttrs) { return createWithBasicProperties(new Builder(children, null).addAttributes(newAttrs)); }
ImmutableNode function(final Map<String, Object> newAttrs) { return createWithBasicProperties(new Builder(children, null).addAttributes(newAttrs)); }
/** * Creates a new {@code ImmutableNode} instance with the same properties as this object, but with the given new * attributes. * * @param newAttrs the new attributes * @return the new node instance */
Creates a new ImmutableNode instance with the same properties as this object, but with the given new attributes
createWithNewAttributes
{ "repo_name": "apache/commons-configuration", "path": "src/main/java/org/apache/commons/configuration2/tree/ImmutableNode.java", "license": "apache-2.0", "size": 21176 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
954,775
public void testRemoveColumn() { DefaultCategoryDataset d = new DefaultCategoryDataset(); d.addValue(1.0, "R1", "C1"); d.addValue(2.0, "R2", "C2"); assertEquals(2, d.getColumnCount()); d.removeColumn("C2"); assertEquals(1, d.getColumnCount()); boolean pass = false; try { d.removeColumn("XXX"); } catch (UnknownKeyException e) { pass = true; } assertTrue(pass); pass = false; try { d.removeColumn(null); } catch (IllegalArgumentException e) { pass = true; } assertTrue(pass); }
void function() { DefaultCategoryDataset d = new DefaultCategoryDataset(); d.addValue(1.0, "R1", "C1"); d.addValue(2.0, "R2", "C2"); assertEquals(2, d.getColumnCount()); d.removeColumn("C2"); assertEquals(1, d.getColumnCount()); boolean pass = false; try { d.removeColumn("XXX"); } catch (UnknownKeyException e) { pass = true; } assertTrue(pass); pass = false; try { d.removeColumn(null); } catch (IllegalArgumentException e) { pass = true; } assertTrue(pass); }
/** * Some checks for the removeColumn(Comparable) method. */
Some checks for the removeColumn(Comparable) method
testRemoveColumn
{ "repo_name": "integrated/jfreechart", "path": "tests/org/jfree/data/category/junit/DefaultCategoryDatasetTests.java", "license": "lgpl-2.1", "size": 12218 }
[ "org.jfree.data.UnknownKeyException", "org.jfree.data.category.DefaultCategoryDataset" ]
import org.jfree.data.UnknownKeyException; import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.*; import org.jfree.data.category.*;
[ "org.jfree.data" ]
org.jfree.data;
1,830,437
List<BlockJson> cloned = new ArrayList<BlockJson>(list.size()); list.forEach(b -> cloned.add(deepClone(b))); // for (BlockJson block : list) { // cloned.add( (BlockJson) SerializationUtils.clone(block)); // } return cloned; } public static final GsonBuilder GSON_BUILDER = new GsonBuilder() .disableHtmlEscaping () .setPrettyPrinting() .registerTypeAdapter(BlockJson.class, new BlockJson.Deserializer()) .registerTypeAdapter(BlockJson.class, new BlockJson.Serializer()) .registerTypeAdapter(Drop.class, new Drop.Deserializer()) .registerTypeAdapter(Drop.class, new Drop.Serializer()) .registerTypeAdapter(Recipe.class, new Recipe.Deserializer()) .registerTypeAdapter(Recipe.class, new Recipe.Serializer()); public static final Gson GSON = GSON_BUILDER.create();
List<BlockJson> cloned = new ArrayList<BlockJson>(list.size()); list.forEach(b -> cloned.add(deepClone(b))); return cloned; } public static final GsonBuilder GSON_BUILDER = new GsonBuilder() .disableHtmlEscaping () .setPrettyPrinting() .registerTypeAdapter(BlockJson.class, new BlockJson.Deserializer()) .registerTypeAdapter(BlockJson.class, new BlockJson.Serializer()) .registerTypeAdapter(Drop.class, new Drop.Deserializer()) .registerTypeAdapter(Drop.class, new Drop.Serializer()) .registerTypeAdapter(Recipe.class, new Recipe.Deserializer()) .registerTypeAdapter(Recipe.class, new Recipe.Serializer()); public static final Gson GSON = GSON_BUILDER.create();
/** * Deep clones the given List. Had to implement * this because Java's default cloning sucks ass and * only makes a shallow deepCopy of the Object. * * @return A deep-copied <code> List <BlockJson> </code> */
Deep clones the given List. Had to implement this because Java's default cloning sucks ass and only makes a shallow deepCopy of the Object
deepCloneList
{ "repo_name": "kimfy/NotEnoughBlocks", "path": "src/main/java/com/kimfy/notenoughblocks/common/util/Utilities.java", "license": "mit", "size": 3132 }
[ "com.google.gson.Gson", "com.google.gson.GsonBuilder", "com.kimfy.notenoughblocks.common.file.json.BlockJson", "com.kimfy.notenoughblocks.common.util.block.Drop", "com.kimfy.notenoughblocks.common.util.block.Recipe", "java.util.ArrayList", "java.util.List" ]
import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.kimfy.notenoughblocks.common.file.json.BlockJson; import com.kimfy.notenoughblocks.common.util.block.Drop; import com.kimfy.notenoughblocks.common.util.block.Recipe; import java.util.ArrayList; import java.util.List;
import com.google.gson.*; import com.kimfy.notenoughblocks.common.file.json.*; import com.kimfy.notenoughblocks.common.util.block.*; import java.util.*;
[ "com.google.gson", "com.kimfy.notenoughblocks", "java.util" ]
com.google.gson; com.kimfy.notenoughblocks; java.util;
1,399,725
public void setObjects(List<Object> objects) { this.objects = objects; }
void function(List<Object> objects) { this.objects = objects; }
/** * Sets the objects. * @param objects the new value of the property */
Sets the objects
setObjects
{ "repo_name": "nssales/Strata", "path": "modules/basics/src/test/java/com/opengamma/strata/basics/date/MockSerBean.java", "license": "apache-2.0", "size": 11150 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
671,447
public IModel<Boolean> getJoinModel();
IModel<Boolean> function();
/** * Get join * @return {@link IModel} with boolean. If true - result of filtering will be include to result */
Get join
getJoinModel
{ "repo_name": "OrienteerBAP/wicket-orientdb", "path": "wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/filter/IFilterCriteria.java", "license": "apache-2.0", "size": 1265 }
[ "org.apache.wicket.model.IModel" ]
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.*;
[ "org.apache.wicket" ]
org.apache.wicket;
2,571,786