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
|
---|---|---|---|---|---|---|---|---|---|---|---|
FluidStack drain(World world, BlockPos pos, boolean doDrain);
|
FluidStack drain(World world, BlockPos pos, boolean doDrain);
|
/**
* Attempt to drain the block. This method should be called by devices such as pumps.
*
* NOTE: The block is intended to handle its own state changes.
*
* @param doDrain
* If false, the drain will only be simulated.
* @return
*/
|
Attempt to drain the block. This method should be called by devices such as pumps
|
drain
|
{
"repo_name": "fcjailybo/MinecraftForge",
"path": "src/main/java/net/minecraftforge/fluids/IFluidBlock.java",
"license": "lgpl-2.1",
"size": 1469
}
|
[
"net.minecraft.util.BlockPos",
"net.minecraft.world.World"
] |
import net.minecraft.util.BlockPos; import net.minecraft.world.World;
|
import net.minecraft.util.*; import net.minecraft.world.*;
|
[
"net.minecraft.util",
"net.minecraft.world"
] |
net.minecraft.util; net.minecraft.world;
| 123,122 |
public static boolean add(Repository repo, String filepattern) {
if (add(repo, filepattern, false))
return true;
return false;
}
|
static boolean function(Repository repo, String filepattern) { if (add(repo, filepattern, false)) return true; return false; }
|
/**
* Overloads the add(Repository repo, String filepattern, boolean update)
* method passing the update value as false
*
* @param repo
* @param filepattern
* @return
*/
|
Overloads the add(Repository repo, String filepattern, boolean update) method passing the update value as false
|
add
|
{
"repo_name": "XMLVersioningFramework/XMLVersioningFramework",
"path": "app/models/GitHandler.java",
"license": "apache-2.0",
"size": 12905
}
|
[
"org.eclipse.jgit.lib.Repository"
] |
import org.eclipse.jgit.lib.Repository;
|
import org.eclipse.jgit.lib.*;
|
[
"org.eclipse.jgit"
] |
org.eclipse.jgit;
| 2,785,900 |
private static boolean hasSpecializedHandlerIntents(Context context, Intent intent) {
try {
PackageManager pm = context.getPackageManager();
List<ResolveInfo> handlers = pm.queryIntentActivities(
intent,
PackageManager.GET_RESOLVED_FILTER);
if (handlers == null || handlers.size() == 0) {
return false;
}
for (ResolveInfo resolveInfo : handlers) {
IntentFilter filter = resolveInfo.filter;
if (filter == null) continue;
if (filter.countDataAuthorities() == 0 || filter.countDataPaths() == 0) continue;
if (resolveInfo.activityInfo == null) continue;
return true;
}
} catch (RuntimeException e) {
Log.e(TAG, "Runtime exception while getting specialized handlers");
}
return false;
}
|
static boolean function(Context context, Intent intent) { try { PackageManager pm = context.getPackageManager(); List<ResolveInfo> handlers = pm.queryIntentActivities( intent, PackageManager.GET_RESOLVED_FILTER); if (handlers == null handlers.size() == 0) { return false; } for (ResolveInfo resolveInfo : handlers) { IntentFilter filter = resolveInfo.filter; if (filter == null) continue; if (filter.countDataAuthorities() == 0 filter.countDataPaths() == 0) continue; if (resolveInfo.activityInfo == null) continue; return true; } } catch (RuntimeException e) { Log.e(TAG, STR); } return false; }
|
/**
* Used to check whether there is a specialized handler for a given intent.
* @param intent The intent to check with.
* @return Whether there is a specialized handler for the given intent.
*/
|
Used to check whether there is a specialized handler for a given intent
|
hasSpecializedHandlerIntents
|
{
"repo_name": "andrewlu1/CustomTabNew",
"path": "shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java",
"license": "apache-2.0",
"size": 6294
}
|
[
"android.content.Context",
"android.content.Intent",
"android.content.IntentFilter",
"android.content.pm.PackageManager",
"android.content.pm.ResolveInfo",
"android.util.Log",
"java.util.List"
] |
import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.util.Log; import java.util.List;
|
import android.content.*; import android.content.pm.*; import android.util.*; import java.util.*;
|
[
"android.content",
"android.util",
"java.util"
] |
android.content; android.util; java.util;
| 2,725,136 |
public BaselineQueryTestBuilder sqlBaselineQuery(Object baselineQuery) {
return new BaselineQueryTestBuilder(baselineQuery, UserBitShared.QueryType.SQL, services, query, queryType, ordered, approximateEquality,
baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison, expectedNumBatches);
}
|
BaselineQueryTestBuilder function(Object baselineQuery) { return new BaselineQueryTestBuilder(baselineQuery, UserBitShared.QueryType.SQL, services, query, queryType, ordered, approximateEquality, baselineTypeMap, baselineOptionSettingQueries, testOptionSettingQueries, highPerformanceComparison, expectedNumBatches); }
|
/**
* Provide a SQL query to validate against.
* @param baselineQuery
* @return the test builder
*/
|
Provide a SQL query to validate against
|
sqlBaselineQuery
|
{
"repo_name": "Ben-Zvi/drill",
"path": "exec/java-exec/src/test/java/org/apache/drill/test/TestBuilder.java",
"license": "apache-2.0",
"size": 31697
}
|
[
"org.apache.drill.exec.proto.UserBitShared"
] |
import org.apache.drill.exec.proto.UserBitShared;
|
import org.apache.drill.exec.proto.*;
|
[
"org.apache.drill"
] |
org.apache.drill;
| 2,340,912 |
SetupConfigurationTemplate downloadSetupConfigurationTemplateByUuid(final String uuid) throws IOException;
|
SetupConfigurationTemplate downloadSetupConfigurationTemplateByUuid(final String uuid) throws IOException;
|
/**
* Download setup configuration template by the uuid of the setup configuration associated with the setup configuration template.
*
* @param uuid the uuid of the setup configuration.
* @return the setup configuration template with matching uuid downloaded from the server.
* @throws IOException when search api unable to process the resource.
* @should download the setup configuration template by the uuid of the setup configuration.
*/
|
Download setup configuration template by the uuid of the setup configuration associated with the setup configuration template
|
downloadSetupConfigurationTemplateByUuid
|
{
"repo_name": "mssavai/muzima-api",
"path": "src/main/java/com/muzima/api/service/SetupConfigurationService.java",
"license": "mpl-2.0",
"size": 4298
}
|
[
"com.muzima.api.model.SetupConfigurationTemplate",
"java.io.IOException"
] |
import com.muzima.api.model.SetupConfigurationTemplate; import java.io.IOException;
|
import com.muzima.api.model.*; import java.io.*;
|
[
"com.muzima.api",
"java.io"
] |
com.muzima.api; java.io;
| 952,279 |
@Nonnull
public final Self forceIgnore(@Nonnull Condition<? super T> c) {
return newInstance(myMeta.forceIgnore(c));
}
|
final Self function(@Nonnull Condition<? super T> c) { return newInstance(myMeta.forceIgnore(c)); }
|
/**
* Excludes the nodes by the specified condition from any traversal completely.
* <p/>
* This property is not reset by {@code reset()} call.
* @see FilteredTraverserBase#expand(Condition)
* @see FilteredTraverserBase#filter(Condition)
* @see FilteredTraverserBase#reset()
*/
|
Excludes the nodes by the specified condition from any traversal completely. This property is not reset by reset() call
|
forceIgnore
|
{
"repo_name": "consulo/consulo",
"path": "modules/base/util-deprecated/src/main/java/com/intellij/util/containers/FilteredTraverserBase.java",
"license": "apache-2.0",
"size": 14623
}
|
[
"com.intellij.openapi.util.Condition",
"javax.annotation.Nonnull"
] |
import com.intellij.openapi.util.Condition; import javax.annotation.Nonnull;
|
import com.intellij.openapi.util.*; import javax.annotation.*;
|
[
"com.intellij.openapi",
"javax.annotation"
] |
com.intellij.openapi; javax.annotation;
| 542,015 |
public final void setTime(String parameterName, Time x)
throws SQLException {
throw Util.notImplemented();
}
|
final void function(String parameterName, Time x) throws SQLException { throw Util.notImplemented(); }
|
/**
* JDBC 3.0
*
* Sets the designated parameter to the given java.sql.Time value. The
* driver converts this to an SQL TIME value when it sends it to the
* database.
*
* @param parameterName - the name of the parameter
* @param x - the parameter value
* @exception SQLException Feature not implemented for now.
*/
|
JDBC 3.0 Sets the designated parameter to the given java.sql.Time value. The driver converts this to an SQL TIME value when it sends it to the database
|
setTime
|
{
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java",
"license": "apache-2.0",
"size": 62201
}
|
[
"java.sql.SQLException",
"java.sql.Time"
] |
import java.sql.SQLException; import java.sql.Time;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,352,744 |
public List getList() {
return list;
}
|
List function() { return list; }
|
/**
* Returns the newly created list.
*/
|
Returns the newly created list
|
getList
|
{
"repo_name": "shyamalschandra/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/svg/AbstractSVGList.java",
"license": "apache-2.0",
"size": 16335
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,977,878 |
@Requires("ClassName.isBinaryName(className)")
private void findSuperInfo(String className) {
if (superClassNames.containsKey(className)) {
return;
}
if (blacklistManager.isIgnored(new ClassName(className)
.getQualifiedName())) {
findSuperInfoFromClass(className);
} else {
findSuperInfoFromClassFile(className);
}
}
|
@Requires(STR) void function(String className) { if (superClassNames.containsKey(className)) { return; } if (blacklistManager.isIgnored(new ClassName(className) .getQualifiedName())) { findSuperInfoFromClass(className); } else { findSuperInfoFromClassFile(className); } }
|
/**
* Look up information about super classes and assignable types
* for the class named {@code className}.
*/
|
Look up information about super classes and assignable types for the class named className
|
findSuperInfo
|
{
"repo_name": "pashapm/cofoja",
"path": "src/com/google/java/contract/core/agent/ContractClassFileTransformer.java",
"license": "lgpl-3.0",
"size": 13963
}
|
[
"com.google.java.contract.Requires",
"com.google.java.contract.core.model.ClassName"
] |
import com.google.java.contract.Requires; import com.google.java.contract.core.model.ClassName;
|
import com.google.java.contract.*; import com.google.java.contract.core.model.*;
|
[
"com.google.java"
] |
com.google.java;
| 2,701,766 |
public static I_CmsPrincipal readPrincipal(CmsObject cms, String type, String name) throws CmsException {
if (CmsStringUtil.isNotEmpty(type)) {
String upperCaseType = type.toUpperCase();
if (PRINCIPAL_GROUP.equals(upperCaseType)) {
// this principal is a group
return cms.readGroup(name);
} else if (PRINCIPAL_USER.equals(upperCaseType)) {
// this principal is a user
return cms.readUser(name);
}
}
// invalid principal type was given
throw new CmsDbEntryNotFoundException(
Messages.get().container(Messages.ERR_INVALID_PRINCIPAL_TYPE_2, type, name));
}
|
static I_CmsPrincipal function(CmsObject cms, String type, String name) throws CmsException { if (CmsStringUtil.isNotEmpty(type)) { String upperCaseType = type.toUpperCase(); if (PRINCIPAL_GROUP.equals(upperCaseType)) { return cms.readGroup(name); } else if (PRINCIPAL_USER.equals(upperCaseType)) { return cms.readUser(name); } } throw new CmsDbEntryNotFoundException( Messages.get().container(Messages.ERR_INVALID_PRINCIPAL_TYPE_2, type, name)); }
|
/**
* Utility function to read a principal of the given type from the OpenCms database using the
* provided OpenCms user context.<p>
*
* The type must either be <code>{@link I_CmsPrincipal#PRINCIPAL_GROUP}</code> or
* <code>{@link I_CmsPrincipal#PRINCIPAL_USER}</code>.<p>
*
* @param cms the OpenCms user context to use when reading the principal
* @param type the principal type
* @param name the principal name
*
* @return the principal read from the OpenCms database
*
* @throws CmsException in case the principal could not be read
*/
|
Utility function to read a principal of the given type from the OpenCms database using the provided OpenCms user context. The type must either be <code><code>I_CmsPrincipal#PRINCIPAL_GROUP</code></code> or <code><code>I_CmsPrincipal#PRINCIPAL_USER</code></code>
|
readPrincipal
|
{
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/security/CmsPrincipal.java",
"license": "lgpl-2.1",
"size": 16804
}
|
[
"org.opencms.db.CmsDbEntryNotFoundException",
"org.opencms.file.CmsObject",
"org.opencms.main.CmsException",
"org.opencms.util.CmsStringUtil"
] |
import org.opencms.db.CmsDbEntryNotFoundException; import org.opencms.file.CmsObject; import org.opencms.main.CmsException; import org.opencms.util.CmsStringUtil;
|
import org.opencms.db.*; import org.opencms.file.*; import org.opencms.main.*; import org.opencms.util.*;
|
[
"org.opencms.db",
"org.opencms.file",
"org.opencms.main",
"org.opencms.util"
] |
org.opencms.db; org.opencms.file; org.opencms.main; org.opencms.util;
| 2,693,390 |
public List getRowKeys() {
return this.data.getRowKeys();
}
|
List function() { return this.data.getRowKeys(); }
|
/**
* Returns the row keys.
*
* @return The keys.
*
* @see #getRowKey(int)
*/
|
Returns the row keys
|
getRowKeys
|
{
"repo_name": "Mr-Steve/LTSpice_Library_Manager",
"path": "libs/jfreechart-1.0.16/source/org/jfree/data/category/DefaultCategoryDataset.java",
"license": "gpl-2.0",
"size": 13275
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,178,835 |
String getEndpointGatewayConfig(String endpointId) throws APIManagementException;
|
String getEndpointGatewayConfig(String endpointId) throws APIManagementException;
|
/**
* Return Gateway Configuration of Endpoint
*
* @param endpointId
* @return gateway Configuration of Endpoint
* @throws APIManagementException If failed to get Endpoints configuration
*/
|
Return Gateway Configuration of Endpoint
|
getEndpointGatewayConfig
|
{
"repo_name": "rswijesena/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.core/src/main/java/org/wso2/carbon/apimgt/core/api/APIMgtAdminService.java",
"license": "apache-2.0",
"size": 14765
}
|
[
"org.wso2.carbon.apimgt.core.exception.APIManagementException"
] |
import org.wso2.carbon.apimgt.core.exception.APIManagementException;
|
import org.wso2.carbon.apimgt.core.exception.*;
|
[
"org.wso2.carbon"
] |
org.wso2.carbon;
| 209,970 |
default LongConsumer andThen(LongConsumer after) {
Objects.requireNonNull(after);
return (long t) -> { accept(t); after.accept(t); };
}
|
default LongConsumer andThen(LongConsumer after) { Objects.requireNonNull(after); return (long t) -> { accept(t); after.accept(t); }; }
|
/**
* Returns a composed {@code LongConsumer} that performs, in sequence, this
* operation followed by the {@code after} operation. If performing either
* operation throws an exception, it is relayed to the caller of the
* composed operation. If performing this operation throws an exception,
* the {@code after} operation will not be performed.
*
* @param after the operation to perform after this operation
* @return a composed {@code LongConsumer} that performs in sequence this
* operation followed by the {@code after} operation
* @throws NullPointerException if {@code after} is null
*/
|
Returns a composed LongConsumer that performs, in sequence, this operation followed by the after operation. If performing either operation throws an exception, it is relayed to the caller of the composed operation. If performing this operation throws an exception, the after operation will not be performed
|
andThen
|
{
"repo_name": "evanman/Java-Source",
"path": "util/function/LongConsumer.java",
"license": "lgpl-2.1",
"size": 2749
}
|
[
"java.util.Objects"
] |
import java.util.Objects;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,103,012 |
public boolean removeOperand(T operand) {
if (operands == null) {
return false;
}
// JCR-1650 search the operand without relying on Object#equals(Object)
Iterator it = operands.iterator();
while (it.hasNext()) {
if (it.next() == operand) {
it.remove();
return true;
}
}
return false;
}
|
boolean function(T operand) { if (operands == null) { return false; } Iterator it = operands.iterator(); while (it.hasNext()) { if (it.next() == operand) { it.remove(); return true; } } return false; }
|
/**
* Removes an <code>operand</code> (child node) from this query node.
*
* @param operand the child to remove.
* @return <code>true</code> if the operand was in the list of child nodes
* and has been removed; <code>false</code> if this node does not contain
* <code>operand</code> as a child node.
*/
|
Removes an <code>operand</code> (child node) from this query node
|
removeOperand
|
{
"repo_name": "sdmcraft/jackrabbit",
"path": "jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/NAryQueryNode.java",
"license": "apache-2.0",
"size": 5321
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,488,833 |
@Test
public void test190AccountMorganDeadExpireOperation() throws Exception {
final String TEST_NAME = "test190AccountMorganDeadExpireOperation";
displayTestTitle(TEST_NAME);
// GIVEN
Task task = createTask(TEST_NAME);
OperationResult result = task.getResult();
clockForward("P1D");
syncServiceMock.reset();
dummyResource.resetBreakMode();
PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID);
// WHEN
displayWhen(TEST_NAME);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
// THEN
displayThen(TEST_NAME);
display("Result", result);
assertSuccess(result);
syncServiceMock.assertNoNotifcations();
assertRepoShadow(ACCOUNT_MORGAN_OID)
.assertKind(ShadowKindType.ACCOUNT)
.assertDead()
.assertIsNotExists()
.assertNoLegacyConsistency()
.attributes()
.assertAttributes(SchemaConstants.ICFS_NAME)
.end()
.pendingOperations()
.assertNone();
assertShadowNoFetch(ACCOUNT_MORGAN_OID)
.assertDead()
.assertIsNotExists()
.assertNoLegacyConsistency()
.attributes()
.assertResourceAttributeContainer()
.assertNoPrimaryIdentifier()
.assertHasSecondaryIdentifier()
.assertSize(1)
.end()
.pendingOperations()
.assertNone();
ShadowAsserter<Void> asserterShadowFuture = assertShadowFuture(ACCOUNT_MORGAN_OID)
.assertTombstone()
.assertNoLegacyConsistency()
.attributes()
.assertResourceAttributeContainer()
.assertNoPrimaryIdentifier()
.assertHasSecondaryIdentifier()
.end();
assertShadowFutureNoFetch(ACCOUNT_MORGAN_OID)
.assertTombstone()
.assertNoLegacyConsistency()
.attributes()
.assertResourceAttributeContainer()
.assertNoPrimaryIdentifier()
.assertHasSecondaryIdentifier()
.end();
dummyResource.resetBreakMode();
// Check if the shadow is still in the repo (e.g. that the consistency or sync haven't removed it)
checkUniqueness(asserterShadowFuture.getObject());
assertSteadyResources();
}
|
void function() throws Exception { final String TEST_NAME = STR; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); clockForward("P1D"); syncServiceMock.reset(); dummyResource.resetBreakMode(); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); displayThen(TEST_NAME); display(STR, result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertRepoShadow(ACCOUNT_MORGAN_OID) .assertKind(ShadowKindType.ACCOUNT) .assertDead() .assertIsNotExists() .assertNoLegacyConsistency() .attributes() .assertAttributes(SchemaConstants.ICFS_NAME) .end() .pendingOperations() .assertNone(); assertShadowNoFetch(ACCOUNT_MORGAN_OID) .assertDead() .assertIsNotExists() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertHasSecondaryIdentifier() .assertSize(1) .end() .pendingOperations() .assertNone(); ShadowAsserter<Void> asserterShadowFuture = assertShadowFuture(ACCOUNT_MORGAN_OID) .assertTombstone() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertHasSecondaryIdentifier() .end(); assertShadowFutureNoFetch(ACCOUNT_MORGAN_OID) .assertTombstone() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertHasSecondaryIdentifier() .end(); dummyResource.resetBreakMode(); checkUniqueness(asserterShadowFuture.getObject()); assertSteadyResources(); }
|
/**
* Refreshing dead shadow after pending operation is expired.
* Pending operation should be gone.
* This is the original dead shadow from test10x which is
* a result of failed add operation.
* MID-3891
*/
|
Refreshing dead shadow after pending operation is expired. Pending operation should be gone. This is the original dead shadow from test10x which is a result of failed add operation. MID-3891
|
test190AccountMorganDeadExpireOperation
|
{
"repo_name": "arnost-starosta/midpoint",
"path": "provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyConsistency.java",
"license": "apache-2.0",
"size": 95749
}
|
[
"com.evolveum.midpoint.prism.PrismObject",
"com.evolveum.midpoint.schema.constants.SchemaConstants",
"com.evolveum.midpoint.schema.result.OperationResult",
"com.evolveum.midpoint.task.api.Task",
"com.evolveum.midpoint.test.asserter.ShadowAsserter",
"com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType",
"com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType"
] |
import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.asserter.ShadowAsserter; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
|
import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.schema.constants.*; import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.test.asserter.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
|
[
"com.evolveum.midpoint"
] |
com.evolveum.midpoint;
| 2,208,060 |
public Connection getConnection() {
return connection;
}
|
Connection function() { return connection; }
|
/**
* Gets the connection.
*
* @return The connection
*/
|
Gets the connection
|
getConnection
|
{
"repo_name": "vexsoftware/ajdbc",
"path": "src/main/java/com/vexsoftware/ajdbc/wrapper/AsynchronousConnection.java",
"license": "lgpl-3.0",
"size": 2051
}
|
[
"java.sql.Connection"
] |
import java.sql.Connection;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,694,125 |
@ServiceMethod(returns = ReturnType.SINGLE)
TransformationsGetResponse getWithResponse(
String resourceGroupName, String jobName, String transformationName, Context context);
|
@ServiceMethod(returns = ReturnType.SINGLE) TransformationsGetResponse getWithResponse( String resourceGroupName, String jobName, String transformationName, Context context);
|
/**
* Gets details about the specified transformation.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param jobName The name of the streaming job.
* @param transformationName The name of the transformation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return details about the specified transformation.
*/
|
Gets details about the specified transformation
|
getWithResponse
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/streamanalytics/azure-resourcemanager-streamanalytics/src/main/java/com/azure/resourcemanager/streamanalytics/fluent/TransformationsClient.java",
"license": "mit",
"size": 8826
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.streamanalytics.models.TransformationsGetResponse"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.streamanalytics.models.TransformationsGetResponse;
|
import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.streamanalytics.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,408,694 |
private void fireConnectedListeners(ConnectedClient client)
{
for (ConnectionsListener listener : listeners)
{
listener.clientConnected(client);
}
}
|
void function(ConnectedClient client) { for (ConnectionsListener listener : listeners) { listener.clientConnected(client); } }
|
/**
* Fire all registered {@link ConnectionsListener} with information that
* the specified {@link ConnectedClient} was connected.
*
* @param client - the specified {@link ConnectedClient} object.
*/
|
Fire all registered <code>ConnectionsListener</code> with information that the specified <code>ConnectedClient</code> was connected
|
fireConnectedListeners
|
{
"repo_name": "molszewski/dante",
"path": "module/BattleClientServer/src/net/java/dante/gui/server/ClientsManagerImpl.java",
"license": "lgpl-3.0",
"size": 6691
}
|
[
"net.java.dante.gui.common.clients.ConnectedClient",
"net.java.dante.gui.common.clients.ConnectionsListener"
] |
import net.java.dante.gui.common.clients.ConnectedClient; import net.java.dante.gui.common.clients.ConnectionsListener;
|
import net.java.dante.gui.common.clients.*;
|
[
"net.java.dante"
] |
net.java.dante;
| 2,561,746 |
protected float textWidthImpl(char buffer[], int start, int stop) {
Font font = textFont.getFont();
if ((textMode != SHAPE) || (font == null)) {
return super.textWidthImpl(buffer, start, stop);
}
Graphics2D graphics = (Graphics2D) parent.getGraphics();
// otherwise smaller sizes will be totally crapped up
// seems to need to be before the getFRC, but after the canvas.getGraphics
// (placing this inside textSize(), even though it was called, wasn't working)
graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
FontRenderContext frc = graphics.getFontRenderContext();
GlyphVector gv;
gv = font.createGlyphVector(frc, buffer);
float sum = 0;
for (int i = start; i < stop; i++) {
GlyphMetrics gm = gv.getGlyphMetrics(i);
sum += gm.getAdvance();
}
return sum;
}
//////////////////////////////////////////////////////////////
// TEXT
// None of the variations of text() are overridden from PGraphics.
//////////////////////////////////////////////////////////////
// TEXT IMPL
//protected void textLineAlignImpl(char buffer[], int start, int stop,
// float x, float y)
//protected void textLineImpl(char buffer[], int start, int stop,
// float x, float y)
|
float function(char buffer[], int start, int stop) { Font font = textFont.getFont(); if ((textMode != SHAPE) (font == null)) { return super.textWidthImpl(buffer, start, stop); } Graphics2D graphics = (Graphics2D) parent.getGraphics(); graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); FontRenderContext frc = graphics.getFontRenderContext(); GlyphVector gv; gv = font.createGlyphVector(frc, buffer); float sum = 0; for (int i = start; i < stop; i++) { GlyphMetrics gm = gv.getGlyphMetrics(i); sum += gm.getAdvance(); } return sum; }
|
/**
* Same as parent, but override for native version of the font.
* <p/>
* Also gets called by textFont, so the metrics
* will get recorded properly.
*/
|
Same as parent, but override for native version of the font. Also gets called by textFont, so the metrics will get recorded properly
|
textWidthImpl
|
{
"repo_name": "acm-uiuc/Tacchi",
"path": "src/processing/opengl/PGraphicsOpenGL.java",
"license": "gpl-2.0",
"size": 90829
}
|
[
"java.awt.Font",
"java.awt.Graphics2D",
"java.awt.RenderingHints",
"java.awt.font.FontRenderContext",
"java.awt.font.GlyphMetrics",
"java.awt.font.GlyphVector"
] |
import java.awt.Font; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.font.FontRenderContext; import java.awt.font.GlyphMetrics; import java.awt.font.GlyphVector;
|
import java.awt.*; import java.awt.font.*;
|
[
"java.awt"
] |
java.awt;
| 2,618,799 |
public void touchHost(HostBean host) {
long now = System.currentTimeMillis() / 1000;
ContentValues values = new ContentValues();
values.put(FIELD_HOST_LASTCONNECT, now);
synchronized (dbLock) {
SQLiteDatabase db = this.getWritableDatabase();
db.update(TABLE_HOSTS, values, "_id = ?", new String[] { String.valueOf(host.getId()) });
}
}
|
void function(HostBean host) { long now = System.currentTimeMillis() / 1000; ContentValues values = new ContentValues(); values.put(FIELD_HOST_LASTCONNECT, now); synchronized (dbLock) { SQLiteDatabase db = this.getWritableDatabase(); db.update(TABLE_HOSTS, values, STR, new String[] { String.valueOf(host.getId()) }); } }
|
/**
* Touch a specific host to update its "last connected" field.
* @param host Nickname field of host to update
*/
|
Touch a specific host to update its "last connected" field
|
touchHost
|
{
"repo_name": "getconsole/serialbot",
"path": "src/nz/co/cloudstore/serialbot/util/HostDatabase.java",
"license": "apache-2.0",
"size": 27726
}
|
[
"android.content.ContentValues",
"android.database.sqlite.SQLiteDatabase",
"nz.co.cloudstore.serialbot.bean.HostBean"
] |
import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase; import nz.co.cloudstore.serialbot.bean.HostBean;
|
import android.content.*; import android.database.sqlite.*; import nz.co.cloudstore.serialbot.bean.*;
|
[
"android.content",
"android.database",
"nz.co.cloudstore"
] |
android.content; android.database; nz.co.cloudstore;
| 49,265 |
public void testEquals() {
ConcurrentHashMap map1 = map5();
ConcurrentHashMap map2 = map5();
assertEquals(map1, map2);
assertEquals(map2, map1);
map1.clear();
assertFalse(map1.equals(map2));
assertFalse(map2.equals(map1));
}
|
void function() { ConcurrentHashMap map1 = map5(); ConcurrentHashMap map2 = map5(); assertEquals(map1, map2); assertEquals(map2, map1); map1.clear(); assertFalse(map1.equals(map2)); assertFalse(map2.equals(map1)); }
|
/**
* Maps with same contents are equal
*/
|
Maps with same contents are equal
|
testEquals
|
{
"repo_name": "mirego/j2objc",
"path": "jre_emul/android/platform/libcore/jsr166-tests/src/test/java/jsr166/ConcurrentHashMapTest.java",
"license": "apache-2.0",
"size": 24611
}
|
[
"java.util.concurrent.ConcurrentHashMap"
] |
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 365,798 |
public Options shapes(List<Shape> shapes) {
this.shapes = shapes;
return this;
}
|
Options function(List<Shape> shapes) { this.shapes = shapes; return this; }
|
/**
* Sets the shapes option.
*
* @param shapes The shape of each component in a value. The length of this attr must
* be either 0 or the same as the length of component_types. If the length of
* this attr is 0, the shapes of queue elements are not constrained, and
* only one element may be dequeued at a time.
* @return this Options instance.
*/
|
Sets the shapes option
|
shapes
|
{
"repo_name": "tensorflow/java",
"path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java",
"license": "apache-2.0",
"size": 12517
}
|
[
"java.util.List",
"org.tensorflow.ndarray.Shape"
] |
import java.util.List; import org.tensorflow.ndarray.Shape;
|
import java.util.*; import org.tensorflow.ndarray.*;
|
[
"java.util",
"org.tensorflow.ndarray"
] |
java.util; org.tensorflow.ndarray;
| 1,496,081 |
public static String validateVersion(String hbaseVersion, Configuration conf) {
int encodedVersion = VersionUtil.encodeVersion(hbaseVersion);
// above 0.94 everything should be supported
if (encodedVersion > INDEXING_SUPPORTED_MAJOR_VERSION) {
return null;
}
// check to see if its at least 0.94
if (encodedVersion < INDEXING_SUPPORTED__MIN_MAJOR_VERSION) {
return "Indexing not supported for versions older than 0.94.X";
}
// if less than 0.94.9, we need to check if WAL Compression is enabled
if (encodedVersion < INDEX_WAL_COMPRESSION_MINIMUM_SUPPORTED_VERSION) {
if (conf.getBoolean(HConstants.ENABLE_WAL_COMPRESSION, false)) {
return "Indexing not supported with WAL Compression for versions of HBase older than 0.94.9 - found version:"
+ hbaseVersion;
}
}
return null;
}
|
static String function(String hbaseVersion, Configuration conf) { int encodedVersion = VersionUtil.encodeVersion(hbaseVersion); if (encodedVersion > INDEXING_SUPPORTED_MAJOR_VERSION) { return null; } if (encodedVersion < INDEXING_SUPPORTED__MIN_MAJOR_VERSION) { return STR; } if (encodedVersion < INDEX_WAL_COMPRESSION_MINIMUM_SUPPORTED_VERSION) { if (conf.getBoolean(HConstants.ENABLE_WAL_COMPRESSION, false)) { return STR + hbaseVersion; } } return null; }
|
/**
* Validate that the version and configuration parameters are supported
* @param hbaseVersion current version of HBase on which <tt>this</tt> coprocessor is installed
* @param conf configuration to check for allowed parameters (e.g. WAL Compression only if >=
* 0.94.9)
* @return <tt>null</tt> if the version is supported, the error message to display otherwise
*/
|
Validate that the version and configuration parameters are supported
|
validateVersion
|
{
"repo_name": "AakashPradeep/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/hbase/index/Indexer.java",
"license": "apache-2.0",
"size": 25531
}
|
[
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.HConstants",
"org.apache.phoenix.hbase.index.util.VersionUtil"
] |
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.phoenix.hbase.index.util.VersionUtil;
|
import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; import org.apache.phoenix.hbase.index.util.*;
|
[
"org.apache.hadoop",
"org.apache.phoenix"
] |
org.apache.hadoop; org.apache.phoenix;
| 2,355,710 |
protected ImportContainer singleFile(File file, ImportConfig config)
{
if (file == null) {
// Can't do anything about it.
return null;
}
final String path = file.getAbsolutePath();
if (!file.exists() || !file.canRead()) {
safeUpdate(new ErrorHandler.UNREADABLE_FILE(path,
new java.io.FileNotFoundException(path), this));
return null;
}
String format = null;
String[] usedFiles = new String[] { path };
long start = System.currentTimeMillis();
try {
try {
setids++;
reader.close();
reader.setMetadataStore(new ImageNameMetadataStore());
reader.setMetadataOptions(
new DefaultMetadataOptions(METADATA_LEVEL));
reader.setId(path);
format = reader.getFormat();
usedFiles = getOrderedFiles();
String[] domains = reader.getReader().getDomains();
boolean isSPW = Arrays.asList(domains).contains(FormatTools.HCS_DOMAIN);
final String readerClassName = reader.unwrap().getClass().getCanonicalName();
ImportContainer ic = new ImportContainer(config,
file, null, null,
readerClassName, usedFiles, isSPW);
ic.setDoThumbnails(config.doThumbnails.get());
ic.setNoStatsInfo(config.noStatsInfo.get());
String configImageName = config.userSpecifiedName.get();
if (configImageName == null)
{
ic.setUserSpecifiedName(file.getName());
}
else
{
ic.setUserSpecifiedName(configImageName);
}
ic.setUserSpecifiedDescription(config.userSpecifiedDescription.get());
ic.setCustomAnnotationList(config.annotations.get());
return ic;
} finally
{
readerTime += (System.currentTimeMillis() - start);
reader.close();
}
} catch (UnsupportedCompressionException uce)
{
unknown++;
// Handling as UNKNOWN_FORMAT for 4.3.0
safeUpdate(new ErrorHandler.UNKNOWN_FORMAT(path, uce, this));
} catch (UnknownFormatException ufe)
{
unknown++;
safeUpdate(new ErrorHandler.UNKNOWN_FORMAT(path, ufe, this));
} catch (MissingLibraryException mle)
{
safeUpdate(new ErrorHandler.MISSING_LIBRARY(path, mle, usedFiles, format));
} catch (Throwable t)
{
Exception e = null;
if (t instanceof Exception) {
e = (Exception) t;
}
else {
e = new Exception(t);
}
safeUpdate(new ErrorHandler.FILE_EXCEPTION(path, e, usedFiles, format));
}
return null;
}
|
ImportContainer function(File file, ImportConfig config) { if (file == null) { return null; } final String path = file.getAbsolutePath(); if (!file.exists() !file.canRead()) { safeUpdate(new ErrorHandler.UNREADABLE_FILE(path, new java.io.FileNotFoundException(path), this)); return null; } String format = null; String[] usedFiles = new String[] { path }; long start = System.currentTimeMillis(); try { try { setids++; reader.close(); reader.setMetadataStore(new ImageNameMetadataStore()); reader.setMetadataOptions( new DefaultMetadataOptions(METADATA_LEVEL)); reader.setId(path); format = reader.getFormat(); usedFiles = getOrderedFiles(); String[] domains = reader.getReader().getDomains(); boolean isSPW = Arrays.asList(domains).contains(FormatTools.HCS_DOMAIN); final String readerClassName = reader.unwrap().getClass().getCanonicalName(); ImportContainer ic = new ImportContainer(config, file, null, null, readerClassName, usedFiles, isSPW); ic.setDoThumbnails(config.doThumbnails.get()); ic.setNoStatsInfo(config.noStatsInfo.get()); String configImageName = config.userSpecifiedName.get(); if (configImageName == null) { ic.setUserSpecifiedName(file.getName()); } else { ic.setUserSpecifiedName(configImageName); } ic.setUserSpecifiedDescription(config.userSpecifiedDescription.get()); ic.setCustomAnnotationList(config.annotations.get()); return ic; } finally { readerTime += (System.currentTimeMillis() - start); reader.close(); } } catch (UnsupportedCompressionException uce) { unknown++; safeUpdate(new ErrorHandler.UNKNOWN_FORMAT(path, uce, this)); } catch (UnknownFormatException ufe) { unknown++; safeUpdate(new ErrorHandler.UNKNOWN_FORMAT(path, ufe, this)); } catch (MissingLibraryException mle) { safeUpdate(new ErrorHandler.MISSING_LIBRARY(path, mle, usedFiles, format)); } catch (Throwable t) { Exception e = null; if (t instanceof Exception) { e = (Exception) t; } else { e = new Exception(t); } safeUpdate(new ErrorHandler.FILE_EXCEPTION(path, e, usedFiles, format)); } return null; }
|
/**
* Return an import container for a single file
* @param file - single file
* @return importer container
*/
|
Return an import container for a single file
|
singleFile
|
{
"repo_name": "dominikl/openmicroscopy",
"path": "components/blitz/src/ome/formats/importer/ImportCandidates.java",
"license": "gpl-2.0",
"size": 24828
}
|
[
"java.io.File",
"java.util.Arrays"
] |
import java.io.File; import java.util.Arrays;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,200,082 |
@Test
public void getSimpleLoginUserListProvidedByApp() throws Exception {
Configuration.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.SIMPLE.getAuthName());
Configuration.set(PropertyKey.SECURITY_LOGIN_USERNAME, "alluxio-user, superuser");
User loginUser = LoginUser.get();
// The user list is considered as a single user name.
Assert.assertNotNull(loginUser);
Assert.assertEquals("alluxio-user, superuser", loginUser.getName());
}
|
void function() throws Exception { Configuration.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.SIMPLE.getAuthName()); Configuration.set(PropertyKey.SECURITY_LOGIN_USERNAME, STR); User loginUser = LoginUser.get(); Assert.assertNotNull(loginUser); Assert.assertEquals(STR, loginUser.getName()); }
|
/**
* Tests whether we can get login user with conf in SIMPLE mode, when a user list is provided by
* by the application through configuration.
*/
|
Tests whether we can get login user with conf in SIMPLE mode, when a user list is provided by by the application through configuration
|
getSimpleLoginUserListProvidedByApp
|
{
"repo_name": "apc999/alluxio",
"path": "core/common/src/test/java/alluxio/security/LoginUserTest.java",
"license": "apache-2.0",
"size": 5638
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,844,018 |
@Override
public int compareTo(Genome otherGenome) {
if (this.isBetterThan(otherGenome)) {
return Comparable.GREATER;
}
else if (otherGenome.isBetterThan(this)) {
return Comparable.LOWER;
}
else if (this.equals(otherGenome)) {
return Comparable.EQUAL;
}
else {
if (random.nextBoolean()) {
return Comparable.LOWER;
}
else {
return Comparable.GREATER;
}
}
}
|
int function(Genome otherGenome) { if (this.isBetterThan(otherGenome)) { return Comparable.GREATER; } else if (otherGenome.isBetterThan(this)) { return Comparable.LOWER; } else if (this.equals(otherGenome)) { return Comparable.EQUAL; } else { if (random.nextBoolean()) { return Comparable.LOWER; } else { return Comparable.GREATER; } } }
|
/**
* Compares this genome to another genome depending on the return values of
* {@link #isBetterThan(Genome)} and {@link #equals(Object)}.
*
* @param otherGenome
* the other genome which is compared to this genome
* @return <code>Comparable.GREATER</code> if this genome is better<br>
* <code>Comparable.LOWER</code> if this genome is worse<br>
* <code>Comparable.EQUAL</code> if both genomes are equal<br>
* or some value randomly chosen between
* <code>Comparable.LOWER</code> and <code>Comparable.GREATER</code>
* if <code>this.isBetterThan(otherGenome)</code> and
* <code>otherGenome.isBetterThan(this)</code> and
* <code>this.equals(otherGenome)</code> all return
* <code>false</code>
* @see Comparable
*/
|
Compares this genome to another genome depending on the return values of <code>#isBetterThan(Genome)</code> and <code>#equals(Object)</code>
|
compareTo
|
{
"repo_name": "MH4J/MetaHeuristics4Java",
"path": "MetaHeuristics4Java/src/main/java/de/mh4j/solver/genetic/Genome.java",
"license": "gpl-3.0",
"size": 3661
}
|
[
"de.mh4j.util.Comparable"
] |
import de.mh4j.util.Comparable;
|
import de.mh4j.util.*;
|
[
"de.mh4j.util"
] |
de.mh4j.util;
| 1,067,905 |
byte[] getBytes() throws LdapInvalidAttributeValueException;
|
byte[] getBytes() throws LdapInvalidAttributeValueException;
|
/**
* <p>
* Get the byte[] value, if and only if the value is known to be Binary,
* otherwise a InvalidAttributeValueException will be thrown
* </p>
* <p>
* Note that this method returns the first value only.
* </p>
*
* @return The value as a byte[]
* @throws LdapInvalidAttributeValueException If the value is a String
*/
|
Get the byte[] value, if and only if the value is known to be Binary, otherwise a InvalidAttributeValueException will be thrown Note that this method returns the first value only.
|
getBytes
|
{
"repo_name": "darranl/directory-shared",
"path": "ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Attribute.java",
"license": "apache-2.0",
"size": 14545
}
|
[
"org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException"
] |
import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException;
|
import org.apache.directory.api.ldap.model.exception.*;
|
[
"org.apache.directory"
] |
org.apache.directory;
| 2,776,642 |
private void saveFeedback(String jsonString) {
try {
JSONArray jsonArray = new JSONArray(jsonString);
if (null != jsonArray) {
JSONObject sessionObj = (JSONObject) jsonArray.get(0);
String sessionId = sessionObj.getString("s");
StringBuffer result = new StringBuffer("Session Id: " + sessionId + "\n");
int[] answers = new int[4];
for (int i = 0; i < answers.length; i++) {
answers[i] = -1;
}
for (int i = 1; i < jsonArray.length(); i++) {
JSONObject answerObj = (JSONObject) jsonArray.get(i);
int question = answerObj.getInt("q");
int answer = answerObj.getInt("a") + 1;
answers[question] = answer;
result.append("Question: " + question + " ---> Answer: " + answer + "\n");
}
LOGD(TAG, "Feedback answers received from the wear: " + result.toString());
FeedbackUtils.saveSessionFeedback(this, sessionId, answers[0], answers[1],
answers[2], answers[3], null);
}
} catch (JSONException e) {
LOGE(TAG, "Failed to parse the json received from the wear", e);
}
}
|
void function(String jsonString) { try { JSONArray jsonArray = new JSONArray(jsonString); if (null != jsonArray) { JSONObject sessionObj = (JSONObject) jsonArray.get(0); String sessionId = sessionObj.getString("s"); StringBuffer result = new StringBuffer(STR + sessionId + "\n"); int[] answers = new int[4]; for (int i = 0; i < answers.length; i++) { answers[i] = -1; } for (int i = 1; i < jsonArray.length(); i++) { JSONObject answerObj = (JSONObject) jsonArray.get(i); int question = answerObj.getInt("q"); int answer = answerObj.getInt("a") + 1; answers[question] = answer; result.append(STR + question + STR + answer + "\n"); } LOGD(TAG, STR + result.toString()); FeedbackUtils.saveSessionFeedback(this, sessionId, answers[0], answers[1], answers[2], answers[3], null); } } catch (JSONException e) { LOGE(TAG, STR, e); } }
|
/**
* Persisting the feedback in the database. The input is the JSON string that represents the
* response from the user on the paired wear device. The format of a typical response is:
* <pre>[{"s":"sessionId-1234"},{"q":1,"a":2},{"q":0,"a":1},{"q":3,"a":1},{"q":2,"a":1}]</pre>
*/
|
Persisting the feedback in the database. The input is the JSON string that represents the response from the user on the paired wear device. The format of a typical response is: <code>[{"s":"sessionId-1234"},{"q":1,"a":2},{"q":0,"a":1},{"q":3,"a":1},{"q":2,"a":1}]</code>
|
saveFeedback
|
{
"repo_name": "ipalermo/schedo",
"path": "android/src/main/java/com/ncode/android/apps/schedo/service/FeedbackListenerService.java",
"license": "apache-2.0",
"size": 9502
}
|
[
"com.ncode.android.apps.schedo.util.FeedbackUtils",
"org.json.JSONArray",
"org.json.JSONException",
"org.json.JSONObject"
] |
import com.ncode.android.apps.schedo.util.FeedbackUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;
|
import com.ncode.android.apps.schedo.util.*; import org.json.*;
|
[
"com.ncode.android",
"org.json"
] |
com.ncode.android; org.json;
| 186,756 |
void components(Action<? super ComponentMetadataHandler> configureAction);
|
void components(Action<? super ComponentMetadataHandler> configureAction);
|
/**
* Configures component metadata for this project.
*
* <p>This method executes the given action against the {@link org.gradle.api.artifacts.dsl.ComponentMetadataHandler} for this project.</p>
*
* @param configureAction the action to use to configure module metadata
* @since 1.8
*/
|
Configures component metadata for this project. This method executes the given action against the <code>org.gradle.api.artifacts.dsl.ComponentMetadataHandler</code> for this project
|
components
|
{
"repo_name": "gradle/gradle",
"path": "subprojects/core-api/src/main/java/org/gradle/api/artifacts/dsl/DependencyHandler.java",
"license": "apache-2.0",
"size": 27329
}
|
[
"org.gradle.api.Action"
] |
import org.gradle.api.Action;
|
import org.gradle.api.*;
|
[
"org.gradle.api"
] |
org.gradle.api;
| 1,078,556 |
public static ActionType lookupActionTypeByName(String name) {
Map<String, String> params = new HashMap<String, String>();
params.put("name", name);
return (ActionType) singleton.lookupObjectByNamedQuery("ActionType.findByName",
params, true);
}
|
static ActionType function(String name) { Map<String, String> params = new HashMap<String, String>(); params.put("name", name); return (ActionType) singleton.lookupObjectByNamedQuery(STR, params, true); }
|
/**
* Helper method to get a ActionType by name
* @param name the Action to lookup
* @return Returns the ActionType corresponding to name
*/
|
Helper method to get a ActionType by name
|
lookupActionTypeByName
|
{
"repo_name": "mcalmer/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/action/ActionFactory.java",
"license": "gpl-2.0",
"size": 40280
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,469,916 |
public static String generateSeriesData() {
return RandomStringUtils.randomAlphanumeric(DEF_COUNT);
}
|
static String function() { return RandomStringUtils.randomAlphanumeric(DEF_COUNT); }
|
/**
* Generate a unique series to validate a persistent token, used in the
* authentication remember-me mechanism.
*
* @return the generated series data
*/
|
Generate a unique series to validate a persistent token, used in the authentication remember-me mechanism
|
generateSeriesData
|
{
"repo_name": "MoWeg/webRTC-firstTry",
"path": "src/main/java/de/mwg/web/service/util/RandomUtil.java",
"license": "mit",
"size": 1442
}
|
[
"org.apache.commons.lang3.RandomStringUtils"
] |
import org.apache.commons.lang3.RandomStringUtils;
|
import org.apache.commons.lang3.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,465,776 |
public OffsetDateTime lastModifiedTime() {
return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
}
|
OffsetDateTime function() { return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); }
|
/**
* Get the lastModifiedTime property: Returns the date and time the share was last modified.
*
* @return the lastModifiedTime value.
*/
|
Get the lastModifiedTime property: Returns the date and time the share was last modified
|
lastModifiedTime
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java",
"license": "mit",
"size": 8693
}
|
[
"java.time.OffsetDateTime"
] |
import java.time.OffsetDateTime;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 1,887,148 |
public Shape getShape()
{
return shape;
}
|
Shape function() { return shape; }
|
/**
* Get the Shape of the component
*
* @return the the Shape of the compnent
*/
|
Get the Shape of the component
|
getShape
|
{
"repo_name": "silverweed/pokepon",
"path": "gui/ShapeComponent.java",
"license": "gpl-3.0",
"size": 4850
}
|
[
"java.awt.Shape"
] |
import java.awt.Shape;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,757,374 |
@Override
public ResourceLocator getResourceLocator() {
return FoundationEditPlugin.INSTANCE;
}
|
ResourceLocator function() { return FoundationEditPlugin.INSTANCE; }
|
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Return the resource locator for this item provider's resources.
|
getResourceLocator
|
{
"repo_name": "Nasdanika/amur-it-js",
"path": "org.nasdanika.amur.it.js.foundation.edit/src/org/nasdanika/amur/it/js/foundation/provider/EventListenerItemProvider.java",
"license": "epl-1.0",
"size": 7269
}
|
[
"org.eclipse.emf.common.util.ResourceLocator"
] |
import org.eclipse.emf.common.util.ResourceLocator;
|
import org.eclipse.emf.common.util.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,178,611 |
public Timestamp getDateModified() {
return (Timestamp) get(3);
}
|
Timestamp function() { return (Timestamp) get(3); }
|
/**
* Getter for <code>sugarcrm_4_12.ss_customer_invoices.date_modified</code>.
*/
|
Getter for <code>sugarcrm_4_12.ss_customer_invoices.date_modified</code>
|
getDateModified
|
{
"repo_name": "SmartMedicalServices/SpringJOOQ",
"path": "src/main/java/com/sms/sis/db/tables/records/SsCustomerInvoicesRecord.java",
"license": "gpl-3.0",
"size": 15000
}
|
[
"java.sql.Timestamp"
] |
import java.sql.Timestamp;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,075,952 |
public static IPackageFragmentRoot addSourceContainer(IJavaProject jproject, String containerName, IPath[] inclusionFilters,
IPath[] exclusionFilters) throws CoreException {
return addSourceContainer(jproject, containerName, inclusionFilters, exclusionFilters, null);
}
|
static IPackageFragmentRoot function(IJavaProject jproject, String containerName, IPath[] inclusionFilters, IPath[] exclusionFilters) throws CoreException { return addSourceContainer(jproject, containerName, inclusionFilters, exclusionFilters, null); }
|
/**
* Adds a source container to a IJavaProject.
* @param jproject The parent project
* @param containerName The name of the new source container
* @param inclusionFilters Inclusion filters to set
* @param exclusionFilters Exclusion filters to set
* @return The handle to the new source container
* @throws CoreException Creation failed
*/
|
Adds a source container to a IJavaProject
|
addSourceContainer
|
{
"repo_name": "gazarenkov/che-sketch",
"path": "plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/jdt/testplugin/JavaProjectHelper.java",
"license": "epl-1.0",
"size": 39409
}
|
[
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IPath",
"org.eclipse.jdt.core.IJavaProject",
"org.eclipse.jdt.core.IPackageFragmentRoot"
] |
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragmentRoot;
|
import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.*;
|
[
"org.eclipse.core",
"org.eclipse.jdt"
] |
org.eclipse.core; org.eclipse.jdt;
| 732,888 |
@Generated
@CVariable()
@NInt
public static native long GCKeyCodePageDown();
|
@CVariable() static native long function();
|
/**
* Page Down
*/
|
Page Down
|
GCKeyCodePageDown
|
{
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/gamecontroller/c/GameController.java",
"license": "apache-2.0",
"size": 61506
}
|
[
"org.moe.natj.c.ann.CVariable"
] |
import org.moe.natj.c.ann.CVariable;
|
import org.moe.natj.c.ann.*;
|
[
"org.moe.natj"
] |
org.moe.natj;
| 1,250,280 |
public Ping ping() throws IOException {
Ping ping = new Ping();
int pingId;
synchronized (this) {
if (shutdown) {
throw new IOException("shutdown");
}
pingId = nextPingId;
nextPingId += 2;
if (pings == null) pings = new HashMap<>();
pings.put(pingId, ping);
}
writePing(false, pingId, 0x4f4b6f6b , ping);
return ping;
}
|
Ping function() throws IOException { Ping ping = new Ping(); int pingId; synchronized (this) { if (shutdown) { throw new IOException(STR); } pingId = nextPingId; nextPingId += 2; if (pings == null) pings = new HashMap<>(); pings.put(pingId, ping); } writePing(false, pingId, 0x4f4b6f6b , ping); return ping; }
|
/**
* Sends a ping frame to the peer. Use the returned object to await the
* ping's response and observe its round trip time.
*/
|
Sends a ping frame to the peer. Use the returned object to await the ping's response and observe its round trip time
|
ping
|
{
"repo_name": "10045125/okhttp",
"path": "okhttp/src/main/java/com/squareup/okhttp/internal/spdy/SpdyConnection.java",
"license": "apache-2.0",
"size": 29987
}
|
[
"java.io.IOException",
"java.util.HashMap"
] |
import java.io.IOException; import java.util.HashMap;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,035,663 |
@Test
public void checkIReaderOperations() throws JAXBException, CoreException {
// Create a Form
Form form = new Form();
form.setName("The artist formerly known as Prince");
IFile file = project.getFile("ireader_test_form.xml");
// Create a context and write the Form to a stream
JAXBContext jaxbContext = JAXBContext.newInstance(Form.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
marshaller.marshal(form, outputStream);
// Convert it to an input stream so it can be pushed to file
ByteArrayInputStream inputStream = new ByteArrayInputStream(
outputStream.toByteArray());
// Update the output file if it already exists
if (file.exists()) {
file.setContents(inputStream, IResource.FORCE, null);
} else {
// Or create it from scratch
file.create(inputStream, IResource.FORCE, null);
}
// Read the Form back in with the provider
Form loadedForm = xmlpp.read(file);
assertNotNull(loadedForm);
assertEquals(loadedForm, form);
return;
}
|
void function() throws JAXBException, CoreException { Form form = new Form(); form.setName(STR); IFile file = project.getFile(STR); JAXBContext jaxbContext = JAXBContext.newInstance(Form.class); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); marshaller.marshal(form, outputStream); ByteArrayInputStream inputStream = new ByteArrayInputStream( outputStream.toByteArray()); if (file.exists()) { file.setContents(inputStream, IResource.FORCE, null); } else { file.create(inputStream, IResource.FORCE, null); } Form loadedForm = xmlpp.read(file); assertNotNull(loadedForm); assertEquals(loadedForm, form); return; }
|
/**
* This operation insures that IReader interface is implemented as described
* by the XML persistence provider and that the operations function.
*
* @throws JAXBException
* JAXB could not load
* @throws CoreException
* Eclispe Resources could not read the file
*/
|
This operation insures that IReader interface is implemented as described by the XML persistence provider and that the operations function
|
checkIReaderOperations
|
{
"repo_name": "eclipse/ice",
"path": "org.eclipse.ice.tests.persistence.xml/src/org/eclipse/ice/tests/persistence/xml/XMLPersistenceProviderTester.java",
"license": "epl-1.0",
"size": 14845
}
|
[
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"javax.xml.bind.JAXBContext",
"javax.xml.bind.JAXBException",
"javax.xml.bind.Marshaller",
"org.eclipse.core.resources.IFile",
"org.eclipse.core.resources.IResource",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.ice.datastructures.form.Form",
"org.junit.Assert"
] |
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.ice.datastructures.form.Form; import org.junit.Assert;
|
import java.io.*; import javax.xml.bind.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.ice.datastructures.form.*; import org.junit.*;
|
[
"java.io",
"javax.xml",
"org.eclipse.core",
"org.eclipse.ice",
"org.junit"
] |
java.io; javax.xml; org.eclipse.core; org.eclipse.ice; org.junit;
| 819,481 |
@Override
public HtmlData getInquiryUrl(BusinessObject bo, String propertyName) {
return (new AccountBalanceByLevelInquirableImpl()).getInquiryUrl(bo, propertyName);
}
|
HtmlData function(BusinessObject bo, String propertyName) { return (new AccountBalanceByLevelInquirableImpl()).getInquiryUrl(bo, propertyName); }
|
/**
* Returns the inquiry url for a field if one exist.
*
* @param bo the business object instance to build the urls for
* @param propertyName the property which links to an inquirable
* @return String url to inquiry
*/
|
Returns the inquiry url for a field if one exist
|
getInquiryUrl
|
{
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/gl/businessobject/lookup/AccountBalanceByLevelLookupableHelperServiceImpl.java",
"license": "agpl-3.0",
"size": 5907
}
|
[
"org.kuali.kfs.gl.businessobject.inquiry.AccountBalanceByLevelInquirableImpl",
"org.kuali.rice.kns.lookup.HtmlData",
"org.kuali.rice.krad.bo.BusinessObject"
] |
import org.kuali.kfs.gl.businessobject.inquiry.AccountBalanceByLevelInquirableImpl; import org.kuali.rice.kns.lookup.HtmlData; import org.kuali.rice.krad.bo.BusinessObject;
|
import org.kuali.kfs.gl.businessobject.inquiry.*; import org.kuali.rice.kns.lookup.*; import org.kuali.rice.krad.bo.*;
|
[
"org.kuali.kfs",
"org.kuali.rice"
] |
org.kuali.kfs; org.kuali.rice;
| 2,275,572 |
public void stopAllThreads()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "stopAllThreads");
synchronized (this)
{
Iterator iterator = ((ArrayList)_threadCache.clone()).iterator();
while (iterator.hasNext())
{
StoppableThread thread = (StoppableThread)iterator.next();
if (tc.isDebugEnabled())
SibTr.debug(tc, "Attempting to stop thread " + thread);
// Stop the thread
thread.stopThread(this);
// Remove from the iterator
iterator.remove();
// Remove from the cache
_threadCache.remove(thread);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "stopAllThreads");
}
|
void function() { if (tc.isEntryEnabled()) SibTr.entry(tc, STR); synchronized (this) { Iterator iterator = ((ArrayList)_threadCache.clone()).iterator(); while (iterator.hasNext()) { StoppableThread thread = (StoppableThread)iterator.next(); if (tc.isDebugEnabled()) SibTr.debug(tc, STR + thread); thread.stopThread(this); iterator.remove(); _threadCache.remove(thread); } } if (tc.isEntryEnabled()) SibTr.exit(tc, STR); }
|
/**
* Stops all the stoppable threads that haven't already been stopped
*/
|
Stops all the stoppable threads that haven't already been stopped
|
stopAllThreads
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/StoppableThreadCache.java",
"license": "epl-1.0",
"size": 3495
}
|
[
"com.ibm.ws.sib.processor.impl.interfaces.StoppableThread",
"com.ibm.ws.sib.utils.ras.SibTr",
"java.util.ArrayList",
"java.util.Iterator"
] |
import com.ibm.ws.sib.processor.impl.interfaces.StoppableThread; import com.ibm.ws.sib.utils.ras.SibTr; import java.util.ArrayList; import java.util.Iterator;
|
import com.ibm.ws.sib.processor.impl.interfaces.*; import com.ibm.ws.sib.utils.ras.*; import java.util.*;
|
[
"com.ibm.ws",
"java.util"
] |
com.ibm.ws; java.util;
| 82,025 |
public static final SourceModel.Expr expression_Let_getBody(SourceModel.Expr jExpression_Let) {
return
SourceModel.Expr.Application.make(
new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.expression_Let_getBody), jExpression_Let});
}
public static final QualifiedName expression_Let_getBody =
QualifiedName.make(
CAL_Optimizer_Expression_internal.MODULE_NAME,
"expression_Let_getBody");
|
static final SourceModel.Expr function(SourceModel.Expr jExpression_Let) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.expression_Let_getBody), jExpression_Let}); } static final QualifiedName function = QualifiedName.make( CAL_Optimizer_Expression_internal.MODULE_NAME, STR);
|
/**
* Helper binding method for function: expression_Let_getBody.
* @param jExpression_Let
* @return the SourceModule.expr representing an application of expression_Let_getBody
*/
|
Helper binding method for function: expression_Let_getBody
|
expression_Let_getBody
|
{
"repo_name": "levans/Open-Quark",
"path": "src/CAL_Platform/src/org/openquark/cal/internal/module/Cal/Internal/CAL_Optimizer_Expression_internal.java",
"license": "bsd-3-clause",
"size": 265925
}
|
[
"org.openquark.cal.compiler.QualifiedName",
"org.openquark.cal.compiler.SourceModel"
] |
import org.openquark.cal.compiler.QualifiedName; import org.openquark.cal.compiler.SourceModel;
|
import org.openquark.cal.compiler.*;
|
[
"org.openquark.cal"
] |
org.openquark.cal;
| 1,092,276 |
@org.junit.jupiter.api.Test
public void test_transforms_signatures_xPathSignature() throws Exception {
String filename = gregorsDir + "transforms/signatures/xPathSignature.xml";
ResourceResolverSpi resolver = null;
boolean followManifests = false;
boolean verify = false;
try {
verify = this.verify(filename, resolver, followManifests);
} catch (RuntimeException ex) {
LOG.error("Verification crashed for " + filename);
throw ex;
}
if (!verify) {
LOG.error("Verification failed for " + filename);
}
assertTrue(verify, filename);
}
|
@org.junit.jupiter.api.Test void function() throws Exception { String filename = gregorsDir + STR; ResourceResolverSpi resolver = null; boolean followManifests = false; boolean verify = false; try { verify = this.verify(filename, resolver, followManifests); } catch (RuntimeException ex) { LOG.error(STR + filename); throw ex; } if (!verify) { LOG.error(STR + filename); } assertTrue(verify, filename); }
|
/**
* Method test_transforms_signatures_xPathSignature
*
* @throws Exception
*/
|
Method test_transforms_signatures_xPathSignature
|
test_transforms_signatures_xPathSignature
|
{
"repo_name": "apache/santuario-java",
"path": "src/test/java/org/apache/xml/security/test/dom/interop/IAIKTest.java",
"license": "apache-2.0",
"size": 12567
}
|
[
"org.apache.xml.security.utils.resolver.ResourceResolverSpi",
"org.junit.jupiter.api.Assertions"
] |
import org.apache.xml.security.utils.resolver.ResourceResolverSpi; import org.junit.jupiter.api.Assertions;
|
import org.apache.xml.security.utils.resolver.*; import org.junit.jupiter.api.*;
|
[
"org.apache.xml",
"org.junit.jupiter"
] |
org.apache.xml; org.junit.jupiter;
| 1,936,316 |
List<NumeratorDenominatorPair> getNumeratorDenominatorPairs(
final User user,
final Geography geography,
final HealthTheme healthTheme)
throws RIFServiceException;
|
List<NumeratorDenominatorPair> getNumeratorDenominatorPairs( final User user, final Geography geography, final HealthTheme healthTheme) throws RIFServiceException;
|
/**
* Gets the numerator denominator pairs.
*
* @param user the user
* @param geography the geography
* @param healthTheme the health theme
* @return the numerator denominator pairs
* @throws RIFServiceException the RIF service exception
*/
|
Gets the numerator denominator pairs
|
getNumeratorDenominatorPairs
|
{
"repo_name": "smallAreaHealthStatisticsUnit/rapidInquiryFacility",
"path": "rifServices/src/main/java/org/sahsu/rif/services/concepts/RIFStudySubmissionAPI.java",
"license": "lgpl-3.0",
"size": 5722
}
|
[
"java.util.List",
"org.sahsu.rif.generic.concepts.User",
"org.sahsu.rif.generic.system.RIFServiceException"
] |
import java.util.List; import org.sahsu.rif.generic.concepts.User; import org.sahsu.rif.generic.system.RIFServiceException;
|
import java.util.*; import org.sahsu.rif.generic.concepts.*; import org.sahsu.rif.generic.system.*;
|
[
"java.util",
"org.sahsu.rif"
] |
java.util; org.sahsu.rif;
| 778,940 |
public static void logInfo(String tag, String message)
{
Log log = logMap.get(tag);
if ((log != null) && log.isLoggable(tag, Level.INFO))
{
log.info(tag, message);
}
}
|
static void function(String tag, String message) { Log log = logMap.get(tag); if ((log != null) && log.isLoggable(tag, Level.INFO)) { log.info(tag, message); } }
|
/**
* Public accessor for logMessage()
* @param tag
* @param message
*/
|
Public accessor for logMessage()
|
logInfo
|
{
"repo_name": "andrew-bowley/classy_tools",
"path": "hello-two-dbs-example/src/main/java/au/com/cybersearch2/example/HelloTwoDbsMain.java",
"license": "gpl-3.0",
"size": 18023
}
|
[
"au.com.cybersearch2.classylog.Log",
"java.util.logging.Level"
] |
import au.com.cybersearch2.classylog.Log; import java.util.logging.Level;
|
import au.com.cybersearch2.classylog.*; import java.util.logging.*;
|
[
"au.com.cybersearch2",
"java.util"
] |
au.com.cybersearch2; java.util;
| 840,798 |
public AttributeList getAttributes() {
return attributes;
}
|
AttributeList function() { return attributes; }
|
/**
* Gets the associated attribute list.
*
* @return {@code non-null;} the attribute list
*/
|
Gets the associated attribute list
|
getAttributes
|
{
"repo_name": "nikita36078/J2ME-Loader",
"path": "dexlib/src/main/java/com/android/dx/cf/attrib/AttCode.java",
"license": "apache-2.0",
"size": 4210
}
|
[
"com.android.dx.cf.iface.AttributeList"
] |
import com.android.dx.cf.iface.AttributeList;
|
import com.android.dx.cf.iface.*;
|
[
"com.android.dx"
] |
com.android.dx;
| 549,839 |
final void getSrcOffset(Point srcOffset) {
srcOffset.setLocation(xSrcOffset, ySrcOffset);
}
|
final void getSrcOffset(Point srcOffset) { srcOffset.setLocation(xSrcOffset, ySrcOffset); }
|
/**
* Retrieves the current source pixel offset.
* @param srcOffset the object that will receive the source offset
*/
|
Retrieves the current source pixel offset
|
getSrcOffset
|
{
"repo_name": "kephale/java3d-core",
"path": "src/classes/share/javax/media/j3d/RasterRetained.java",
"license": "gpl-2.0",
"size": 20895
}
|
[
"java.awt.Point"
] |
import java.awt.Point;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,984,360 |
private boolean processEMailParameter (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String email = WebUtil.getParameter (request, "EMail");
if (email == null || email.length() == 0)
return false;
int AD_Client_ID = -1;
try
{
AD_Client_ID = Integer.parseInt(email);
}
catch (Exception e)
{
log.warning("Parsing: " + email + " - " + e.toString());
}
if (AD_Client_ID < 0)
{
m_message = new p();
m_message.addElement("No EMail: " + email);
return false;
}
// log.info ("Test EMail: " + AD_Client_ID);
MClient client = MClient.get(new Properties(), AD_Client_ID);
log.info ("Test: " + client);
m_message = new p();
m_message.addElement(client.getName() + ": " + client.testEMail());
return false;
} // processEMailParameter
|
boolean function (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String email = WebUtil.getParameter (request, "EMail"); if (email == null email.length() == 0) return false; int AD_Client_ID = -1; try { AD_Client_ID = Integer.parseInt(email); } catch (Exception e) { log.warning(STR + email + STR + e.toString()); } if (AD_Client_ID < 0) { m_message = new p(); m_message.addElement(STR + email); return false; } MClient client = MClient.get(new Properties(), AD_Client_ID); log.info (STR + client); m_message = new p(); m_message.addElement(client.getName() + STR + client.testEMail()); return false; }
|
/**
* Process EMail Parameter
* @param request request
* @param response response
* @return true if it was a email request with output
* @throws ServletException
* @throws IOException
*/
|
Process EMail Parameter
|
processEMailParameter
|
{
"repo_name": "erpcya/adempierePOS",
"path": "serverRoot/src/main/servlet/org/compiere/web/AdempiereMonitor.java",
"license": "gpl-2.0",
"size": 29228
}
|
[
"java.io.IOException",
"java.util.Properties",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.compiere.model.MClient",
"org.compiere.util.WebUtil"
] |
import java.io.IOException; import java.util.Properties; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.compiere.model.MClient; import org.compiere.util.WebUtil;
|
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.compiere.model.*; import org.compiere.util.*;
|
[
"java.io",
"java.util",
"javax.servlet",
"org.compiere.model",
"org.compiere.util"
] |
java.io; java.util; javax.servlet; org.compiere.model; org.compiere.util;
| 2,056,185 |
@Test
public void testKillGuaranteedContainerUponOOM() throws Exception {
int currentContainerId = 0;
ConcurrentHashMap<ContainerId, Container> containers =
new ConcurrentHashMap<>();
Container c1 = createContainer(currentContainerId++, false, 2, true);
containers.put(c1.getContainerId(), c1);
Container c2 = createContainer(currentContainerId++, false, 1, true);
containers.put(c2.getContainerId(), c2);
Container c3 = createContainer(currentContainerId++, true, 1, true);
containers.put(c3.getContainerId(), c3);
ContainerExecutor ex = createContainerExecutor(containers);
Context context = mock(Context.class);
when(context.getContainers()).thenReturn(containers);
when(context.getContainerExecutor()).thenReturn(ex);
CGroupsHandler cGroupsHandler = mock(CGroupsHandler.class);
when(cGroupsHandler.getCGroupParam(
CGroupsHandler.CGroupController.MEMORY,
"",
CGROUP_PARAM_MEMORY_OOM_CONTROL))
.thenReturn("under_oom 1")
.thenReturn("under_oom 1")
.thenReturn("under_oom 1")
.thenReturn("under_oom 0");
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c1.getContainerId().toString(), CGROUP_PROCS_FILE))
.thenReturn("1234").thenReturn("");
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c1.getContainerId().toString(), CGROUP_PARAM_MEMORY_USAGE_BYTES))
.thenReturn(getMB(9));
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c1.getContainerId().toString(), CGROUP_PARAM_MEMORY_MEMSW_USAGE_BYTES))
.thenReturn(getMB(9));
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c2.getContainerId().toString(), CGROUP_PROCS_FILE))
.thenReturn("1235").thenReturn("");
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c2.getContainerId().toString(), CGROUP_PARAM_MEMORY_USAGE_BYTES))
.thenReturn(getMB(9));
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c2.getContainerId().toString(), CGROUP_PARAM_MEMORY_MEMSW_USAGE_BYTES))
.thenReturn(getMB(9));
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c3.getContainerId().toString(), CGROUP_PROCS_FILE))
.thenReturn("1236").thenReturn("");
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c3.getContainerId().toString(), CGROUP_PARAM_MEMORY_USAGE_BYTES))
.thenReturn(getMB(11));
when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY,
c3.getContainerId().toString(), CGROUP_PARAM_MEMORY_MEMSW_USAGE_BYTES))
.thenReturn(getMB(11));
|
void function() throws Exception { int currentContainerId = 0; ConcurrentHashMap<ContainerId, Container> containers = new ConcurrentHashMap<>(); Container c1 = createContainer(currentContainerId++, false, 2, true); containers.put(c1.getContainerId(), c1); Container c2 = createContainer(currentContainerId++, false, 1, true); containers.put(c2.getContainerId(), c2); Container c3 = createContainer(currentContainerId++, true, 1, true); containers.put(c3.getContainerId(), c3); ContainerExecutor ex = createContainerExecutor(containers); Context context = mock(Context.class); when(context.getContainers()).thenReturn(containers); when(context.getContainerExecutor()).thenReturn(ex); CGroupsHandler cGroupsHandler = mock(CGroupsHandler.class); when(cGroupsHandler.getCGroupParam( CGroupsHandler.CGroupController.MEMORY, STRunder_oom 1STRunder_oom 1STRunder_oom 1STRunder_oom 0STR1234STRSTR1235STRSTR1236STR"); when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY, c3.getContainerId().toString(), CGROUP_PARAM_MEMORY_USAGE_BYTES)) .thenReturn(getMB(11)); when(cGroupsHandler.getCGroupParam(CGroupsHandler.CGroupController.MEMORY, c3.getContainerId().toString(), CGROUP_PARAM_MEMORY_MEMSW_USAGE_BYTES)) .thenReturn(getMB(11));
|
/**
* We have two running OPPORTUNISTIC containers and one running GUARANTEED
* container. The GUARANTEED container is out of limit. OOM is resolved
* after first killing the two OPPORTUNISTIC containers and then the
* GUARANTEED container.
*/
|
We have two running OPPORTUNISTIC containers and one running GUARANTEED container. The GUARANTEED container is out of limit. OOM is resolved after first killing the two OPPORTUNISTIC containers and then the GUARANTEED container
|
testKillGuaranteedContainerUponOOM
|
{
"repo_name": "steveloughran/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestDefaultOOMHandler.java",
"license": "apache-2.0",
"size": 54408
}
|
[
"java.util.concurrent.ConcurrentHashMap",
"org.apache.hadoop.yarn.api.records.ContainerId",
"org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor",
"org.apache.hadoop.yarn.server.nodemanager.Context",
"org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container",
"org.mockito.Mockito"
] |
import java.util.concurrent.ConcurrentHashMap; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor; import org.apache.hadoop.yarn.server.nodemanager.Context; import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container; import org.mockito.Mockito;
|
import java.util.concurrent.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.nodemanager.*; import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.*; import org.mockito.*;
|
[
"java.util",
"org.apache.hadoop",
"org.mockito"
] |
java.util; org.apache.hadoop; org.mockito;
| 2,214,399 |
public double t(double mu, double[] observed)
throws IllegalArgumentException {
checkSampleData(observed);
return t(StatUtils.mean(observed), mu, StatUtils.variance(observed),
observed.length);
}
|
double function(double mu, double[] observed) throws IllegalArgumentException { checkSampleData(observed); return t(StatUtils.mean(observed), mu, StatUtils.variance(observed), observed.length); }
|
/**
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula">
* t statistic </a> given observed values and a comparison constant.
* <p>
* This statistic can be used to perform a one sample t-test for the mean.
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul></p>
*
* @param mu comparison constant
* @param observed array of values
* @return t statistic
* @throws IllegalArgumentException if input array length is less than 2
*/
|
Computes a t statistic given observed values and a comparison constant. This statistic can be used to perform a one sample t-test for the mean. Preconditions: The observed array length must be at least 2.
|
t
|
{
"repo_name": "SpoonLabs/astor",
"path": "examples/math_85/src/java/org/apache/commons/math/stat/inference/TTestImpl.java",
"license": "gpl-2.0",
"size": 46925
}
|
[
"org.apache.commons.math.stat.StatUtils"
] |
import org.apache.commons.math.stat.StatUtils;
|
import org.apache.commons.math.stat.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 325,843 |
public void shutdown() throws SchedulerException {
// Have to get the scheduler name before we actually call shutdown.
String schedulerName = getSchedulerName();
invoke("shutdown", new Object[] {}, new String[] {});
SchedulerRepository.getInstance().remove(schedulerName);
}
|
void function() throws SchedulerException { String schedulerName = getSchedulerName(); invoke(STR, new Object[] {}, new String[] {}); SchedulerRepository.getInstance().remove(schedulerName); }
|
/**
* <p>
* Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
* </p>
*/
|
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
|
shutdown
|
{
"repo_name": "xqiang26/quartz-source-node",
"path": "src/main/java/org/quartz/impl/RemoteMBeanScheduler.java",
"license": "apache-2.0",
"size": 31863
}
|
[
"org.quartz.SchedulerException"
] |
import org.quartz.SchedulerException;
|
import org.quartz.*;
|
[
"org.quartz"
] |
org.quartz;
| 2,290,728 |
protected synchronized void setStream(InputStream s)
{
if (stream != null)
{
throw new UnsupportedOperationException("Cannot set the stream of an open resource");
}
stream = s;
streamState = StreamStates.OPEN;
}
|
synchronized void function(InputStream s) { if (stream != null) { throw new UnsupportedOperationException(STR); } stream = s; streamState = StreamStates.OPEN; }
|
/**
* Sets the stream for a resource.
* This function allows you to provide a stream that is already open to
* an existing resource. It will throw an exception if that resource
* already has an open stream.
* @param s InputStream currently open stream to use for I/O.
*/
|
Sets the stream for a resource. This function allows you to provide a stream that is already open to an existing resource. It will throw an exception if that resource already has an open stream
|
setStream
|
{
"repo_name": "roshanch/GearVRf",
"path": "GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAndroidResource.java",
"license": "apache-2.0",
"size": 22520
}
|
[
"java.io.InputStream"
] |
import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 913,103 |
public static boolean updateMessageFields(EmailContent.Message localMessage, Message message,
long accountId, long mailboxId) throws MessagingException {
Address[] from = message.getFrom();
Address[] to = message.getRecipients(Message.RecipientType.TO);
Address[] cc = message.getRecipients(Message.RecipientType.CC);
Address[] bcc = message.getRecipients(Message.RecipientType.BCC);
Address[] replyTo = message.getReplyTo();
String subject = message.getSubject();
Date sentDate = message.getSentDate();
Date internalDate = message.getInternalDate();
if (from != null && from.length > 0) {
localMessage.mDisplayName = from[0].toFriendly();
}
if (sentDate != null) {
localMessage.mTimeStamp = sentDate.getTime();
}
if (subject != null) {
localMessage.mSubject = subject;
}
localMessage.mFlagRead = message.isSet(Flag.SEEN);
if (message.isSet(Flag.ANSWERED)) {
localMessage.mFlags |= EmailContent.Message.FLAG_REPLIED_TO;
}
// Keep the message in the "unloaded" state until it has (at least) a display name.
// This prevents early flickering of empty messages in POP download.
if (localMessage.mFlagLoaded != EmailContent.Message.FLAG_LOADED_COMPLETE) {
if (localMessage.mDisplayName == null || "".equals(localMessage.mDisplayName)) {
localMessage.mFlagLoaded = EmailContent.Message.FLAG_LOADED_UNLOADED;
} else {
localMessage.mFlagLoaded = EmailContent.Message.FLAG_LOADED_PARTIAL;
}
}
localMessage.mFlagFavorite = message.isSet(Flag.FLAGGED);
// public boolean mFlagAttachment = false;
// public int mFlags = 0;
localMessage.mServerId = message.getUid();
if (internalDate != null) {
localMessage.mServerTimeStamp = internalDate.getTime();
}
// public String mClientId;
// Only replace the local message-id if a new one was found. This is seen in some ISP's
// which may deliver messages w/o a message-id header.
String messageId = ((MimeMessage)message).getMessageId();
if (messageId != null) {
localMessage.mMessageId = messageId;
}
// public long mBodyKey;
localMessage.mMailboxKey = mailboxId;
localMessage.mAccountKey = accountId;
if (from != null && from.length > 0) {
localMessage.mFrom = Address.pack(from);
}
localMessage.mTo = Address.pack(to);
localMessage.mCc = Address.pack(cc);
localMessage.mBcc = Address.pack(bcc);
localMessage.mReplyTo = Address.pack(replyTo);
// public String mText;
// public String mHtml;
// public String mTextReply;
// public String mHtmlReply;
// // Can be used while building messages, but is NOT saved by the Provider
// transient public ArrayList<Attachment> mAttachments = null;
return true;
}
|
static boolean function(EmailContent.Message localMessage, Message message, long accountId, long mailboxId) throws MessagingException { Address[] from = message.getFrom(); Address[] to = message.getRecipients(Message.RecipientType.TO); Address[] cc = message.getRecipients(Message.RecipientType.CC); Address[] bcc = message.getRecipients(Message.RecipientType.BCC); Address[] replyTo = message.getReplyTo(); String subject = message.getSubject(); Date sentDate = message.getSentDate(); Date internalDate = message.getInternalDate(); if (from != null && from.length > 0) { localMessage.mDisplayName = from[0].toFriendly(); } if (sentDate != null) { localMessage.mTimeStamp = sentDate.getTime(); } if (subject != null) { localMessage.mSubject = subject; } localMessage.mFlagRead = message.isSet(Flag.SEEN); if (message.isSet(Flag.ANSWERED)) { localMessage.mFlags = EmailContent.Message.FLAG_REPLIED_TO; } if (localMessage.mFlagLoaded != EmailContent.Message.FLAG_LOADED_COMPLETE) { if (localMessage.mDisplayName == null "".equals(localMessage.mDisplayName)) { localMessage.mFlagLoaded = EmailContent.Message.FLAG_LOADED_UNLOADED; } else { localMessage.mFlagLoaded = EmailContent.Message.FLAG_LOADED_PARTIAL; } } localMessage.mFlagFavorite = message.isSet(Flag.FLAGGED); localMessage.mServerId = message.getUid(); if (internalDate != null) { localMessage.mServerTimeStamp = internalDate.getTime(); } String messageId = ((MimeMessage)message).getMessageId(); if (messageId != null) { localMessage.mMessageId = messageId; } localMessage.mMailboxKey = mailboxId; localMessage.mAccountKey = accountId; if (from != null && from.length > 0) { localMessage.mFrom = Address.pack(from); } localMessage.mTo = Address.pack(to); localMessage.mCc = Address.pack(cc); localMessage.mBcc = Address.pack(bcc); localMessage.mReplyTo = Address.pack(replyTo); return true; }
|
/**
* Copy field-by-field from a "store" message to a "provider" message
* @param message The message we've just downloaded (must be a MimeMessage)
* @param localMessage The message we'd like to write into the DB
* @result true if dirty (changes were made)
*/
|
Copy field-by-field from a "store" message to a "provider" message
|
updateMessageFields
|
{
"repo_name": "craigacgomez/android_email_policy_patch",
"path": "packages/apps/Email/src/com/android/email/LegacyConversions.java",
"license": "apache-2.0",
"size": 21139
}
|
[
"com.android.emailcommon.internet.MimeMessage",
"com.android.emailcommon.mail.Address",
"com.android.emailcommon.mail.Flag",
"com.android.emailcommon.mail.Message",
"com.android.emailcommon.mail.MessagingException",
"com.android.emailcommon.provider.EmailContent",
"java.util.Date"
] |
import com.android.emailcommon.internet.MimeMessage; import com.android.emailcommon.mail.Address; import com.android.emailcommon.mail.Flag; import com.android.emailcommon.mail.Message; import com.android.emailcommon.mail.MessagingException; import com.android.emailcommon.provider.EmailContent; import java.util.Date;
|
import com.android.emailcommon.internet.*; import com.android.emailcommon.mail.*; import com.android.emailcommon.provider.*; import java.util.*;
|
[
"com.android.emailcommon",
"java.util"
] |
com.android.emailcommon; java.util;
| 433,392 |
@Deprecated
public static void returnResourceInputStream(InputStream is)
throws Exception {
if (is != null)
is.close();
}
|
static void function(InputStream is) throws Exception { if (is != null) is.close(); }
|
/**
* Input Stream management not safe
*/
|
Input Stream management not safe
|
returnResourceInputStream
|
{
"repo_name": "wadanii/kulturarv",
"path": "src/dk/codeunited/kulturarv/mgr/HttpTools.java",
"license": "gpl-3.0",
"size": 6446
}
|
[
"java.io.InputStream"
] |
import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,814,957 |
public static Unit generateSummon(Unit summoner) {
WeaponFactory.loadWeapons();
summonCount = summonCount + 1;
final Unit summon = new Unit("Phantom " + summonCount, net.fe.unit.Class.createClass("Phantom"), '-', BASES, GROWTHS);
summon.addToInventory(net.fe.unit.Item.getItem("Iron Axe"));
summon.initializeEquipment();
summon.setLevel(summoner.getLevel());
summon.fillHp();
summon.setMoved(true);
summoner.getParty().addUnit(summon);
summon.stage = summoner.stage;
return summon;
}
private static final class EmptyRunnable implements Runnable {
@Override public void run() {}
|
static Unit function(Unit summoner) { WeaponFactory.loadWeapons(); summonCount = summonCount + 1; final Unit summon = new Unit(STR + summonCount, net.fe.unit.Class.createClass(STR), '-', BASES, GROWTHS); summon.addToInventory(net.fe.unit.Item.getItem(STR)); summon.initializeEquipment(); summon.setLevel(summoner.getLevel()); summon.fillHp(); summon.setMoved(true); summoner.getParty().addUnit(summon); summon.stage = summoner.stage; return summon; } private static final class EmptyRunnable implements Runnable { @Override public void run() {}
|
/**
* Generate summon.
*
* @param summoner the summoner
* @return the unit
*/
|
Generate summon
|
generateSummon
|
{
"repo_name": "eliatlarge/FEMultiPlayer-V2",
"path": "src/net/fe/overworldStage/context/Summon.java",
"license": "gpl-3.0",
"size": 5535
}
|
[
"net.fe.unit.Class",
"net.fe.unit.Unit",
"net.fe.unit.WeaponFactory"
] |
import net.fe.unit.Class; import net.fe.unit.Unit; import net.fe.unit.WeaponFactory;
|
import net.fe.unit.*;
|
[
"net.fe.unit"
] |
net.fe.unit;
| 33,235 |
SetLinkedListContainer<Integer> setLinkedListContainer = new SetLinkedListContainer<Integer>();
setLinkedListContainer.add(1);
setLinkedListContainer.add(2);
setLinkedListContainer.add(3);
assertThat(setLinkedListContainer.getSize(), is(3));
}
|
SetLinkedListContainer<Integer> setLinkedListContainer = new SetLinkedListContainer<Integer>(); setLinkedListContainer.add(1); setLinkedListContainer.add(2); setLinkedListContainer.add(3); assertThat(setLinkedListContainer.getSize(), is(3)); }
|
/**
* Test check adding an elements to a container.
*/
|
Test check adding an elements to a container
|
whenAddElementToContainer
|
{
"repo_name": "evgenymatveev/Task",
"path": "chapter_005/src/test/java/ru/ematveev/set/SetLinkedListContainerTest.java",
"license": "apache-2.0",
"size": 1988
}
|
[
"org.hamcrest.core.Is",
"org.junit.Assert"
] |
import org.hamcrest.core.Is; import org.junit.Assert;
|
import org.hamcrest.core.*; import org.junit.*;
|
[
"org.hamcrest.core",
"org.junit"
] |
org.hamcrest.core; org.junit;
| 148,607 |
public static ArrayList<TimeZone> getTimeZonesWithUniqueOffsets(String country) {
synchronized(sLastUniqueLockObj) {
if ((country != null) && country.equals(sLastUniqueCountry)) {
if (DBG) {
Log.d(TAG, "getTimeZonesWithUniqueOffsets(" +
country + "): return cached version");
}
return sLastUniqueZoneOffsets;
}
}
Collection<TimeZone> zones = getTimeZones(country);
ArrayList<TimeZone> uniqueTimeZones = new ArrayList<TimeZone>();
for (TimeZone zone : zones) {
// See if we already have this offset,
// Using slow but space efficient and these are small.
boolean found = false;
for (int i = 0; i < uniqueTimeZones.size(); i++) {
if (uniqueTimeZones.get(i).getRawOffset() == zone.getRawOffset()) {
found = true;
break;
}
}
if (found == false) {
if (DBG) {
Log.d(TAG, "getTimeZonesWithUniqueOffsets: add unique offset=" +
zone.getRawOffset() + " zone.getID=" + zone.getID());
}
uniqueTimeZones.add(zone);
}
}
synchronized(sLastUniqueLockObj) {
// Cache the last result
sLastUniqueZoneOffsets = uniqueTimeZones;
sLastUniqueCountry = country;
return sLastUniqueZoneOffsets;
}
}
|
static ArrayList<TimeZone> function(String country) { synchronized(sLastUniqueLockObj) { if ((country != null) && country.equals(sLastUniqueCountry)) { if (DBG) { Log.d(TAG, STR + country + STR); } return sLastUniqueZoneOffsets; } } Collection<TimeZone> zones = getTimeZones(country); ArrayList<TimeZone> uniqueTimeZones = new ArrayList<TimeZone>(); for (TimeZone zone : zones) { boolean found = false; for (int i = 0; i < uniqueTimeZones.size(); i++) { if (uniqueTimeZones.get(i).getRawOffset() == zone.getRawOffset()) { found = true; break; } } if (found == false) { if (DBG) { Log.d(TAG, STR + zone.getRawOffset() + STR + zone.getID()); } uniqueTimeZones.add(zone); } } synchronized(sLastUniqueLockObj) { sLastUniqueZoneOffsets = uniqueTimeZones; sLastUniqueCountry = country; return sLastUniqueZoneOffsets; } }
|
/**
* Return list of unique time zones for the country. Do not modify
*
* @param country to find
* @return list of unique time zones, maybe empty but never null. Do not modify.
* @hide
*/
|
Return list of unique time zones for the country. Do not modify
|
getTimeZonesWithUniqueOffsets
|
{
"repo_name": "haikuowuya/android_system_code",
"path": "src/android/util/TimeUtils.java",
"license": "apache-2.0",
"size": 15173
}
|
[
"java.util.ArrayList",
"java.util.Collection",
"java.util.TimeZone"
] |
import java.util.ArrayList; import java.util.Collection; import java.util.TimeZone;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 378,407 |
protected HRegionInfo[] getMostLoadedRegions() {
ArrayList<HRegionInfo> regions = new ArrayList<HRegionInfo>();
for (HRegion r : onlineRegions.values()) {
if (!r.isAvailable()) {
continue;
}
if (regions.size() < numRegionsToReport) {
regions.add(r.getRegionInfo());
} else {
break;
}
}
return regions.toArray(new HRegionInfo[regions.size()]);
}
|
HRegionInfo[] function() { ArrayList<HRegionInfo> regions = new ArrayList<HRegionInfo>(); for (HRegion r : onlineRegions.values()) { if (!r.isAvailable()) { continue; } if (regions.size() < numRegionsToReport) { regions.add(r.getRegionInfo()); } else { break; } } return regions.toArray(new HRegionInfo[regions.size()]); }
|
/**
* Get the top N most loaded regions this server is serving so we can tell the
* master which regions it can reallocate if we're overloaded. TODO: actually
* calculate which regions are most loaded. (Right now, we're just grabbing
* the first N regions being served regardless of load.)
*/
|
Get the top N most loaded regions this server is serving so we can tell the calculate which regions are most loaded. (Right now, we're just grabbing the first N regions being served regardless of load.)
|
getMostLoadedRegions
|
{
"repo_name": "baishuo/hbase-1.0.0-cdh5.4.7_baishuo",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java",
"license": "apache-2.0",
"size": 119179
}
|
[
"java.util.ArrayList",
"org.apache.hadoop.hbase.HRegionInfo"
] |
import java.util.ArrayList; import org.apache.hadoop.hbase.HRegionInfo;
|
import java.util.*; import org.apache.hadoop.hbase.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 2,499,712 |
public void copyFrom(QueryTreeNode node) throws StandardException {
super.copyFrom(node);
TableOperatorNode other = (TableOperatorNode)node;
this.leftResultSet = (ResultSetNode)getNodeFactory().copyNode(other.leftResultSet,
getParserContext());
this.rightResultSet = (ResultSetNode)getNodeFactory().copyNode(other.rightResultSet,
getParserContext());
}
|
void function(QueryTreeNode node) throws StandardException { super.copyFrom(node); TableOperatorNode other = (TableOperatorNode)node; this.leftResultSet = (ResultSetNode)getNodeFactory().copyNode(other.leftResultSet, getParserContext()); this.rightResultSet = (ResultSetNode)getNodeFactory().copyNode(other.rightResultSet, getParserContext()); }
|
/**
* Fill this node with a deep copy of the given node.
*/
|
Fill this node with a deep copy of the given node
|
copyFrom
|
{
"repo_name": "xiaomizhg/Oceanus",
"path": "oceanus-all/oceanus-exchange/oceanus-exchange-sqlparser/src/main/java/com/bj58/sql/parser/TableOperatorNode.java",
"license": "apache-2.0",
"size": 6959
}
|
[
"com.bj58.sql.StandardException"
] |
import com.bj58.sql.StandardException;
|
import com.bj58.sql.*;
|
[
"com.bj58.sql"
] |
com.bj58.sql;
| 1,642,229 |
public static List<String> getSortedDiscoverableExtentions() {
final List<String> exts= DataSetURI.getDiscoverableExtensions();
exts.add("file:"); // special marker for local files.
File f= new File( AutoplotSettings.settings().resolveProperty( AutoplotSettings.PROP_AUTOPLOTDATA ) + "/bookmarks/discovery.txt" );
if ( f.exists()&& f.canRead()) {
BufferedReader reader=null;
try {
reader= new BufferedReader( new FileReader(f) );
String s= reader.readLine();
while ( s!=null ) {
if ( s.length()>29 ) {
String ss= s.substring(25,29);
switch (ss) {
case "file":
{
String ex1= "file:";
if ( exts.contains(ex1) ) {
exts.remove(ex1);
exts.add(0,ex1);
} break;
}
case "vap+":
{
int i= s.indexOf(":",29);
String ex1= "."+s.substring(29,i);
if ( exts.contains(ex1) ) {
exts.remove(ex1);
exts.add(0,ex1);
} break;
}
}
}
s= reader.readLine();
}
} catch ( IOException ex ) {
} finally {
if ( reader!=null ) {
try {
reader.close();
} catch (IOException ex) {
logger.log(Level.SEVERE, null, ex);
}
}
}
}
return exts;
}
|
static List<String> function() { final List<String> exts= DataSetURI.getDiscoverableExtensions(); exts.add("file:"); File f= new File( AutoplotSettings.settings().resolveProperty( AutoplotSettings.PROP_AUTOPLOTDATA ) + STR ); if ( f.exists()&& f.canRead()) { BufferedReader reader=null; try { reader= new BufferedReader( new FileReader(f) ); String s= reader.readLine(); while ( s!=null ) { if ( s.length()>29 ) { String ss= s.substring(25,29); switch (ss) { case "file": { String ex1= "file:"; if ( exts.contains(ex1) ) { exts.remove(ex1); exts.add(0,ex1); } break; } case "vap+": { int i= s.indexOf(":",29); String ex1= "."+s.substring(29,i); if ( exts.contains(ex1) ) { exts.remove(ex1); exts.add(0,ex1); } break; } } } s= reader.readLine(); } } catch ( IOException ex ) { } finally { if ( reader!=null ) { try { reader.close(); } catch (IOException ex) { logger.log(Level.SEVERE, null, ex); } } } } return exts; }
|
/**
* return the list of discoverable extentions, sorted by recent use.
* @return
*/
|
return the list of discoverable extentions, sorted by recent use
|
getSortedDiscoverableExtentions
|
{
"repo_name": "autoplot/app",
"path": "DataSource/src/org/autoplot/datasource/DataSetURI.java",
"license": "gpl-2.0",
"size": 105000
}
|
[
"java.io.BufferedReader",
"java.io.File",
"java.io.FileReader",
"java.io.IOException",
"java.util.List",
"java.util.logging.Level"
] |
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.List; import java.util.logging.Level;
|
import java.io.*; import java.util.*; import java.util.logging.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 2,833,787 |
Set<Object> getRequiredNodeProperties();
|
Set<Object> getRequiredNodeProperties();
|
/**
* Obtain set of identifiers of node properties required by this solver.
*
* @return set of identifiers of node properties required by this solver
*/
|
Obtain set of identifiers of node properties required by this solver
|
getRequiredNodeProperties
|
{
"repo_name": "liyi-david/ePMC",
"path": "main/src/main/java/epmc/modelchecker/PropertySolver.java",
"license": "gpl-3.0",
"size": 3827
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 912,818 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<StorageAccountListKeysResultInner> listKeysAsync(
String resourceGroupName, String accountName, ListKeyExpand expand) {
return listKeysWithResponseAsync(resourceGroupName, accountName, expand)
.flatMap(
(Response<StorageAccountListKeysResultInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<StorageAccountListKeysResultInner> function( String resourceGroupName, String accountName, ListKeyExpand expand) { return listKeysWithResponseAsync(resourceGroupName, accountName, expand) .flatMap( (Response<StorageAccountListKeysResultInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); }
|
/**
* Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case
* insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names
* must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param expand Specifies type of the key to be listed. Possible value is kerb.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response from the ListKeys operation on successful completion of {@link Mono}.
*/
|
Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account
|
listKeysAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java",
"license": "mit",
"size": 213141
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner",
"com.azure.resourcemanager.storage.models.ListKeyExpand"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner; import com.azure.resourcemanager.storage.models.ListKeyExpand;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.storage.fluent.models.*; import com.azure.resourcemanager.storage.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,333,690 |
public Date getSunset()
{
if ( bSunsetToday )
return( dateSunset );
else
return( null );
}
|
Date function() { if ( bSunsetToday ) return( dateSunset ); else return( null ); }
|
/******************************************************************************
* method: getSunset()
*******************************************************************************
*
* Gets the date and time of sunset. If there is no sunset, returns null.
*
* Member of SunriseSunset class
*
* -------------------------------------------------------------------------- */
|
method: getSunset() Gets the date and time of sunset. If there is no sunset, returns null. Member of SunriseSunset class
|
getSunset
|
{
"repo_name": "thadrobertson/eye-contact",
"path": "Processing/EyeContact/SunriseSunset.java",
"license": "gpl-2.0",
"size": 46887
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,726,406 |
public void addColumn(int index, String alias, DataType<?> datatype) {
if (config instanceof ImportConfigurationCSV) {
config.addColumn(new ImportColumnCSV(index, alias, datatype));
} else if (config instanceof ImportConfigurationExcel) {
config.addColumn(new ImportColumnExcel(index, alias, datatype));
} else if (config instanceof ImportConfigurationJDBC) {
config.addColumn(new ImportColumnJDBC(index, alias, datatype));
}
}
|
void function(int index, String alias, DataType<?> datatype) { if (config instanceof ImportConfigurationCSV) { config.addColumn(new ImportColumnCSV(index, alias, datatype)); } else if (config instanceof ImportConfigurationExcel) { config.addColumn(new ImportColumnExcel(index, alias, datatype)); } else if (config instanceof ImportConfigurationJDBC) { config.addColumn(new ImportColumnJDBC(index, alias, datatype)); } }
|
/**
* Adds a new column.
*
* @param index
* @param alias
* @param datatype
*/
|
Adds a new column
|
addColumn
|
{
"repo_name": "kentoa/arx",
"path": "src/main/org/deidentifier/arx/DataSource.java",
"license": "apache-2.0",
"size": 10764
}
|
[
"org.deidentifier.arx.io.ImportColumnCSV",
"org.deidentifier.arx.io.ImportColumnExcel",
"org.deidentifier.arx.io.ImportColumnJDBC",
"org.deidentifier.arx.io.ImportConfigurationCSV",
"org.deidentifier.arx.io.ImportConfigurationExcel",
"org.deidentifier.arx.io.ImportConfigurationJDBC"
] |
import org.deidentifier.arx.io.ImportColumnCSV; import org.deidentifier.arx.io.ImportColumnExcel; import org.deidentifier.arx.io.ImportColumnJDBC; import org.deidentifier.arx.io.ImportConfigurationCSV; import org.deidentifier.arx.io.ImportConfigurationExcel; import org.deidentifier.arx.io.ImportConfigurationJDBC;
|
import org.deidentifier.arx.io.*;
|
[
"org.deidentifier.arx"
] |
org.deidentifier.arx;
| 200,557 |
@Override
public javax.oss.fm.monitor.AlarmValue makeAlarmValue(){
return new OOSSAlarmValue();
}
|
javax.oss.fm.monitor.AlarmValue function(){ return new OOSSAlarmValue(); }
|
/**
* Makes a new empty alarm value object
* NOTE THIS IS A PATCH to proxy for JVTAlarmMonitorSession.makeAlarmValue()
*
* @return a javax$oss$fm$monitor$AlarmValue object.
*/
|
Makes a new empty alarm value object NOTE THIS IS A PATCH to proxy for JVTAlarmMonitorSession.makeAlarmValue()
|
makeAlarmValue
|
{
"repo_name": "roskens/opennms-pre-github",
"path": "opennms-tools/opennms-qosdaemon/src/main/java/org/openoss/opennms/spring/qosd/spring/AlarmListConnectionManagerSpringImpl.java",
"license": "agpl-3.0",
"size": 6798
}
|
[
"javax.oss.fm.monitor.AlarmValue",
"org.openoss.ossj.jvt.fm.monitor.OOSSAlarmValue"
] |
import javax.oss.fm.monitor.AlarmValue; import org.openoss.ossj.jvt.fm.monitor.OOSSAlarmValue;
|
import javax.oss.fm.monitor.*; import org.openoss.ossj.jvt.fm.monitor.*;
|
[
"javax.oss",
"org.openoss.ossj"
] |
javax.oss; org.openoss.ossj;
| 196,846 |
@Override
public List<SocialInformation> getSocialInformationsList(
SocialInformationType socialInformationType, String userId,
String classification, Date begin, Date end) throws SocialNetworkException {
List<SocialInformation> listResult = new ArrayList<SocialInformation>();
try {
switch (socialInformationType) {
case EVENT:
listResult =
getSocialEventsInterface().getSocialInformationsList(userId, classification, begin,
end);
break;
case MEDIA:
listResult = getSocialGalleryInterface().getSocialInformationsList(userId, begin, end);
break;
case PUBLICATION:
listResult =
getSocialPublicationsInterface().getSocialInformationsList(userId, begin, end);
break;
case STATUS:
listResult = getSocialStatusInterface().getSocialInformationsList(userId, begin, end);
break;
case RELATIONSHIP:
listResult =
getSocialRelationShipsInterface().getSocialInformationsList(userId, begin, end);
break;
case LASTEVENT:
listResult =
getSocialEventsInterface().getMyLastSocialInformationsList(userId, begin, end);
break;
case ALL:
for (SocialInformationType type : SocialInformationType.values()) {
if (SocialInformationType.ALL != type && SocialInformationType.EVENT != type) {
List<SocialInformation> listAll = getSocialInformationsList(type, userId,
classification, begin, end);
if (!(listAll == null)) {
listResult.addAll(listAll);
}
}
}
break;
default:
}
} catch (SilverpeasException ex) {
throw new SocialNetworkException("ProviderSwitch.getSocialInformationsList",
SilverpeasException.ERROR, "root.EX_CANT_GET_REMOTE_OBJECT", ex);
}
return listResult;
}
|
List<SocialInformation> function( SocialInformationType socialInformationType, String userId, String classification, Date begin, Date end) throws SocialNetworkException { List<SocialInformation> listResult = new ArrayList<SocialInformation>(); try { switch (socialInformationType) { case EVENT: listResult = getSocialEventsInterface().getSocialInformationsList(userId, classification, begin, end); break; case MEDIA: listResult = getSocialGalleryInterface().getSocialInformationsList(userId, begin, end); break; case PUBLICATION: listResult = getSocialPublicationsInterface().getSocialInformationsList(userId, begin, end); break; case STATUS: listResult = getSocialStatusInterface().getSocialInformationsList(userId, begin, end); break; case RELATIONSHIP: listResult = getSocialRelationShipsInterface().getSocialInformationsList(userId, begin, end); break; case LASTEVENT: listResult = getSocialEventsInterface().getMyLastSocialInformationsList(userId, begin, end); break; case ALL: for (SocialInformationType type : SocialInformationType.values()) { if (SocialInformationType.ALL != type && SocialInformationType.EVENT != type) { List<SocialInformation> listAll = getSocialInformationsList(type, userId, classification, begin, end); if (!(listAll == null)) { listResult.addAll(listAll); } } } break; default: } } catch (SilverpeasException ex) { throw new SocialNetworkException(STR, SilverpeasException.ERROR, STR, ex); } return listResult; }
|
/**
* get my social Informations list according to the social information type and the UserId
* @param socialInformationType
* @param userId
* @param String classification
* @param limit nb of element
* @param offset firstIndex
* @return List<SocialInformation>
*/
|
get my social Informations list according to the social information type and the UserId
|
getSocialInformationsList
|
{
"repo_name": "CecileBONIN/Silverpeas-Core",
"path": "lib-core/src/main/java/com/silverpeas/socialnetwork/provider/ProviderSwitch.java",
"license": "agpl-3.0",
"size": 9506
}
|
[
"com.silverpeas.calendar.Date",
"com.silverpeas.socialnetwork.SocialNetworkException",
"com.silverpeas.socialnetwork.model.SocialInformation",
"com.silverpeas.socialnetwork.model.SocialInformationType",
"com.stratelia.webactiv.util.exception.SilverpeasException",
"java.util.ArrayList",
"java.util.List"
] |
import com.silverpeas.calendar.Date; import com.silverpeas.socialnetwork.SocialNetworkException; import com.silverpeas.socialnetwork.model.SocialInformation; import com.silverpeas.socialnetwork.model.SocialInformationType; import com.stratelia.webactiv.util.exception.SilverpeasException; import java.util.ArrayList; import java.util.List;
|
import com.silverpeas.calendar.*; import com.silverpeas.socialnetwork.*; import com.silverpeas.socialnetwork.model.*; import com.stratelia.webactiv.util.exception.*; import java.util.*;
|
[
"com.silverpeas.calendar",
"com.silverpeas.socialnetwork",
"com.stratelia.webactiv",
"java.util"
] |
com.silverpeas.calendar; com.silverpeas.socialnetwork; com.stratelia.webactiv; java.util;
| 1,976,148 |
EReference getParticipantAssociation_OuterParticipantRef();
|
EReference getParticipantAssociation_OuterParticipantRef();
|
/**
* Returns the meta object for the reference '{@link org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef <em>Outer Participant Ref</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Outer Participant Ref</em>'.
* @see org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef()
* @see #getParticipantAssociation()
* @generated
*/
|
Returns the meta object for the reference '<code>org.eclipse.bpmn2.ParticipantAssociation#getOuterParticipantRef Outer Participant Ref</code>'.
|
getParticipantAssociation_OuterParticipantRef
|
{
"repo_name": "lqjack/fixflow",
"path": "modules/fixflow-core/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java",
"license": "apache-2.0",
"size": 1014933
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,408,277 |
public static boolean isIntelHexFormat(File fp)
{
BufferedReader in;
String stringline;
byte[] byteline;
try
{
in = new BufferedReader(new FileReader(fp));
}
catch (FileNotFoundException e)
{
return false;
}
for (;;)
{
try
{
stringline = in.readLine();
}
catch (IOException e)
{
return false;
}
// EOF reached
if ( stringline == null )
return false;
// start code exists?
if ( stringline.length() == 0 || stringline.charAt(0) != ':' )
continue;
// convert hex-string w/o start code to byte array
byteline = new BigInteger(stringline.substring(1),16
).toByteArray();
try
{
// checksum is correct?
checkSum(byteline);
}
catch (Exception e)
{
return false;
}
if ( stringline.substring(7,9).equals("01") )
break;
}
return true;
}
//--- Methods (private)
|
static boolean function(File fp) { BufferedReader in; String stringline; byte[] byteline; try { in = new BufferedReader(new FileReader(fp)); } catch (FileNotFoundException e) { return false; } for (;;) { try { stringline = in.readLine(); } catch (IOException e) { return false; } if ( stringline == null ) return false; if ( stringline.length() == 0 stringline.charAt(0) != ':' ) continue; byteline = new BigInteger(stringline.substring(1),16 ).toByteArray(); try { checkSum(byteline); } catch (Exception e) { return false; } if ( stringline.substring(7,9).equals("01") ) break; } return true; }
|
/**
* Check if file is in IntelHex format
*
* @param fp a <code>File</code> instance
* @return true, if file is in IntelHex format
*/
|
Check if file is in IntelHex format
|
isIntelHexFormat
|
{
"repo_name": "mogorman/audioboot-writer",
"path": "src/hexTools/IntelHexFormat.java",
"license": "gpl-3.0",
"size": 13293
}
|
[
"java.io.BufferedReader",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FileReader",
"java.io.IOException",
"java.math.BigInteger"
] |
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.math.BigInteger;
|
import java.io.*; import java.math.*;
|
[
"java.io",
"java.math"
] |
java.io; java.math;
| 2,280,274 |
public static void checkArgument(
boolean b, @Nullable String errorMessageTemplate, long p1, long p2) {
if (!b) {
throw new IllegalArgumentException(format(errorMessageTemplate, p1, p2));
}
}
|
static void function( boolean b, @Nullable String errorMessageTemplate, long p1, long p2) { if (!b) { throw new IllegalArgumentException(format(errorMessageTemplate, p1, p2)); } }
|
/**
* Ensures the truth of an expression involving one or more parameters to the calling method.
*
* <p>See {@link #checkArgument(boolean, String, Object...)} for details.
*/
|
Ensures the truth of an expression involving one or more parameters to the calling method. See <code>#checkArgument(boolean, String, Object...)</code> for details
|
checkArgument
|
{
"repo_name": "jakubmalek/guava",
"path": "guava/src/com/google/common/base/Preconditions.java",
"license": "apache-2.0",
"size": 51675
}
|
[
"javax.annotation.Nullable"
] |
import javax.annotation.Nullable;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 1,514,781 |
public void write_Context(Context context, ContextList contexts)
{
throw new NO_IMPLEMENT();
}
|
void function(Context context, ContextList contexts) { throw new NO_IMPLEMENT(); }
|
/**
* Should write a CORBA context to the output stream, but,
* following the 1.4 specification, it does not and
* must be overridden to get a functionality.
*
* @throws NO_IMPLEMENT, always.
*/
|
Should write a CORBA context to the output stream, but, following the 1.4 specification, it does not and must be overridden to get a functionality
|
write_Context
|
{
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/org/omg/CORBA/portable/OutputStream.java",
"license": "gpl-2.0",
"size": 7549
}
|
[
"org.omg.CORBA"
] |
import org.omg.CORBA;
|
import org.omg.*;
|
[
"org.omg"
] |
org.omg;
| 1,371,431 |
public void testCertificates() throws Exception {
Identity i = new IdentityStub("iii");
PublicKeyStub pk1 = new PublicKeyStub("kkk", "fff", null);
CertificateStub c1 = new CertificateStub("fff", null, null, pk1);
CertificateStub c2 = new CertificateStub("zzz", null, null, pk1);
i.addCertificate(c1);
i.addCertificate(c2);
Certificate[] s = i.certificates();
assertEquals(2, s.length);
assertTrue(c1.equals(s[0]) || c2.equals(s[0]));
assertTrue(c1.equals(s[1]) || c2.equals(s[1]));
s[0] = null;
s[1] = null;
// check that the copy was modified
s = i.certificates();
assertEquals(2, s.length);
assertTrue(c1.equals(s[0]) || c2.equals(s[0]));
assertTrue(c1.equals(s[1]) || c2.equals(s[1]));
}
|
void function() throws Exception { Identity i = new IdentityStub("iii"); PublicKeyStub pk1 = new PublicKeyStub("kkk", "fff", null); CertificateStub c1 = new CertificateStub("fff", null, null, pk1); CertificateStub c2 = new CertificateStub("zzz", null, null, pk1); i.addCertificate(c1); i.addCertificate(c2); Certificate[] s = i.certificates(); assertEquals(2, s.length); assertTrue(c1.equals(s[0]) c2.equals(s[0])); assertTrue(c1.equals(s[1]) c2.equals(s[1])); s[0] = null; s[1] = null; s = i.certificates(); assertEquals(2, s.length); assertTrue(c1.equals(s[0]) c2.equals(s[0])); assertTrue(c1.equals(s[1]) c2.equals(s[1])); }
|
/**
* verify certificates() returns a copy of all certificates for this identity
*/
|
verify certificates() returns a copy of all certificates for this identity
|
testCertificates
|
{
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/security/src/test/api/java.injected/java/security/IdentityTest.java",
"license": "apache-2.0",
"size": 15842
}
|
[
"org.apache.harmony.security.tests.support.CertificateStub",
"org.apache.harmony.security.tests.support.IdentityStub",
"org.apache.harmony.security.tests.support.PublicKeyStub"
] |
import org.apache.harmony.security.tests.support.CertificateStub; import org.apache.harmony.security.tests.support.IdentityStub; import org.apache.harmony.security.tests.support.PublicKeyStub;
|
import org.apache.harmony.security.tests.support.*;
|
[
"org.apache.harmony"
] |
org.apache.harmony;
| 887,204 |
public void testChangeColumnDataType2()
{
final String MODEL1 =
"<?xml version='1.0' encoding='ISO-8859-1'?>\n" +
"<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='test'>\n" +
" <table name='TableA'>\n" +
" <column name='ColPK' type='INTEGER' primaryKey='true' required='true'/>\n" +
" <column name='Col' type='DOUBLE'/>\n" +
" </table>\n" +
"</database>";
final String MODEL2 =
"<?xml version='1.0' encoding='ISO-8859-1'?>\n" +
"<database xmlns='" + DatabaseIO.DDLUTILS_NAMESPACE + "' name='test'>\n" +
" <table name='TableA'>\n" +
" <column name='ColPK' type='INTEGER' primaryKey='true' required='true'/>\n" +
" <column name='Col' type='VARCHAR' size='32'/>\n" +
" </table>\n" +
"</database>";
Database model1 = parseDatabaseFromString(MODEL1);
Database model2 = parseDatabaseFromString(MODEL2);
List changes = getPlatform(true).getChanges(model1, model2);
assertEquals(1,
changes.size());
ColumnDefinitionChange change = (ColumnDefinitionChange)changes.get(0);
assertEquals("TableA",
change.getChangedTable());
assertColumn("Col", Types.VARCHAR, "32", null, false, false, false,
change.getNewColumn());
}
|
void function() { final String MODEL1 = STR + STR + DatabaseIO.DDLUTILS_NAMESPACE + STR + STR + STR + STR + STR + STR; final String MODEL2 = STR + STR + DatabaseIO.DDLUTILS_NAMESPACE + STR + STR + STR + STR + STR + STR; Database model1 = parseDatabaseFromString(MODEL1); Database model2 = parseDatabaseFromString(MODEL2); List changes = getPlatform(true).getChanges(model1, model2); assertEquals(1, changes.size()); ColumnDefinitionChange change = (ColumnDefinitionChange)changes.get(0); assertEquals(STR, change.getChangedTable()); assertColumn("Col", Types.VARCHAR, "32", null, false, false, false, change.getNewColumn()); }
|
/**
* Tests changing the data type of a column.
*/
|
Tests changing the data type of a column
|
testChangeColumnDataType2
|
{
"repo_name": "qxo/ddlutils",
"path": "src/test/java/org/apache/ddlutils/alteration/TestTableComparison.java",
"license": "apache-2.0",
"size": 52130
}
|
[
"java.sql.Types",
"java.util.List",
"org.apache.ddlutils.io.DatabaseIO",
"org.apache.ddlutils.model.Database"
] |
import java.sql.Types; import java.util.List; import org.apache.ddlutils.io.DatabaseIO; import org.apache.ddlutils.model.Database;
|
import java.sql.*; import java.util.*; import org.apache.ddlutils.io.*; import org.apache.ddlutils.model.*;
|
[
"java.sql",
"java.util",
"org.apache.ddlutils"
] |
java.sql; java.util; org.apache.ddlutils;
| 2,601,882 |
public Map<String, List<Tag>> getTagsByUser(String userId) {
List<Tag> tags = TagFactory.getTagByUser(userId);
Map<String, List<Tag>> map = new HashMap<String, List<Tag>>();
map.put("tags", tags);
return map;
}
|
Map<String, List<Tag>> function(String userId) { List<Tag> tags = TagFactory.getTagByUser(userId); Map<String, List<Tag>> map = new HashMap<String, List<Tag>>(); map.put("tags", tags); return map; }
|
/**
* Gets all the tag created by an user
* @param userId id of the user
* @return a Map with a list of all the tags created
*/
|
Gets all the tag created by an user
|
getTagsByUser
|
{
"repo_name": "zhiqinghuang/core",
"path": "src/com/dotmarketing/tag/ajax/TagAjax.java",
"license": "gpl-3.0",
"size": 14745
}
|
[
"com.dotmarketing.tag.factories.TagFactory",
"com.dotmarketing.tag.model.Tag",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] |
import com.dotmarketing.tag.factories.TagFactory; import com.dotmarketing.tag.model.Tag; import java.util.HashMap; import java.util.List; import java.util.Map;
|
import com.dotmarketing.tag.factories.*; import com.dotmarketing.tag.model.*; import java.util.*;
|
[
"com.dotmarketing.tag",
"java.util"
] |
com.dotmarketing.tag; java.util;
| 2,047,225 |
public void setDisplayProperties(FileDisplayProperties displayProperties) {
this.displayProperties = displayProperties;
}
|
void function(FileDisplayProperties displayProperties) { this.displayProperties = displayProperties; }
|
/**
* Sets the display properties.
*
* @param displayProperties the new display properties
*/
|
Sets the display properties
|
setDisplayProperties
|
{
"repo_name": "taconaut/pms-mlx",
"path": "core/src/main/java/net/pms/medialibrary/dlna/MediaLibraryRealFile.java",
"license": "gpl-2.0",
"size": 12473
}
|
[
"net.pms.medialibrary.commons.dataobjects.FileDisplayProperties"
] |
import net.pms.medialibrary.commons.dataobjects.FileDisplayProperties;
|
import net.pms.medialibrary.commons.dataobjects.*;
|
[
"net.pms.medialibrary"
] |
net.pms.medialibrary;
| 2,672,884 |
public void testDrawWithNullInfo() {
boolean success = false;
try {
BufferedImage image = new BufferedImage(
200 , 100, BufferedImage.TYPE_INT_RGB
);
Graphics2D g2 = image.createGraphics();
this.chart.draw(
g2, new Rectangle2D.Double(0, 0, 200, 100), null, null
);
g2.dispose();
success = true;
}
catch (Exception e) {
success = false;
}
assertTrue(success);
}
|
void function() { boolean success = false; try { BufferedImage image = new BufferedImage( 200 , 100, BufferedImage.TYPE_INT_RGB ); Graphics2D g2 = image.createGraphics(); this.chart.draw( g2, new Rectangle2D.Double(0, 0, 200, 100), null, null ); g2.dispose(); success = true; } catch (Exception e) { success = false; } assertTrue(success); }
|
/**
* Draws the chart with a null info object to make sure that no exceptions
* are thrown (a problem that was occurring at one point).
*/
|
Draws the chart with a null info object to make sure that no exceptions are thrown (a problem that was occurring at one point)
|
testDrawWithNullInfo
|
{
"repo_name": "raedle/univis",
"path": "lib/jfreechart-1.0.1/src/org/jfree/chart/junit/StackedAreaChartTests.java",
"license": "lgpl-2.1",
"size": 7268
}
|
[
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D",
"java.awt.image.BufferedImage"
] |
import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage;
|
import java.awt.*; import java.awt.geom.*; import java.awt.image.*;
|
[
"java.awt"
] |
java.awt;
| 2,092,742 |
public void setBooleanVals(List booleanVals) {
this.booleanVals = booleanVals;
}
|
void function(List booleanVals) { this.booleanVals = booleanVals; }
|
/**
* Set the booleanVals.
*/
|
Set the booleanVals
|
setBooleanVals
|
{
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-4.1.12-src/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/HostForm.java",
"license": "apache-2.0",
"size": 12285
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,884,157 |
for (int i = 0; i < size(); i++) {
PropertyModel model = get(i).model;
if (model.get(CARD_TYPE) == TAB && model.get(TAB_ID) == tabId) return i;
}
return TabModel.INVALID_TAB_INDEX;
}
|
for (int i = 0; i < size(); i++) { PropertyModel model = get(i).model; if (model.get(CARD_TYPE) == TAB && model.get(TAB_ID) == tabId) return i; } return TabModel.INVALID_TAB_INDEX; }
|
/**
* Convert the given tab ID to an index to match during partial updates.
* @param tabId The tab ID to search for.
* @return The index within the model {@link org.chromium.ui.modelutil.SimpleList}.
*/
|
Convert the given tab ID to an index to match during partial updates
|
indexFromId
|
{
"repo_name": "nwjs/chromium.src",
"path": "chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListModel.java",
"license": "bsd-3-clause",
"size": 12256
}
|
[
"org.chromium.chrome.browser.tabmodel.TabModel",
"org.chromium.ui.modelutil.PropertyModel"
] |
import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.ui.modelutil.PropertyModel;
|
import org.chromium.chrome.browser.tabmodel.*; import org.chromium.ui.modelutil.*;
|
[
"org.chromium.chrome",
"org.chromium.ui"
] |
org.chromium.chrome; org.chromium.ui;
| 244,898 |
private int amountToScroll(int direction, int nextSelectedPosition) {
final int listBottom = getHeight() - mListPadding.bottom;
final int listTop = mListPadding.top;
final int numChildren = getChildCount();
if (direction == View.FOCUS_DOWN) {
int indexToMakeVisible = numChildren - 1;
if (nextSelectedPosition != INVALID_POSITION) {
indexToMakeVisible = nextSelectedPosition - mFirstPosition;
}
final int positionToMakeVisible = mFirstPosition + indexToMakeVisible;
final View viewToMakeVisible = getChildAt(indexToMakeVisible);
int goalBottom = listBottom;
if (positionToMakeVisible < mItemCount - 1) {
goalBottom -= getArrowScrollPreviewLength();
}
if (viewToMakeVisible.getBottom() <= goalBottom) {
// item is fully visible.
return 0;
}
if (nextSelectedPosition != INVALID_POSITION
&& (goalBottom - viewToMakeVisible.getTop()) >= getMaxScrollAmount()) {
// item already has enough of it visible, changing selection is good enough
return 0;
}
int amountToScroll = (viewToMakeVisible.getBottom() - goalBottom);
if ((mFirstPosition + numChildren) == mItemCount) {
// last is last in list -> make sure we don't scroll past it
final int max = getChildAt(numChildren - 1).getBottom() - listBottom;
amountToScroll = Math.min(amountToScroll, max);
}
return Math.min(amountToScroll, getMaxScrollAmount());
} else {
int indexToMakeVisible = 0;
if (nextSelectedPosition != INVALID_POSITION) {
indexToMakeVisible = nextSelectedPosition - mFirstPosition;
}
final int positionToMakeVisible = mFirstPosition + indexToMakeVisible;
final View viewToMakeVisible = getChildAt(indexToMakeVisible);
int goalTop = listTop;
if (positionToMakeVisible > 0) {
goalTop += getArrowScrollPreviewLength();
}
if (viewToMakeVisible.getTop() >= goalTop) {
// item is fully visible.
return 0;
}
if (nextSelectedPosition != INVALID_POSITION &&
(viewToMakeVisible.getBottom() - goalTop) >= getMaxScrollAmount()) {
// item already has enough of it visible, changing selection is good enough
return 0;
}
int amountToScroll = (goalTop - viewToMakeVisible.getTop());
if (mFirstPosition == 0) {
// first is first in list -> make sure we don't scroll past it
final int max = listTop - getChildAt(0).getTop();
amountToScroll = Math.min(amountToScroll, max);
}
return Math.min(amountToScroll, getMaxScrollAmount());
}
}
static private class ArrowScrollFocusResult {
private int mSelectedPosition;
private int mAmountToScroll;
|
int function(int direction, int nextSelectedPosition) { final int listBottom = getHeight() - mListPadding.bottom; final int listTop = mListPadding.top; final int numChildren = getChildCount(); if (direction == View.FOCUS_DOWN) { int indexToMakeVisible = numChildren - 1; if (nextSelectedPosition != INVALID_POSITION) { indexToMakeVisible = nextSelectedPosition - mFirstPosition; } final int positionToMakeVisible = mFirstPosition + indexToMakeVisible; final View viewToMakeVisible = getChildAt(indexToMakeVisible); int goalBottom = listBottom; if (positionToMakeVisible < mItemCount - 1) { goalBottom -= getArrowScrollPreviewLength(); } if (viewToMakeVisible.getBottom() <= goalBottom) { return 0; } if (nextSelectedPosition != INVALID_POSITION && (goalBottom - viewToMakeVisible.getTop()) >= getMaxScrollAmount()) { return 0; } int amountToScroll = (viewToMakeVisible.getBottom() - goalBottom); if ((mFirstPosition + numChildren) == mItemCount) { final int max = getChildAt(numChildren - 1).getBottom() - listBottom; amountToScroll = Math.min(amountToScroll, max); } return Math.min(amountToScroll, getMaxScrollAmount()); } else { int indexToMakeVisible = 0; if (nextSelectedPosition != INVALID_POSITION) { indexToMakeVisible = nextSelectedPosition - mFirstPosition; } final int positionToMakeVisible = mFirstPosition + indexToMakeVisible; final View viewToMakeVisible = getChildAt(indexToMakeVisible); int goalTop = listTop; if (positionToMakeVisible > 0) { goalTop += getArrowScrollPreviewLength(); } if (viewToMakeVisible.getTop() >= goalTop) { return 0; } if (nextSelectedPosition != INVALID_POSITION && (viewToMakeVisible.getBottom() - goalTop) >= getMaxScrollAmount()) { return 0; } int amountToScroll = (goalTop - viewToMakeVisible.getTop()); if (mFirstPosition == 0) { final int max = listTop - getChildAt(0).getTop(); amountToScroll = Math.min(amountToScroll, max); } return Math.min(amountToScroll, getMaxScrollAmount()); } } static private class ArrowScrollFocusResult { private int mSelectedPosition; private int mAmountToScroll;
|
/**
* Determine how much we need to scroll in order to get the next selected view
* visible, with a fading edge showing below as applicable. The amount is
* capped at {@link #getMaxScrollAmount()} .
*
* @param direction either {@link android.view.View#FOCUS_UP} or
* {@link android.view.View#FOCUS_DOWN}.
* @param nextSelectedPosition The position of the next selection, or
* {@link #INVALID_POSITION} if there is no next selectable position
* @return The amount to scroll. Note: this is always positive! Direction
* needs to be taken into account when actually scrolling.
*/
|
Determine how much we need to scroll in order to get the next selected view visible, with a fading edge showing below as applicable. The amount is capped at <code>#getMaxScrollAmount()</code>
|
amountToScroll
|
{
"repo_name": "mateor/PDroidHistory",
"path": "frameworks/base/core/java/android/widget/ListView.java",
"license": "gpl-3.0",
"size": 141583
}
|
[
"android.view.View"
] |
import android.view.View;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 1,719,141 |
protected CategoryItemRendererState createState(PlotRenderingInfo info) {
return new CategoryItemRendererState(info);
}
|
CategoryItemRendererState function(PlotRenderingInfo info) { return new CategoryItemRendererState(info); }
|
/**
* Creates a new state instance---this method is called from the
* {@link #initialise(Graphics2D, Rectangle2D, CategoryPlot, int,
* PlotRenderingInfo)} method. Subclasses can override this method if
* they need to use a subclass of {@link CategoryItemRendererState}.
*
* @param info collects plot rendering info (<code>null</code> permitted).
*
* @return The new state instance (never <code>null</code>).
*
* @since 1.0.5
*/
|
Creates a new state instance---this method is called from the <code>#initialise(Graphics2D, Rectangle2D, CategoryPlot, int, PlotRenderingInfo)</code> method. Subclasses can override this method if they need to use a subclass of <code>CategoryItemRendererState</code>
|
createState
|
{
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java",
"license": "gpl-3.0",
"size": 66756
}
|
[
"org.jfree.chart.plot.PlotRenderingInfo"
] |
import org.jfree.chart.plot.PlotRenderingInfo;
|
import org.jfree.chart.plot.*;
|
[
"org.jfree.chart"
] |
org.jfree.chart;
| 2,446,318 |
static PathMapping ofRegex(String regex) {
return ofRegex(Pattern.compile(requireNonNull(regex, "regex")));
}
|
static PathMapping ofRegex(String regex) { return ofRegex(Pattern.compile(requireNonNull(regex, "regex"))); }
|
/**
* Creates a new {@link PathMapping} that matches a {@linkplain ServiceRequestContext#path() path} with
* the specified regular expression and extracts the values of the named groups.
* e.g. {@code "^/users/(?<userId>[0-9]+)$"} will extract the second numeric part of the path into
* the {@code "userId"} path parameter.
*/
|
Creates a new <code>PathMapping</code> that matches a ServiceRequestContext#path() path with the specified regular expression and extracts the values of the named groups. e.g. "^/users/(?[0-9]+)$" will extract the second numeric part of the path into the "userId" path parameter
|
ofRegex
|
{
"repo_name": "imasahiro/armeria",
"path": "core/src/main/java/com/linecorp/armeria/server/PathMapping.java",
"license": "apache-2.0",
"size": 8419
}
|
[
"java.util.regex.Pattern"
] |
import java.util.regex.Pattern;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 1,591,829 |
void send(T message) throws MessageSendException;
|
void send(T message) throws MessageSendException;
|
/**
* Send a message
* @param message Message to send
* @throws MessageSendException
*/
|
Send a message
|
send
|
{
"repo_name": "click-alexvladut/Cheddar",
"path": "cheddar/cheddar-messaging/src/main/java/com/clicktravel/cheddar/infrastructure/messaging/MessageSender.java",
"license": "apache-2.0",
"size": 1456
}
|
[
"com.clicktravel.cheddar.infrastructure.messaging.exception.MessageSendException"
] |
import com.clicktravel.cheddar.infrastructure.messaging.exception.MessageSendException;
|
import com.clicktravel.cheddar.infrastructure.messaging.exception.*;
|
[
"com.clicktravel.cheddar"
] |
com.clicktravel.cheddar;
| 78,326 |
public static TransactionPhase getTransactionalPhase(EnhancedAnnotatedMethod<?, ?> observer) {
EnhancedAnnotatedParameter<?, ?> parameter = observer.getEnhancedParameters(Observes.class).iterator().next();
return parameter.getAnnotation(Observes.class).during();
}
|
static TransactionPhase function(EnhancedAnnotatedMethod<?, ?> observer) { EnhancedAnnotatedParameter<?, ?> parameter = observer.getEnhancedParameters(Observes.class).iterator().next(); return parameter.getAnnotation(Observes.class).during(); }
|
/**
* Tests an observer method to see if it is transactional.
*
* @param observer The observer method
* @return true if the observer method is annotated as transactional
*/
|
Tests an observer method to see if it is transactional
|
getTransactionalPhase
|
{
"repo_name": "antoinesd/weld-core",
"path": "impl/src/main/java/org/jboss/weld/event/ObserverFactory.java",
"license": "apache-2.0",
"size": 2550
}
|
[
"javax.enterprise.event.Observes",
"javax.enterprise.event.TransactionPhase",
"org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod",
"org.jboss.weld.annotated.enhanced.EnhancedAnnotatedParameter"
] |
import javax.enterprise.event.Observes; import javax.enterprise.event.TransactionPhase; import org.jboss.weld.annotated.enhanced.EnhancedAnnotatedMethod; import org.jboss.weld.annotated.enhanced.EnhancedAnnotatedParameter;
|
import javax.enterprise.event.*; import org.jboss.weld.annotated.enhanced.*;
|
[
"javax.enterprise",
"org.jboss.weld"
] |
javax.enterprise; org.jboss.weld;
| 672,230 |
public void popExecutionStmtValidator(ExecutionStmtValidator validator)
throws StandardException;
|
void function(ExecutionStmtValidator validator) throws StandardException;
|
/**
* Remove the validator. Does an object identity (validator == validator)
* comparison. Asserts that the validator is found.
*
* @param validator the validator to remove
*
* @exception StandardException on error
*/
|
Remove the validator. Does an object identity (validator == validator) comparison. Asserts that the validator is found
|
popExecutionStmtValidator
|
{
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java",
"license": "apache-2.0",
"size": 43432
}
|
[
"org.apache.derby.iapi.sql.execute.ExecutionStmtValidator",
"org.apache.derby.shared.common.error.StandardException"
] |
import org.apache.derby.iapi.sql.execute.ExecutionStmtValidator; import org.apache.derby.shared.common.error.StandardException;
|
import org.apache.derby.iapi.sql.execute.*; import org.apache.derby.shared.common.error.*;
|
[
"org.apache.derby"
] |
org.apache.derby;
| 618,519 |
@Test
public void testString2Byte_1() {
try {
Message message = senderSession.createMessage();
message.setStringProperty("prop", "0");
Assert.assertEquals((byte) 0, message.getByteProperty("prop"));
} catch (JMSException e) {
fail(e);
}
}
|
void function() { try { Message message = senderSession.createMessage(); message.setStringProperty("prop", "0"); Assert.assertEquals((byte) 0, message.getByteProperty("prop")); } catch (JMSException e) { fail(e); } }
|
/**
* if a property is set as a <code>java.lang.String</code>,
* it can also be read as a <code>byte</code> if the <code>String</code>
* is a correct representation of a <code>byte</code> (e.g. <code>"0"</code>).
*/
|
if a property is set as a <code>java.lang.String</code>, it can also be read as a <code>byte</code> if the <code>String</code> is a correct representation of a <code>byte</code> (e.g. <code>"0"</code>)
|
testString2Byte_1
|
{
"repo_name": "cshannon/activemq-artemis",
"path": "tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/message/properties/MessagePropertyConversionTest.java",
"license": "apache-2.0",
"size": 43771
}
|
[
"javax.jms.JMSException",
"javax.jms.Message",
"org.junit.Assert"
] |
import javax.jms.JMSException; import javax.jms.Message; import org.junit.Assert;
|
import javax.jms.*; import org.junit.*;
|
[
"javax.jms",
"org.junit"
] |
javax.jms; org.junit;
| 11,415 |
public byte[] readFromFile(String filePath, int position, int size)
throws IOException {
RandomAccessFile file = new RandomAccessFile(filePath, "rw");
file.seek(position);
byte[] bytes = new byte[size];
file.read(bytes);
file.close();
return bytes;
}
|
byte[] function(String filePath, int position, int size) throws IOException { RandomAccessFile file = new RandomAccessFile(filePath, "rw"); file.seek(position); byte[] bytes = new byte[size]; file.read(bytes); file.close(); return bytes; }
|
/**
* Read data from a file at a specific position
*
* @param filePath
* Path to file
* @param position
* Position in file
* @param size
* Number of bytes to reads from the given position
* @return Data that was read
* @throws IOException
*/
|
Read data from a file at a specific position
|
readFromFile
|
{
"repo_name": "zerkahel/BenchmarkApp",
"path": "src/benchmark/hdd/HDDRandomAccess.java",
"license": "gpl-2.0",
"size": 8177
}
|
[
"java.io.IOException",
"java.io.RandomAccessFile"
] |
import java.io.IOException; import java.io.RandomAccessFile;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,914,069 |
@Test
public void testToString()
{
final Terminal<Integer> node0 = create0();
final String result = node0.toString();
assertNotNull(result);
final String expected = "LeftTerminal[returnType=Integer,parent=<null>]";
assertThat(result, is(expected));
}
|
void function() { final Terminal<Integer> node0 = create0(); final String result = node0.toString(); assertNotNull(result); final String expected = STR; assertThat(result, is(expected)); }
|
/**
* Test the <code>toString()</code> method.
*/
|
Test the <code>toString()</code> method
|
testToString
|
{
"repo_name": "jmthompson2015/vizzini",
"path": "ai/src/test/java/org/vizzini/ai/geneticalgorithm/geneticprogramming/problem/artificialant/LeftTerminalTest.java",
"license": "mit",
"size": 5355
}
|
[
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.vizzini.ai.geneticalgorithm.geneticprogramming.Terminal"
] |
import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.vizzini.ai.geneticalgorithm.geneticprogramming.Terminal;
|
import org.hamcrest.*; import org.junit.*; import org.vizzini.ai.geneticalgorithm.geneticprogramming.*;
|
[
"org.hamcrest",
"org.junit",
"org.vizzini.ai"
] |
org.hamcrest; org.junit; org.vizzini.ai;
| 789,049 |
public static ValueBuilder header(String name) {
Expression expression = ExpressionBuilder.headerExpression(name);
return new ValueBuilder(expression);
}
|
static ValueBuilder function(String name) { Expression expression = ExpressionBuilder.headerExpression(name); return new ValueBuilder(expression); }
|
/**
* Returns a predicate and value builder for headers on an exchange
*/
|
Returns a predicate and value builder for headers on an exchange
|
header
|
{
"repo_name": "kingargyle/turmeric-bot",
"path": "camel-core/src/main/java/org/apache/camel/builder/Builder.java",
"license": "apache-2.0",
"size": 8004
}
|
[
"org.apache.camel.Expression"
] |
import org.apache.camel.Expression;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 956,097 |
// Note also called reflectively by BrooklynLeakListener
@Beta
public static int terminateAll() {
int closed=0,dangling=0;
for (LocalManagementContext context : getInstances()) {
try {
context.terminate();
closed++;
}catch (Throwable t) {
Exceptions.propagateIfFatal(t);
log.warn("Failed to terminate management context", t);
dangling++;
}
}
if (dangling>0) return -dangling;
return closed;
}
private String managementPlaneId;
private String managementNodeId;
private BasicExecutionManager execution;
private SubscriptionManager subscriptions;
private LocalEntityManager entityManager;
private final LocalLocationManager locationManager;
private final LocalAccessManager accessManager;
private final LocalUsageManager usageManager;
private OsgiManager osgiManager;
public final Throwable constructionStackTrace = new Throwable("for construction stacktrace").fillInStackTrace();
private final Map<String, Object> brooklynAdditionalProperties;
public LocalManagementContext() {
this(new Builder());
}
public LocalManagementContext(BrooklynProperties brooklynProperties) {
this(brooklynProperties, (DataGridFactory)null);
}
@VisibleForTesting
public LocalManagementContext(BrooklynProperties brooklynProperties, DataGridFactory datagridFactory) {
this(Builder.fromProperties(brooklynProperties), datagridFactory);
}
public LocalManagementContext(Builder builder) {
this(builder, null, null);
}
public LocalManagementContext(Builder builder, DataGridFactory datagridFactory) {
this(builder, null, datagridFactory);
}
public LocalManagementContext(Builder builder, Map<String, Object> brooklynAdditionalProperties) {
this(builder, brooklynAdditionalProperties, null);
}
public LocalManagementContext(BrooklynProperties brooklynProperties, Map<String, Object> brooklynAdditionalProperties) {
this(Builder.fromProperties(brooklynProperties), brooklynAdditionalProperties, null);
}
public LocalManagementContext(Builder builder, Map<String, Object> brooklynAdditionalProperties, DataGridFactory datagridFactory) {
super(builder.build(), datagridFactory);
// TODO in a persisted world the planeId may be injected
this.managementPlaneId = Strings.makeRandomId(8);
this.managementNodeId = Strings.makeRandomId(8);
checkNotNull(configMap, "brooklynProperties");
this.builder = builder;
this.brooklynAdditionalProperties = brooklynAdditionalProperties;
if (brooklynAdditionalProperties != null)
configMap.addFromMap(brooklynAdditionalProperties);
this.locationManager = new LocalLocationManager(this);
this.accessManager = new LocalAccessManager();
this.usageManager = new LocalUsageManager(this);
if (configMap.getConfig(OsgiManager.USE_OSGI)) {
this.osgiManager = new OsgiManager();
osgiManager.start();
}
INSTANCES.add(this);
log.debug("Created management context "+this);
}
|
static int function() { int closed=0,dangling=0; for (LocalManagementContext context : getInstances()) { try { context.terminate(); closed++; }catch (Throwable t) { Exceptions.propagateIfFatal(t); log.warn(STR, t); dangling++; } } if (dangling>0) return -dangling; return closed; } private String managementPlaneId; private String managementNodeId; private BasicExecutionManager execution; private SubscriptionManager subscriptions; private LocalEntityManager entityManager; private final LocalLocationManager locationManager; private final LocalAccessManager accessManager; private final LocalUsageManager usageManager; private OsgiManager osgiManager; public final Throwable constructionStackTrace = new Throwable(STR).fillInStackTrace(); private final Map<String, Object> brooklynAdditionalProperties; public LocalManagementContext() { this(new Builder()); } public LocalManagementContext(BrooklynProperties brooklynProperties) { this(brooklynProperties, (DataGridFactory)null); } public LocalManagementContext(BrooklynProperties brooklynProperties, DataGridFactory datagridFactory) { this(Builder.fromProperties(brooklynProperties), datagridFactory); } public LocalManagementContext(Builder builder) { this(builder, null, null); } public LocalManagementContext(Builder builder, DataGridFactory datagridFactory) { this(builder, null, datagridFactory); } public LocalManagementContext(Builder builder, Map<String, Object> brooklynAdditionalProperties) { this(builder, brooklynAdditionalProperties, null); } public LocalManagementContext(BrooklynProperties brooklynProperties, Map<String, Object> brooklynAdditionalProperties) { this(Builder.fromProperties(brooklynProperties), brooklynAdditionalProperties, null); } public LocalManagementContext(Builder builder, Map<String, Object> brooklynAdditionalProperties, DataGridFactory datagridFactory) { super(builder.build(), datagridFactory); this.managementPlaneId = Strings.makeRandomId(8); this.managementNodeId = Strings.makeRandomId(8); checkNotNull(configMap, STR); this.builder = builder; this.brooklynAdditionalProperties = brooklynAdditionalProperties; if (brooklynAdditionalProperties != null) configMap.addFromMap(brooklynAdditionalProperties); this.locationManager = new LocalLocationManager(this); this.accessManager = new LocalAccessManager(); this.usageManager = new LocalUsageManager(this); if (configMap.getConfig(OsgiManager.USE_OSGI)) { this.osgiManager = new OsgiManager(); osgiManager.start(); } INSTANCES.add(this); log.debug(STR+this); }
|
/** terminates all (best effort); returns count of sessions closed; if exceptions thrown, returns negative number.
* semantics might change, particular in dealing with interminable mgmt contexts. */
|
terminates all (best effort); returns count of sessions closed; if exceptions thrown, returns negative number
|
terminateAll
|
{
"repo_name": "neykov/incubator-brooklyn",
"path": "core/src/main/java/brooklyn/management/internal/LocalManagementContext.java",
"license": "apache-2.0",
"size": 14193
}
|
[
"com.google.common.base.Preconditions",
"java.util.Map"
] |
import com.google.common.base.Preconditions; import java.util.Map;
|
import com.google.common.base.*; import java.util.*;
|
[
"com.google.common",
"java.util"
] |
com.google.common; java.util;
| 2,900,835 |
if (registry == null) {
registry = new AssetRegistry();
}
return registry;
}
private Downloader downloader;
protected List<FileTransferListener> listeners = new ArrayList<FileTransferListener>();
private Uploader uploader;
private AssetRegistry() {
uploader = new Uploader(this);
downloader = new Downloader(this);
}
|
if (registry == null) { registry = new AssetRegistry(); } return registry; } private Downloader downloader; protected List<FileTransferListener> listeners = new ArrayList<FileTransferListener>(); private Uploader uploader; private AssetRegistry() { uploader = new Uploader(this); downloader = new Downloader(this); }
|
/**
* Gets the single instance of AssetRegistry.
*
* @return single instance of AssetRegistry
*/
|
Gets the single instance of AssetRegistry
|
getInstance
|
{
"repo_name": "synergynet/synergynet2.5",
"path": "synergynet2.5/src/main/java/apps/mtdesktop/fileutility/AssetRegistry.java",
"license": "bsd-3-clause",
"size": 4257
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,543,599 |
private void preemptAMContainers(Resource clusterResource,
Map<ApplicationAttemptId, Set<RMContainer>> preemptMap,
Map<ApplicationAttemptId, Set<RMContainer>> curCandidates,
List<RMContainer> skippedAMContainerlist,
Map<String, Resource> resToObtainByPartition, Resource skippedAMSize,
Resource maxAMCapacityForThisQueue, Resource totalPreemptionAllowed) {
for (RMContainer c : skippedAMContainerlist) {
// Got required amount of resources for preemption, can stop now
if (resToObtainByPartition.isEmpty()) {
break;
}
// Once skippedAMSize reaches down to maxAMCapacityForThisQueue,
// container selection iteration for preemption will be stopped.
if (Resources.lessThanOrEqual(rc, clusterResource, skippedAMSize,
maxAMCapacityForThisQueue)) {
break;
}
boolean preempted = CapacitySchedulerPreemptionUtils
.tryPreemptContainerAndDeductResToObtain(rc, preemptionContext,
resToObtainByPartition, c, clusterResource, preemptMap,
curCandidates, totalPreemptionAllowed,
preemptionContext.getCrossQueuePreemptionConservativeDRF());
if (preempted) {
Resources.subtractFrom(skippedAMSize, c.getAllocatedResource());
}
}
skippedAMContainerlist.clear();
}
|
void function(Resource clusterResource, Map<ApplicationAttemptId, Set<RMContainer>> preemptMap, Map<ApplicationAttemptId, Set<RMContainer>> curCandidates, List<RMContainer> skippedAMContainerlist, Map<String, Resource> resToObtainByPartition, Resource skippedAMSize, Resource maxAMCapacityForThisQueue, Resource totalPreemptionAllowed) { for (RMContainer c : skippedAMContainerlist) { if (resToObtainByPartition.isEmpty()) { break; } if (Resources.lessThanOrEqual(rc, clusterResource, skippedAMSize, maxAMCapacityForThisQueue)) { break; } boolean preempted = CapacitySchedulerPreemptionUtils .tryPreemptContainerAndDeductResToObtain(rc, preemptionContext, resToObtainByPartition, c, clusterResource, preemptMap, curCandidates, totalPreemptionAllowed, preemptionContext.getCrossQueuePreemptionConservativeDRF()); if (preempted) { Resources.subtractFrom(skippedAMSize, c.getAllocatedResource()); } } skippedAMContainerlist.clear(); }
|
/**
* As more resources are needed for preemption, saved AMContainers has to be
* rescanned. Such AMContainers can be preemptionCandidates based on resToObtain, but
* maxAMCapacityForThisQueue resources will be still retained.
*
* @param clusterResource
* @param preemptMap
* @param skippedAMContainerlist
* @param skippedAMSize
* @param maxAMCapacityForThisQueue
*/
|
As more resources are needed for preemption, saved AMContainers has to be rescanned. Such AMContainers can be preemptionCandidates based on resToObtain, but maxAMCapacityForThisQueue resources will be still retained
|
preemptAMContainers
|
{
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/FifoCandidatesSelector.java",
"license": "apache-2.0",
"size": 12209
}
|
[
"java.util.List",
"java.util.Map",
"java.util.Set",
"org.apache.hadoop.yarn.api.records.ApplicationAttemptId",
"org.apache.hadoop.yarn.api.records.Resource",
"org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer",
"org.apache.hadoop.yarn.util.resource.Resources"
] |
import java.util.List; import java.util.Map; import java.util.Set; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer; import org.apache.hadoop.yarn.util.resource.Resources;
|
import java.util.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.*; import org.apache.hadoop.yarn.util.resource.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 1,067,157 |
public void stopRunning(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface) throws KettleException;
|
void function(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface) throws KettleException;
|
/**
* Stop running operations...
* @param stepMetaInterface The metadata that might be needed by the step to stop running.
* @param stepDataInterface The interface to the step data containing the connections, resultsets, open files, etc.
*
*/
|
Stop running operations..
|
stopRunning
|
{
"repo_name": "soluvas/pdi-ce",
"path": "src/org/pentaho/di/trans/step/StepInterface.java",
"license": "apache-2.0",
"size": 10245
}
|
[
"org.pentaho.di.core.exception.KettleException"
] |
import org.pentaho.di.core.exception.KettleException;
|
import org.pentaho.di.core.exception.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 605,363 |
protected int getExperiencePoints(EntityPlayer par1EntityPlayer)
{
return 1 + this.worldObj.rand.nextInt(3);
}
|
int function(EntityPlayer par1EntityPlayer) { return 1 + this.worldObj.rand.nextInt(3); }
|
/**
* Get the experience points the entity currently has.
*/
|
Get the experience points the entity currently has
|
getExperiencePoints
|
{
"repo_name": "liquidgithub/Biotech",
"path": "src/minecraft/biotech/entity/passive/bioEntity.java",
"license": "bsd-3-clause",
"size": 16305
}
|
[
"net.minecraft.entity.player.EntityPlayer"
] |
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.*;
|
[
"net.minecraft.entity"
] |
net.minecraft.entity;
| 2,818,768 |
public static Set<URL> extracting(URL url, String queryOrRegex) {
Set<URL> result = null;
Document doc = null;
try {
if (!queryOrRegex.startsWith("#")) {
doc = getJsoupDocumentByUrl(url.toFullString());
result = getAbsoluteURLsByJSoupQuery(doc, queryOrRegex);
} else {
result = getAbsoluteURLsByRegex(url, queryOrRegex);
}
} catch (Throwable e) {
logger.error(url.toFullString() + " extracting links failure " + e.getMessage());
}
return result;
}
|
static Set<URL> function(URL url, String queryOrRegex) { Set<URL> result = null; Document doc = null; try { if (!queryOrRegex.startsWith("#")) { doc = getJsoupDocumentByUrl(url.toFullString()); result = getAbsoluteURLsByJSoupQuery(doc, queryOrRegex); } else { result = getAbsoluteURLsByRegex(url, queryOrRegex); } } catch (Throwable e) { logger.error(url.toFullString() + STR + e.getMessage()); } return result; }
|
/**
* Extracting links use JSoup or regex
* @param url
* @param queryOrRegex
* @return
*/
|
Extracting links use JSoup or regex
|
extracting
|
{
"repo_name": "zhuoran/crawler4j",
"path": "crawler4j-core/src/main/java/me/zhuoran/crawler4j/crawler/util/Util.java",
"license": "apache-2.0",
"size": 5621
}
|
[
"java.util.Set",
"org.jsoup.nodes.Document"
] |
import java.util.Set; import org.jsoup.nodes.Document;
|
import java.util.*; import org.jsoup.nodes.*;
|
[
"java.util",
"org.jsoup.nodes"
] |
java.util; org.jsoup.nodes;
| 666,376 |
try {
return acquireFieldInstance();
} catch (IllegalAccessException e) {
throw new MockitoException(
"Problems initializing field '"
+ field.getName()
+ "' of type '"
+ field.getType().getSimpleName()
+ "'",
e);
}
}
|
try { return acquireFieldInstance(); } catch (IllegalAccessException e) { throw new MockitoException( STR + field.getName() + STR + field.getType().getSimpleName() + "'", e); } }
|
/**
* Initialize field if not initialized and return the actual instance.
*
* @return Actual field instance.
*/
|
Initialize field if not initialized and return the actual instance
|
initialize
|
{
"repo_name": "mockito/mockito",
"path": "src/main/java/org/mockito/internal/util/reflection/FieldInitializer.java",
"license": "mit",
"size": 13419
}
|
[
"org.mockito.exceptions.base.MockitoException"
] |
import org.mockito.exceptions.base.MockitoException;
|
import org.mockito.exceptions.base.*;
|
[
"org.mockito.exceptions"
] |
org.mockito.exceptions;
| 846,446 |
public UpdateType updateRequired(RepositoryResourceImpl remoteResource) throws RepositoryBackendException, RepositoryResourceException {
if (null == remoteResource) {
// No matching asset found
return UpdateType.ADD;
}
Collection<AttachmentResource> remoteAttachments = remoteResource.getAttachments();
for (AttachmentResource remoteAt : remoteAttachments) {
if (getName().equals(remoteAt.getName())) {
if (equivalent(remoteAt)) {
return UpdateType.NOTHING;
} else {
return UpdateType.UPDATE;
}
}
}
// No attachment found
return UpdateType.ADD;
}
|
UpdateType function(RepositoryResourceImpl remoteResource) throws RepositoryBackendException, RepositoryResourceException { if (null == remoteResource) { return UpdateType.ADD; } Collection<AttachmentResource> remoteAttachments = remoteResource.getAttachments(); for (AttachmentResource remoteAt : remoteAttachments) { if (getName().equals(remoteAt.getName())) { if (equivalent(remoteAt)) { return UpdateType.NOTHING; } else { return UpdateType.UPDATE; } } } return UpdateType.ADD; }
|
/**
* Does this attachment need updating. Is it different from the one in the
* remote resource
*
* @param remoteResource
* @return
* @throws RepositoryBackendException
* @throws RepositoryResourceException
*/
|
Does this attachment need updating. Is it different from the one in the remote resource
|
updateRequired
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.repository/src/com/ibm/ws/repository/resources/internal/RepositoryResourceImpl.java",
"license": "epl-1.0",
"size": 79962
}
|
[
"com.ibm.ws.repository.exceptions.RepositoryBackendException",
"com.ibm.ws.repository.exceptions.RepositoryResourceException",
"com.ibm.ws.repository.resources.AttachmentResource",
"java.util.Collection"
] |
import com.ibm.ws.repository.exceptions.RepositoryBackendException; import com.ibm.ws.repository.exceptions.RepositoryResourceException; import com.ibm.ws.repository.resources.AttachmentResource; import java.util.Collection;
|
import com.ibm.ws.repository.exceptions.*; import com.ibm.ws.repository.resources.*; import java.util.*;
|
[
"com.ibm.ws",
"java.util"
] |
com.ibm.ws; java.util;
| 335,119 |
@Override public void enterNested_predicate(@NotNull LuceneSqlParser.Nested_predicateContext ctx) { }
|
@Override public void enterNested_predicate(@NotNull LuceneSqlParser.Nested_predicateContext ctx) { }
|
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
|
The default implementation does nothing
|
exitOrNot
|
{
"repo_name": "bbejeck/nosql-jdbc-driver",
"path": "src/main/java/bbejeck/nosql/antlr/generated/LuceneSqlBaseListener.java",
"license": "apache-2.0",
"size": 18266
}
|
[
"org.antlr.v4.runtime.misc.NotNull"
] |
import org.antlr.v4.runtime.misc.NotNull;
|
import org.antlr.v4.runtime.misc.*;
|
[
"org.antlr.v4"
] |
org.antlr.v4;
| 2,893,726 |
public static List<Method> getReadsDuplicateInitializingMethods() {
try {
return Arrays.asList(
MultisetReadsTester.class.getMethod("testCount_3"));
} catch (NoSuchMethodException e) {
throw new RuntimeException(e);
}
}
|
static List<Method> function() { try { return Arrays.asList( MultisetReadsTester.class.getMethod(STR)); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } }
|
/**
* Returns {@link Method} instances for the read tests that assume multisets
* support duplicates so that the test of {@code Multisets.forSet()} can
* suppress them.
*/
|
Returns <code>Method</code> instances for the read tests that assume multisets support duplicates so that the test of Multisets.forSet() can suppress them
|
getReadsDuplicateInitializingMethods
|
{
"repo_name": "tracylihui/google-collections",
"path": "test/com/google/common/collect/testing/google/MultisetReadsTester.java",
"license": "apache-2.0",
"size": 5396
}
|
[
"java.lang.reflect.Method",
"java.util.Arrays",
"java.util.List"
] |
import java.lang.reflect.Method; import java.util.Arrays; import java.util.List;
|
import java.lang.reflect.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 1,622,470 |
public void allowTypesByRegExp(String[] regexps) {
addPermission(new RegExpTypePermission(regexps));
}
|
void function(String[] regexps) { addPermission(new RegExpTypePermission(regexps)); }
|
/**
* Add security permission for types matching one of the specified regular expressions.
*
* @param regexps the regular expressions to allow type names
* @since 1.4.7
*/
|
Add security permission for types matching one of the specified regular expressions
|
allowTypesByRegExp
|
{
"repo_name": "Groostav/XStream-GG",
"path": "xstream/src/java/com/thoughtworks/xstream/XStream.java",
"license": "bsd-3-clause",
"size": 90964
}
|
[
"com.thoughtworks.xstream.security.RegExpTypePermission"
] |
import com.thoughtworks.xstream.security.RegExpTypePermission;
|
import com.thoughtworks.xstream.security.*;
|
[
"com.thoughtworks.xstream"
] |
com.thoughtworks.xstream;
| 1,265,236 |
@Override
public List<String> update(List<FileItem> items, DataRecord record, PagesContext pagesContext,
boolean updateWysiwyg) {
List<String> attachmentIds = new ArrayList<String>();
for (FieldTemplate fieldTemplate : fieldTemplates) {
FieldDisplayer fieldDisplayer = null;
// Have to check if field is not readonly, if so no need to update
if (!fieldTemplate.isReadOnly()) {
if (fieldTemplate != null) {
String fieldName = fieldTemplate.getFieldName();
String fieldType = fieldTemplate.getTypeName();
String fieldDisplayerName = fieldTemplate.getDisplayerName();
try {
if ((fieldDisplayerName == null) || (fieldDisplayerName.isEmpty())) {
fieldDisplayerName = getTypeManager().getDisplayerName(fieldType);
}
if ((!"wysiwyg".equals(fieldDisplayerName) || updateWysiwyg)) {
fieldDisplayer = getTypeManager().getDisplayer(fieldType, fieldDisplayerName);
if (fieldDisplayer != null) {
attachmentIds.addAll(fieldDisplayer.update(items, record.getField(fieldName),
fieldTemplate, pagesContext));
}
}
} catch (FormException fe) {
SilverTrace.error("form", "AbstractForm.update", "form.EXP_UNKNOWN_FIELD", null, fe);
} catch (Exception e) {
SilverTrace.error("form", "AbstractForm.update", "form.EXP_UNKNOWN_FIELD", null, e);
}
}
} else {
SilverTrace.info("form", "AbstractForm.update", "root.MSG_GEN_PARAM_VALUE", fieldTemplate
.getFieldName() +
" : field value is ignored as field is read only");
}
}
return attachmentIds;
}
|
List<String> function(List<FileItem> items, DataRecord record, PagesContext pagesContext, boolean updateWysiwyg) { List<String> attachmentIds = new ArrayList<String>(); for (FieldTemplate fieldTemplate : fieldTemplates) { FieldDisplayer fieldDisplayer = null; if (!fieldTemplate.isReadOnly()) { if (fieldTemplate != null) { String fieldName = fieldTemplate.getFieldName(); String fieldType = fieldTemplate.getTypeName(); String fieldDisplayerName = fieldTemplate.getDisplayerName(); try { if ((fieldDisplayerName == null) (fieldDisplayerName.isEmpty())) { fieldDisplayerName = getTypeManager().getDisplayerName(fieldType); } if ((!STR.equals(fieldDisplayerName) updateWysiwyg)) { fieldDisplayer = getTypeManager().getDisplayer(fieldType, fieldDisplayerName); if (fieldDisplayer != null) { attachmentIds.addAll(fieldDisplayer.update(items, record.getField(fieldName), fieldTemplate, pagesContext)); } } } catch (FormException fe) { SilverTrace.error("form", STR, STR, null, fe); } catch (Exception e) { SilverTrace.error("form", STR, STR, null, e); } } } else { SilverTrace.info("form", STR, STR, fieldTemplate .getFieldName() + STR); } } return attachmentIds; }
|
/**
* Updates the values of the dataRecord using the RecordTemplate to extra control information
* (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from
* the request.
* @param items the item of a form in which is embbeded multipart data.
* @param record the record of data.
* @param pagesContext the page context.
* @param updateWysiwyg flag indicating if all of WYSIWYG data can be updated.
* @throw FormException if the field type is not a managed type.
* @throw FormException if the field doesn't accept the new value.
*/
|
Updates the values of the dataRecord using the RecordTemplate to extra control information (readOnly or mandatory status). The fieldName must be used to retrieve the HTTP parameter from the request
|
update
|
{
"repo_name": "NicolasEYSSERIC/Silverpeas-Core",
"path": "lib-core/src/main/java/com/silverpeas/form/AbstractForm.java",
"license": "agpl-3.0",
"size": 17486
}
|
[
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"java.util.ArrayList",
"java.util.List",
"org.apache.commons.fileupload.FileItem"
] |
import com.stratelia.silverpeas.silvertrace.SilverTrace; import java.util.ArrayList; import java.util.List; import org.apache.commons.fileupload.FileItem;
|
import com.stratelia.silverpeas.silvertrace.*; import java.util.*; import org.apache.commons.fileupload.*;
|
[
"com.stratelia.silverpeas",
"java.util",
"org.apache.commons"
] |
com.stratelia.silverpeas; java.util; org.apache.commons;
| 1,119,418 |
@Trivial
static boolean isImmediateExpression(String expression, boolean mask) {
final String methodName = "isImmediateExpression";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, methodName, new Object[] { (expression == null) ? null : mask ? OBFUSCATED_STRING : expression, mask });
}
boolean result = false;
if (expression != null) {
result = expression.startsWith("${") && expression.endsWith("}");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, methodName, result);
}
return result;
}
|
static boolean isImmediateExpression(String expression, boolean mask) { final String methodName = STR; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, methodName, new Object[] { (expression == null) ? null : mask ? OBFUSCATED_STRING : expression, mask }); } boolean result = false; if (expression != null) { result = expression.startsWith("${") && expression.endsWith("}"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, methodName, result); } return result; }
|
/**
* Return whether the expression is an immediate EL expression.
*
* @param expression The expression to evaluate.
* @param mask Set whether to mask the expression and result. Useful for when passwords might be
* contained in either the expression or the result.
* @return True if the expression is an immediate EL expression.
*/
|
Return whether the expression is an immediate EL expression
|
isImmediateExpression
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java",
"license": "epl-1.0",
"size": 22623
}
|
[
"com.ibm.websphere.ras.Tr",
"com.ibm.websphere.ras.TraceComponent"
] |
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent;
|
import com.ibm.websphere.ras.*;
|
[
"com.ibm.websphere"
] |
com.ibm.websphere;
| 1,475,648 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.